/* Self-hosted display serif (SIL Open Font License; public/fonts/PLAYFAIR-DISPLAY-OFL.txt). CSP font-src 'self'. */
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/playfair-display-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/playfair-display-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: italic; font-weight: 500; font-display: swap; src: url("../fonts/playfair-display-latin-500-italic.woff2") format("woff2"); }
/*
 * ALFRESCO CAKES - BASE STYLES. Mobile-first. Uses tokens.css only; no raw colour/spacing values.
 * Breakpoints (UI/UX §10): 600 tablet, 900 tablet-landscape, 1200 laptop, 1440 desktop.
 */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-background);
  color: var(--color-text-primary);
  font-family: var(--font-family-primary);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
/* Form controls never inherit their text colour from a dark band they sit in (root cause of the unreadable header search): they always use the text token. */
input, select, textarea { font: inherit; color: var(--color-text-primary); }

h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: var(--line-height-heading); font-weight: var(--font-weight-semibold); }
/* Customer storefront headings use the display serif; the staff interface stays in the plain UI sans for density. */
h1, h2 { font-family: var(--font-family-display); font-weight: 500; }
.staff-main h1, .staff-main h2, .staff-main h3, .staff-top, .site-footer h2 { font-family: var(--font-family-primary); }
.staff-main h1, .staff-main h2 { font-weight: var(--font-weight-semibold); }

/* Links are recognised by position (navigation, cards, buttons) or, inside running text and tables, by a distinct colour and heavier weight:
   no resting underline anywhere. Hover adds an underline and keyboard focus shows the ring below (UI/UX Bible §52, WCAG 1.4.1). */
a { color: inherit; text-decoration: none; text-underline-offset: 0.2em; }
a:hover { text-decoration: underline; }
main p a:not(.btn), main li a:not(.btn):not(.chip):not(.tile):not(.pagination__link):not(.cat-card):not(.promo-card):not(.product-card__link), main td a:not(.btn), main dd a:not(.btn), main .section-head a, main .t-small a, main label a { color: var(--color-link); font-weight: var(--font-weight-semibold); }
.site-footer a, .site-header a, .staff-nav a:not(.btn), .tabbar a, .hero-band a:not(.btn), .invite a:not(.btn) { color: inherit; font-weight: inherit; }

/* ---- Type roles ---- */
.t-display { font-family: var(--font-family-display); font-size: var(--font-size-display); line-height: var(--line-height-display); font-weight: var(--font-weight-bold); letter-spacing: var(--letter-spacing-tight); }
.t-h1 { font-size: var(--font-size-h1); letter-spacing: var(--letter-spacing-tight); }
.t-h2 { font-size: var(--font-size-h2); }
.t-h3 { font-size: var(--font-size-h3); line-height: var(--line-height-tight); }
.t-body-lg { font-size: var(--font-size-body-lg); }
.t-small { font-size: var(--font-size-body-sm); }
.t-caption { font-size: var(--font-size-caption); letter-spacing: var(--letter-spacing-wide); color: var(--color-text-secondary); }
.t-muted { color: var(--color-text-muted); }

/* ---- Accessibility ---- */
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--space-4); top: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary); color: var(--color-on-primary);
  border-radius: var(--radius-sm); z-index: var(--z-toast);
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin-inline: auto;
  padding-inline: var(--page-margin);
}

.site-header { border-bottom: var(--border-width-hairline) solid var(--border-color-default); }
.site-header__inner { display: flex; align-items: center; min-height: var(--size-tap-min); padding-block: var(--space-3); }
.site-header__brand { font-weight: var(--font-weight-bold); font-size: var(--font-size-h3); text-decoration: none; }

.site-footer { margin-top: var(--space-16); padding-block: var(--space-8); border-top: var(--border-width-hairline) solid var(--border-color-default); }

.section { padding-block: var(--space-12); }

/* ---- Buttons (tap target >= 44px) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--size-button-height-md); min-width: var(--size-tap-min);
  padding-inline: var(--space-6);
  border: var(--border-width-hairline) solid transparent; border-radius: var(--radius-md);
  font-size: var(--font-size-button); font-weight: var(--font-weight-semibold); line-height: 1;
  text-decoration: none; cursor: pointer;
  transition: opacity var(--duration-fast) var(--easing-standard), transform var(--duration-fast) var(--easing-standard);
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--color-primary); color: var(--color-on-primary); }
.btn--primary:hover { background: var(--color-primary-light); }
.btn--secondary { background: transparent; color: var(--color-text-primary); border-color: var(--color-border); }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--color-disabled); color: var(--color-on-primary); cursor: not-allowed; }

/* ---- Status messages: colour is never the only signal; pair with text/icon ---- */
.status { font-weight: var(--font-weight-semibold); }
.status--success { color: var(--color-success); }
.status--warning { color: var(--color-warning); }
.status--error { color: var(--color-error); }
.status--info { color: var(--color-info); }

/* ---- Error pages ---- */
.error-page { padding-block: var(--space-24); max-width: var(--measure); }
.error-page__code { color: var(--color-text-muted); margin-bottom: var(--space-2); }
.error-page__actions { margin-top: var(--space-8); }

/* ---- Breakpoints ---- */
@media (max-width: 374px) { :root { --page-margin: 1rem; } }

@media (min-width: 600px) {
  :root { --page-margin: 2rem; --gutter: 1.25rem; }
}

@media (min-width: 900px) {
  :root {
    --page-margin: 2.5rem; --gutter: 1.5rem;
    --font-size-display: 3.5rem;
    --font-size-h1: 2.5rem;
    --font-size-h2: 1.875rem;
    --font-size-h3: 1.375rem;
    --font-size-body: 1rem;
    --font-size-body-lg: 1.125rem;
  }
  [data-surface="staff"] { --font-size-body: 0.875rem; --font-size-body-lg: 0.9375rem; --page-margin: 1.5rem; }
}

@media (min-width: 1200px) { :root { --page-margin: 4rem; } }
@media (min-width: 1440px) { :root { --page-margin: 5rem; --font-size-display: 4.5rem; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

/* Long words in large headings wrap instead of forcing sideways scrolling at large text sizes. */
h1, h2, h3, h4, .t-display { overflow-wrap: break-word; }
