/* Sydnie's Kitchen — "Herb garden": linen, sage green, Cormorant Garamond titles over Mulish text.
   Colors are tokens. Dark is set twice (phone setting, and the toggle's data-theme); keep the two in sync. */
:root {
  --bg: #F3F1E8;
  --surface: #FBFAF5;
  --text: #222A22;
  --muted: #4E584E;
  --line: #DEDFD0;
  --border: #C9CDB8;
  --accent: #3B5B3E;
  --accent-strong: #26402A;
  --mark: #8DAE7E;
  --mark-bg: rgba(141, 174, 126, .18);
  --danger: #A23B2C;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: Mulish, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151A16;
    --surface: #1E241F;
    --text: #E9EDE4;
    --muted: #AEB8AC;
    --line: #2F3830;
    --border: #3E4A40;
    --accent: #9FC293;
    --accent-strong: #C7DDBD;
    --mark: #6E8F62;
    --mark-bg: rgba(110, 143, 98, .22);
    --danger: #F08A78;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151A16;
  --surface: #1E241F;
  --text: #E9EDE4;
  --muted: #AEB8AC;
  --line: #2F3830;
  --border: #3E4A40;
  --accent: #9FC293;
  --accent-strong: #C7DDBD;
  --mark: #6E8F62;
  --mark-bg: rgba(110, 143, 98, .22);
  --danger: #F08A78;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
}
main, .site-header, .site-footer { max-width: 720px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; color: var(--accent-strong); line-height: 1.1; }
button, input, select { font: inherit; color: inherit; }

/* Header */
.site-header { padding-top: 10px; }
.top { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.top a { text-decoration: none; font-weight: 600; padding: 10px; }
.theme-toggle {
  min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; cursor: pointer; font-size: 14px;
}
.brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 0 4px; color: var(--accent); }
.brand .sprig { width: 120px; height: 46px; }
.brand .site-name { margin: 0; font-family: var(--serif); font-size: clamp(40px, 11vw, 60px); font-weight: 700; color: var(--accent-strong); line-height: 1; }
.brand.small { flex-direction: row; justify-content: center; text-decoration: none; padding: 0 0 6px; }
.brand.small .sprig { width: 60px; height: 23px; }
.brand.small .site-name { font-size: 26px; }

/* Home */
.welcome { text-align: center; color: var(--muted); margin: 8px auto 24px; max-width: 34em; }
.search-form label { display: block; font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.search, .search-form input {
  width: 100%; padding: 12px 14px; font-size: 17px;
  border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text);
}
.section-title { font-size: 28px; margin: 32px 0 12px; }
.tiles {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  background: var(--border); border: 1px solid var(--border);
}
@media (min-width: 600px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tiles a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 84px; padding: 14px 10px; text-align: center; text-decoration: none; background: var(--surface);
}
.tiles span { font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--accent-strong); line-height: 1.1; }
.tiles small { color: var(--muted); font-size: 13px; }
.tiles a:hover span { text-decoration: underline; }
.more { text-align: center; margin: 20px 0 8px; font-weight: 700; }

/* Recipe cards */
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card {
  display: flex; flex-direction: column; gap: 2px; height: 100%;
  padding: 14px 16px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
}
.card:hover { border-color: var(--mark); }
.card-cat { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.card-title { font-family: var(--serif); font-size: 22px; font-weight: 700; line-height: 1.15; color: var(--accent-strong); }

/* All recipes */
.page-title { font-size: 40px; margin: 18px 0 16px; text-align: center; }
.filters { margin: 14px 0 6px; display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  min-height: 40px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); font-size: 15px;
}
.chips[data-group="cat"] button { font-weight: 700; }
.chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.count { color: var(--muted); font-size: 14px; margin: 8px 0; }
.none { text-align: center; color: var(--muted); }
.none button { border: 0; background: none; color: var(--accent); text-decoration: underline; cursor: pointer; min-height: 44px; }

/* Recipe page */
.recipe { padding-top: 8px; }
.kicker { text-align: center; margin: 12px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.kicker a { text-decoration: none; }
.recipe h1 { font-size: clamp(34px, 9vw, 48px); text-align: center; margin: 6px 0 10px; }
.intro { text-align: center; color: var(--muted); font-style: italic; margin: 0 auto 10px; max-width: 34em; }
.tags { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tags a { display: inline-block; padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 14px; text-decoration: none; }
.photo { width: 100%; border-radius: 4px; margin: 12px 0; }
.recipe h2 { font-size: 30px; margin: 28px 0 8px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.servings { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.servings button {
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 22px; line-height: 1;
  border: 1px solid var(--border); background: var(--surface);
}
.note { color: var(--muted); font-size: 14px; margin: 4px 0 8px; }
#ingredient-list { list-style: none; padding: 0; margin: 0; }
#ingredient-list li { padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
#ingredient-list li:last-child { border-bottom: 0; }
#ingredient-list .amt { font-weight: 700; }
#ingredient-list li.done { color: var(--muted); text-decoration: line-through; }
#ingredient-list li.section {
  cursor: default; border-bottom: 0; padding: 16px 0 2px;
  font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--accent);
}
.method ol, .method ul { padding-left: 24px; }
.method li { margin: 0 0 10px; }
.method li::marker { color: var(--accent); font-weight: 700; }
.method h3 { font-size: 24px; margin: 20px 0 6px; color: var(--accent); }
.amt-ref { font-weight: 700; color: var(--accent-strong); border-bottom: 2px solid var(--mark); background: var(--mark-bg); padding: 0 2px; }
.token-missing { color: var(--danger); font-weight: 700; }
.source { color: var(--muted); font-size: 14px; font-style: italic; text-align: center; margin: 28px 0 0; }

/* About */
.about { max-width: 34em; margin: 0 auto; }
.placeholder { color: var(--muted); font-style: italic; }

/* Footer */
.site-footer { text-align: center; color: var(--accent); padding: 40px 16px 32px; }
.site-footer .sprig { width: 60px; height: 23px; }
.site-footer p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
