* { box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --bg: #ffffff;
  --surface: #f4f4f2;
  --ink: #000000;
  --muted: #5c5c5c;
  --line: #e2e2e2;
  --accent: #e5604d;
  --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --body: "Work Sans", system-ui, -apple-system, sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 800; letter-spacing: -0.01em; line-height: 1.02; }

/* Letter-spaced small caps line (category under titles) */
.byline, .kicker {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink);
}

main { max-width: 1280px; margin: 0 auto; padding: 40px 48px 64px; }

/* ---------- Hero banner ---------- */
body { overflow-x: clip; }
.hero {
  position: relative;
  /* full width of the window, outside the page margins */
  width: 100vw;
  margin: -40px calc(50% - 50vw) 72px;
  min-height: 86vh;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.35) 50%, rgba(0, 0, 0, 0.1) 100%),
    #2a1d14 url("images/hero.jpg") center / cover no-repeat;
}
.hero-inner { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 48px 72px; }
.hero .kicker { color: #fff; margin: 0 0 18px; font-weight: 600; }
.hero h1 {
  font-size: clamp(3.4rem, 8.5vw, 8rem);
  text-transform: uppercase;
  line-height: 0.9;
  letter-spacing: -0.02em;
  max-width: 11ch;
  margin: 0 0 24px;
}
.hero-sub { font-size: 1.3rem; margin: 0 0 32px; max-width: 560px; opacity: 0.92; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .photo-credit { position: absolute; right: 20px; bottom: 14px; margin: 0; font-size: 0.72rem; opacity: 0.75; }
#recipes { scroll-margin-top: 24px; }

/* ---------- Intro ---------- */
.intro {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 56px;
  padding: 44px 0 52px;
  margin-bottom: 72px;
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
}
.intro-head .kicker { margin: 0 0 14px; color: var(--accent); font-weight: 600; }
.intro-head h2 { font-size: 4.4rem; text-transform: uppercase; margin: 0; }
.intro-text p { margin: 0 0 18px; font-size: 1.1rem; line-height: 1.7; }

/* ---------- Recipe list ---------- */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 { font-size: 5rem; text-transform: uppercase; margin: 0; line-height: 0.9; }
.section-head #search { margin-bottom: 6px; }

#search {
  width: 320px;
  max-width: 100%;
  padding: 12px 2px;
  border: none;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  outline: none;
}
#search::placeholder { color: #9a9a9a; }

.tabs { display: flex; gap: 0; flex-wrap: wrap; margin: 28px 0 44px; border-bottom: 1px solid var(--line); }
.tab {
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  background: none;
  padding: 10px 18px 12px 0;
  margin-right: 18px;
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 56px 32px;
}
.card { display: flex; flex-direction: column; text-decoration: none; }
.card-art { aspect-ratio: 1 / 1; overflow: hidden; display: grid; place-items: center; }
.card-art img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.card:hover .card-art img { transform: scale(1.03); }
.card-body { padding-top: 22px; }
.card h3 { font-size: 2.6rem; margin: 0 0 16px; }
.card:hover h3 { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }
.card .byline { margin: 0 0 22px; }
.card .card-meta { font-size: 1.05rem; font-weight: 500; }

.plate { font-size: 5rem; line-height: 1; }
.plate.big { font-size: 7rem; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- Recipe page ---------- */
.banner { height: 560px; overflow: hidden; display: grid; place-items: center; }
.banner img { width: 100%; height: 100%; object-fit: cover; }
.banner.no-photo { height: 260px; }

.page { background: #fff; max-width: 1000px; margin: 0 auto; padding: 40px 0 48px; }
.recipe-page { padding-top: 32px; padding-bottom: 0; }
.back {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 600;
}
.back:hover { color: var(--accent); }

.recipe-head { padding: 36px 0 44px; border-bottom: 3px solid var(--ink); }
.recipe-head .kicker { margin: 0; }
.recipe-head h2 { font-size: 5.6rem; text-transform: uppercase; margin: 14px 0 0; }
.lede { font-size: 1.25rem; margin: 16px 0 0; max-width: 680px; }
.meta-strip { display: flex; flex-wrap: wrap; margin-top: 24px; border-top: 1px solid var(--line); }
.meta-strip div { padding: 16px 40px 0 0; margin-right: 40px; border-right: 1px solid var(--line); }
.meta-strip div:last-child { border-right: none; }
.meta-strip span { display: block; }
.meta-strip .label { text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.7rem; font-weight: 500; color: var(--muted); }
.meta-strip .value { font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1.1; }

.recipe-body { display: grid; grid-template-columns: 1fr 1.6fr; gap: 64px; padding-top: 44px; }
.recipe-body h3 { font-size: 2.4rem; text-transform: uppercase; margin: 0 0 6px; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0 0 14px; }

.ingredients ul { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--ink); }
.ingredients li {
  position: relative;
  padding: 13px 0 13px 34px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
}
.ingredients li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
}
.ingredients li:hover::before { border-color: var(--accent); }
.ingredients li.done { color: #a0a0a0; text-decoration: line-through; }
.ingredients li.done::before { background: var(--ink); border-color: var(--ink); }
.ingredients li.done::after {
  content: "✓";
  position: absolute;
  left: 4px;
  top: 14px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.method > ol { list-style: none; counter-reset: step; padding: 0; margin: 0; border-top: 2px solid var(--ink); }
.method > ol > li {
  counter-increment: step;
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--line);
}
.method > ol > li::before {
  content: "Step " counter(step);
  display: block;
  margin-bottom: 6px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  text-transform: uppercase;
  line-height: 1;
}

.notes { margin-top: 28px; padding: 22px 26px; background: var(--surface); border-left: 6px solid var(--accent); }
.notes h4 { margin: 0 0 6px; font-size: 1.5rem; text-transform: uppercase; }
.notes p { margin: 0; white-space: pre-line; }

.recipe-actions { display: flex; gap: 10px; margin-top: 44px; padding-top: 28px; border-top: 3px solid var(--ink); }
.credit { font-size: 0.8rem; color: var(--muted); margin: 18px 0 0; }
.credit a, .photo-credit a { color: inherit; }


/* Ingredient groups (e.g. 6” / 8” cake tin) */
.ing-group {
  font-size: 1.25rem;
  text-transform: uppercase;
  margin: 26px 0 8px;
}
.ingredients .hint + .ing-group { margin-top: 4px; }
.ing-group + ul { border-top-width: 1px; }

/* Step title with points underneath */
.step-title { display: block; font-weight: 600; margin-bottom: 6px; }
.step-details { margin: 0; padding-left: 20px; }
.step-details li { margin: 0 0 6px; }
.step-details li::marker { color: var(--accent); }

.source { margin: 18px 0 0; font-size: 0.9rem; color: var(--muted); }
.source a { color: var(--ink); font-weight: 600; }


/* Back link + print link above the recipe title */
.recipe-topbar { display: flex; justify-content: space-between; align-items: center; }
.link-btn {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
}
.link-btn::before { content: "⎙ "; letter-spacing: 0; font-size: 0.95rem; }
.link-btn:hover, .back:hover { color: var(--accent); }

/* "Find the original recipe" section at the bottom of recipe pages */
.original-recipe {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-top: 56px;
  padding: 32px 36px;
  background: var(--surface);
  border-left: 6px solid var(--accent);
}
.original-recipe h3 { font-size: 2.4rem; text-transform: uppercase; margin: 0 0 8px; }
.original-recipe p { margin: 0; max-width: 60ch; color: var(--muted); }
.original-recipe strong { color: var(--ink); }
.original-recipe .btn { flex-shrink: 0; }
@media (max-width: 760px) {
  .original-recipe { flex-direction: column; align-items: flex-start; gap: 20px; padding: 24px 22px; }
  .original-recipe h3 { font-size: 2rem; }
}

.recipe-credits { margin: 36px 0 0; font-size: 0.85rem; color: var(--muted); }
.recipe-credits a { color: var(--ink); }
.btn:focus:not(:focus-visible), .scale button:focus:not(:focus-visible) { outline: none; }

/* Scale buttons on recipe pages */
.scale { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 14px 0 12px; }
.scale-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  font-weight: 600;
}
.scale-buttons { display: flex; }
.scale-buttons button {
  min-width: 40px;
  padding: 6px 8px;
  border: 2px solid var(--ink);
  margin-left: -2px;
  background: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.scale-buttons button:first-child { margin-left: 0; }
.scale-buttons button:hover { background: var(--surface); }
.scale-buttons button.active { background: var(--ink); color: #fff; }
.scale-custom { display: flex; align-items: center; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.scale-custom input {
  width: 54px;
  padding: 5px 6px;
  border: 2px solid var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}
.qty.scaled { color: var(--accent); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 13px 24px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #fff;
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.light { background: #fff; border-color: #fff; color: var(--ink); }
.btn.light:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.small { padding: 8px 14px; font-size: 0.7rem; }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }
.btn.danger { border-color: #c4271a; color: #c4271a; }
.btn.danger:hover { background: #c4271a; color: #fff; }

.site-foot a { text-decoration: none; font-weight: 600; }
.site-foot {
  width: calc(100% - 96px);
  max-width: 1184px;
  margin: 0 auto;
  padding: 24px 0 48px;
  border-top: 3px solid var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}
.site-foot.narrow { max-width: 1000px; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  main { padding: 24px 18px 60px; }
  .hero { margin-top: -24px; min-height: 75vh; }
  .hero-inner { padding: 0 18px 56px; }
  .section-head h2 { font-size: 3.4rem; }
  .intro { grid-template-columns: 1fr; gap: 24px; padding: 32px 0 40px; margin-bottom: 52px; }
  .intro-head h2 { font-size: 3.2rem; }
  .card h3 { font-size: 2.2rem; }
  .banner { height: 320px; }
  .recipe-head h2 { font-size: 3.4rem; }
  .recipe-body { grid-template-columns: 1fr; gap: 40px; }
  #search { width: 100%; }
  .site-foot a { text-decoration: none; font-weight: 600; }
.site-foot { width: calc(100% - 36px); padding: 20px 0 40px; }
}

/* ---------- Print ---------- */
@media print {
  .recipe-topbar, .scale, .hint, .banner, .site-foot { display: none !important; }
  .recipe-head { padding-top: 0; }
  .qty.scaled { color: inherit; }
  .ingredients li.done { text-decoration: none; color: inherit; }
}
