/* ==========================================================================
   ImpRecipe Design System
   Art direction: WARM EDITORIAL (magazine-style) -- original to this build.
   Type pairing: Display serif "Georgia / Iowan Old Style / Palatino" (warm,
     literary headlines) + Body sans "Century Gothic / Avenir Next / Segoe UI"
     (geometric, friendly). System-stack only: no external font requests.
   Palette (light):
     --cream:   #FAF3E8  background
     --paper:   #FFFFFF  card surfaces
     --ink:     #2B2420  primary text (warm near-black)
     --terra:   #C1502E  primary accent (terracotta)
     --terra-d: #9A3D22  accent hover/dark
     --olive:   #4B5320  secondary accent (deep olive)
     --gold:    #D9A441  tertiary accent (aged gold, ratings/highlights)
     --line:    #E7DCC9  hairline borders
   Palette (dark):
     --cream:   #201B16
     --paper:   #2A241D
     --ink:     #F3EADA
     --terra:   #E07850
     --olive:   #8FA05A
     --gold:    #E6BE6E
     --line:    #3B332A
   Layout patterns: full-bleed editorial hero, asymmetric magazine card grid,
   pull-quote style highlights, numbered-tab recipe steps.
   ========================================================================== */

:root {
  --cream: #FAF3E8;
  --paper: #FFFFFF;
  --ink: #2B2420;
  --ink-soft: #5C5347;
  --terra: #C1502E;
  --terra-d: #9A3D22;
  --olive: #4B5320;
  --gold: #D9A441;
  --line: #E7DCC9;
  --danger: #B3261E;
  --success: #2E6B3E;
  --radius: 10px;
  --shadow: 0 4px 16px rgba(43, 36, 32, 0.08);
  --font-display: Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', serif;
  --font-body: 'Century Gothic', 'Avenir Next', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #201B16;
    --paper: #2A241D;
    --ink: #F3EADA;
    --ink-soft: #C8BCA9;
    --terra: #E07850;
    --terra-d: #F09268;
    --olive: #8FA05A;
    --gold: #E6BE6E;
    --line: #3B332A;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --cream: #201B16;
  --paper: #2A241D;
  --ink: #F3EADA;
  --ink-soft: #C8BCA9;
  --terra: #E07850;
  --terra-d: #F09268;
  --olive: #8FA05A;
  --gold: #E6BE6E;
  --line: #3B332A;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  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(--terra-d); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0 0 0.5em; color: var(--ink); }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.eyebrow { font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; color: var(--terra-d); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.7em 1.4em;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--terra); color: #fff; }
.btn-primary:hover { background: var(--terra-d); color: #fff; }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--cream); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-sm { padding: 0.4em 0.9em; font-size: 0.85rem; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Top marquee ---------- */
.marquee {
  background: var(--olive);
  color: #fff;
  font-size: 0.82rem;
  padding: 6px 0;
  text-align: center;
  letter-spacing: 0.03em;
}
.marquee a { color: #fff; text-decoration: underline; }

/* ---------- Header / Nav ---------- */
header.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand span { color: var(--terra); }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; }
nav.main-nav { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
nav.main-nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
nav.main-nav a:hover { color: var(--terra-d); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.nav-search-form { display: flex; }
.nav-search-form input[type="search"] {
  border: 1px solid var(--line);
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 8px 12px;
  font-family: var(--font-body);
  width: 160px;
}
.nav-search-form button {
  border-radius: 0 var(--radius) var(--radius) 0;
  border: 1px solid var(--terra);
  background: var(--terra);
  color: #fff;
  padding: 0 12px;
  cursor: pointer;
}
.cart-badge {
  position: relative;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}
.cart-icon { display: block; vertical-align: middle; }
.guarantee-note {
  background: var(--paper, #fff);
  border: 1px solid var(--line);
  border-left: 4px solid var(--olive);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.85rem;
  margin: 16px 0;
}
.cart-count {
  position: absolute;
  top: -8px;
  right: -12px;
  background: var(--terra);
  color: #fff;
  border-radius: 50%;
  font-size: 0.68rem;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.menu-toggle { display: none; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--ink); }

@media (max-width: 860px) {
  nav.main-nav { display: none; flex-direction: column; align-items: flex-start; width: 100%; padding: 10px 0; gap: 12px; }
  nav.main-nav.open { display: flex; }
  .menu-toggle { display: block; }
  .nav-search-form input[type="search"] { width: 120px; }
}

/* ---------- Hero (editorial, full-bleed) ---------- */
.hero {
  position: relative;
  min-height: 62vh;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  color: #fff;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,16,12,0.15) 0%, rgba(20,16,12,0.78) 100%);
}
.hero-inner { position: relative; z-index: 2; padding: 60px 0 48px; max-width: 720px; }
.hero-inner h1 { color: #fff; }
.hero-inner p { color: #EFE6D6; font-size: 1.1rem; max-width: 560px; }
.hero-actions { display: flex; gap: 14px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- Magazine card grid ---------- */
.grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.grid.featured-grid {
  grid-template-columns: 1.6fr 1fr 1fr;
  grid-auto-rows: 220px;
}
.grid.featured-grid > a:first-child { grid-row: span 2; }
@media (max-width: 760px) {
  .grid.featured-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .grid.featured-grid > a:first-child { grid-row: auto; }
}

.card {
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  height: 100%;
  position: relative;
}
.card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 1.08rem; margin-bottom: 6px; }
.card-meta { font-size: 0.82rem; color: var(--ink-soft); display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.badge {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
}
.badge-premium { background: var(--terra); color: #fff; }
.badge-free { background: var(--olive); color: #fff; }
.card-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 3; }
.rating { color: var(--gold); font-weight: 700; }

/* Overlay-image cards (photo hero card) */
.photo-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  display: block;
  height: 100%;
}
.photo-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.photo-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(20,16,12,0.85) 100%); z-index: 1; }
.photo-card .photo-card-text { position: relative; z-index: 2; padding: 18px; align-self: flex-end; margin-top: auto; }
.photo-card { display: flex; flex-direction: column; }
.photo-card h3 { color: #fff; margin: 0; }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
section.tight { padding: 32px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 26px; flex-wrap: wrap; gap: 10px; }
.section-head a { font-weight: 700; text-decoration: none; }
.bg-alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- Recipe detail ---------- */
.recipe-head { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 800px) { .recipe-head { grid-template-columns: 1fr; } }
.recipe-head img { border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-row { display: flex; flex-wrap: wrap; gap: 18px; margin: 18px 0; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; min-width: 90px; text-align: center; }
.stat .num { font-family: var(--font-display); font-size: 1.3rem; display: block; }
.stat .label { font-size: 0.72rem; text-transform: uppercase; color: var(--ink-soft); letter-spacing: 0.05em; }
.highlight-list { list-style: none; padding: 0; margin: 0; }
.highlight-list li { padding-left: 28px; position: relative; margin-bottom: 10px; }
.highlight-list li::before { content: "\2726"; position: absolute; left: 0; color: var(--terra); }

.recipe-columns { display: grid; grid-template-columns: 340px 1fr; gap: 48px; margin-top: 40px; }
@media (max-width: 860px) { .recipe-columns { grid-template-columns: 1fr; } }
.ingredient-list { list-style: none; padding: 0; margin: 0; }
.ingredient-list li { padding: 8px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 10px; }
.ingredient-list input[type="checkbox"] { margin-top: 4px; }
.steps-list { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps-list li { counter-increment: step; padding: 18px 0 18px 56px; position: relative; border-bottom: 1px solid var(--line); }
.steps-list li::before {
  content: counter(step);
  position: absolute; left: 0; top: 14px;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--terra); color: #fff;
  font-family: var(--font-display); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.tip-box { background: var(--paper); border-left: 4px solid var(--gold); padding: 16px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 14px; }
.nutrition-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.nutrition-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; margin-top: 10px; }
.nutrition-grid div strong { display: block; font-family: var(--font-display); font-size: 1.1rem; }
.paywall {
  background: linear-gradient(180deg, transparent, var(--cream) 70%), var(--paper);
  border: 1px dashed var(--terra);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  margin-top: -60px;
  position: relative;
  z-index: 2;
}

/* ---------- Product ---------- */
.product-head { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
@media (max-width: 800px) { .product-head { grid-template-columns: 1fr; } }
.product-head img { border-radius: var(--radius); box-shadow: var(--shadow); }
.price-tag { font-family: var(--font-display); font-size: 2rem; color: var(--terra-d); }
.spec-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.spec-table tr { border-bottom: 1px solid var(--line); }
.spec-table td { padding: 10px 6px; }
.spec-table td:first-child { font-weight: 700; color: var(--ink-soft); width: 40%; }
.feature-list { list-style: none; padding: 0; }
.feature-list li { padding-left: 24px; position: relative; margin-bottom: 8px; }
.feature-list li::before { content: "\2713"; color: var(--olive); position: absolute; left: 0; font-weight: 700; }
.sku-row { color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 10px; }
.stock-yes { color: var(--success); font-weight: 700; }
.stock-no { color: var(--danger); font-weight: 700; }

/* ---------- Forms ---------- */
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.92rem; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 1rem; background: var(--paper); color: var(--ink);
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; max-width: 480px; margin: 0 auto; box-shadow: var(--shadow); }
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.92rem; }
.alert-success { background: rgba(46,107,62,0.12); color: var(--success); border: 1px solid var(--success); }
.alert-error { background: rgba(179,38,30,0.12); color: var(--danger); border: 1px solid var(--danger); }

/* ---------- Filters / search ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 30px; }
.filter-bar select, .filter-bar input { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); font-family: var(--font-body); }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.pagination .current { background: var(--terra); color: #fff; border-color: var(--terra); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }

/* ---------- Cart / checkout ---------- */
.cart-row { display: grid; grid-template-columns: 80px 1fr auto auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-row img { border-radius: 6px; aspect-ratio: 1; object-fit: cover; }
.cart-summary { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.summary-line { display: flex; justify-content: space-between; padding: 6px 0; }
.summary-line.total { font-weight: 700; font-size: 1.15rem; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }

/* ---------- Footer ---------- */
footer.site-footer { background: var(--ink); color: #E9E1D2; padding: 56px 0 24px; margin-top: 60px; }
footer.site-footer a { color: #E9E1D2; text-decoration: none; }
footer.site-footer a:hover { color: var(--gold); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 { color: #fff; font-family: var(--font-body); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; font-size: 0.92rem; }
.footer-bottom { border-top: 1px solid #443B31; margin-top: 40px; padding-top: 20px; font-size: 0.8rem; color: #B9AD98; text-align: center; }

/* ---------- Cookie banner ---------- */
#cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--ink); color: #F3EADA; padding: 16px 20px;
  display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.2);
}
#cookie-banner p { margin: 0; font-size: 0.88rem; max-width: 640px; }
#cookie-banner .actions { display: flex; gap: 10px; }

/* ---------- Toasts ---------- */
#toast-region { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--ink); color: var(--cream); padding: 12px 18px; border-radius: var(--radius); box-shadow: var(--shadow); font-size: 0.9rem; }

/* ---------- Misc ---------- */
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 30px; }
.team-card { text-align: center; }
.team-card img { border-radius: 50%; width: 160px; height: 160px; object-fit: cover; margin: 0 auto 14px; }
.job-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.legal-content h2 { margin-top: 1.6em; }
.legal-content ul { padding-left: 22px; }
.breadcrumb { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 16px; }
.breadcrumb a { color: var(--ink-soft); }
