:root {
  --paper: #f3eee4;
  --paper-deep: #e7dfd0;
  --card: #fffaf3;
  --ink: #2b211c;
  --ink-soft: #5e4b40;
  --line: #e0d3c3;
  --terra: #8d3f2a;
  --terra-deep: #6f2f1e;
  --sage: #2f6a45;
  --gold: #8a5a12;
  --gold-soft: #f3e2c4;
  --danger: #8d1d2c;
  --focus: #6f2f1e;
  --shadow: 0 12px 30px rgba(74, 46, 28, 0.07);
  --radius: 18px;
  --max: 1080px;
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(255, 255, 255, 0.8), transparent 60%),
    var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--terra-deep); }
a:hover { color: var(--terra); }
h1, h2, h3 { line-height: 1.2; font-weight: 650; }
h1 { font-size: clamp(2.1rem, 4vw, 3.3rem); margin: 0.2em 0 0.35em; }
h2 { font-size: clamp(1.6rem, 2.5vw, 2.1rem); }
p { margin: 0.6em 0; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: #fff;
  color: #000;
  padding: 0.7rem 1rem;
  z-index: 20;
  border-radius: 8px;
}
.skip-link:focus { top: 0.6rem; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(243, 238, 228, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.header-inner, .wrap, .site-footer .wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 0;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 700;
}
.brand-mark { width: 42px; height: 42px; flex: none; }
.nav-toggle {
  margin-left: auto;
  min-height: 48px;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font: inherit;
  color: inherit;
}
#site-nav, #auth-slot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  align-items: center;
}
#site-nav a, #auth-slot a, .linkish {
  color: var(--ink);
  text-decoration: none;
  padding: 0.35rem 0.1rem;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}
#site-nav a[aria-current="page"] { color: var(--terra-deep); text-decoration: underline; text-underline-offset: 0.25em; }
.who { color: var(--ink-soft); }

.demo-banner {
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--gold-soft);
  color: var(--ink);
  text-align: center;
  border-bottom: 1px solid #e4d0a4;
}
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.7rem 1.2rem; }
.site-footer a { color: var(--ink-soft); }

main { padding: 1.2rem 0 2rem; }
.lede { font-size: 1.35rem; max-width: 40rem; }
.eyebrow {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sage);
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}
.hero {
  display: grid;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.4rem;
}
.hero-copy { max-width: 40rem; }
.panel, .card, .product-card, .offer, .comment, .prose, .form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel, .form-card, .prose { padding: 1rem 1.1rem 1.2rem; }
.prose { max-width: 46rem; }
.prose h1 { margin-top: 0; }

.filters { display: grid; gap: 0.9rem; margin: 1rem 0 1.2rem; }
label { display: block; font-weight: 650; margin-top: 0.8rem; }
input, select, textarea {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  border: 1px solid #cbbba8;
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
}
textarea { resize: vertical; }
.search-label input { font-size: 1.15rem; min-height: 52px; }
.chip-row { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.chip-row button, .button, button, .button-quiet {
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  min-height: 48px;
  padding: 0.45rem 0.95rem;
}
.chip-row button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}
.chip-row button[aria-pressed="true"] {
  background: var(--terra);
  border-color: var(--terra);
  color: #fffaf3;
}
.button, button[type="submit"], .button-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid transparent;
}
.button, button[type="submit"] {
  background: var(--terra);
  color: #fffaf3;
}
.button:hover, button[type="submit"]:hover { background: var(--terra-deep); color: #fff; }
.button-quiet, button.button-quiet {
  background: transparent;
  color: var(--terra-deep);
  border-color: #ddc8b6;
}
.results-count { color: var(--ink-soft); margin: 0.2rem 0 0.8rem; }
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.card { overflow: hidden; }
.card-media { position: relative; display: block; color: inherit; }
.card-body, .product-card { padding: 0.9rem 1rem 1.1rem; }
.card h2 { font-size: 1.55rem; margin: 0.15em 0; }
.card h2 a { color: inherit; text-decoration: none; }
.card h2 a:hover { text-decoration: underline; }
.meta, .hint, .credit, .note { color: var(--ink-soft); }
.badge {
  display: inline-block;
  background: var(--gold-soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.95rem;
}
.card-media .badge { position: absolute; left: 0.7rem; top: 0.7rem; }
.photo-fallback {
  display: grid;
  place-items: center;
  min-height: 180px;
  background: var(--paper-deep);
  color: var(--ink-soft);
}
.empty { color: var(--ink-soft); }

.shop-feature {
  margin-top: 2rem;
  padding: 1.1rem;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 250, 243, 0.4), rgba(255, 250, 243, 0.9)),
    var(--gold-soft);
  border: 1px solid #e4d0a4;
}
.feature-grid { display: grid; gap: 0.8rem; margin-top: 1rem; }
.feature-grid a {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 0.7rem;
  align-items: center;
  background: var(--card);
  border-radius: 14px;
  padding: 0.45rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
}
.status-pill {
  display: inline-block;
  background: var(--terra);
  color: #fffaf3;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 1rem;
}
.product-layout, .recipe-layout { display: grid; gap: 1rem; }
figure { margin: 0; }
figcaption, .illus-label { color: var(--ink-soft); font-size: 1rem; margin-top: 0.35rem; }
.offer { padding: 0.9rem 1rem; margin: 0.8rem 0; }
.price { font-size: 1.25rem; }

.recipe-photo img, .product-photo img, .hero img { border-radius: 16px; background: var(--paper-deep); }
.ingredients, .steps { padding-left: 1.3rem; }
.ingredients li, .steps li { margin: 0.45rem 0; }
.action-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.8rem 0; }
.heart[aria-pressed="true"] { background: #f8e4e0; border: 1px solid var(--terra); color: var(--terra-deep); }
.rate { border: 0; padding: 0; margin: 0.6rem 0 0; display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.rate legend { padding: 0; font-weight: 650; width: 100%; }
.rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate label {
  width: 48px;
  height: 48px;
  margin: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  cursor: pointer;
}
.rate label::before { content: "★"; color: #c8b39d; font-size: 1.6rem; }
.rate label.is-on::before,
.rate input:focus-visible + label::before { color: var(--gold); }
.rate label.is-on { border-color: var(--gold); background: #fff6e8; }
.comment { padding: 0.8rem 1rem; margin: 0.7rem 0; }
.comment.is-hidden { opacity: 0.7; }
.form-error { color: var(--danger); min-height: 1.2em; font-weight: 650; }
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.rows { list-style: none; padding: 0; margin: 0.4rem 0 0; }
.rows li { display: grid; gap: 0.4rem; margin-bottom: 0.6rem; }
.preview-img { max-width: 280px; border-radius: 12px; }
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  width: min(520px, calc(100% - 2rem));
  padding: 1rem 1.1rem 1.2rem;
}
dialog::backdrop { background: rgba(43, 33, 28, 0.45); }
.report-list { padding-left: 1.2rem; }
.draft-banner {
  background: var(--gold-soft);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
}

.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;
}

.print-only, #preview-bar { display: none; }
#preview-bar {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #fff6d8;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #e4d0a4;
}
body[data-preview] #preview-bar { display: block; }
body[data-preview] .badge { display: none !important; }
body[data-preview] .site-header,
body[data-preview] .site-footer,
body[data-preview] .demo-banner,
body[data-preview] .no-print,
body[data-preview] #comments,
body[data-preview] #recipe-actions,
body[data-preview] .note,
body[data-preview] .ad-slot,
body[data-preview] .ad-sidebar,
body[data-preview] .ad-footer,
body[data-preview] .cookie-banner,
body[data-preview] .ad-step { display: none !important; }
body[data-preview] .print-only { display: block; }
body[data-preview="full"] .shopping-label { display: none; }
body[data-preview="ingredients"] .steps,
body[data-preview="ingredients"] .steps-heading,
body[data-preview="ingredients"] .recipe-story,
body[data-preview="ingredients"] .recipe-photo,
body[data-preview="ingredients"] .credit,
body[data-preview="ingredients"] #rating-summary,
body[data-preview="ingredients"] #heart-summary { display: none !important; }
body[data-preview="ingredients"] .ingredients { list-style: none; padding-left: 0; }
body[data-preview="ingredients"] .ingredients li::before { content: "☐  "; }

@media (max-width: 760px) {
  .brand { order: 1; }
  #auth-slot { order: 2; width: auto; margin-left: auto; }
  .nav-toggle { order: 3; margin-left: 0.4rem; }
  html:not(.no-js) .nav-toggle { display: inline-flex; }
  html:not(.no-js) #site-nav {
    display: none;
    order: 4;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 0.4rem;
  }
  html:not(.no-js) #site-nav.is-open { display: flex; }
}
@media (min-width: 761px) {
  .nav-toggle { display: none; }
  #site-nav { margin-left: auto; }
  .hero { grid-template-columns: 1.2fr 0.8fr; }
  .grid { grid-template-columns: 1fr 1fr; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .product-layout { grid-template-columns: 0.9fr 1.1fr; align-items: start; }
  .rows li { grid-template-columns: 1fr auto; align-items: start; }
}
@media (min-width: 1100px) {
  .grid { grid-template-columns: 1fr 1fr 1fr; }
}

.grid > .ad-slot { grid-column: 1 / -1; }
.ad-slot[data-debug="true"] {
  outline: 2px dashed #8d3f2a;
  outline-offset: -2px;
  background: rgba(141, 63, 42, 0.06);
  border-radius: 12px;
}
.ad-debug-label {
  display: block;
  padding: 0.45rem 0.7rem;
  color: var(--terra-deep);
  font-size: 0.95rem;
}
.ad-sidebar { display: none; }
.ad-step { list-style: none; margin: 0.8rem 0; }
.ad-footer, .cookie-banner { display: none; }
.affiliate-note {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--gold-soft);
}
.affiliate-disclosure { margin-top: 0; }

@media (min-width: 1100px) {
  .recipe-layout.has-ad-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    column-gap: 1.25rem;
    align-items: start;
  }
  .recipe-layout.has-ad-sidebar > :not(.ad-sidebar) { grid-column: 1; }
  .recipe-layout.has-ad-sidebar > .ad-sidebar {
    display: block;
    grid-column: 2;
    grid-row: 1 / span 24;
    position: sticky;
    top: 1rem;
    align-self: start;
  }
}
@media (max-width: 760px) {
  .ad-footer {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8;
    background: var(--card);
    border-top: 1px solid var(--line);
    padding: 0.4rem 0.6rem 0.6rem;
  }
  .ad-dismiss {
    position: absolute;
    right: 0.4rem;
    top: 0.3rem;
    min-height: 44px;
  }
  body:has(.ad-footer) { padding-bottom: 5.5rem; }
}
.cookie-banner {
  display: block;
  position: fixed;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.8rem;
  z-index: 9;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

@media print {
  @page { margin: 0.6in; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .site-header, .site-footer, .demo-banner, .no-print, #comments, #recipe-actions, #preview-bar, .note, .badge,
  .ad-slot, .ad-sidebar, .ad-footer, .cookie-banner, .ad-step { display: none !important; }
  .recipe-layout.has-ad-sidebar { display: block !important; }
  a { color: #000; text-decoration: none; }
  .print-only { display: block; }
  body[data-print="full"] .shopping-label { display: none !important; }
  body[data-print="ingredients"] .steps,
  body[data-print="ingredients"] .steps-heading,
  body[data-print="ingredients"] .recipe-story,
  body[data-print="ingredients"] .recipe-photo,
  body[data-print="ingredients"] .credit,
  body[data-print="ingredients"] #rating-summary,
  body[data-print="ingredients"] #heart-summary { display: none !important; }
  body[data-print="ingredients"] .ingredients { list-style: none; padding-left: 0; }
  body[data-print="ingredients"] .ingredients li::before { content: "☐  "; }
  .card, .panel, .prose { box-shadow: none; border: 0; }
}
