/* =====================================================================
   dhanjas.com recipe system — v2 (responsive)
   Paste this entire <style> block, unchanged, into every recipe file.
   ===================================================================== */

:root {
  --saffron:        #E8822A;
  --cream:          #FDF6EC;
  --cream-dark:     #F5ECD8;
  --rule:           #E4D8C4;
  --green:          #2D5016;
  --clay:           #8C5A2A;
  --ink:            #14100B;
  --ink-soft:       #3A2C1E;
  --amount:         #8B3A00;
  --toddler-bg:     #FFFBEA;
  --toddler-line:   #E9C34A;
  --toddler-ink:    #4A3000;
  --night-bg:       #EEF3FC;
  --night-line:     #C3D3EE;
  --night-ink:      #1E3160;
  --tip-bg:         #F1F7EC;

  --gut:            clamp(0.85rem, 2.2vw, 1.6rem);
  --shell:          1480px;
  --sidebar:        14rem;
}

html {
  font-size: clamp(17px, 0.9vw + 13.5px, 20px);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { overflow-x: clip; max-width: 100%; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: break-word;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; border-radius: 3px; }

/* ---------- page header ---------- */
.site-header {
  background: var(--green);
  color: var(--cream);
  padding: 1.1rem var(--gut) 1rem;
  text-align: center;
}
.site-header .eyebrow {
  font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: #A8C08C; margin-bottom: 0.25rem;
}
.site-header h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.75rem; font-weight: 400; line-height: 1.1; color: var(--cream);
}
.site-header .subtitle {
  margin: 0.4rem auto 0; max-width: 42ch;
  font-size: 0.78rem; line-height: 1.45; color: #C3D2B0;
}
.badge-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.7rem; }
.badge {
  background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.22);
  color: #DCEBCC; font-size: 0.64rem; padding: 0.15rem 0.55rem; border-radius: 999px;
}

/* ---------- shell ---------- */
.page-shell {
  display: block;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gut);
}
main { min-width: 0; padding-bottom: 3rem; }

.toc-sidebar { display: none; }
@media (min-width: 1100px) {
  .page-shell:has(.toc-sidebar) { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: 2rem; }
  .toc-sidebar {
    display: block; position: sticky; top: 1rem; align-self: start;
    max-height: calc(100vh - 2rem); overflow-y: auto; padding: 1.2rem 0;
  }
  .toc-mobile { display: none; }
}
.toc-label {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--clay); margin-bottom: 0.6rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--rule);
}
.toc-list { list-style: none; }
.toc-list a {
  display: flex; gap: 0.5rem; align-items: baseline;
  text-decoration: none; font-size: 0.8rem; line-height: 1.3;
  color: var(--ink-soft); padding: 0.4rem 0.5rem; border-radius: 5px;
}
.toc-list a:hover, .toc-list a.active { background: var(--cream-dark); }
.toc-list a.active { color: var(--clay); font-weight: 600; }
.toc-num { color: var(--saffron); font-weight: 700; font-size: 0.72rem; width: 1.1rem; flex-shrink: 0; }

.toc-mobile {
  background: var(--cream-dark);
  border-bottom: 2px solid var(--saffron);
  padding: 0.7rem var(--gut);
}
.toc-mobile summary {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--clay); cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; padding: 0.2rem 0;
}
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after { content: '▾'; color: var(--saffron); font-size: 0.9rem; }
.toc-mobile[open] summary::after { content: '▴'; }
.toc-mobile-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.1rem 1rem; margin-top: 0.6rem;
}
.toc-mobile-grid a {
  display: flex; gap: 0.5rem; align-items: baseline;
  font-size: 0.82rem; line-height: 1.3; color: var(--ink-soft);
  text-decoration: none; padding: 0.45rem 0;
}

/* ---------- recipe block ---------- */
.recipe {
  padding: 1.4rem 0 1.2rem;
  scroll-margin-top: 0.5rem;
}
.recipe + .recipe { border-top: 1px solid var(--rule); }

.recipe-header { margin-bottom: 0.7rem; }
.recipe-eyebrow { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.2rem; }
.recipe-num { font-size: 0.68rem; font-weight: 700; color: var(--saffron); letter-spacing: 0.08em; }
.recipe-tag {
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--cream-dark); color: var(--clay); padding: 0.1rem 0.5rem; border-radius: 999px;
}
.recipe-name {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.5rem; font-weight: 400; line-height: 1.15; color: var(--ink);
  margin-bottom: 0.35rem;
}
.recipe-meta {
  display: flex; flex-wrap: wrap; gap: 0.25rem 1rem;
  font-size: 0.78rem; color: var(--ink-soft);
}
.recipe-meta span { display: flex; align-items: baseline; gap: 0.3rem; }
.recipe-meta .dot { color: var(--saffron); font-size: 0.55rem; }

.strip-row { display: grid; gap: 0.6rem; margin: 0.7rem 0 1rem; }
@media (min-width: 700px) { .strip-row { grid-template-columns: 1fr 1.6fr; align-items: start; } }
.strip-row:has(> :only-child) { grid-template-columns: 1fr; }

.protein-bar {
  background: var(--cream-dark); border-left: 3px solid var(--green);
  padding: 0.5rem 0.7rem; border-radius: 0 6px 6px 0;
  font-size: 0.8rem; font-weight: 600; color: var(--green); line-height: 1.35;
}
.night-prep {
  background: var(--night-bg); border: 1px solid var(--night-line); border-radius: 8px;
  padding: 0.6rem 0.8rem; font-size: 0.8rem; color: var(--night-ink); line-height: 1.45;
}
.night-prep .night-label {
  font-weight: 700; font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.night-prep ul { list-style: none; }
.night-prep li { padding-left: 0.85rem; position: relative; margin-bottom: 0.15rem; }
.night-prep li::before { content: '·'; position: absolute; left: 0.15rem; font-size: 1.1rem; line-height: 1; top: 0.15rem; }

.section-title {
  font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--clay); font-weight: 700;
  margin-bottom: 0.5rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--rule);
}

/* ---------- ingredients ---------- */
.ingredients-block { margin-bottom: 1.2rem; }

.ingredient-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.4rem 2rem;
  align-items: start;
}
.ingredient-group { margin-bottom: 0.7rem; break-inside: avoid; }
.ingredient-group-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-soft); font-weight: 700; margin-bottom: 0.2rem;
}
.ingredient-list { list-style: none; }
.ingredient-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.2rem 0.8rem;
  align-items: baseline;
  padding: 0.3rem 0;
  border-bottom: 1px dashed var(--rule);
  font-size: 0.92rem;
  line-height: 1.35;
}
.ingredient-list li:last-child { border-bottom: none; }
.ing-name { min-width: 0; }
.ing-amount {
  color: var(--amount); font-weight: 700; font-size: 0.86rem;
  text-align: right; min-width: 0;
}
@media (max-width: 22rem) {
  .ingredient-list li { grid-template-columns: minmax(0, 1fr); }
  .ing-amount { text-align: left; }
}

/* ---------- method ---------- */
.steps-block { margin-bottom: 0.5rem; }
.steps-block .step ul,
.steps-block .toddler-box,
.steps-block .tip-box { max-width: 80ch; }

.step { margin-bottom: 0.9rem; }
.step-title {
  font-weight: 700; font-size: 0.95rem; color: var(--ink);
  margin-bottom: 0.25rem; display: flex; align-items: center; gap: 0.45rem;
}
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.35rem; height: 1.35rem; border-radius: 50%;
  background: var(--saffron); color: #fff;
  font-size: 0.72rem; font-weight: 700; flex-shrink: 0;
}
.step ul { list-style: none; padding-left: 1.8rem; }
.step ul li {
  position: relative; font-size: 0.95rem; color: var(--ink-soft);
  padding: 0.2rem 0 0.2rem 0.85rem; line-height: 1.45;
}
.step ul li::before { content: '–'; position: absolute; left: 0; color: var(--clay); }
.amt { color: var(--amount); font-weight: 700; }

/* ---------- toddler ---------- */
.toddler-box {
  background: var(--toddler-bg); border: 1.5px solid var(--toddler-line);
  border-radius: 10px; padding: 0.7rem 0.85rem; margin: 0.8rem 0 0.9rem;
}
.toddler-label {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--toddler-ink); margin-bottom: 0.35rem;
}
.toddler-box ul { list-style: none; }
.toddler-box li {
  font-size: 0.9rem; color: var(--toddler-ink); line-height: 1.45;
  padding: 0.18rem 0 0.18rem 0.85rem; position: relative;
}
.toddler-box li::before {
  content: '·'; position: absolute; left: 0.1rem; color: #B8901C;
  font-size: 1.2rem; line-height: 1; top: 0.2rem;
}

/* ---------- tip ---------- */
.tip-box {
  background: var(--tip-bg); border-left: 3px solid var(--green);
  padding: 0.55rem 0.8rem; margin: 0.7rem 0 0.2rem; border-radius: 0 6px 6px 0;
  font-size: 0.86rem; line-height: 1.45; color: #22350F;
}
.tip-box strong {
  display: block; font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--green); margin-bottom: 0.15rem;
}

/* ---------- back to top ---------- */
.to-top {
  position: fixed; right: 0.9rem; bottom: 0.9rem;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--saffron); color: #fff; border: none;
  font-size: 1rem; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 8px rgba(60,30,0,0.25);
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.to-top.show { opacity: 0.92; pointer-events: auto; }
@media (min-width: 1100px) { .to-top { display: none; } }

/* ---------- print ---------- */
@media print {
  .toc-mobile, .toc-sidebar, .to-top, .site-header .badge-row { display: none; }
  body { background: #fff; }
  .recipe { break-inside: avoid; padding: 0.6rem 0; }
}
