/* =========================================================================
   RECIPE PUBLICATION - DESIGN SYSTEM
   Art direction: WARM EDITORIAL MAGAZINE. Oversized serif display type,
   generous whitespace, thin gold hairline rules, card grids with soft
   borders instead of heavy shadows, a cream paper background evoking a
   printed food magazine rather than a typical recipe-blog template.

   Type pairing: "Fraunces" (serif, display/headlines, high-contrast,
   slightly quirky old-style italics) + "Inter" (sans, body copy and UI).

   Color system (light):
     --bg:        #FBF6ED  warm cream paper
     --surface:   #FFFFFF  card surface
     --ink:       #241F19  near-black warm charcoal (text)
     --ink-soft:  #5B5346  muted body text
     --accent:    #C1502E  burnt terracotta (primary accent / CTAs)
     --accent-2:  #6B7A4F  olive (secondary accent)
     --gold:      #C9A66B  hairline rule / decorative gold
     --line:      #E7DFD0  hairline borders

   Color system (dark - prefers-color-scheme / data-theme):
     --bg:        #1B1712
     --surface:   #241F19
     --ink:       #F3ECDD
     --ink-soft:  #C9BFAC
     --accent:    #E07A50
     --accent-2:  #8FA36A
     --gold:      #D8B98A
     --line:      #3A332A
   ========================================================================= */

:root {
  --bg: #FBF6ED;
  --surface: #FFFFFF;
  --ink: #241F19;
  --ink-soft: #5B5346;
  --accent: #C1502E;
  --accent-2: #6B7A4F;
  --gold: #C9A66B;
  --line: #E7DFD0;
  --danger: #B3261E;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(36, 31, 25, 0.06);
  --shadow-lg: 0 12px 32px rgba(36, 31, 25, 0.14);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1B1712;
    --surface: #241F19;
    --ink: #F3ECDD;
    --ink-soft: #C9BFAC;
    --accent: #E07A50;
    --accent-2: #8FA36A;
    --gold: #D8B98A;
    --line: #3A332A;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #1B1712;
  --surface: #241F19;
  --ink: #F3ECDD;
  --ink-soft: #C9BFAC;
  --accent: #E07A50;
  --accent-2: #8FA36A;
  --gold: #D8B98A;
  --line: #3A332A;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}
.hairline { border: none; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.gold-rule { height: 3px; background: var(--gold); width: 64px; margin: 0.75rem 0 1.5rem; border-radius: 2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5em;
  padding: 0.7em 1.4em;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #a4421f; }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--bg); }
.btn-secondary { background: var(--accent-2); color: #fff; }
.btn-secondary:hover { opacity: 0.9; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}

/* Header / nav */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.marquee {
  background: var(--ink); color: var(--bg);
  font-size: 0.82rem; letter-spacing: 0.03em;
  padding: 7px 0; overflow: hidden; white-space: nowrap;
}
.marquee-track { display: inline-block; padding-left: 100%; animation: marquee 26s linear infinite; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; padding-left: 2rem; } }

.nav-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; gap: 24px;
}
.brand { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--ink); font-weight: 500; font-size: 0.95rem; }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.icon-btn { position: relative; color: var(--ink); font-size: 1.1rem; }
.cart-badge {
  position: absolute; top: -8px; right: -10px; background: var(--accent);
  color: #fff; font-size: 0.65rem; border-radius: 50%; min-width: 17px; height: 17px;
  display: flex; align-items: center; justify-content: center; padding: 0 2px;
}
.search-form { display: flex; align-items: center; }
.search-form input {
  border: 1px solid var(--line); border-radius: var(--radius) 0 0 var(--radius);
  padding: 8px 10px; font-family: var(--font-body); font-size: 0.9rem; background: var(--bg); color: var(--ink);
}
.search-form button {
  border: 1px solid var(--ink); border-left: none; background: var(--ink); color: var(--bg);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 8px 12px; cursor: pointer;
}
.mobile-toggle { display: none; background: none; border: none; font-size: 1.4rem; color: var(--ink); cursor: pointer; }

@media (max-width: 860px) {
  .nav-links { display: none; width: 100%; flex-direction: column; align-items: flex-start; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
  .nav-links.open { display: flex; }
  .nav-row { flex-wrap: wrap; }
  .mobile-toggle { display: block; }
  .search-form { display: none; }
}

/* Hero */
.hero { position: relative; padding: 70px 0; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero-eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; color: var(--accent); font-weight: 700; margin-bottom: 0.75em; }
.hero img { border-radius: var(--radius); box-shadow: var(--shadow-lg); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero { padding: 40px 0; } }

/* Cards */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-family: var(--font-display); font-size: 1.15rem; margin: 0; }
.card-title a { color: var(--ink); }
.meta-row { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.8rem; color: var(--ink-soft); }
.badge {
  display: inline-block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 3px 8px; border-radius: 20px; background: var(--line); color: var(--ink-soft);
}
.badge-premium { background: var(--accent); color: #fff; }
.badge-free { background: var(--accent-2); color: #fff; }
.price-tag { font-family: var(--font-display); font-size: 1.2rem; color: var(--accent); font-weight: 600; }

/* Section headers */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head p { margin: 0; max-width: 560px; }

/* Recipe detail */
.recipe-hero-img { width: 100%; border-radius: var(--radius); aspect-ratio: 16/9; object-fit: cover; }
.recipe-meta-bar { display: flex; flex-wrap: wrap; gap: 22px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 24px 0; }
.recipe-meta-item { display: flex; flex-direction: column; }
.recipe-meta-item .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.recipe-meta-item .value { font-family: var(--font-display); font-size: 1.1rem; }
.recipe-layout { display: grid; grid-template-columns: 1fr 1.6fr; gap: 44px; }
@media (max-width: 860px) { .recipe-layout { grid-template-columns: 1fr; } }
.ingredient-list { list-style: none; padding: 0; margin: 0; }
.ingredient-list li { padding: 9px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 10px; align-items: baseline; }
.ingredient-list input[type="checkbox"] { margin-top: 3px; }
.step-list { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.step-list li { counter-increment: step; display: flex; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.step-list li::before {
  content: counter(step); flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff; font-family: var(--font-display); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.highlight-box { background: var(--surface); border: 1px solid var(--gold); border-radius: var(--radius); padding: 18px 20px; margin: 20px 0; }
.highlight-box h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent-2); }
.tip-box { background: rgba(193,80,46,0.06); border-left: 4px solid var(--accent); padding: 14px 18px; margin: 14px 0; border-radius: 0 var(--radius) var(--radius) 0; }
.nutrition-table { width: 100%; border-collapse: collapse; }
.nutrition-table td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.nutrition-table td:last-child { text-align: right; font-weight: 600; }
.paywall {
  background: var(--surface); border: 2px dashed var(--gold); border-radius: var(--radius);
  padding: 40px 24px; text-align: center; margin: 32px 0;
}

/* Product detail */
.spec-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.spec-table tr:nth-child(odd) { background: rgba(0,0,0,0.02); }
.spec-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.spec-table td:first-child { font-weight: 600; width: 40%; color: var(--ink-soft); }

/* Forms */
.form-group { margin-bottom: 18px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], textarea, select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font-family: var(--font-body); font-size: 0.95rem;
}
textarea { resize: vertical; min-height: 120px; }
.form-error { color: var(--danger); font-size: 0.85rem; margin-top: 4px; }
.alert { padding: 14px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 0.92rem; }
.alert-success { background: rgba(107,122,79,0.12); border: 1px solid var(--accent-2); color: var(--accent-2); }
.alert-error { background: rgba(179,38,30,0.1); border: 1px solid var(--danger); color: var(--danger); }

/* Footer */
.site-footer { background: var(--ink); color: var(--bg); padding: 56px 0 24px; margin-top: 60px; }
.site-footer a { color: var(--bg); opacity: 0.85; }
.site-footer a:hover { opacity: 1; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; }
.footer-grid h4 { color: var(--gold); font-family: var(--font-body); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); margin-top: 40px; padding-top: 20px; font-size: 0.8rem; opacity: 0.7; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* Cookie banner */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 620px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 18px 20px; z-index: 200; display: none;
}
.cookie-banner.visible { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.cookie-banner p { margin: 0; font-size: 0.86rem; flex: 1 1 260px; }

/* Cart drawer */
.cart-drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 300; display: none; }
.cart-drawer-backdrop.open { display: block; }
.cart-drawer {
  position: fixed; top: 0; right: -420px; width: 100%; max-width: 400px; height: 100%;
  background: var(--surface); z-index: 301; transition: right 0.25s ease; padding: 24px; overflow-y: auto;
}
.cart-drawer.open { right: 0; }
.cart-drawer-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-drawer-item img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius); }
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 400; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 0.9rem; opacity: 0; transform: translateY(10px); transition: all 0.25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.small { font-size: 0.85rem; color: var(--ink-soft); }
.stars { color: var(--gold); letter-spacing: 1px; }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 13px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 0.9rem; }
.pagination .current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filter-bar { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 28px; background: var(--surface); border: 1px solid var(--line); padding: 16px; border-radius: var(--radius); }
.filter-bar select { width: auto; }
.breadcrumb { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 18px; }
.breadcrumb a { color: var(--ink-soft); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 780px) { .two-col { grid-template-columns: 1fr; } }
