:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --line: #ececec;
  --soft: #f6f6f4;
  --accent: #22ce71;
  --accent-text: #178a4c;
  --wide: 72rem;
  --narrow: 44rem;
  --ratio: 40 / 31; /* shape of all recipe pictures (2000 × 1550) */
  --gutter: clamp(1rem, 4vw, 2rem);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }

/* Header and menu */

.site-header {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  border-bottom: 1px solid var(--line);
}

.logo { display: block; }

.logo img { height: 2.25rem; width: auto; }

.menu {
  display: flex;
  gap: 0.25rem 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.menu a {
  padding: 0.35rem 0;
  text-decoration: none;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.menu a:hover { color: var(--fg); }

.menu a[aria-current="page"] {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

@media (max-width: 40rem) {
  .site-header { flex-direction: column; align-items: flex-start; }
  .menu { width: 100%; gap: 0.75rem; justify-content: space-between; }
}

main {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter) 4rem;
}

/* Page intro */

.page-intro {
  max-width: var(--narrow);
  padding: clamp(2rem, 6vw, 4rem) 0 clamp(1.5rem, 4vw, 2.5rem);
}

.page-intro h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 600;
}

.page-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 1.15rem;
}

/* Thumbnail grid */

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 1rem;
}

@media (min-width: 48rem) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 2.5rem 1.75rem; }
}

.card { display: block; text-decoration: none; }

.card img {
  width: 100%;
  aspect-ratio: var(--ratio);
  object-fit: contain;
  transition: opacity 0.2s;
}

.card:hover img { opacity: 0.85; }

.card h2 {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 500;
}

.empty { color: var(--muted); }

/* Recipe page */

.recipe { max-width: 60rem; margin: 0 auto; }

.recipe-header {
  max-width: var(--narrow);
  padding: clamp(2rem, 5vw, 3rem) 0 1.5rem;
}

.recipe-header h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 600;
}

.lead { margin: 0; color: var(--muted); font-size: 1.15rem; }

.facts {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 1.25rem 0 0;
  padding: 0;
}

.facts span {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.hero {
  width: 100%;
  aspect-ratio: var(--ratio);
  object-fit: contain;
}

/* Photos keep their own shape, centred and no taller than the screen. */
.hero.photo {
  width: auto;
  aspect-ratio: auto;
  max-height: min(80vh, 44rem);
  margin: 0 auto;
}

.recipe-body {
  display: grid;
  gap: 2.5rem;
  padding-top: 2.5rem;
}

@media (min-width: 48rem) {
  .recipe-body { grid-template-columns: 1fr 2fr; gap: 3.5rem; }
}

.recipe-body h2 { margin: 0 0 1rem; font-size: 1.25rem; font-weight: 600; }
.recipe-body h3 { margin: 1.5rem 0 0.5rem; font-size: 1rem; font-weight: 600; }

.ingredients ul { list-style: none; margin: 0; padding: 0; }

.ingredients li { border-bottom: 1px solid var(--line); }

.ingredients label {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.55rem 0;
  cursor: pointer;
}

.ingredients input { accent-color: var(--accent); flex: none; }

.ingredients input:checked + span { color: var(--muted); text-decoration: line-through; }

/* Numbered steps; a step marked as a note gets no number and is skipped in the count. */
.method ol { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.method li { position: relative; margin-bottom: 1rem; padding-left: 1.75rem; }
.method li:not(.note) { counter-increment: step; }
.method li:not(.note)::before {
  content: counter(step) ".";
  position: absolute;
  left: 0;
  color: var(--accent-text);
  font-weight: 600;
}
.method li.note { font-style: italic; color: var(--muted); }

.notes { margin-top: 2rem; }

/* Footer */

.site-footer {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2rem var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p { margin: 0; }

@media (max-width: 24rem) {
  .menu { gap: 0.5rem; }
  .menu a { font-size: 0.875rem; }
}

@media print {
  .site-header, .site-footer, .hero { display: none; }
}
