:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --text: #2b2420;
  --muted: #6f625a;
  --line: #e7ddd2;
  --accent: #a4501c;        /* rolling-pin wood from the original header photo */
  --accent-soft: #f5e6da;
  --radius: 12px;
  --serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1a18;
    --surface: #27231f;
    --text: #efe8e1;
    --muted: #b3a79d;
    --line: #3a342f;
    --accent: #e39a62;
    --accent-soft: #3b2a1f;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
}

a { color: var(--accent); }
img { max-width: 100%; height: auto; }

.loading { padding: 3rem 1rem; text-align: center; color: var(--muted); }

/* ---------- header ---------- */

.site-header {
  background: linear-gradient(rgba(20, 12, 6, .45), rgba(20, 12, 6, .65)), url(images/header.jpg) center 40% / cover;
  min-height: 50vh;
  display: grid;
  place-content: center;
  padding: 2.5rem 1rem;
  text-align: center;
}
@supports (height: 50svh) { .site-header { min-height: 50svh; } }
.site-header.compact { min-height: 0; padding: 1.4rem 1rem; }
.brand { color: #fff; text-decoration: none; display: inline-block; }
.brand-title { display: block; font: 700 clamp(2rem, 6vw, 3.2rem)/1.1 var(--serif); letter-spacing: .02em; }
.brand-tagline { display: block; margin-top: .35rem; font-style: italic; opacity: .9; }
.compact .brand-title { font-size: 1.6rem; }
.compact .brand-tagline { font-size: .9rem; }

main { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
main.list { padding-top: 3rem; }

/* ---------- list ---------- */

.toolbar { display: grid; gap: .9rem; }
.search {
  width: 100%;
  padding: .8rem 1rem;
  font: inherit;
  font-size: 1.05rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
}
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: .92rem;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-count { font-size: .78rem; opacity: .7; }

.active-tag { margin: 0; color: var(--muted); }
.active-tag .clear { margin-left: .4rem; text-decoration: none; font-size: 1.2rem; line-height: 1; }

.result-count { color: var(--muted); font-size: .92rem; margin: 2.5rem 0 1.25rem; }
.show-all { margin-left: .75rem; }
.empty { color: var(--muted); padding: 2rem 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.1rem;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(60, 35, 15, .12); }
.card-img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--accent-soft); }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: .8rem .95rem 1rem; }
.card-title { font: 700 1.02rem/1.3 var(--serif); margin: 0 0 .3rem; }
.card-course { margin: 0 0 .35rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.card-teaser {
  margin: 0;
  font-size: .86rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- recipe ---------- */

.recipe { max-width: 860px; }
.recipe-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.recipe-actions a { text-decoration: none; }
.recipe-actions button {
  font: inherit;
  padding: .4rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}
.recipe-actions button:hover { background: var(--accent); color: #fff; }

.recipe h1 { font: 700 clamp(1.6rem, 5vw, 2.4rem)/1.15 var(--serif); margin: 0 0 .6rem; }
.recipe h2 { font: 700 1.25rem/1.3 var(--serif); margin: 0 0 .7rem; padding-bottom: .35rem; border-bottom: 2px solid var(--accent-soft); }
.recipe h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 1rem 0 .4rem; }

.facts { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 0 0 1.2rem; }
.facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.facts dd a + a::before { content: ', '; }

.hero { display: block; width: 100%; max-height: 520px; object-fit: cover; border-radius: var(--radius); margin-bottom: 1.5rem; }
.description { font-size: 1.05rem; }

.columns { display: grid; gap: 2rem; }
@media (min-width: 760px) {
  .columns { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}

.scaler { display: flex; align-items: center; gap: .4rem; margin: 0 0 .9rem; font-size: .92rem; color: var(--muted); }
.scaler button {
  display: inline-grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
}
.scaler button:hover:not(:disabled) { border-color: var(--accent); }
.scaler button:disabled { opacity: .35; cursor: default; }
.scaler output { min-width: 2rem; font: inherit; font-weight: 700; color: var(--text); text-align: center; }
.scaler .reset {
  width: auto;
  height: auto;
  margin-left: .2rem;
  padding: 0 .2rem;
  font-size: .85rem;
  border: 0;
  border-radius: 0;
  background: none;
  text-decoration: underline;
}
.qty-fixed { text-decoration: underline dotted; text-underline-offset: .15em; cursor: help; }

.ingredients ul { list-style: none; padding: 0; margin: 0; }
.ingredients li { padding: .4rem 0; border-bottom: 1px dashed var(--line); }
.qty { font-weight: 700; margin-right: .35rem; }
.ing-notes { color: var(--muted); }
.ing-notes::before { content: ', '; }

.instructions ol { margin: 0; padding-left: 1.4rem; }
.instructions li { padding-left: .3rem; margin-bottom: .8rem; }
.instructions li::marker { color: var(--accent); font-weight: 700; }
.instructions p { margin: 0; }
.instructions img { margin-top: .5rem; border-radius: 8px; }

.notes { margin-top: 2rem; padding: 1rem 1.2rem; background: var(--accent-soft); border-radius: var(--radius); }
.notes h2 { border: 0; padding: 0; margin-bottom: .4rem; }
.notes p { margin: 0; white-space: pre-line; }

.tags { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { font-size: .82rem; padding: .15rem .6rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.tag::before { content: '#'; opacity: .6; }

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

/* ---------- print: just the recipe ---------- */

@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #444; --line: #ccc; --accent: #000; --accent-soft: #f2f2f2; }
  body { font-size: 11.5pt; }
  .site-header, .toolbar, .result-count, .recipe-actions, .tags, .site-footer { display: none !important; }
  main { padding: 0; max-width: none; }
  a { color: inherit; text-decoration: none; }
  .hero { max-height: 6.5cm; width: auto; max-width: 100%; margin-bottom: .8rem; }
  .columns { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 1.2rem; }
  .instructions li, .ingredients li { break-inside: avoid; }
  .scaler.is-default, .scaler button { display: none !important; }
  .notes { border: 1px solid #ccc; }
}
