/* Minimal, responsive recipe styles. Sizes use rem so they follow the
   reader's browser font-size setting; clamp() scales headings with width. */

:root {
  --text: #1f1f1f;
  --muted: #5f5f5f;
  --bg: #fdfcfa;
  --panel: #f3f0ea;
  --accent: #9a3d1c;
  --rule: #e2ddd3;
  --gap: clamp(1.5rem, 4vw, 3.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #ece9e4;
    --muted: #a9a49b;
    --bg: #1a1918;
    --panel: #252321;
    --accent: #e8926b;
    --rule: #3a3734;
  }
}

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

html { font-size: 112.5%; -webkit-text-size-adjust: 100%; } /* 18px base */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.7;
}

a { color: var(--accent); text-underline-offset: 0.2em; }

.site-header {
  padding: 1.25rem var(--gap);
  border-bottom: 1px solid var(--rule);
  font-weight: 600;
}
.site-header a { color: var(--text); text-decoration: none; }

main {
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--gap);
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  margin: 0 0 var(--gap);
}

h2 {
  font-size: 1.35rem;
  margin: 0 0 1rem;
  letter-spacing: 0.02em;
}

/* ---- index ---- */
.recipe-list { list-style: none; padding: 0; margin: 0; }
.recipe-list li { border-bottom: 1px solid var(--rule); }
.recipe-list a {
  display: block;
  padding: 1.25rem 0;
  font-size: 1.3rem;
  text-decoration: none;
}
.recipe-list a:hover { text-decoration: underline; }

/* ---- recipe ---- */
.recipe-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}

.ingredients {
  background: var(--panel);
  border-radius: 0.75rem;
  padding: 1.5rem 1.75rem;
  align-self: start;
}
.ingredients ul { padding-left: 1.1rem; margin: 0; }
.ingredients li { margin-bottom: 0.75rem; }
.ingredients li:last-child { margin-bottom: 0; }

.instructions ol { padding-left: 1.5rem; margin: 0 0 2rem; }
.instructions li { margin-bottom: 1.5rem; padding-left: 0.5rem; }
.instructions li::marker { color: var(--accent); font-weight: 700; }

.back { margin-top: var(--gap); }

/* Sidebar layout on wider screens; ingredients stay visible while scrolling */
@media (min-width: 52rem) {
  .recipe-layout { grid-template-columns: minmax(16rem, 22rem) 1fr; }
  .recipe-layout.no-sidebar { grid-template-columns: 1fr; }
  .ingredients { position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto; }
}

@media print {
  .site-header, .back { display: none; }
  .ingredients { position: static; max-height: none; background: none; border: 1px solid #ccc; }
}
