/**
 * The Food Gene — main.css
 * Version: 3.4 (Site V2) · Teal Kitchen
 *
 * OWNER: UI Foundation. The shared design system: base type, the white column,
 * the header and footer, buttons, pills, chips, badges, cards, panels, forms,
 * breadcrumbs, share and follow icons, the newsletter and pagination. Page
 * agents use these classes and do not restyle them; page-only rules live in
 *   home.css     — the homepage (Home agent)
 *   listing.css  — recipe index, search, saved, guides index, Watch & Cook and
 *                  the video page (Listings agent)
 *   recipe.css   — recipe and guide pages (Recipe agent)
 *
 * Every colour, radius and size comes from tokens.css (NFR-008): there are no
 * raw colour values below. The component class contract is documented at
 * /colours-and-type/ (BR-013).
 *
 * Structure:
 *   1. Reset and base
 *   2. Accessibility (NFR-004)
 *   3. Layout: the white column (BR-014), sections and panels
 *   4. Typography (BR-003)
 *   5. Buttons, arrow pills, chips and badges (BR-004)
 *   6. Header and navigation (NAV-001, NAV-002, NAV-007, BR-005)
 *   7. Search panel and forms (NAV-003)
 *   8. Media, placeholder and video player (MED-008, BR-011)
 *   9. Cards (CARD-001 … CARD-007, BR-007)
 *  10. Breadcrumbs
 *  11. Share and follow (CNT-022, CNT-027)
 *  12. Newsletter (HOME-007, INT-005)
 *  13. Empty states and pagination (CNT-025)
 *  14. Footer (NAV-006)
 *  15. Bare layout and the style guide (CMS-009, BR-013)
 *  16. Responsive (BR-006, BR-007, NAV-007, NFR-010)
 */

/* ═══ 1. Reset and base ═══════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

/* The hidden attribute must win over any component's display value. Without
   this, .share-btn's inline-flex showed the copy and device-share buttons that
   main.js had deliberately left hidden because their API was missing. */
[hidden] { display: none !important; }

html {
  /* No overflow-x:hidden here. It hides the symptom of a too-wide element while
     breaking position:sticky, so NFR-010 is met by sizing things correctly. */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

/* The public shell: header, the white column, footer. A flex column so a short
   page still puts the footer at the bottom of the window. Scoped to .site so
   the admin, which shares this file, keeps its own shell. */
body.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img, picture, video, svg { max-width: 100%; }
img, video { height: auto; }

/* MED-008: the shape is never stretched or squashed. object-fit covers the case
   where a container has a fixed ratio and the file does not match it. */
img { object-fit: cover; }

a { color: var(--accent-juniper); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--accent-juniper-hover); }

ul, ol { margin: 0; padding: 0; }
li { list-style: none; }
figure { margin: 0; }
button { font: inherit; color: inherit; }
p { margin: 0 0 var(--space-sm); }

hr {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-xl) 0;
}

/* ═══ 2. Accessibility (NFR-004) ══════════════════════════════════════════ */

/* A visible focus ring on every focusable thing. :focus-visible so a mouse
   click does not leave a ring behind, while keyboard focus always shows one. */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

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

/* The skip link: off-screen until focused, then anchored top-left. */
.skip-link {
  position: absolute;
  top: var(--space-2xs); left: var(--space-sm);
  transform: translateY(-160%);
  z-index: var(--z-modal);
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-pill);
  background: var(--accent-juniper);
  color: var(--text-inverse);
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-label);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-decoration: none;
  transition: transform var(--transition-fast);
}
.skip-link:focus { transform: translateY(0); color: var(--text-inverse); }

/* #main receives focus after the skip link, and must not show a ring for it. */
.site-main:focus { outline: none; }

/* NFR-004: respect "reduce motion". Anyone who has asked for less movement gets
   none — including the smooth scrolling that can trigger nausea. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}

/* ═══ 3. Layout: the white column (BR-014) ═══════════════════════════════ */

/* BR-014: content sits in a white, centred column up to 1000px wide on the
   pale page. Below 1000px it fills the width; the side padding is 16px on
   phones (BR-014.2) and 24px from 900px up (§16). */
.site-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--width-sheet);
  margin: 0 auto;
  padding: var(--space-lg) var(--sheet-pad) var(--space-2xl);
  background: var(--bg-surface);
}

section { margin-bottom: var(--space-2xl); }

/* Section rhythm for stacked page sections. */
.mb-section { padding: var(--space-xl) 0; margin-bottom: 0; }
.mb-section--tight { padding-top: 0; }

/* A tinted section (BR-002, --bg-accent-soft) is a rounded panel inside the column. */
.mb-section--tint {
  margin-block: var(--space-md);
  padding: var(--space-xl) var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-accent-soft);
}

/* Section title: a Rubik heading, left-aligned, with an optional intro line. */
.mb-title { margin: 0 0 var(--space-md); }
.mb-title h1, .mb-title h2 { margin: 0; }
.mb-title p {
  max-width: 60ch;
  margin: var(--space-2xs) 0 0;
  color: var(--text-primary);
}
.mb-title--center { text-align: center; }
.mb-title--center p { margin-inline: auto; }
/* Legacy modifier: titles are left-aligned by default now. */
.mb-title--left { text-align: left; }

/* Section head: a heading with a "see all" link at the right. */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.section-head h2 { margin: 0; }
.section-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-target);
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-label);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-decoration: none;
}
.section-link:hover { text-decoration: underline; }

.page-head { margin-bottom: var(--space-lg); }
.page-head__intro {
  max-width: var(--width-reading);
  font-size: var(--text-lg);
  color: var(--text-primary);
}
.page-head__meta {
  display: flex; flex-wrap: wrap; gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.page-narrow .site-main .page-head,
.page-error .site-main > * { max-width: var(--width-reading); margin-inline: auto; }

/* Panels: rounded boxes inside the column (BR-004, BR-014). */
.panel {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-surface-subtle);
}
.panel--tint { background: var(--bg-accent-soft); }
.panel--deep { background: var(--bg-panel-deep); color: var(--text-on-dark); }
.panel--deep h2, .panel--deep h3 { color: var(--text-on-dark); }
.panel--deep a { color: var(--accent-mint); }   /* BR-012: mint as text on deep teal only */
.panel--deep :focus-visible { outline: var(--focus-ring-on-dark); }

/* ═══ 4. Typography (BR-003) ═════════════════════════════════════════════ */

/* Page titles and section headings: Rubik 800, all capitals, teal, set solid
   and balanced so a long recipe title breaks into even lines (BR-003.2). */
h1, h2, h3 {
  margin: 0 0 var(--space-2xs);
  font-family: var(--font-display);
  font-weight: var(--weight-heavy);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--accent-juniper);
}
h1 { font-size: var(--size-h1); }
h2 { font-size: var(--size-h2); }
h3 { font-size: var(--size-h3); }

/* h4 is a card-sized title: the condensed second display face. */
h4 {
  margin: 0 0 var(--space-3xs);
  font-family: var(--font-title);
  font-weight: var(--weight-semi);
  font-size: var(--size-card);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-title);
  text-transform: uppercase;
  color: var(--accent-juniper);
}

/* The Cotswold roman-plus-italic accent is retired: Teal Kitchen caps carry no
   italics, so an <em> left in a heading reads as part of it. */
h1 em, h2 em, h3 em, h4 em { font-style: normal; color: inherit; }

/* Kicker: the small line above a heading. Barlow Condensed caps, 18px. */
.kicker, .eyebrow, .mb-feature__kicker {
  display: block;
  margin: 0 0 var(--space-2xs);
  font-family: var(--font-title);
  font-weight: var(--weight-semi);
  font-size: var(--size-kicker);
  font-style: normal;
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-title);
  text-transform: uppercase;
  color: var(--accent-juniper);
}
/* BR-012: mint is allowed as text on the deep-teal panel and dark photo scrims. */
.kicker--on-dark { color: var(--accent-mint); }

/* Small labels: Jost 500 caps, 14px, 0.08em. Navigation, buttons, field labels
   and side headings all share this voice. */
.label, .side-heading {
  margin: 0 0 var(--space-2xs);
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-label);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-wrap: wrap;
  color: var(--accent-juniper);
}

/* Reading text. BR-003.3: body text is never set in capitals. */
.prose { max-width: var(--width-reading); }
.prose > * + * { margin-top: var(--space-sm); }
.prose p, .prose li { text-transform: none; }
.prose h2 { margin-top: var(--space-xl); font-size: var(--size-h3); }
.prose h3 { margin-top: var(--space-lg); font-size: var(--text-xl); }
.prose ul, .prose ol { padding-left: var(--space-md); }
.prose li { list-style: disc; margin-bottom: var(--space-3xs); }
.prose ol li { list-style: decimal; }
.prose blockquote {
  margin: var(--space-md) 0;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  background: var(--bg-accent-soft);
  color: var(--text-primary);
}
.prose img { margin: var(--space-md) 0; border-radius: var(--radius-md); }
.smallprint { font-size: var(--text-sm); color: var(--text-secondary); }
.lede { font-size: var(--text-lg); color: var(--text-primary); }

/* ═══ 5. Buttons, arrow pills, chips and badges (BR-004) ═════════════════ */

/* Buttons are pills (BR-004) with the label voice. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  min-height: var(--tap-target);     /* NFR-004 */
  padding: var(--space-2xs) 22px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-label);
  font-size: var(--size-label);
  font-weight: var(--weight-medium);
  line-height: 1.2;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.btn-primary {
  background: var(--accent-juniper);
  border-color: var(--accent-juniper);
  color: var(--text-inverse);
}
.btn-primary:hover {
  background: var(--accent-juniper-hover);
  border-color: var(--accent-juniper-hover);
  color: var(--text-inverse);
}

.btn-secondary {
  background: var(--bg-surface-subtle);
  border-color: var(--bg-surface-subtle);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--bg-accent-soft); border-color: var(--bg-accent-soft); color: var(--accent-juniper); }

.btn-outline {
  background: var(--bg-surface);
  border-color: var(--border-medium);
  color: var(--accent-juniper);
}
.btn-outline:hover { border-color: var(--accent-juniper); }

.btn-quiet {
  padding-inline: var(--space-2xs);
  background: transparent;
  border-color: transparent;
  color: var(--accent-juniper);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}
.btn-quiet:hover { color: var(--accent-juniper-hover); }

.btn[aria-pressed="true"] {
  background: var(--accent-juniper);
  border-color: var(--accent-juniper);
  color: var(--text-inverse);
}

/* The main call-to-action: a pill with a round arrow (BR-004). The circle is
   ::after, in the flow; the arrow is ::before, laid over it and drawn with a
   mask so it takes its colour from a token rather than an image.
   Variants only change the four custom properties. */
.mb-pill {
  --pill-bg: var(--bg-surface-subtle);
  --pill-bg-hover: var(--bg-accent-soft);
  --pill-fg: var(--text-primary);
  --pill-circle: var(--accent-juniper);
  --pill-arrow: var(--text-inverse);

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 6px 6px 6px 22px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--pill-bg);
  color: var(--pill-fg);
  font-family: var(--font-label);
  font-size: var(--size-label);
  font-weight: var(--weight-medium);
  line-height: 1.2;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.mb-pill::after {
  content: "";
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--pill-circle);
}
.mb-pill::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 6px;
  width: 36px;
  height: 36px;
  background: var(--pill-arrow);
  -webkit-mask: var(--icon-arrow) center / 18px 18px no-repeat;
          mask: var(--icon-arrow) center / 18px 18px no-repeat;
  transform: translateY(-50%);
  transition: transform var(--transition-fast);
}
.mb-pill:hover { background: var(--pill-bg-hover); color: var(--pill-fg); }
.mb-pill:hover::before { transform: translate(3px, -50%); }

/* .mb-pill--solid and --dark are the default pill; kept so existing markup
   keeps working. */
.mb-pill--primary {
  --pill-bg: var(--accent-juniper);
  --pill-bg-hover: var(--accent-juniper-hover);
  --pill-fg: var(--text-inverse);
  --pill-circle: var(--bg-surface);
  --pill-arrow: var(--accent-juniper);
}
/* White pill, for photographs and tinted panels. */
.mb-pill--light {
  --pill-bg: var(--bg-surface);
  --pill-bg-hover: var(--bg-surface-subtle);
}
/* Outline pill on a photograph or the deep panel. */
.mb-pill--ghost {
  --pill-bg: transparent;
  --pill-bg-hover: var(--wash-on-dark);
  --pill-fg: var(--text-on-dark);
  --pill-circle: var(--bg-surface);
  --pill-arrow: var(--accent-juniper);
  box-shadow: inset 0 0 0 1.5px var(--line-on-dark);
}
/* No arrow, for a pill that is not a "go somewhere" action. */
.mb-pill--plain { padding-right: 22px; }
.mb-pill--plain::before, .mb-pill--plain::after { display: none; }

/* Filter chips: pale pills; the selected one inverts (a slightly paler pill on
   a row of pale pills is not a state anyone can see). */
.mb-chips { display: flex; flex-wrap: wrap; gap: var(--space-2xs); margin: 0 0 var(--space-md); }
.mb-chips--center { justify-content: center; }
.mb-chips__label {
  margin: 0 0 var(--space-2xs);
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-label);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-juniper);
}
.mb-chip {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-target);
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-label);
  line-height: 1.2;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.mb-chip:hover { background: var(--bg-accent-soft); color: var(--accent-juniper); }
.mb-chip[aria-current="page"],
.mb-chip[aria-pressed="true"],
.mb-chip.is-active {
  background: var(--accent-juniper);
  color: var(--text-inverse);
}

/* Badges — CARD-002, CARD-007. Pills; the colour style comes from the badge's
   definition (CARD-005). BR-012: small labels on tints use label teal. */
.badge-row {
  display: flex; flex-wrap: wrap; gap: var(--space-3xs);
  margin: 0 0 var(--space-2xs);
}
.badge, .badge-juniper, .badge-sage {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.2em 0.75em;
  border-radius: var(--radius-pill);
  font-family: var(--font-label);
  font-size: var(--size-badge);
  font-weight: var(--weight-medium);
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge {
  background: var(--bg-surface-subtle);
  color: var(--text-secondary);
}
.badge-juniper {
  background: var(--bg-accent-soft);
  color: var(--accent-sage-strong);
}
.badge-sage {
  background: var(--bg-sage-soft);
  color: var(--accent-sage-strong);
}
/* A label laid on a photograph: the deep-teal panel colour (BR-002). */
.badge--on-photo {
  background: var(--bg-panel-deep);
  color: var(--text-on-dark);
}

/* Small tag links on content pages. */
.tag-list { display: flex; flex-wrap: wrap; gap: var(--space-3xs); }
.tag-list a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 var(--space-xs);
  background: var(--bg-surface-subtle);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  color: var(--accent-sage-strong);
  text-decoration: none;
}
.tag-list a:hover { background: var(--bg-accent-soft); }

/* ═══ 6. Header and navigation (NAV-001, NAV-002, NAV-007, BR-005) ═══════ */

/* NAV-002: a white bar with a rounded underside (BR-004), the width of the
   column. From 900px it has two rows: the centred wordmark with the icons at
   the right, then the navigation. Below 900px it is one row and the
   navigation is a slide-out panel (§16). */
.site-header {
  position: relative;
  z-index: var(--z-header);
}
.site-header__bar {
  max-width: var(--width-sheet);
  margin: 0 auto;
  padding: var(--space-sm) var(--space-md) 0;
  background: var(--bg-surface);
  border-radius: 0 0 var(--radius-header) var(--radius-header);
  box-shadow: var(--shadow-md);
}
.site-header__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-sm);
  min-height: 64px;
}
.site-header__brand {
  grid-column: 2;
  min-width: 0;
  text-align: center;
}

/* BR-005: "THE FOOD GENE" in the heading face, in mint. A logotype, which
   WCAG 1.4.3 exempts from text contrast, and the one place mint is text on a
   light background (BR-012). */
.wordmark {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: var(--weight-heavy);
  font-size: 1.875rem;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--accent-mint);
  text-decoration: none;
}
a.wordmark:hover { color: var(--accent-mint); }
.wordmark--footer { font-size: 1.5rem; margin: 0 0 var(--space-2xs); }
.wordmark--large  { font-size: 2.25rem; margin-bottom: var(--space-md); }

/* The supplied logo artwork, trimmed to its lettering (docs/design/Website
   Logo v2.png). 380px keeps "Food Gene" the size it was before "The" joined it. */
.site-header__logo {
  display: block;
  width: 380px;
  max-width: 100%;
  margin-inline: auto;
}
.site-header__logo img {
  display: block;
  width: 100%;
  height: auto;
}
/* BR-005: the optional tagline. Only rendered when the setting has text, so an
   empty setting leaves no gap. */
.site-header__tagline {
  margin: var(--space-3xs) 0 0;
  font-size: var(--text-md);
  line-height: var(--leading-snug);
  color: var(--text-secondary);
  text-wrap: balance;
}

.header-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--space-3xs);
}

/* NAV-007: every header button is at least 44 × 44. */
.header-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--tap-target);
  height: var(--tap-target);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--accent-juniper);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.header-btn:hover { background: var(--bg-surface-subtle); color: var(--accent-juniper-hover); }
.search-toggle[aria-expanded="true"] { background: var(--bg-accent-soft); }

/* NAV-001: the saved count. Hidden until the script knows the real number. */
.saved-count {
  position: absolute;
  top: 2px; right: 0;
  min-width: 1.15rem;
  padding: 0 0.3em;
  border-radius: var(--radius-pill);
  background: var(--accent-juniper);
  color: var(--text-inverse);
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: var(--weight-semi);
  line-height: 1.15rem;
  text-align: center;
}

.nav-toggle { grid-column: 1; justify-self: start; display: none; }

/* The navigation row (NAV-002). Items come from the header menu (NAV-004). */
.site-nav {
  margin-top: var(--space-2xs);
  border-top: 1px solid var(--border-subtle);
}
.site-nav__head { display: none; }   /* the slide-out panel's own bar, §16 */
.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 var(--space-lg);
}
.site-nav__list a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 2px 0 0;
  border-bottom: 2px solid transparent;
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-label);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--accent-juniper);
  text-decoration: none;
}
.site-nav__list a:hover { border-bottom-color: var(--border-medium); }
.site-nav__list a[aria-current="page"] {
  color: var(--accent-juniper-hover);
  border-bottom-color: var(--accent-juniper);
}

/* ═══ 7. Search panel (NAV-003) and forms ════════════════════════════════ */

/* The panel opens inside the header bar, so the rounded underside wraps it. */
.search-panel {
  padding: var(--space-sm) 0 var(--space-md);
  border-top: 1px solid var(--border-subtle);
}
.search-panel__form {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  max-width: var(--width-reading);
  margin: 0 auto;
}
.search-panel__form input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding-inline: 20px;
  border-radius: var(--radius-pill);
}
.search-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--tap-target); height: var(--tap-target);
  background: none; border: 0; border-radius: var(--radius-pill);
  cursor: pointer;
  color: var(--accent-juniper);
}
.search-panel__close:hover { background: var(--bg-surface-subtle); }
.search-panel__results {
  max-width: var(--width-reading);
  margin: var(--space-2xs) auto 0;
}
.suggest-group + .suggest-group { margin-top: var(--space-xs); }
.suggest-group__label {
  margin: 0 0 var(--space-3xs);
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-badge);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-juniper);
}
.suggest-group a {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm);
  min-height: var(--tap-target);
  padding: var(--space-3xs) var(--space-xs);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
}
.suggest-group a:hover { background: var(--bg-surface-subtle); color: var(--accent-juniper); }
.suggest-group__meta { color: var(--text-secondary); font-size: var(--text-sm); }
/* NAV-003: "See all results for '…'" under the groups, in the section-link voice. */
.suggest-all {
  margin: var(--space-xs) 0 0;
  padding: var(--space-3xs) var(--space-xs) 0;
  border-top: 1px solid var(--border-subtle);
}

/* Inputs. BR-012 permits the muted text colour for an input border, which
   keeps the field edge at 5:1 against white. */
input[type="search"], input[type="email"], input[type="text"],
input[type="password"], input[type="url"], input[type="number"], select, textarea {
  width: 100%;
  min-height: var(--tap-target);
  padding: var(--space-2xs) var(--space-sm);
  background: var(--bg-surface);
  border: 1px solid var(--text-muted);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--text-base);
  color: var(--text-primary);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent-juniper);
  outline: var(--focus-ring);
  outline-offset: 1px;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent-juniper); }
::placeholder { color: var(--text-muted); opacity: 1; }
label { display: block; font-size: var(--text-sm); font-weight: var(--weight-semi); }
input[aria-invalid="true"] { border-color: var(--accent-juniper-hover); border-width: 2px; }

.form-error {
  display: flex;
  gap: var(--space-2xs);
  align-items: flex-start;
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--bg-accent-soft);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
}
.form-error::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.25rem; height: 1.25rem;
  margin-top: 0.1em;
  border-radius: var(--radius-pill);
  background: var(--accent-juniper);
  color: var(--text-inverse);
  font-size: var(--text-xs);
  line-height: 1;
}

/* ═══ 8. Media (MED-008), placeholder (BR-011), video player ═════════════ */

/* The three display sizes. max-width, never width — MED-008 requires that on a
   screen narrower than the chosen size the media fills the available width, and
   a max-width does exactly that with no media query. */
.media { display: block; }
.media--small  { max-width: var(--media-small); }
.media--medium { max-width: var(--media-medium); }
.media--large  { max-width: var(--media-large); }
.media img { display: block; width: 100%; }

/* Photographs have 24px corners (BR-004). */
.rounded { border-radius: var(--radius-md); overflow: hidden; }

/* BR-011: ONE uniform placeholder — the wash with a small line icon in the
   muted colour. Never a different colour per card or category. */
.media-placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 2;
  width: 100%;
  background: var(--bg-placeholder);
  color: var(--text-muted);
}

/* The click-to-load video player (INT-010). */
.video-player { max-width: var(--video-width, var(--media-large)); }
.video-player__trigger {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--bg-surface-warm);
  cursor: pointer;
  /* MED-008: the ratio is fixed from the data, so the frame is never squashed. */
  aspect-ratio: var(--video-ratio, 16 / 9);
  overflow: hidden;
}
.video-player__trigger .media,
.video-player__trigger img { width: 100%; height: 100%; max-width: none; }
.video-player__play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--text-inverse);
  background: var(--scrim-soft);
  transition: background-color var(--transition-fast);
}
.video-player__trigger:hover .video-player__play { background: var(--scrim-strong); }
.video-player__duration {
  position: absolute; right: var(--space-xs); bottom: var(--space-xs);
  padding: 0.15em 0.6em;
  background: var(--bg-panel-deep);
  color: var(--text-on-dark);
  font-size: var(--text-xs);
  border-radius: var(--radius-pill);
}
.video-player__notice, .video-player__missing p {
  margin: var(--space-3xs) 0 0;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.video-player iframe {
  display: block; width: 100%;
  aspect-ratio: var(--video-ratio, 16 / 9);
  border: 0;
  border-radius: var(--radius-md);
}

/* MED-008: a vertical film is never taller than 85% of the screen. */
.video-player--vertical { max-width: min(var(--video-width), 100%); }
.video-player--vertical .video-player__trigger,
.video-player--vertical iframe { max-height: 85vh; }

/* MED-008: the player box per display size, set by class (partials/video-embed)
   rather than an inline style, so pages can run under a strict CSP (NFR-005).
   The vertical widths are Media::VERTICAL_DIMENSIONS. Added by Listings. */
.video-player--small  { --video-width: var(--media-small); }
.video-player--medium { --video-width: var(--media-medium); }
.video-player--large  { --video-width: var(--media-large); }
.video-player--vertical { --video-ratio: 9 / 16; }
.video-player--vertical.video-player--small  { --video-width: 270px; }
.video-player--vertical.video-player--medium { --video-width: 360px; }
.video-player--vertical.video-player--large  { --video-width: 450px; }

/* ═══ 9. Cards (CARD-001 … CARD-007, BR-007) ═════════════════════════════ */

/* BR-007: the recipe grid is four columns from 900px (inside the 1000px
   column), three from 600px, two below. Set in §16. */
.mb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg) var(--space-sm);
}

/* Guide and video lists may use wider cards (BR-007). */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: var(--space-lg) var(--space-md);
}
.card-grid--three { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }

/* ── Recipe card (partials/thumb.php) ───────────────────────────────────────
   CARD-001: a 3:4 portrait photograph with 24px corners, the title beneath in
   Barlow Condensed caps, the total time and level as a plain .card__meta line
   (CARD-001.3), then the capped badges (CARD-004, CARD-007).
   The title link is stretched over the whole card, so a click anywhere opens
   the recipe; the bookmark sits above that layer. */
.mb-thumb { position: relative; display: flex; flex-direction: column; }
.mb-thumb > a { display: block; color: inherit; text-decoration: none; }
.mb-thumb__shot {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-placeholder);
}
/* The 3:4 portrait crop (MED-001) where one exists; otherwise the Small 3:2
   derivative, cropped to the box by object-fit. */
.mb-thumb__shot .media, .mb-thumb__shot img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.mb-thumb__shot .media-placeholder { height: 100%; aspect-ratio: auto; }
.mb-thumb__shot img { transition: transform 0.5s ease; }
.mb-thumb:hover .mb-thumb__shot img { transform: scale(1.04); }

.mb-thumb__cap {
  display: block;
  margin: var(--space-xs) 0 var(--space-2xs);
  font-family: var(--font-title);
  font-weight: var(--weight-semi);
  font-size: var(--size-card);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-title);
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--accent-juniper);
}
.mb-thumb__link { color: inherit; text-decoration: none; }
.mb-thumb__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius-md);
}
.mb-thumb__link:focus-visible { outline: none; }
.mb-thumb__link:focus-visible::after { outline: var(--focus-ring); outline-offset: 4px; }
.mb-thumb:hover .mb-thumb__cap, .mb-thumb > a:hover .mb-thumb__cap { color: var(--accent-juniper-hover); }
.mb-thumb__badges { margin: 0; }

/* A label on the photograph — the run time on a video still. */
.mb-thumb__onshot {
  position: absolute;
  left: 12px; bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  max-width: calc(100% - 24px);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-panel-deep);
  color: var(--text-on-dark);
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-badge);
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mb-thumb__onshot .sep { opacity: 0.7; }

/* Film thumbnails: a play affordance over the still. */
.mb-thumb__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-inverse);
  background: var(--scrim-soft);
  transition: background-color var(--transition-fast);
}
.mb-thumb--video:hover .mb-thumb__play { background: var(--scrim-strong); }

/* CARD-006: the bookmark. White on the photograph, teal when pressed — a clear
   state, not a subtle tint. Always visible: touch has no hover. */
.mb-thumb__save, .card__bookmark {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: var(--tap-target);
  height: var(--tap-target);
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--veil-light);
  color: var(--accent-juniper);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.mb-thumb__save:hover, .card__bookmark:hover { background: var(--bg-surface); color: var(--accent-juniper-hover); }
.mb-thumb__save[aria-pressed="true"], .card__bookmark[aria-pressed="true"] {
  background: var(--accent-juniper);
  color: var(--text-inverse);
}
.mb-thumb__save[aria-pressed="true"] svg, .card__bookmark[aria-pressed="true"] svg { fill: currentColor; }
.mb-thumb__save[aria-disabled="true"], .card__bookmark[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }

/* ── Guide and video card (partials/card.php) ───────────────────────────────
   CARD-001: a 3:2 image, title beneath, summary and one meta line. Borderless,
   like the recipe card; the whole card is the link. */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: transparent;
}
.card__media {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-placeholder);
}
.card__media .media, .card__media img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.card__media .media-placeholder { height: 100%; aspect-ratio: auto; }
.card__media img { transition: transform 0.5s ease; }
.card:hover .card__media img { transform: scale(1.03); }
.card__play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--text-inverse);
  background: var(--scrim-soft);
}
.card__body { padding: var(--space-xs) 0 0; }
.card__title {
  margin: 0 0 var(--space-2xs);
  font-family: var(--font-title);
  font-weight: var(--weight-semi);
  font-size: var(--size-card);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-title);
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--accent-juniper);
}
.card__title a { color: inherit; text-decoration: none; }
.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius-md);
}
.card__link:focus-visible { outline: none; }
.card__link:focus-visible::after { outline: var(--focus-ring); outline-offset: 4px; }
.card:hover .card__title { color: var(--accent-juniper-hover); }
.card__summary {
  margin: 0 0 var(--space-3xs);
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.card__meta { margin: 0 0 var(--space-2xs); font-size: var(--text-sm); color: var(--text-secondary); }
.card__badges { margin: var(--space-2xs) 0 0; }

/* ═══ 10. Breadcrumbs ═══════════════════════════════════════════════════ */

/* One line where it fits, slash-separated, in the label voice (BR-003). */
.breadcrumbs { margin: 0 0 var(--space-sm); }
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-2xs);
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-label);
  line-height: 1.2;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: var(--space-2xs); }
.breadcrumbs li + li::before { content: "/"; color: var(--text-muted); }
.breadcrumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--accent-juniper);
  text-decoration: none;
}
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--text-secondary); }

/* ═══ 11. Share and follow (CNT-022, CNT-026, CNT-027) ═══════════════════ */

/* One "Share this recipe" button; the options open beneath it (owner,
   23 Oct 2026). The button is a <summary>, styled as the site's solid pill
   with a share icon in place of the arrow. */
.share-bar {
  margin: var(--space-lg) 0;
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.share-menu__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  background: var(--accent-juniper);
  color: var(--text-inverse);
  font-family: var(--font-label);
  font-size: var(--size-label);
  font-weight: var(--weight-medium);
  line-height: 1.2;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.share-menu__toggle::-webkit-details-marker { display: none; }
.share-menu__toggle::marker { content: ""; }
.share-menu__toggle:hover,
.share-menu[open] .share-menu__toggle { background: var(--accent-juniper-hover); }
.share-menu__toggle:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.share-menu .share-bar__list { margin-top: var(--space-sm); }

.follow-icons__label {
  margin: 0;
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-label);
  line-height: 1.2;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-juniper);
}
.share-bar__list, .follow-icons__list { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }

/* Round icon buttons. */
.share-btn, .follow-btn, .icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-target);
  height: var(--tap-target);
  padding: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-pill);
  color: var(--accent-juniper);
  cursor: pointer;
  text-decoration: none;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}
.share-btn:hover, .follow-btn:hover, .icon-btn:hover {
  color: var(--accent-juniper-hover);
  border-color: var(--accent-juniper);
  background: var(--bg-accent-soft);
}
.share-btn__flash {
  position: absolute;
  bottom: calc(-1 * var(--space-md));
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: var(--text-xs);
  color: var(--accent-juniper);
}

.follow-icons {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--space-2xs) var(--space-sm);
  margin: var(--space-lg) 0;
}
.follow-icons__intro { flex-basis: 100%; margin: 0; font-size: var(--text-sm); color: var(--text-secondary); }
/* The foot of the phone menu (CNT-027). Only the slide-out panel shows it
   (section 16); the desktop navigation row does not. */
.follow-icons--menu { display: none; }

/* ═══ 12. Newsletter (HOME-007, INT-005, INT-008) ════════════════════════ */

/* The deep-teal band at the top of the footer (BR-014): white type, the email
   field and a mint Sign up button on one row, an unticked consent box beneath,
   and mint as a fill or as text on the deep panel, never as text on a light
   background (BR-012). */
.newsletter {
  margin: 0;
  padding: var(--space-lg) var(--sheet-pad);
  background: var(--bg-panel-deep);
  color: var(--text-on-dark);
}
.newsletter__inner { max-width: var(--width-narrow); margin: 0 auto; text-align: center; }
.newsletter__heading {
  margin: 0 0 var(--space-3xs);
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--text-base);
  line-height: 1.2;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-mint);
}
.newsletter__intro { margin: 0; font-size: var(--text-sm); color: var(--text-on-dark); }
.newsletter__form { max-width: 32rem; margin: var(--space-sm) auto 0; text-align: left; }
.newsletter__row { display: flex; align-items: center; gap: var(--space-2xs); }
.newsletter__field { flex: 1 1 auto; min-width: 0; }
.newsletter input[type="email"], .newsletter input[type="text"] {
  min-height: 48px;
  padding-inline: 20px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  color: var(--text-primary);
}
.newsletter input:focus { outline: var(--focus-ring-on-dark); outline-offset: 3px; }
.newsletter input[aria-invalid="true"] { box-shadow: 0 0 0 3px var(--text-on-dark); }
.newsletter :focus-visible { outline: var(--focus-ring-on-dark); }
.newsletter__consent {
  display: flex; align-items: flex-start; gap: var(--space-2xs);
  margin-top: var(--space-sm);
}
.newsletter__consent input {
  flex: none;
  width: 1.25rem; height: 1.25rem;
  min-height: 0;
  margin: 0.15em 0 0;
  accent-color: var(--accent-mint);
}
.newsletter__consent label { font-weight: var(--weight-normal); font-size: var(--text-sm); color: var(--text-on-dark); }
.newsletter__submit {
  --pill-bg: var(--accent-mint);
  --pill-bg-hover: var(--bg-surface);
  --pill-fg: var(--text-on-mint);
  flex: none;
}
.newsletter__smallprint { margin: var(--space-2xs) 0 0; font-size: var(--text-xs); color: var(--text-on-dark-muted); text-align: center; }
.newsletter a { color: var(--accent-mint); }
.newsletter a:hover { color: var(--text-on-dark); }
/* The error on the dark panel: a white box, so it reads as an interruption. */
.newsletter .form-error {
  margin: 0 0 var(--space-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* ═══ 13. Empty states and pagination (CNT-025) ═════════════════════════ */

.empty-state {
  padding: var(--space-xl) var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--bg-surface-subtle);
  text-align: center;
}
.empty-state--page { background: transparent; padding-top: var(--space-xl); }
.empty-state h1, .empty-state h2, .empty-state h3 { margin-bottom: var(--space-2xs); }
.empty-state h2, .empty-state h3 { font-size: var(--size-h3); }
.empty-state p { color: var(--text-primary); max-width: 48ch; margin-inline: auto; }
.empty-state .btn, .empty-state .mb-pill { margin: var(--space-2xs) var(--space-3xs) 0; }

.error-detail {
  margin-top: var(--space-lg);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--bg-surface-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-align: left;
  white-space: pre-wrap;
  overflow-x: auto;
}

.pagination {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
}
.pagination__prev, .pagination__next {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-target);
  padding: 0 22px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-label);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-decoration: none;
}
.pagination__prev:hover, .pagination__next:hover { background: var(--bg-accent-soft); color: var(--accent-juniper); }
.pagination__next { margin-left: auto; }
.pagination__status { font-size: var(--text-sm); color: var(--text-secondary); }

/* ═══ 14. Footer (NAV-006) ══════════════════════════════════════════════ */

/* The light panel, continuing the column, under the Journal band. Everything
   is centred: wordmark and summary, the follow icons, the Browse recipes
   chips, the site links on one row, then the legal links and copyright
   (owner, 23 Oct 2026). Rules divide the parts. */
.site-footer {
  width: 100%;
  max-width: var(--width-sheet);
  margin: 0 auto;
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
}
.site-footer__body {
  padding: var(--space-lg) var(--sheet-pad) var(--space-md);
  text-align: center;
}
.site-footer__summary {
  max-width: 46ch;
  margin: 0 auto;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.site-footer .follow-icons { justify-content: center; margin: var(--space-md) 0 0; }
.site-footer .follow-icons__list { justify-content: center; }
.site-footer .follow-btn { background: var(--bg-surface); }

.site-footer__section {
  max-width: 56rem;
  margin: var(--space-md) auto 0;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-sand);
}
.site-footer__heading {
  margin: 0 0 var(--space-xs);
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  font-size: var(--size-label);
  line-height: 1.2;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-juniper);
}
/* Chips on the light panel take the white fill and a hairline, as the filter
   chips do (listing.css), or they would vanish into the panel. */
.site-footer__chips { margin: 0; }
.site-footer__chips .mb-chip {
  background: var(--bg-surface);
  box-shadow: inset 0 0 0 1px var(--border-medium);
}
.site-footer__chips .mb-chip:hover { background: var(--bg-accent-soft); }

/* A centred row of plain links; a long menu wraps onto a second line. */
.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 var(--space-md);
}
.site-footer__row a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 0.9375rem;
  color: var(--accent-juniper);
  text-decoration: none;
}
.site-footer__row a:hover { color: var(--accent-juniper-hover); text-decoration: underline; }
/* The legal row: smaller, with a dot between the links. */
.site-footer__row--small { gap: 0 var(--space-2xs); }
.site-footer__row--small a { min-height: 36px; font-size: var(--text-sm); }
.site-footer__row--small li + li::before {
  content: "·";
  margin-right: var(--space-2xs);
  color: var(--text-secondary);
}
.site-footer__copyright {
  margin: var(--space-3xs) 0 0;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ═══ 15. Bare layout and the style guide ═══════════════════════════════ */

.layout-bare { display: grid; place-items: center; min-height: 100vh; padding: var(--gutter); }
.bare-main {
  width: 100%;
  max-width: var(--width-narrow);
  padding: var(--space-xl) var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
}
.maintenance { text-align: center; }
.maintenance__message { color: var(--text-secondary); font-size: var(--text-lg); }

/* BR-013 — /colours-and-type/ */
.sg-table { width: 100%; border-collapse: collapse; margin-bottom: var(--space-lg); font-size: var(--text-sm); }
.sg-table th, .sg-table td {
  padding: var(--space-2xs);
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: middle;
}
.sg-table th {
  font-family: var(--font-label);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-juniper);
}
.sg-table-wrap { overflow-x: auto; }
/* An SVG rectangle filled with the token's value; currentColor is its outline. */
.sg-swatch {
  display: block;
  width: 3rem; height: 2rem;
  color: var(--border-medium);
}
.sg-muted { color: var(--text-muted); }
.sg-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); margin-bottom: var(--space-md); }
.sg-subhead { margin-top: var(--space-md); }
.sg-subhead code { text-transform: none; letter-spacing: 0; }
.sg-specimen { margin: 0 0 var(--space-2xs); }
.sg-specimen--display { font-family: var(--font-display); font-weight: var(--weight-heavy); font-size: var(--size-h2); line-height: 1; text-transform: uppercase; color: var(--accent-juniper); }
.sg-specimen--title { font-family: var(--font-title); font-weight: var(--weight-semi); font-size: var(--size-card); text-transform: uppercase; letter-spacing: var(--tracking-title); color: var(--accent-juniper); }
.sg-specimen--body { font-family: var(--font-body); font-size: var(--text-md); max-width: var(--width-reading); }
.sg-specimen--label { font-family: var(--font-label); font-weight: var(--weight-medium); font-size: var(--size-label); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--accent-juniper); }
.sg-type { display: grid; gap: var(--space-md); margin-bottom: var(--space-lg); }
.sg-type__item { padding: var(--space-md); border-radius: var(--radius-md); background: var(--bg-surface-subtle); }
.sg-type__item .smallprint { margin: var(--space-2xs) 0 0; }
.sg-demo-dark { padding: var(--space-md); border-radius: var(--radius-md); background: var(--bg-panel-deep); }
.sg-placeholder { width: min(100%, 240px); }
/* color is set, not inherited: inside .panel--deep an inherited white sat on
   this pale background at 1.09:1 (BR-012). */
code { font-family: var(--font-mono); font-size: 0.9em; color: var(--text-primary); background: var(--bg-surface-subtle); padding: 0.1em 0.35em; border-radius: var(--radius-sm); }

/* ═══ 16. Responsive (BR-006, BR-007, NAV-007, NFR-010) ═════════════════ */

/* BR-007: three recipe columns from 600px, four from 900px. */
@media (min-width: 600px) {
  .mb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  :root { --sheet-pad: 24px; }
  .mb-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-lg) 20px; }
}

/* NAV-002.2 / NAV-007: below 900px the menu button replaces the navigation row,
   and the navigation becomes a slide-out panel. The header is one row and
   stays at the top of the window. */
@media (max-width: 899.98px) {
  html { scroll-padding-top: 5rem; }

  .site-header { position: sticky; top: 0; }
  .site-header__bar {
    padding: var(--space-2xs);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
  }
  .site-header__top {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: var(--space-3xs);
    min-height: var(--tap-target);
  }
  .nav-toggle { display: inline-flex; }
  /* Sized to fit between the menu button and the two icons at 320px (NFR-010). */
  .wordmark { font-size: clamp(1rem, 0.55rem + 2.8vw, 1.5rem); }
  .site-header__logo { width: 260px; }
  .site-header__tagline { margin-top: 2px; font-size: calc((var(--text-xs) + var(--text-sm)) / 2); }

  .site-nav {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: var(--z-panel);
    display: flex;
    flex-direction: column;
    width: min(20rem, 86vw);
    margin: 0;
    padding: var(--space-2xs) var(--space-md) var(--space-lg);
    overflow-y: auto;
    border: 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: var(--bg-surface);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    /* Hidden, not just moved: a closed panel's links must not be reachable by
       Tab. The visibility change waits for the slide to finish. */
    visibility: hidden;
    transition: transform var(--transition-smooth), visibility 0s linear 220ms;
  }
  .site-nav.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform var(--transition-smooth);
  }
  .site-nav__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    min-height: 56px;
    margin-bottom: var(--space-2xs);
    border-bottom: 1px solid var(--border-subtle);
  }
  .site-nav__title { margin: 0; }
  .site-nav__list { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; }
  .site-nav__list a {
    display: flex;
    min-height: 52px;
    padding: 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--text-base);
  }
  .site-nav__list a[aria-current="page"] { border-bottom: 2px solid var(--accent-juniper); }
  /* CNT-027: the follow icons at the foot of the panel, on the light panel
     colour and edge to edge (the negative margins undo the panel's padding). */
  .follow-icons--menu {
    display: flex;
    margin: auto calc(-1 * var(--space-md)) calc(-1 * var(--space-lg));
    padding: var(--space-md);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface-subtle);
  }

  /* The backdrop is a pseudo-element on body, so no extra markup is needed.
     Below the header in the stacking order, because the panel lives inside
     the header's stacking context. */
  body.nav-open::after {
    content: "";
    position: fixed; inset: 0;
    z-index: calc(var(--z-header) - 1);
    background: var(--backdrop);
  }
  body.nav-open { overflow: hidden; }

  .search-panel { padding: var(--space-2xs) 0 var(--space-xs); }
}

@media (min-width: 900px) {
  .site-nav__close { display: none; }
}

@media (max-width: 599.98px) {
  .site-main { padding-top: var(--space-md); }
  .section-head { flex-direction: column; align-items: flex-start; gap: var(--space-3xs); }
  .mb-section { padding: var(--space-lg) 0; }
  .mb-section--tint { padding: var(--space-lg) var(--space-sm); border-radius: var(--radius-md); }
  .panel { padding: var(--space-md); border-radius: var(--radius-md); }
  .mb-grid { gap: var(--space-md) var(--space-xs); }
  .mb-thumb__save, .card__bookmark { top: 6px; right: 6px; }
  .pagination { flex-direction: column; align-items: stretch; text-align: center; }
  .pagination__prev, .pagination__next { justify-content: center; margin-left: 0; }
  .search-panel__form { flex-wrap: wrap; }
  .search-panel__form input[type="search"] { flex: 1 1 100%; }
  .search-panel__form .btn { flex: 1 1 auto; }
}
