/* ==========================================================================
   Web Fonts (display + body) — loaded site-wide via every page's stylesheet
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;0,9..144,900;1,9..144,500&family=Inter:wght@400;500;600;700&display=swap");

/* ==========================================================================
   Design Tokens — "Heritage Kitchen": warm ivory paper, espresso ink,
   antique brass metallic accent. Ember reserved for heat/cost cues only.
   ========================================================================== */

:root {
  --bg: #f6f1e7;
  --bg-accent: #ece2cf;
  --surface: rgba(255, 253, 248, 0.93);
  --surface-strong: #fffdf7;
  --surface-muted: rgba(255, 255, 255, 0.62);
  --border: rgba(42, 32, 24, 0.12);
  --border-strong: rgba(42, 32, 24, 0.22);
  --text: #2a2018;
  --text-soft: #5c5043;
  --text-muted: #8a7b6b;
  /* Brass family — readable on ivory; used for links, eyebrows, accents */
  --accent: #9c6b2c;
  --accent-strong: #7c5320;
  --accent-warm: #c89445;
  /* Bright antique brass — decorative metallic (monogram, hairlines, stars) */
  --gold: #b4884a;
  --gold-soft: rgba(180, 136, 74, 0.18);
  /* Ember — heat / cost cues only, never structural */
  --ember: #b9532f;
  --ember-bg: #f3e0d4;
  --success: #4f6841;
  --success-bg: #e2ecd8;
  --info: #315f66;
  --info-bg: #ddecee;
  --warning: #956416;
  --warning-bg: #f1dfb8;
  --ink: #241a12;
  --copper: #b4633a;
  --sage: #596a49;
  --shadow-lg: 0 24px 54px rgba(34, 24, 16, 0.16);
  --shadow-md: 0 14px 34px rgba(34, 24, 16, 0.13);
  --shadow-sm: 0 8px 20px rgba(34, 24, 16, 0.09);
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --font-display: "Fraunces", "Iowan Old Style", "Charter", Georgia, serif;
  --font-body: "Inter", "Avenir Next", "SF Pro Text", "Segoe UI", sans-serif;
}

/* ==========================================================================
   Base Reset
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  /* clip (not hidden) prevents horizontal scroll WITHOUT creating a scroll
     container, so position: sticky keeps working for the ingredients panel */
  overflow-x: clip;
}

body {
  width: 100%;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    linear-gradient(180deg, #fbf8f0 0%, #f6f1e7 48%, #ece2cf 100%),
    linear-gradient(90deg, rgba(180, 136, 74, 0.06), rgba(36, 26, 18, 0.03));
  background-attachment: fixed;
  line-height: 1.55;
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

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

/* ==========================================================================
   Page Shell
   ========================================================================== */

.page-shell {
  width: min(1360px, calc(100% - 36px));
  max-width: 100%;
  margin: 0 auto;
  padding-bottom: 56px;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  margin: 18px auto 16px;
  padding: clamp(20px, 2.4vw, 30px);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.98) 0%, rgba(249, 243, 233, 0.96) 56%, rgba(236, 226, 207, 0.96) 100%);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

/* Brass top keyline — a thin metallic edge that reads as "branded" */
.hero {
  border-top: 2px solid transparent;
  background-clip: padding-box;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #8f6a37 0%, var(--gold) 28%, #e7c98b 50%, var(--gold) 72%, #8f6a37 100%);
  pointer-events: none;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(140% 120% at 100% 0%, rgba(180, 136, 74, 0.10), transparent 42%),
    repeating-linear-gradient(90deg, rgba(42, 32, 24, 0.03) 0 1px, transparent 1px 76px);
  pointer-events: none;
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 315px);
  gap: clamp(20px, 4vw, 54px);
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-copy {
  min-width: 0;
  max-width: 790px;
}

.site-identity {
  display: inline-grid;
  grid-template-columns: 48px auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  color: var(--text);
  text-decoration: none;
}

.site-identity:hover {
  color: var(--accent-strong);
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background:
    radial-gradient(120% 120% at 30% 22%, #38291b 0%, var(--ink) 60%, #160f09 100%);
  box-shadow:
    0 12px 24px rgba(32, 22, 14, 0.26),
    inset 0 1px 0 rgba(255, 244, 226, 0.12);
}

/* Brass keyline ring inset from the edge — the crafted, "stamped" detail */
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 8px;
  border: 1px solid rgba(180, 136, 74, 0.62);
  box-shadow: inset 0 0 0 1px rgba(180, 136, 74, 0.16);
  pointer-events: none;
}

.brand-mark--small {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow:
    0 8px 16px rgba(32, 22, 14, 0.2),
    inset 0 1px 0 rgba(255, 244, 226, 0.12);
}

.brand-mark--small::after {
  inset: 3px;
  border-radius: 7px;
}

.brand-initials {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
  background: linear-gradient(160deg, #e7c98b 0%, var(--gold) 46%, #8f6a37 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.brand-mark--small .brand-initials {
  font-size: 0.82rem;
}

.brand-text {
  display: grid;
  gap: 1px;
}

.brand-name {
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 2vw, 1.36rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.015em;
}

.brand-section {
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.1;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  font-family: var(--font-display);
  font-size: clamp(2.05rem, 3.6vw, 3.15rem);
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}

.hero p {
  max-width: 660px;
  color: var(--text-soft);
  font-size: 1rem;
}

.auth-panel {
  min-width: 0;
  width: 100%;
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(42, 35, 29, 0.1);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.auth-panel-copy {
  display: grid;
  gap: 4px;
}

.auth-label {
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-panel strong {
  font-size: 1.02rem;
  color: var(--text);
}

.auth-panel p {
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-button,
.inline-auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff8ec;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.auth-button {
  width: 100%;
}

.auth-button:hover,
.inline-auth-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.auth-button:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.hero-stat {
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(42, 35, 29, 0.08);
  backdrop-filter: blur(10px);
}

.hero-stat strong {
  display: block;
  font-size: 0.96rem;
  margin-bottom: 2px;
  color: var(--text);
}

.hero-stat span {
  color: var(--text-soft);
  font-size: 0.8rem;
}

/* ==========================================================================
   Control Panel
   ========================================================================== */

.controls {
  position: relative;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 252, 246, 0.88);
  border: 1px solid rgba(42, 35, 29, 0.1);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(210px, 0.52fr) minmax(430px, 0.9fr) auto;
  gap: 10px;
  margin-bottom: 10px;
  align-items: end;
}

.select-filter-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

/* Reserve space for JS-populated controls so the cookbook grid below does not
   shift when the filter selects, chips, and view toggles are injected.
   Values are tuned to match the tallest fully-populated layout per breakpoint. */
#primaryFilterControls {
  min-height: 0;
}

#viewToggles {
  min-height: 0;
}

#secondaryFilterControls {
  min-height: 0;
}

.field-shell {
  position: relative;
}

.field-label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.search-input,
.filter-select {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 253, 248, 0.96);
  color: var(--text);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.search-input {
  padding-left: 42px;
}

.search-input:focus,
.filter-select:focus,
.chip:focus-visible,
.view-toggle:focus-visible,
.auth-button:focus-visible,
.inline-auth-button:focus-visible,
.rating-star:focus-visible,
.load-more:focus-visible,
.card:focus-visible,
.clear-btn:focus-visible {
  border-color: rgba(198, 93, 46, 0.46);
  box-shadow: 0 0 0 3px rgba(198, 93, 46, 0.14);
  outline: none;
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 33px;
  color: var(--text-muted);
  pointer-events: none;
}

.filter-stack {
  display: grid;
  gap: 10px;
}

.filter-section {
  display: grid;
  gap: 8px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 252, 248, 0.86);
  color: var(--text-soft);
  font-size: 0.81rem;
  line-height: 1.2;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(180, 136, 74, 0.45);
  color: var(--accent-strong);
}

.chip.active {
  background: linear-gradient(135deg, #38291b 0%, var(--ink) 100%);
  border-color: rgba(180, 136, 74, 0.55);
  color: #f7ecd7;
  box-shadow: 0 10px 20px rgba(34, 24, 16, 0.2);
}

.chip.dietary.active {
  background: linear-gradient(135deg, rgba(89, 106, 73, 0.98), rgba(65, 82, 54, 0.96));
  box-shadow: 0 10px 20px rgba(89, 106, 73, 0.18);
}

.chip.recipe-tags.active {
  background: linear-gradient(135deg, rgba(36, 95, 143, 0.96), rgba(21, 70, 110, 0.94));
  box-shadow: 0 10px 20px rgba(36, 95, 143, 0.18);
}

.view-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  align-items: stretch;
  justify-content: flex-end;
  align-self: end;
}

.view-toggle-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.view-toggle {
  min-width: 62px;
  padding: 8px 11px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 250, 244, 0.94);
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.view-toggle.active {
  background: #2a211b;
  color: #fff9f1;
  border-color: #2a211b;
  transform: translateY(-1px);
}

/* ==========================================================================
   Results Bar
   ========================================================================== */

.results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 4px 0 14px;
  padding: 0 4px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.results-bar strong {
  color: var(--text);
}

.clear-btn {
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 0.9rem;
}

.clear-btn:disabled {
  opacity: 0.42;
  cursor: default;
  pointer-events: none;
}

/* ==========================================================================
   Recipe Grid And Cards
   ========================================================================== */

.recipe-grid {
  display: grid;
  gap: 16px;
}

.recipe-grid.view-list {
  grid-template-columns: 1fr;
}

.recipe-grid.view-grid-2,
.recipe-grid.view-grid-3,
.recipe-grid.view-grid-4 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.card {
  display: block;
  width: 100%;
  border: 1px solid rgba(83, 55, 26, 0.1);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(255, 248, 240, 0.92));
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  text-align: left;
  color: inherit;
  text-decoration: none;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(198, 93, 46, 0.2);
}

.card-inner {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100%;
}

.image-shell {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(180, 136, 74, 0.24), rgba(120, 83, 32, 0.22)),
    linear-gradient(45deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
}

.image-shell::after {
  content: "";
  position: absolute;
  inset: auto 12px 12px auto;
  width: 82px;
  height: 82px;
  border-radius: 10px;
  background: radial-gradient(circle, rgba(255, 247, 237, 0.42), rgba(255, 247, 237, 0));
  pointer-events: none;
}

.image-shell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .image-shell img {
  transform: scale(1.04);
}

.card-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
}

.card-topline,
.card-meta-row,
.card-tag-row,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.card-topline {
  justify-content: space-between;
  align-items: flex-start;
}

.card h2 {
  font-size: 1.12rem;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.source-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-soft);
}

.source-meta--article {
  margin-top: 12px;
  flex-direction: column;
  gap: 6px;
}

.source-meta__item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.source-meta--card .source-meta__item + .source-meta__item::before {
  content: "•";
  margin-right: 2px;
  color: rgba(83, 55, 26, 0.42);
  font-size: 0.82rem;
  line-height: 1;
}

.source-meta__label {
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.source-meta__value,
.source-meta a {
  min-width: 0;
  color: inherit;
  font-size: 0.78rem;
  line-height: 1.45;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.source-meta--card .source-meta__item {
  max-width: 100%;
}

.source-meta--card .source-meta__value {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.source-meta--article .source-meta__value,
.source-meta--article a {
  font-size: 0.82rem;
}

.source-meta a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.cuisine-label {
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.swap-badge,
.meta-pill,
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.swap-badge.no-alterations {
  background: var(--success-bg);
  color: var(--success);
}

.swap-badge.easy-substitution {
  background: var(--info-bg);
  color: var(--info);
}

.swap-badge.needs-planning {
  background: var(--warning-bg);
  color: var(--warning);
}

.swap-badge.difficult {
  background: rgba(42, 33, 27, 0.1);
  color: var(--text-soft);
}

.meta-pill {
  background: rgba(42, 33, 27, 0.06);
  color: var(--text-soft);
}

.rating-pill-shell {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  min-width: 204px;
  justify-content: flex-end;
}

.rating-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text-soft);
}

.rating-summary--compact {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(36, 95, 143, 0.08);
  border: 1px solid rgba(36, 95, 143, 0.08);
}

.rating-summary-copy {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 0.78rem;
}

.rating-summary-copy strong {
  color: var(--text);
}

.rating-stars-readonly {
  color: #d1832f;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.tag-pill {
  background: rgba(198, 93, 46, 0.08);
  color: var(--accent-strong);
  font-weight: 600;
}

.tag-pill--dietary {
  background: rgba(39, 103, 73, 0.12);
  color: #245f47;
}

.card-desc {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.card-ingredients {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.card-ingredients strong {
  color: var(--text);
}

.card-actions {
  margin-top: auto;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.recipe-grid.view-grid-2 .rating-pill-shell,
.recipe-grid.view-grid-3 .rating-pill-shell,
.recipe-grid.view-grid-4 .rating-pill-shell {
  width: 100%;
  min-width: 0;
  margin-left: 0;
  justify-content: flex-start;
}

.recipe-grid.view-grid-2 .rating-summary--compact,
.recipe-grid.view-grid-3 .rating-summary--compact,
.recipe-grid.view-grid-4 .rating-summary--compact {
  width: 100%;
  justify-content: space-between;
}

.recipe-grid.view-grid-3 .card-desc,
.recipe-grid.view-grid-4 .card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.load-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.load-more {
  min-width: 180px;
  padding: 14px 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2a211b, #49392f);
  color: #fff8ef;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  font-weight: 700;
}

.load-more:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.empty-state {
  padding: 48px 28px;
  border-radius: 14px;
  border: 1px dashed rgba(83, 55, 26, 0.18);
  background: rgba(255, 252, 247, 0.82);
  text-align: center;
  color: var(--text-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.empty-state h3 {
  margin-bottom: 8px;
  font-size: 1.2rem;
  color: var(--text);
}

/* ==========================================================================
   Recipe Article
   ========================================================================== */

.recipe-content {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
  grid-template-areas:
    "sidebar header"
    "sidebar main";
  gap: 28px;
  padding: 0 28px 32px;
  align-items: start;
  min-width: 0;
}

.recipe-sidebar {
  grid-area: sidebar;
  display: grid;
  gap: 16px;
  min-width: 0;
  position: sticky;
  top: 24px;
  align-self: start;
}

.recipe-image {
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(180, 136, 74, 0.2), rgba(120, 83, 32, 0.18)),
    #f4eadb;
  aspect-ratio: 4 / 3;
  min-height: 0;
}

.recipe-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.recipe-header,
.recipe-main {
  display: grid;
  gap: 18px;
  align-content: start;
  min-width: 0;
}

.recipe-header {
  grid-area: header;
}

.recipe-main {
  grid-area: main;
  padding-bottom: 4px;
}

.recipe-header h1 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.recipe-subtitle {
  color: var(--text-soft);
  font-size: 1rem;
}

.recipe-section {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(83, 55, 26, 0.08);
}

.recipe-section h2 {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-soft);
}

.recipe-section ul,
.recipe-section ol {
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--text-soft);
}

.recipe-section p {
  color: var(--text-soft);
}

.recipe-ingredients-panel {
  max-height: 46vh;
  overflow: auto;
  overscroll-behavior: contain;
  background: rgba(255, 252, 247, 0.88);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 24px;
}

.recipe-ingredients-panel ul {
  padding-left: 0;
  list-style: none;
}

.ingredient-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  color: var(--text-soft);
  line-height: 1.42;
  cursor: pointer;
}

.ingredient-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--success);
  cursor: pointer;
}

.ingredient-check span {
  overflow-wrap: anywhere;
}

.ingredient-check input:checked + span {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(156, 107, 44, 0.5);
}

/* At-a-glance fact grid — scannable spec cells with hairline dividers */
.recipe-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--border);
  overflow: hidden;
}

/* If there's an odd number of facts, let the last one span the full width
   so there is never an awkward empty cell */
.recipe-fact:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.recipe-fact {
  margin: 0;
  padding: 12px 14px;
  background: var(--surface-strong);
}

.recipe-fact dt {
  margin: 0 0 3px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.recipe-fact dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

.recipe-section--dietary {
  border-left: 3px solid var(--accent-warm);
  background: rgba(246, 178, 107, 0.06);
}

.recipe-section--dietary .swap-badge {
  margin-bottom: 4px;
}

.recipe-section--ratings {
  border-left: 3px solid rgba(36, 95, 143, 0.4);
  background: rgba(219, 238, 255, 0.2);
}

.recipe-rating-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.rating-composer {
  display: grid;
  gap: 10px;
}

.rating-copy {
  color: var(--text-soft);
}

.rating-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rating-star {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(83, 55, 26, 0.1);
  color: rgba(209, 131, 47, 0.42);
  font-size: 1.35rem;
  transition: transform 0.14s ease, border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.rating-star.active,
.rating-star:hover {
  color: #d1832f;
  border-color: rgba(209, 131, 47, 0.3);
  background: rgba(255, 249, 241, 0.92);
  transform: translateY(-1px);
}

.rating-star:disabled {
  opacity: 0.6;
  cursor: wait;
}

.rating-disabled-note {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.dietary-support-grid {
  display: grid;
  gap: 10px;
}

.dietary-support-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(83, 55, 26, 0.08);
}

.dietary-support-card--supported {
  border-color: rgba(39, 103, 73, 0.16);
}

.dietary-support-card--planned {
  border-color: rgba(198, 93, 46, 0.16);
}

.dietary-support-card--unsupported {
  border-color: rgba(83, 55, 26, 0.08);
  opacity: 0.88;
}

.dietary-support-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dietary-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.dietary-status-pill--supported {
  background: rgba(39, 103, 73, 0.12);
  color: #245f47;
}

.dietary-status-pill--planned {
  background: rgba(198, 93, 46, 0.12);
  color: var(--accent-strong);
}

.dietary-status-pill--unsupported {
  background: rgba(42, 33, 27, 0.08);
  color: var(--text-muted);
}

.dietary-shared-note strong {
  color: var(--text);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer-note {
  margin-top: 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.86rem;
}

/* ==========================================================================
   Responsive Layout
   ========================================================================== */

@media (min-width: 720px) {
  .recipe-grid.view-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recipe-grid.view-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recipe-grid.view-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recipe-grid.view-list .card-inner {
    grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  }

  .recipe-grid.view-list .image-shell {
    height: 100%;
    min-height: 100%;
    max-height: 300px;
    aspect-ratio: auto;
  }
}

@media (min-width: 980px) {
  .recipe-grid.view-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .recipe-grid.view-grid-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1220px) {
  .recipe-grid.view-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .hero-top {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    max-width: 520px;
  }

  .search-row {
    grid-template-columns: 1fr 1fr;
  }

  .select-filter-row {
    grid-column: span 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .view-group {
    min-width: 0;
  }
}

@media (max-width: 840px) {
  .hero-stats {
    grid-template-columns: 1fr;
  }

  .rating-pill-shell {
    min-width: 0;
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .rating-summary--compact {
    width: 100%;
    justify-content: space-between;
  }

  .recipe-content {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "sidebar"
      "main";
  }

  .recipe-image {
    aspect-ratio: 16 / 10;
  }

  .recipe-sidebar {
    position: static;
  }

  .recipe-ingredients-panel {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: 100%;
    padding-inline: 16px;
  }

  .hero,
  .controls {
    border-radius: 14px;
    max-width: 100%;
    overflow: hidden;
  }

  .hero {
    padding: 22px 18px;
  }

  .hero h1 {
    max-width: 11ch;
    font-size: clamp(1.88rem, 9vw, 2.08rem);
    line-height: 1.02;
  }

  .hero p {
    max-width: 31ch;
    overflow-wrap: break-word;
  }

  .site-identity {
    grid-template-columns: 42px auto;
    margin-bottom: 18px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 9px;
  }

  .brand-initials {
    font-size: 0.9rem;
  }

  .controls {
    padding: 14px;
  }

  .auth-panel,
  .hero-stat,
  .search-input,
  .filter-select,
  .view-group,
  .field-shell {
    max-width: 100%;
    min-width: 0;
  }

  .auth-button {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  #primaryFilterControls {
    min-height: 0;
  }

  #secondaryFilterControls {
    min-height: 0;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .select-filter-row {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .results-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-copy {
    padding: 16px;
  }

  .recipe-page main,
  .recipe-page-nav,
  .recipe-page > .footer-note {
    width: min(calc(100% - 18px), 1320px);
  }

  .recipe-page-nav {
    margin-top: 16px;
  }

  .recipe-page-nav nav {
    gap: 14px;
    padding: 12px 16px;
  }

  .recipe-nav-brand,
  .recipe-nav-links {
    width: 100%;
  }

  .recipe-nav-links {
    gap: 14px;
  }

  .recipe-article {
    padding: 18px;
    border-radius: 14px;
  }

  .recipe-content {
    gap: 20px;
    padding: 0 0 24px;
  }

  .recipe-header h1 {
    font-size: clamp(1.8rem, 8.8vw, 2rem);
    line-height: 1.06;
  }

  .recipe-section {
    padding: 14px 16px;
  }

  .source-meta--article .source-meta__item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* ==========================================================================
   Static Recipe Page

   Layout for generated /cookbook/recipes/<slug>/ pages. Core layout
   (.recipe-content, .recipe-image, .recipe-header, .recipe-main,
   .recipe-section) is shared
   with the recipe-article card above; this section adds page-level chrome.
   ========================================================================== */

.recipe-page {
  padding: 0;
}

.recipe-page main {
  width: min(calc(100% - 32px), 1320px);
  margin: 0 auto 32px;
}

.recipe-page-nav {
  width: min(calc(100% - 32px), 1320px);
  margin: 24px auto 20px;
}

.recipe-page-nav nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  align-items: center;
  justify-content: space-between;
}

.recipe-page-nav nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.recipe-page-nav nav a:hover {
  color: var(--accent);
}

.recipe-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text) !important;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 900 !important;
  letter-spacing: -0.01em !important;
}

.recipe-nav-links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.recipe-article {
  padding: 28px;
  background: linear-gradient(180deg, #fffaf3, #fff6eb);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.recipe-article h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3vw, 2.4rem);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.recipe-article .footer-note,
.recipe-page > .footer-note {
  width: min(calc(100% - 32px), 1320px);
  margin: 0 auto 40px;
}

.recipe-page > .footer-note {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* ==========================================================================
   Visual Refresh

   A cleaner, more editorial layer over the original cookbook UI. The goal is
   less "generated beige dashboard" and more durable recipe archive: flatter
   surfaces, sharper hierarchy, real food imagery in the first viewport, and a
   broader brand palette anchored by ink, sage, brass, and tomato.
   ========================================================================== */

:root {
  --bg: #faf8f5;
  --bg-accent: #e8f0e5;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-muted: #f0f5ee;
  --border: rgba(44, 42, 41, 0.12);
  --border-strong: rgba(44, 42, 41, 0.24);
  --text: #2c2a29;
  --text-soft: #514d49;
  --text-muted: #746e68;
  --accent: #c05c3b;
  --accent-strong: #8f3f29;
  --accent-warm: #d08a3f;
  --gold: #b98332;
  --gold-soft: rgba(185, 131, 50, 0.15);
  --sage: #657d5f;
  --sage-soft: #e4eee0;
  --blue: #426f79;
  --blue-soft: #e5f0f1;
  --ink: #2c2a29;
  --shadow-lg: 0 24px 44px rgba(44, 42, 41, 0.12);
  --shadow-md: 0 16px 30px rgba(44, 42, 41, 0.1);
  --shadow-sm: 0 8px 18px rgba(44, 42, 41, 0.07);
  --radius-xl: 8px;
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 6px;
}

body {
  background:
    radial-gradient(120% 70% at 100% 0%, rgba(101, 125, 95, 0.18), transparent 48%),
    radial-gradient(90% 60% at 0% 14%, rgba(192, 92, 59, 0.12), transparent 42%),
    linear-gradient(180deg, #faf8f5 0%, #f3f7f0 54%, #f8eee9 100%);
}

.page-shell {
  width: min(1440px, calc(100% - 80px));
}

.hero {
  margin: 18px auto 16px;
  padding: clamp(22px, 2.6vw, 34px);
  border-radius: 0;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.94) 48%, rgba(228, 238, 224, 0.94) 100%);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  box-shadow: var(--shadow-md);
}

.hero::before {
  background:
    linear-gradient(90deg, rgba(192, 92, 59, 0.11), transparent 34%),
    linear-gradient(180deg, transparent 0%, rgba(66, 111, 121, 0.05) 100%);
}

.hero::after {
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--sage), var(--blue));
}

.hero-top {
  grid-template-columns: minmax(0, 0.95fr) minmax(390px, 0.68fr);
  align-items: stretch;
  min-width: 0;
}

.site-identity {
  grid-template-columns: 42px auto;
  margin-bottom: 20px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.brand-mark::after {
  border-radius: 5px;
}

.brand-name,
.hero h1,
.recipe-header h1,
.recipe-article h1,
.card h2 {
  letter-spacing: 0;
}

.brand-name {
  font-size: clamp(1.08rem, 1.5vw, 1.32rem);
}

.brand-section,
.section-kicker,
.field-label,
.auth-label,
.cuisine-label,
.source-meta__label,
.recipe-section h2 {
  letter-spacing: 0.08em;
}

.hero h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(2.05rem, 3.45vw, 3.55rem);
  line-height: 0.98;
}

.hero p {
  max-width: 660px;
  color: var(--text-soft);
  font-size: clamp(0.98rem, 1.05vw, 1.08rem);
  line-height: 1.58;
}

.hero-quickfacts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-quickfacts span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(44, 42, 41, 0.12);
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.hero-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(138px, 0.65fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  height: clamp(270px, 27vw, 340px);
  min-height: 0;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.hero-feature-image {
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--sage-soft);
  border: 1px solid rgba(34, 29, 24, 0.14);
}

.hero-feature-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-feature-image--large {
  grid-row: 1 / span 2;
}

.hero-feature-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  min-height: 0;
  min-width: 0;
}

.auth-panel {
  grid-column: 1 / -1;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(63, 101, 77, 0.22);
  box-shadow: 0 1px 0 rgba(34, 29, 24, 0.06);
  color: var(--text);
}

.auth-panel strong {
  color: var(--text);
}

.auth-panel p {
  color: var(--text-soft);
}

.auth-label {
  color: var(--sage);
}

.auth-button,
.inline-auth-button {
  min-height: 42px;
  border-radius: 7px;
  background: var(--accent);
  color: #fffdf8;
  box-shadow: none;
}

.hero-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 22px;
  border-top: 1px solid rgba(34, 29, 24, 0.14);
  border-bottom: 1px solid rgba(34, 29, 24, 0.14);
}

.hero-stat {
  padding: 14px 20px;
  border-radius: 0;
  background: transparent;
  border: 0;
  backdrop-filter: none;
  position: relative;
}

.hero-stat + .hero-stat {
  border-left: 1px solid rgba(34, 29, 24, 0.14);
}

.hero-stat::before {
  content: "";
  display: block;
  width: 34px;
  height: 4px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--accent);
}

.hero-stat:nth-child(2)::before {
  background: var(--sage);
}

.hero-stat:nth-child(3)::before {
  background: var(--blue);
}

.hero-stat strong {
  font-size: 1.02rem;
}

.hero-stat span {
  color: var(--text-muted);
}

.controls {
  margin-bottom: 16px;
  padding: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  box-shadow: var(--shadow-sm);
}

.controls-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 22px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(34, 29, 24, 0.1);
}

.section-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.controls-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1;
}

.controls-head p {
  max-width: 520px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.search-row {
  grid-template-columns: minmax(280px, 1.25fr) minmax(180px, 0.45fr) minmax(360px, 0.85fr) auto;
}

.search-input,
.filter-select {
  border-radius: 7px;
  background: #ffffff;
  border-color: rgba(44, 42, 41, 0.16);
  box-shadow: none;
}

.chip,
.view-toggle,
.meta-pill,
.tag-pill,
.swap-badge,
.rating-summary--compact,
.dietary-status-pill {
  border-radius: 7px;
}

.chip {
  background: #ffffff;
  border-color: rgba(34, 29, 24, 0.13);
}

.chip.active,
.view-toggle.active {
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: none;
}

.chip.dietary.active {
  background: var(--sage);
}

.chip.recipe-tags.active {
  background: var(--blue);
}

.chip-toggle {
  border-style: dashed;
  color: var(--accent-strong);
  font-weight: 800;
}

.results-bar {
  margin: 12px 0 18px;
  padding: 0 2px;
}

.card {
  position: relative;
  border-radius: 8px;
  background: #ffffff;
  border-color: rgba(44, 42, 41, 0.12);
  box-shadow: 0 1px 0 rgba(44, 42, 41, 0.06), 0 12px 28px rgba(44, 42, 41, 0.08);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--gold), var(--sage));
  opacity: 0.82;
  z-index: 1;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(157, 86, 56, 0.32);
}

.card-inner {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #f7faf5 100%);
}

.image-shell {
  background: var(--sage-soft);
}

.image-shell::after {
  display: none;
}

.card-copy {
  gap: 13px;
  padding: 18px 20px;
}

.card h2 {
  max-width: 760px;
  font-size: clamp(1.12rem, 1.25vw, 1.32rem);
  line-height: 1.1;
}

.card-desc {
  color: var(--text-soft);
  line-height: 1.55;
}

.source-meta {
  gap: 4px 14px;
}

.meta-pill {
  background: #edf3ea;
  color: #405443;
}

.tag-pill {
  border-radius: 999px;
  background: #f7e3db;
  border: 1px solid rgba(157, 86, 56, 0.14);
  color: var(--accent-strong);
}

.tag-pill--dietary {
  background: #e1ecdc;
  border-color: rgba(63, 101, 77, 0.18);
  color: #31523c;
}

.swap-badge.no-alterations {
  background: var(--sage-soft);
  color: var(--sage);
}

.swap-badge.easy-substitution {
  background: var(--blue-soft);
  color: var(--blue);
}

.card-actions {
  padding-top: 8px;
  border-top: 1px solid rgba(34, 29, 24, 0.08);
  color: var(--accent-strong);
}

.load-more {
  border-radius: 7px;
}

.recipe-page-nav nav,
.recipe-article,
.recipe-section,
.recipe-image,
.dietary-support-card,
.empty-state {
  border-radius: 8px;
}

.recipe-page-nav nav {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.96);
}

.recipe-article {
  background:
    linear-gradient(180deg, #ffffff 0%, #f7faf5 100%);
}

.recipe-content {
  gap: 32px;
}

.recipe-header {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(34, 29, 24, 0.12);
}

.recipe-header h1 {
  max-width: 820px;
}

.recipe-section {
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(34, 29, 24, 0.1);
}

.recipe-section--snapshot {
  background: #f7eae3;
  border-color: rgba(157, 86, 56, 0.14);
}

.recipe-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.recipe-fact {
  padding: 0;
  background: transparent;
}

.recipe-fact dd {
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 700;
}

.recipe-ingredients-panel {
  background: rgba(255, 255, 255, 0.94);
}

.recipe-section--dietary {
  border-left-color: var(--gold);
  background: rgba(228, 238, 224, 0.62);
}

.dietary-support-list {
  display: grid;
  gap: 9px;
  padding-left: 0 !important;
  list-style: none;
}

.dietary-support-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
  color: var(--text-soft);
}

.dietary-support-item strong {
  color: var(--text);
}

.recipe-section ol li strong {
  color: var(--text);
  font-weight: 800;
}

.recipe-section--ratings {
  border-left-color: var(--blue);
  background: rgba(228, 238, 240, 0.5);
}

.mobile-ingredients-tray {
  display: none;
}

@media (max-width: 1120px) {
  .hero-top {
    grid-template-columns: 1fr;
  }

  .hero-feature {
    max-width: 760px;
  }

  .controls-head {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .page-shell {
    width: 100%;
    padding-inline: 14px;
    overflow-x: hidden;
  }

  .hero {
    width: calc(100vw - 28px);
    margin-top: 14px;
    padding: 18px 16px;
    max-width: 100%;
    overflow: hidden;
  }

  .hero-copy,
  .hero-top,
  .hero-feature,
  .hero-feature-stack,
  .hero-feature-image,
  .hero-copy p {
    min-width: 0;
    max-width: 100%;
  }

  .hero h1 {
    max-width: 12ch;
    font-size: clamp(1.85rem, 8.7vw, 2.28rem);
    overflow-wrap: break-word;
  }

  .hero p {
    max-width: 30ch;
    overflow-wrap: break-word;
  }

  .hero-quickfacts {
    margin-top: 14px;
  }

  .hero-feature {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    overflow: hidden;
    width: 100%;
  }

  .hero-feature-image--large {
    grid-row: auto;
    aspect-ratio: 16 / 10;
  }

  .hero-feature-image--large {
    width: 100%;
    max-width: 100%;
  }

  .hero-feature-stack {
    display: none;
  }

  .auth-panel {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    display: none;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .controls-head p {
    max-width: none;
  }

  .recipe-facts {
    grid-template-columns: 1fr;
  }

  .recipe-page {
    padding-bottom: 76px;
  }

  .mobile-ingredients-tray {
    display: block;
  }

  .mobile-ingredients-toggle {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 12px;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 12px 16px;
    border-radius: 999px;
    background: var(--ink);
    color: #fffdf8;
    box-shadow: 0 12px 28px rgba(44, 42, 41, 0.22);
    font-weight: 800;
  }

  .mobile-ingredients-count {
    color: rgba(255, 253, 248, 0.78);
    font-size: 0.82rem;
    font-weight: 700;
  }

  .mobile-ingredients-backdrop {
    position: fixed;
    inset: 0;
    z-index: 41;
    background: rgba(44, 42, 41, 0.34);
  }

  .mobile-ingredients-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 42;
    max-height: min(72vh, 620px);
    padding: 18px 18px 22px;
    border-radius: 18px 18px 0 0;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 -18px 42px rgba(44, 42, 41, 0.18);
    overflow: auto;
    overscroll-behavior: contain;
  }

  .mobile-ingredients-head {
    position: sticky;
    top: -18px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -18px -18px 12px;
    padding: 16px 18px 12px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
  }

  .mobile-ingredients-head strong {
    color: var(--text);
    font-size: 0.92rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .mobile-ingredients-head button {
    color: var(--accent-strong);
    font-weight: 800;
  }

  .mobile-ingredients-sheet ul {
    display: grid;
    gap: 8px;
    padding-left: 0;
    list-style: none;
  }

  .mobile-ingredients-open {
    overflow: hidden;
  }
}
