/* Recipes & Cooking — shared stylesheet.
   P1: base tokens, typography, nav, section cards.
   P2: recipe component set (meta strip, ingredient checklist, method
       steps, boxes), small-screen and print behaviour.
   One accent color, warm neutral palette, system font stack, readable
   measure. No frameworks, no external assets. */

:root {
  --bg: #faf7f1;
  --card: #ffffff;
  --ink: #2b2622;
  --muted: #6f665c;
  --line: #e5ded3;
  --accent: #b3562e;
  --accent-ink: #8a3f20;
}

* { box-sizing: border-box; }

html {
  font-size: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* ---- Typography ---- */

h1, h2, h3 {
  line-height: 1.25;
  font-weight: 650;
}

h1 { font-size: 1.9rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.35rem; margin: 1.75rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 1.25rem 0 0.5rem; }

p { margin: 0 0 1rem; max-width: 65ch; }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

/* ---- Site nav ---- */

.site-nav {
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.site-nav .nav-bar {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
}

.site-nav .brand {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  margin-right: 0.5rem;
}

.site-nav nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem 0.875rem;
}

.site-nav nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.125rem 0;
}

.site-nav nav a:hover { color: var(--accent); }

.site-nav nav a[aria-current="page"] {
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* ---- Intro / section header pattern ---- */

.lede {
  font-size: 1.05rem;
  color: var(--muted);
}

/* ---- Section cards (home page) ---- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  color: var(--ink);
  text-decoration: none;
}

.card:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.card h3 {
  margin: 0 0 0.375rem;
  font-size: 1.05rem;
  color: var(--accent-ink);
}

.card p {
  margin: 0;
  font-size: 0.925rem;
  color: var(--muted);
}

/* ---- Back-link ---- */

.back-link {
  display: inline-block;
  margin: 0 0 1.25rem;
  font-size: 0.925rem;
}

/* ---- Ingredient amounts (recipe pages) ----
   Metric primary, imperial in .alt inside:
   <span class="amt">15 ml <span class="alt">(1 tbsp)</span></span>
   .alt is the hook a future metric⇄imperial toggle would switch. */
.amt { white-space: nowrap; }
.amt .alt { color: var(--muted); }

/* ---- Recipe page components (P2) ---- */

/* Recipe head: native-script name above or inside the title, one-line
   description in .recipe-desc. Plain typography, nothing extra. */
.recipe-title .native {
  display: block;
  font-size: 0.55em;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.recipe-desc { max-width: 65ch; font-size: 1.05rem; color: var(--muted); }

/* (a) Meta strip: Origin · Difficulty · Servings · Prep · Cook · Total.
   A definition-list band. Auto-fit keeps it to one row on wide screens
   and wraps 2-up at narrow widths without horizontal overflow. */
.meta-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.625rem 1.25rem;
  margin: 1.25rem 0 1.75rem;
  padding: 0.875rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.meta-strip > div { min-width: 0; }
.meta-strip dt {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.meta-strip dd {
  margin: 0.125rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
}

/* (b) Ingredients as a checklist: empty squares, generous spacing. */
.ingredients {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}
.ingredients li {
  position: relative;
  padding-left: 1.875rem;
  margin-bottom: 0.5rem;
}
.ingredients li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.42em;
  width: 0.8rem;
  height: 0.8rem;
  border: 1.5px solid var(--muted);
  border-radius: 2px;
  background: var(--card);
}

/* (c) Method: numbered steps, one action each, comfortable line-height. */
.method {
  padding-left: 1.5rem;
  line-height: 1.7;
}
.method li { margin-bottom: 0.75rem; padding-left: 0.25rem; }
.method li::marker {
  color: var(--accent-ink);
  font-weight: 650;
  padding-right: 0.375rem;
}

/* (d) Box: Common failures, Variations & substitutions, Technique notes.
   One accent rule on the left edge keeps it distinct from .card. */
.box {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 0.875rem 1.125rem;
  margin: 1.5rem 0;
}
.box h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.box > *:last-child { margin-bottom: 0; }
.box ul, .box ol { margin: 0.375rem 0 0; padding-left: 1.25rem; }
.box li { margin-bottom: 0.375rem; }

/* .coming-soon: links to a recipe/article that P3+ will build (P1
   convention). Muted, dashed underline, until it resolves. */
a.coming-soon {
  color: var(--muted);
  text-decoration-line: underline;
  text-decoration-style: dashed;
  text-underline-offset: 3px;
}

/* ---- section-list (P5): the shared recipe index on every cuisine page ----
   One component so all four indexes read consistently. A built recipe is a
   card row with a bold name and muted .desc. (P15: a list group is
   wrapped in a collapsible <details>; planned items no longer appear —
   they live in docs/RoadMap.md, not the deployed site.) */
.section-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}
.section-list .item {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 0.625rem 0.875rem;
  margin-bottom: 0.625rem;
}
.section-list .item > a {
  font-weight: 650;
}
.section-list .desc {
  color: var(--muted);
}

/* Collapsible index groups (P15): the <details> summary line takes the
   typography of the <h2>/<h3> it replaced. Works with no JS. */
details.subgroup > summary {
  font-weight: bold;
  cursor: pointer;
}
details.subgroup.h2 > summary { font-size: 1.35rem; margin: 1.75rem 0 0.75rem; }
details.subgroup.h3 > summary { font-size: 1.1rem; margin: 1.25rem 0 0.5rem; }
details.subgroup[open].h2 > summary { margin-bottom: 0.5rem; }
details.subgroup[open].h3 > summary { margin-bottom: 0.4rem; }

/* Equipment: a small list — kept inline so it stays light. */
.equipment { font-size: 0.95rem; }

/* ---- Footer ---- */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ---- Small screens (down to 360 px) ---- */

/* The layout is single-column everywhere; nothing here may introduce a
   fixed width. */
@media (max-width: 480px) {
  h1 { font-size: 1.6rem; }
  .cards { grid-template-columns: 1fr; }
  .meta-strip { gap: 0.5rem 1rem; }
}

/* ---- Print: hide navigation chrome, keep content clean ---- */

@media print {
  .site-nav, .site-footer, .back-link { display: none; }
  body { background: #fff; }
  a { color: var(--ink); text-decoration: none; }
  .box { border-radius: 0; break-inside: avoid; }
  .method li, .ingredients li { break-inside: avoid; }
  .amt .alt { color: var(--ink); }
}


/* ============ cook page & serves scaling (P16) ============ */
.controls label .control-row, .control-row label { display: inline; }
.control-row { margin: 0.8em 0; }
.control-row input[type="search"], .control-row input[type="text"] {
  font: inherit; padding: 0.45em 0.6em; min-width: 18em;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink);
}
.choice {
  font: inherit; cursor: pointer; padding: 0.25em 0.7em; margin: 0.15em 0.15em 0.15em 0;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink);
}
.choice:hover { border-color: var(--ink-soft); }
.choice[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.control-label { color: var(--ink-soft); }
.pantry-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4em; }
.pantry-chips { display: inline-flex; flex-wrap: wrap; gap: 0.3em; }
.chip {
  display: inline-flex; align-items: center; gap: 0.35em;
  font-size: 0.85em; padding: 0.15em 0.3em 0.15em 0.65em;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg);
}
.chip button {
  font: inherit; border: 0; background: none; cursor: pointer; color: var(--ink-soft);
  padding: 0; line-height: 1; font-size: 1.1em;
}
.chip button:hover { color: var(--accent); }
.cook-status { color: var(--ink-soft); font-size: 0.9em; }
.dish {
  display: block; padding: 0.9em 1em 0.9em 1.1em;
  border-left: 3px solid var(--line); margin: 0.5em 0;
}
.dish:hover { border-left-color: var(--accent); }
.dish h3 { margin: 0 0 0.25em; }
.dish-desc { margin: 0 0 0.25em; color: var(--ink); font-size: 0.95em; }
.dish-facts { margin: 0; color: var(--ink-soft); font-size: 0.85em; }
.dish-missing {
  margin: 0.3em 0 0.25em; font-size: 0.9em; color: var(--accent);
}
.serves-control {
  display: inline-flex; align-items: center; gap: 0.4em;
  margin-left: 0.9em; vertical-align: middle;
}
.serves-control button {
  font: inherit; cursor: pointer; border: 1px solid var(--line);
  border-radius: 999px; background: var(--bg); color: var(--ink);
  padding: 0.05em 0.55em; line-height: 1.5;
}
.serves-control button:hover { border-color: var(--accent); color: var(--accent); }
.serves-val { font-size: 0.9em; }
