/* The Hot Spatula — site styles */
:root {
  --bg: #fbf7f2;
  --surface: #ffffff;
  --surface-2: #f4ede4;
  --ink: #1f1a17;
  --muted: #6b625b;
  --line: #ece3d9;
  --accent: #d6461b;
  --accent-ink: #ffffff;
  --accent-soft: #fbe6dd;
  --gold: #e9a23b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 26, 23, .06), 0 8px 24px rgba(31, 26, 23, .06);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151210; --surface: #1f1a17; --surface-2: #2a2420; --ink: #f4ede6;
    --muted: #b3a79d; --line: #352d28; --accent: #f06a3c; --accent-soft: #3a221a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  --bg: #151210; --surface: #1f1a17; --surface-2: #2a2420; --ink: #f4ede6;
  --muted: #b3a79d; --line: #352d28; --accent: #f06a3c; --accent-soft: #3a221a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

/* Photos: warm gradient shows if an image fails to load */
.photo { background: linear-gradient(135deg, #e9a23b, #d6461b 60%, #8c2a10); overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 700; font-size: 1.3rem; }
.logo-mark { color: #fff; width: 38px; height: 38px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; flex: none; }
.logo-mark svg { width: 22px; height: 22px; }
.logo em { font-style: italic; color: var(--accent); }
.nav-links { display: flex; gap: 22px; margin-left: auto; font-weight: 500; font-size: .95rem; }
.nav-links a { color: var(--muted); }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--ink); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }

/* Categories dropdown (opens on hover or keyboard focus) */
.has-menu { position: relative; }
.dropdown {
  display: none; position: absolute; top: 100%; left: -14px; min-width: 220px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.has-menu::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; }
.has-menu:hover .dropdown, .has-menu:focus-within .dropdown { display: block; }
.dropdown a { display: block; padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
.dropdown-wide { display: none; grid-template-columns: repeat(2, minmax(150px, 1fr)); min-width: 340px; }
.has-menu:hover .dropdown-wide, .has-menu:focus-within .dropdown-wide { display: grid; }
.dropdown a:hover { background: var(--accent-soft); color: var(--ink); }
.menu-btn { display: none; }
@media (max-width: 760px) {
  .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px; }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 12px 0; }
  .nav-links > a, .nav-links > .has-menu { border-bottom: 1px solid var(--line); }
  .nav-links > :last-child { border: 0; }
  .dropdown, .has-menu::after { display: none !important; }
  .menu-btn { display: grid; margin-left: auto; }
}

/* ---------- Buttons / chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px;
  font: 600 .95rem var(--sans); border: 1px solid transparent; cursor: pointer; transition: transform .15s, background .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 999px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line); font-weight: 500; font-size: .92rem;
}
.chip:hover, .chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--accent); }

/* ---------- Home: hero ---------- */
.hero { padding: 40px 0 24px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 12px 0 16px; }
.hero p.lede { font-size: 1.12rem; color: var(--muted); max-width: 46ch; margin: 0 0 24px; }
.hero-meta { display: flex; gap: 20px; color: var(--muted); font-size: .92rem; margin-bottom: 28px; flex-wrap: wrap; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta svg { width: 16px; height: 16px; }
.hero-photo { aspect-ratio: 5 / 4; border-radius: 22px; box-shadow: var(--shadow); }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-photo { order: -1; aspect-ratio: 16 / 11; }
}

/* ---------- Search ---------- */
.search-band { padding: 24px 0 8px; }
.search {
  display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 6px 6px 20px; box-shadow: var(--shadow); max-width: 720px;
}
.search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--ink); padding: 10px 0; outline: none; }
.chips { display: flex; gap: 10px; margin-top: 18px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }

/* ---------- Sections ---------- */
.section { padding: 48px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0; }
.section-head a { color: var(--accent); font-weight: 600; white-space: nowrap; }

/* ---------- Recipe cards ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card .photo { aspect-ratio: 4 / 3; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 1.22rem; margin: 0; }
.card-meta { display: flex; gap: 14px; color: var(--muted); font-size: .86rem; margin-top: auto; padding-top: 6px; }
.card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.card-meta svg { width: 14px; height: 14px; }
.stars { color: var(--gold); letter-spacing: 1px; }

/* ---------- Category tiles ---------- */
.cats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
@media (max-width: 960px) { .cats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .cats { grid-template-columns: repeat(2, 1fr); } }
.cat { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; }
.cat::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.65), transparent 60%); }
.cat span { position: absolute; left: 14px; bottom: 12px; z-index: 1; color: #fff; font: 600 1.1rem var(--serif); }
.cat small { display: block; font: 500 .78rem var(--sans); opacity: .85; }

/* ---------- Newsletter band ---------- */
.band { background: var(--ink); color: var(--bg); border-radius: 22px; padding: 44px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.band h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.band p { color: color-mix(in srgb, var(--bg) 70%, transparent); margin: 0; }
.band form { display: flex; gap: 10px; flex-wrap: wrap; }
.band input { flex: 1; min-width: 200px; padding: 13px 18px; border-radius: 999px; border: 0; font: inherit; background: var(--bg); color: var(--ink); }
@media (max-width: 760px) { .band { grid-template-columns: 1fr; padding: 28px 22px; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 36px 0; color: var(--muted); font-size: .9rem; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-row nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-row nav a:hover { color: var(--ink); }

/* ======================= Recipe page ======================= */
.crumbs { font-size: .88rem; color: var(--muted); padding-top: 28px; }
.crumbs a:hover { color: var(--accent); }
.recipe-head { max-width: 820px; padding: 14px 0 24px; }
.recipe-head h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); margin: 8px 0 14px; }
.recipe-head .lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 20px; }
.byline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .92rem; color: var(--muted); margin-bottom: 22px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; }
.byline strong { color: var(--ink); }
.dot::before { content: "·"; margin: 0 2px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.recipe-photo { aspect-ratio: 16 / 9; border-radius: 22px; box-shadow: var(--shadow); }
@media (max-width: 600px) { .recipe-photo { aspect-ratio: 4 / 3; border-radius: 16px; } }

.story { max-width: 720px; margin: 36px auto; font-size: 1.08rem; }
.story h2 { font-size: 1.6rem; margin-top: 1.4em; }
.tip { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; padding: 16px 20px; margin: 24px 0; }
.tip strong { color: var(--accent); }

/* Recipe card */
.recipe-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 84px; margin: 40px 0; }
.rc-top { padding: 32px 36px 24px; border-bottom: 1px solid var(--line); }
.rc-top h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
.rc-top-row { display: flex; justify-content: space-between; gap: 16px; align-items: start; flex-wrap: wrap; }
.times { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: 14px; overflow: hidden; margin-top: 18px; }
.times div { background: var(--surface-2); padding: 14px 16px; }
.times small { display: block; text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; color: var(--muted); font-weight: 600; }
.times b { font-size: 1.1rem; font-family: var(--serif); }
@media (max-width: 560px) { .times { grid-template-columns: repeat(2, 1fr); } }

.rc-body { display: grid; grid-template-columns: 340px 1fr; }
.rc-ingredients { padding: 28px 32px; background: var(--surface-2); border-right: 1px solid var(--line); }
.rc-steps { padding: 28px 36px; }
@media (max-width: 860px) {
  .rc-body { grid-template-columns: 1fr; }
  .rc-ingredients { border-right: 0; border-bottom: 1px solid var(--line); }
  .rc-top, .rc-ingredients, .rc-steps { padding-left: 20px; padding-right: 20px; }
}
.rc-body h3 { font-size: 1.35rem; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.rc-body h4 { font: 700 .78rem var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 22px 0 6px; }

.scaler { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.scaler button { border: 0; background: none; font: 600 .85rem var(--sans); color: var(--muted); padding: 7px 12px; cursor: pointer; }
.scaler button.on { background: var(--ink); color: var(--bg); }

.ing { list-style: none; margin: 0; padding: 0; }
.ing li { display: flex; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px dashed var(--line); cursor: pointer; user-select: none; }
.ing li:last-child { border: 0; }
.box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); background: var(--surface); flex: none; margin-top: 1px; display: grid; place-items: center; transition: .15s; }
.ing li.done .box { background: var(--accent); border-color: var(--accent); }
.ing li.done .box::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.ing li.done .txt { color: var(--muted); text-decoration: line-through; }
.qty { font-weight: 700; }

.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 14px 0; cursor: pointer; }
.steps li::before {
  content: counter(s); width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font: 700 .95rem var(--sans); transition: .15s;
}
.steps li.done::before { content: "✓"; background: var(--accent); color: #fff; }
.steps li.done p { color: var(--muted); }
.steps p { margin: 4px 0 0; }
.steps strong { font-weight: 600; }

.cook-mode { display: flex; align-items: center; gap: 12px; width: fit-content; max-width: 100%; padding: 14px 18px; background: var(--surface-2); border-radius: 12px; margin: 8px 0 18px; font-size: .92rem; }
.cook-mode > span:first-child { flex: 1; }
.cook-mode small { display: block; color: var(--muted); }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: var(--line); border-radius: 99px; cursor: pointer; transition: .2s; }
.switch i::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }

.rc-foot { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.rc-foot > div { padding: 24px 36px; }
.rc-foot > div + div { border-left: 1px solid var(--line); }
@media (max-width: 860px) { .rc-foot { grid-template-columns: 1fr; } .rc-foot > div { padding: 22px 20px; } .rc-foot > div + div { border-left: 0; border-top: 1px solid var(--line); } }
.rc-foot ul { margin: 0; padding-left: 18px; }
.rc-foot li { margin-bottom: 6px; }
.nutrition { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.nutrition div { text-align: center; background: var(--surface-2); border-radius: 10px; padding: 10px 4px; }
.nutrition b { display: block; font-family: var(--serif); font-size: 1.15rem; }
.nutrition small { color: var(--muted); font-size: .75rem; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.tags .chip { padding: 5px 12px; font-size: .82rem; }

/* Print: just the recipe card */
@media print {
  .site-header, .site-footer, .crumbs, .actions, .recipe-photo, .story, .related, .cook-mode, .scaler, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .recipe-card { box-shadow: none; border: 1px solid #ccc; margin: 0; }
  .rc-body { grid-template-columns: 1fr 1.6fr; }
}

/* ======================= Site additions ======================= */
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 16px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); font: 400 .8rem var(--sans); }
.photo { position: relative; display: grid; place-items: center; }
.photo img { position: absolute; inset: 0; }
.photo .ph { width: 30%; max-width: 96px; height: auto; aspect-ratio: 1; color: rgba(255,255,255,.85); }
.hero-link { display: block; }
.btn-light { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); }
.btn-light:hover { border-color: var(--bg); }
.band-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 760px) { .band-actions { justify-content: flex-start; } }

.list-head { padding: 40px 0 8px; max-width: 760px; }
.list-head h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 8px 0 10px; }
.list-head .lede { color: var(--muted); font-size: 1.1rem; margin: 0 0 20px; }
.list-head.center { margin: 0 auto; text-align: center; }
.list-head.center .search { margin: 24px auto 0; }
.section.tight { padding: 24px 0 48px; }
.cats-lg { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .cats-lg { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .cats-lg { grid-template-columns: repeat(2, 1fr); } }
.byline a { color: inherit; }
.byline a:hover strong { color: var(--accent); }
.avatar-lg { width: 72px; height: 72px; flex: none; font: 600 1.9rem var(--serif); }
.author-head { display: flex; align-items: center; gap: 22px; }
.author-head h1 { margin: 6px 0 6px; }
.author-head .lede { margin: 0; }
.author-bio { margin: 12px 0 8px; max-width: 720px; }
.author-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.author-card { display: flex; align-items: center; gap: 18px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.author-card:hover { border-color: var(--accent); }
.author-card strong { display: block; font: 600 1.2rem var(--serif); }
.author-card small { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; }
@media (max-width: 480px) { .author-head { flex-direction: column; align-items: flex-start; gap: 14px; } }
.search-status { color: var(--muted); margin: 16px 0 0; min-height: 1.6em; }

.prose { line-height: 1.75; }
.prose p { margin: 0 0 1.1em; }
.prose h2 { font-size: 1.6rem; margin: 1.6em 0 .5em; }
.prose h3 { font-size: 1.25rem; margin: 1.4em 0 .4em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin-bottom: .35em; }
.prose img { border-radius: 14px; margin: 1.5em 0; }
.page { max-width: 760px; margin: 0 auto; padding: 48px 0 24px; font-size: 1.06rem; }
.page h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: .6em; }

.rc-foot.single { grid-template-columns: 1fr; }
.rc-foot h3 { font-size: 1.2rem; }
.rc-foot h3.mt { margin-top: 24px; }
.rc-foot .tags { margin-top: 0; }
.notes p { margin: 0 0 .9em; }
.notes p:last-child { margin: 0; }
.nutrition { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
.steps p { overflow-wrap: anywhere; }
.rc-body h4:first-of-type { margin-top: 8px; }

@media print {
  .site-header, .site-footer, .crumbs, .actions, .recipe-photo, .story, .related, .cook-mode, .scaler, .no-print, .skip, .recipe-head { display: none !important; }
  .steps li::before { border: 1px solid #999; }
}

/* ---------- Browse: grouped category finder ---------- */
.finder { display: grid; gap: 14px; }
.finder-row { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: start; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.finder-row:last-child { border: 0; }
.finder-row strong { font: 600 1.05rem var(--serif); padding-top: 6px; }
.chips.wrapped { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
@media (max-width: 600px) { .finder-row { grid-template-columns: 1fr; gap: 6px; } }
