/* Easy Lean Kitchen — "Warm editorial" design.
   Colour themes: pick one in src/site.mjs → theme. */
:root {
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Terracotta (original) */
:root, [data-theme="terracotta"] {
  --bg: #f6f0e6;
  --paper: #fffaf2;
  --ink: #2f2a24;
  --muted: #6f6458;
  --line: #e3d8c7;
  --accent: #b5532f;        /* buttons, highlights */
  --accent-dark: #9a4526;
  --accent-soft: #e08a63;
  --on-accent: #fff;
  --accent2: #6b7a3a;       /* badge, tips */
  --on-accent2: #fff;
  --deep: #2f2a24;          /* top bar + footer */
  --on-deep: #fff;
  --on-deep-muted: #cfc5b6;
}

/* 1 · Sage & Honey — fresh, calm, garden-y */
[data-theme="sage"] {
  --bg: #f1f2ea;
  --paper: #fafbf5;
  --ink: #233029;
  --muted: #5d6a61;
  --line: #d9ddce;
  --accent: #4f7556;
  --accent-dark: #3e5e44;
  --accent-soft: #a9c9a4;
  --on-accent: #fff;
  --accent2: #946620;
  --on-accent2: #fff;
  --deep: #233029;
  --on-deep: #fff;
  --on-deep-muted: #b9c4ba;
}

/* 2 · Berry & Blush — soft pink, playful, very "Pinterest" */
[data-theme="berry"] {
  --bg: #f8eeec;
  --paper: #fff8f6;
  --ink: #3b2228;
  --muted: #7a5a60;
  --line: #ecd7d3;
  --accent: #a93a5b;
  --accent-dark: #8a2d4a;
  --accent-soft: #f2a7b9;
  --on-accent: #fff;
  --accent2: #b2553a;
  --on-accent2: #fff;
  --deep: #3b2228;
  --on-deep: #fff;
  --on-deep-muted: #d8bfc4;
}

/* 3 · Midnight & Saffron — dark, moody, food photos pop */
[data-theme="midnight"] {
  --bg: #1c2320;
  --paper: #252e2a;
  --ink: #f3ede1;
  --muted: #a8b0a8;
  --line: #36413c;
  --accent: #e9a63b;
  --accent-dark: #d18f25;
  --accent-soft: #e9a63b;
  --on-accent: #1c2320;
  --accent2: #8fb36f;
  --on-accent2: #1c2320;
  --deep: #141a17;
  --on-deep: #f3ede1;
  --on-deep-muted: #a8b0a8;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
.kicker { font-size: .75rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.serif { font-family: var(--serif); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--on-accent); padding: 14px 26px; border-radius: 999px; font: inherit; font-weight: 600; border: 0; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--accent-dark); }
.btn.line { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn.line:hover { background: var(--ink); color: var(--bg); }
.btn.pin { background: #e60023; }
.btn.pin:hover { background: #c4001d; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Masthead ---------- */
.topbar { background: var(--deep); color: var(--on-deep); font-size: .8rem; text-align: center; padding: 8px 16px; letter-spacing: .04em; }
.topbar a { text-decoration: underline; text-underline-offset: 3px; }
.mast { text-align: center; padding: 28px 0 0; border-bottom: 1px solid var(--line); }
.mast .logo { font-family: var(--serif); font-size: clamp(2.3rem, 6vw, 3.8rem); font-weight: 400; letter-spacing: -.02em; line-height: 1; }
.mast .logo i { color: var(--accent); }
.mast .tag { font-family: var(--serif); font-style: italic; color: var(--muted); margin: 6px 0 18px; }
.mast nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 32px; padding: 14px 16px; border-top: 1px solid var(--line); font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.mast nav a:hover, .mast nav a[aria-current] { color: var(--accent); }

/* ---------- Home hero ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 60px; align-items: center; padding: 70px 0; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.7rem, 5.5vw, 4.7rem); line-height: 1.02; letter-spacing: -.03em; margin: 18px 0 22px; }
.hero h1 em, .h-accent em { color: var(--accent); }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 470px; margin: 0 0 30px; }
.arch-media { position: relative; padding: 0 0 60px 60px; }
.arch-media .main { border-radius: 220px 220px 16px 16px; aspect-ratio: 2 / 3; object-fit: cover; width: 100%; max-width: 420px; margin-left: auto; }
.arch-media .small { position: absolute; left: 0; bottom: 0; width: 44%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 8px solid var(--bg); }
.stamp { position: absolute; top: 20px; left: 30px; width: 110px; height: 110px; border-radius: 50%; background: var(--accent2); color: var(--on-accent2); display: grid; place-items: center; text-align: center; font-family: var(--serif); font-style: italic; font-size: 1rem; line-height: 1.15; transform: rotate(-10deg); }

/* ---------- Category circles ---------- */
.cats { display: flex; justify-content: space-between; gap: 20px; padding: 46px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.cat { text-align: center; flex: none; width: 130px; }
.cat img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; transition: transform .2s; }
.cat:hover img { transform: scale(1.05); }
.cat span { font-family: var(--serif); font-size: 1.1rem; }

/* ---------- Sections & recipe grid ---------- */
.sec { padding: 76px 0; }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 34px; flex-wrap: wrap; }
.sec-head h2, .page-title { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.02em; margin: 8px 0 0; line-height: 1.05; }
.sec-head > a { font-weight: 600; border-bottom: 1px solid; }
.page-head { padding: 60px 0 10px; text-align: center; }
.page-head .page-title { font-size: clamp(2.4rem, 5vw, 3.8rem); }
.page-head p { color: var(--muted); font-size: 1.1rem; max-width: 600px; margin: 14px auto 0; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px 26px; }
.post { display: block; }
.post .ph { position: relative; overflow: hidden; border-radius: 6px; margin-bottom: 14px; }
.post img { aspect-ratio: 2 / 3; object-fit: cover; width: 100%; transition: transform .4s; }
.post:hover img { transform: scale(1.03); }
.post .save { position: absolute; top: 10px; right: 10px; background: #e60023; color: #fff; border: 0; border-radius: 999px; padding: 7px 13px; font: 600 .78rem var(--sans); opacity: 0; transition: opacity .15s; cursor: pointer; }
.post:hover .save, .post .save:focus { opacity: 1; }
.post .kicker { font-size: .68rem; }
.post h3 { font-family: var(--serif); font-weight: 600; font-size: 1.28rem; line-height: 1.2; margin: 6px 0; letter-spacing: -.01em; }
.post:hover h3 { color: var(--accent); }
.post .meta { font-size: .82rem; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 30px 0 44px; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 8px 18px; font: inherit; font-size: .88rem; font-weight: 500; cursor: pointer; color: var(--ink); }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.empty { text-align: center; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 1.2rem; }

/* ---------- Feature (recipe of the week) ---------- */
.feature { display: grid; grid-template-columns: 300px 1fr; gap: 48px; align-items: center; max-width: 940px; margin: 0 auto 90px; padding: 26px; background: var(--paper); border: 1px solid var(--line); border-radius: 22px; }
.feature img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 150px 150px 12px 12px; }
.feature .text { padding: 10px 20px 10px 0; }
.feature h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.08; letter-spacing: -.02em; margin: 10px 0 12px; }
.feature p { color: var(--muted); font-size: 1rem; margin: 0; }
.feature .facts { margin: 20px 0 24px; gap: 28px; }
.feature .facts b { font-size: 1.35rem; }
.facts { display: flex; gap: 34px; margin: 24px 0 32px; font-family: var(--serif); flex-wrap: wrap; }
.facts b { display: block; font-size: 1.6rem; font-weight: 600; line-height: 1.2; }
.facts small { font-family: var(--sans); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.hidden { display: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--deep); color: var(--on-deep-muted); padding: 50px 0 40px; font-size: .9rem; }
.site-footer .row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.site-footer .row + .row { border-top: 1px solid rgba(255,255,255,.12); margin-top: 26px; padding-top: 22px; }
.site-footer .logo { font-family: var(--serif); font-size: 1.6rem; color: var(--on-deep); }
.site-footer .logo i { color: var(--accent-soft); }
.site-footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer a:hover { color: var(--on-deep); }

/* ---------- Recipe page ---------- */
.crumbs { font-size: .82rem; color: var(--muted); padding-top: 28px; }
.crumbs a:hover { color: var(--accent); }
.r-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; padding: 34px 0 60px; }
.r-hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.03; letter-spacing: -.03em; margin: 14px 0 18px; }
.r-hero .lede { font-size: 1.12rem; color: var(--muted); margin: 0 0 6px; }
.r-hero .facts { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; margin: 26px 0 28px; justify-content: space-between; gap: 18px; }
.r-hero .arch-media { padding: 0 0 0 30px; }
.r-hero .arch-media .main { max-width: 440px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.tags a { font-size: .78rem; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; color: var(--muted); }
.tags a:hover { border-color: var(--accent); color: var(--accent); }

.benefits-wrap { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; padding: 56px 0; }
.benefit .pair { font-family: var(--serif); font-size: 1.3rem; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.benefit .pair i { color: var(--accent); font-style: normal; }
.benefit .pair em { color: var(--accent2); }
.benefit p { color: var(--muted); margin: 8px 0 0; }

.r-body { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 56px; padding: 70px 0; }
.r-body h2 { font-family: var(--serif); font-weight: 400; font-size: 2.2rem; letter-spacing: -.02em; margin: 0 0 18px; }
.ing-box { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 30px; position: sticky; top: 24px; }
.servings { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: .9rem; font-weight: 600; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.stepper button { border: 0; background: none; font-size: 1.1rem; width: 36px; height: 34px; cursor: pointer; color: var(--accent); font-weight: 600; }
.stepper output { min-width: 24px; text-align: center; font-weight: 700; }
.ingredients { list-style: none; margin: 0; padding: 0; }
.ingredients li { border-bottom: 1px dashed var(--line); padding: 11px 0; }
.ingredients li:last-child { border-bottom: 0; }
.ingredients label { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.ingredients input { accent-color: var(--accent); width: 17px; height: 17px; margin-top: 4px; flex: none; }
.ingredients input:checked + span { text-decoration: line-through; color: var(--muted); }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 30px 74px; font-size: 1.05rem; }
.steps li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: -8px; font-family: var(--serif); font-style: italic; font-size: 2.3rem; color: var(--accent); line-height: 1; }
.steps b { display: block; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; margin-bottom: 4px; }
.note { background: var(--paper); border-left: 3px solid var(--accent2); padding: 18px 22px; border-radius: 0 12px 12px 0; margin: 6px 0 34px; }
.note .kicker { color: var(--accent2); }
.note p { margin: 6px 0 0; }
.nutrition { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.nutrition div { padding: 16px 10px; text-align: center; background: var(--paper); }
.nutrition div + div { border-left: 1px solid var(--line); }
.nutrition b { display: block; font-family: var(--serif); font-size: 1.4rem; font-weight: 600; }
.nutrition small { color: var(--muted); font-size: .78rem; }
.fine { font-size: .8rem; color: var(--muted); margin-top: 10px; }

/* ---------- Prose pages ---------- */
.prose { max-width: 720px; margin: 0 auto; padding: 30px 0 90px; font-size: 1.08rem; }
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: 1.9rem; margin: 40px 0 10px; }
.prose a { color: var(--accent); text-decoration: underline; }
.about-split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding: 50px 0 90px; }
.about-split img { border-radius: 220px 220px 16px 16px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }

/* ---------- Theme preview switcher (temporary) ---------- */
.theme-switcher { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; gap: 4px; background: #111; padding: 5px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.3); max-width: calc(100vw - 24px); overflow-x: auto; scrollbar-width: none; }
.theme-switcher button { display: flex; align-items: center; gap: 7px; border: 0; background: none; color: #ccc; font: 600 .8rem var(--sans); padding: 7px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.theme-switcher button.on { background: #fff; color: #111; }
.theme-switcher i { width: 12px; height: 12px; border-radius: 50%; flex: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero, .r-hero, .about-split { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 220px 1fr; gap: 30px; }
  .hero { gap: 30px; padding: 44px 0; }
  .arch-media { max-width: 440px; }
  .r-hero { gap: 30px; padding-bottom: 40px; }
  .r-hero .arch-media { order: -1; padding: 0; margin: 0 auto; width: 100%; }
  .r-hero .arch-media .main { margin: 0 auto; max-width: 380px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .benefits { grid-template-columns: 1fr; gap: 24px; padding: 40px 0; }
  .r-body { grid-template-columns: 1fr; gap: 44px; padding: 50px 0; }
  .ing-box { position: static; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .mast nav { gap: 6px 20px; font-size: .74rem; }
  .grid { gap: 26px 14px; }
  .post h3 { font-size: 1.05rem; }
  .arch-media { padding: 0 0 40px 30px; }
  .stamp { width: 84px; height: 84px; font-size: .82rem; left: 0; }
  .cat { width: 96px; } .cat img { width: 88px; height: 88px; }
  .feature { grid-template-columns: 1fr; gap: 18px; padding: 16px; margin-bottom: 60px; }
  .feature img { aspect-ratio: 16 / 11; border-radius: 12px; }
  .feature .text { padding: 0 6px 8px; }
  .ing-box { padding: 22px; }
  .steps li { padding-left: 56px; }
  .steps li::before { font-size: 1.9rem; }
  .nutrition { grid-template-columns: repeat(2, 1fr); }
  .nutrition div:nth-child(3) { border-left: 0; }
  .nutrition div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .r-hero .facts { gap: 12px; }
  .r-hero .facts b { font-size: 1.3rem; }
}

/* ---------- Print: just the recipe ---------- */
@media print {
  .topbar, .mast, .site-footer, .btn-row, .theme-switcher, .related, .benefits-wrap, .save, .stepper, .tags, .crumbs { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .r-hero { grid-template-columns: 1fr 160px; padding: 0; gap: 20px; }
  .r-hero .arch-media { order: 0; padding: 0; }
  .r-hero .arch-media .main { border-radius: 8px; }
  .r-body { grid-template-columns: 1fr 1.6fr; gap: 30px; padding: 20px 0; }
  .ing-box { position: static; border: 0; padding: 0; background: none; }
  .ingredients input { display: none; }
}
