/* ===========================================================================
   Perennial — reader stylesheet
   ---------------------------------------------------------------------------
   Hand-written and served as a static file: no build step, no framework, and
   nothing for the deploy pipeline to compile. The whole file is a few KB, which
   is most of why Core Web Vitals stay green on shared hosting.

   Deliberately a single committed light theme rather than a light/dark pair.
   Site branding arrives as CSS custom properties on :root from the site row, and
   those inline values would win over any prefers-color-scheme block anyway. Food
   photography also reads better on a warm light ground.
   =========================================================================== */

:root {
  /* --accent, --ground and --ink are overridden per site from the sites table. */
  --accent: #1D5C55;
  --ground: #FBFAF7;
  --ink: #1E1D1B;

  --surface: #FFFFFF;
  --muted: #6E6A63;
  --rule: #E6E2D9;
  --accent-wash: #EDF3F1;

  --measure: 36rem;
  --shell: 44rem;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --step: 1.05rem;
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
}

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

a { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem; top: 1rem;
  z-index: 10;
  background: var(--surface);
  padding: .6rem 1rem;
  border-radius: 4px;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 1.15rem;
}

/* --- masthead ------------------------------------------------------------ */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.masthead__inner {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  flex-wrap: wrap;
  padding-block: 1.1rem;
}
.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.01em;
}
.masthead__tagline {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
}

/* --- recipe header ------------------------------------------------------- */

.recipe__header { padding-top: 2.2rem; }

.recipe__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 6vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -.015em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
  margin: 0 0 1.25rem;
  padding: .85rem 0;
  border-block: 1px solid var(--rule);
}
.facts__item { display: flex; flex-direction: column; }
.facts dt {
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.facts dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-transform: capitalize;
}

.jump {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  padding: .65rem 1.15rem;
  border-radius: 999px;
}
.jump:hover { filter: brightness(1.08); }

/* --- hero + prose -------------------------------------------------------- */

/* Stock libraries return whatever aspect ratio the photographer shot, so images
   are cropped to a fixed ratio rather than laid out at their natural one. Two
   reasons: the page reserves exactly the right space before the image arrives,
   which keeps layout shift at zero, and a feed of uniform crops reads as
   designed instead of as whatever the search happened to return. */
.hero { margin: 1.6rem auto; }
.hero img {
  border-radius: 6px;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.hero figcaption {
  margin-top: .5rem;
  font-size: .75rem;
  color: var(--muted);
}

/* `.prose` shares an element with `.shell`, so it must not set its own
   max-width — a narrower value there wins and re-centres the block, pushing body
   copy out of alignment with the headline above it. The shell owns the column;
   prose only holds its own children to a comfortable measure. */
.prose > * { max-width: var(--measure); }
.prose p, .prose li { font-size: 1.03rem; }
.prose h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.45rem;
  margin: 2.2rem 0 .5rem;
}
.prose h3 { font-size: 1.02rem; margin: 1.4rem 0 .2rem; }

/* --- recipe card --------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  margin: 2rem 0;
  overflow: hidden;
}

.card__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.25rem;
  background: var(--accent-wash);
  border-bottom: 1px solid var(--rule);
}
.card__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 0;
}
.card__actions { display: flex; gap: .5rem; }

.btn {
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: .4rem .9rem;
  cursor: pointer;
}
.btn[aria-pressed="true"] { background: var(--accent); color: #fff; }

.card__scaler {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .8rem 1.25rem;
  border-bottom: 1px solid var(--rule);
}
.card__scaler-label {
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: .3rem;
}
.chip {
  font: inherit;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: .25rem .7rem;
  cursor: pointer;
  color: var(--ink);
}
.chip.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.card__body { padding: 1.25rem; }

.card__heading {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0 0 .7rem;
}

/* Ingredients: whole row is a hit target, because this gets tapped with a
   knuckle or the back of a finger. */
.ingredients__list { list-style: none; margin: 0 0 2rem; padding: 0; }
.ingredients__list li + li { border-top: 1px solid var(--rule); }

.ingredient {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .6rem .2rem;
  cursor: pointer;
  font-size: var(--step);
}
.ingredient__check {
  width: 1.15rem; height: 1.15rem;
  margin-top: .18rem;
  accent-color: var(--accent);
  flex: none;
}
.ingredient__check:checked + .ingredient__text {
  color: var(--muted);
  text-decoration: line-through;
}
.qty { font-variant-numeric: tabular-nums; }
.unit { color: var(--ink); }
.ingredient__note { color: var(--muted); font-style: normal; font-size: .9em; }

/* Steps: numerals sit outside the text column so the prose stays flush. */
.steps__list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}
.step {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.15rem 2.6rem;
}
.step::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 1.75rem; height: 1.75rem;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent);
  font-size: .85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center;
}
.step__text { margin: 0; font-size: var(--step); }
.step__time {
  display: inline-block;
  margin-top: .3rem;
  font-size: .74rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Cook mode: bigger type at arm's length, and drop everything decorative. */
body.cook-mode { --step: 1.3rem; }
body.cook-mode .ad,
body.cook-mode .hero,
body.cook-mode .tools { display: none; }

/* --- affiliate box ------------------------------------------------------- */

.tools {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 1rem 1.15rem;
  margin: 2rem 0;
  background: var(--surface);
}
.tools__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0;
}
.tools__note {
  margin: .15rem 0 .8rem;
  font-size: .72rem;
  color: var(--muted);
}
.tools__list { list-style: none; margin: 0; padding: 0; }
.tools__item { padding: .35rem 0; }
.tools__link { font-weight: 600; }
.tools__why { display: block; font-size: .86rem; color: var(--muted); }

/* --- ads ----------------------------------------------------------------- */

/* Ads are visually fenced off from the recipe rather than blended into it.
   Placement itself is enforced in the template: three units maximum, none of
   them between the ingredients and the steps. */
.ad {
  margin: 2.25rem 0;
  padding-top: .5rem;
  border-top: 1px solid var(--rule);
  text-align: center;
}
.ad__label {
  margin: 0 0 .5rem;
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.ad--placeholder {
  border: 1px dashed var(--rule);
  border-radius: 6px;
  padding: 1.6rem 1rem;
  color: var(--muted);
}

/* --- feed ---------------------------------------------------------------- */

/* Each entry is a bounded card. Left unboxed, a picture and the title beneath it
   are just two things stacked in a column, and the eye has to work out whether a
   title belongs to the image above it or the one below — which gets harder the
   longer the feed grows. */
.feed { list-style: none; margin: 2rem 0; padding: 0; display: grid; gap: 1.5rem; }

.feed__item {
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  transition: border-color .15s ease;
}
.feed__item:hover { border-color: var(--muted); }
.feed__item:focus-within { border-color: var(--accent); }

.feed__link { text-decoration: none; color: inherit; display: block; }
/* The card carries the focus ring, so the link does not draw a second one. */
.feed__link:focus-visible { outline: none; }

.feed__image {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--rule);
}

.feed__body { padding: .9rem 1.1rem 1.05rem; }

.feed__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
}
.feed__meta { margin: .25rem 0 0; color: var(--muted); font-size: .82rem; }
.empty { color: var(--muted); padding: 3rem 0; }

/* --- footer -------------------------------------------------------------- */

/* Small print, set like small print. These are legal and housekeeping links —
   they must be present and findable, but they are not an invitation, and at
   body size they compete with the recipe for attention. */
.footer {
  border-top: 1px solid var(--rule);
  margin-top: 3.5rem;
  padding-block: 1.1rem 2rem;
  background: var(--surface);
}
/* Statement first, then the links. The disclosure is the part that has to be
   read; the links are wayfinding and sit under it, on one line with the
   copyright. */
.footer__disclosure {
  margin: 0 0 .75rem;
  font-size: .69rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 42rem;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .3rem 1.1rem;
  font-size: .72rem;
}
.footer__nav a {
  color: var(--muted);
  text-decoration: none;
}
.footer__nav a:hover { color: var(--accent); text-decoration: underline; }

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

/* --- static pages --------------------------------------------------------- */

.page { padding-top: 2.2rem; }
.page__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -.015em;
  margin: 0 0 1.2rem;
  text-wrap: balance;
}
.page ul { padding-left: 1.15rem; }
.page li { margin: .5rem 0; }
.page__meta {
  margin-top: 2.5rem;
  padding-top: .9rem;
  border-top: 1px solid var(--rule);
  font-size: .78rem;
  color: var(--muted);
}

/* --- print --------------------------------------------------------------- */

/* One clean page: the recipe and nothing else. A trust builder, and the reason
   a reader bookmarks the site instead of screenshotting it. */
@media print {
  .masthead, .footer, .ad, .tools, .hero,
  .jump, .card__actions, .card__scaler, .skip { display: none !important; }

  body { background: #fff; font-size: 11pt; }
  .shell { max-width: none; padding: 0; }
  .card { border: none; margin: 0; }
  .card__bar { background: none; border-bottom: 1px solid #000; padding-inline: 0; }
  .card__body { padding-inline: 0; }
  .step { break-inside: avoid; }
  .recipe__title { font-size: 20pt; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* --- safety notice (how-to vertical) -------------------------------------- */

/* Deliberately louder than anything else on the page and placed above the first
   step. Somebody who starts working after reading step one must already have
   passed this; a caution below the instructions is a caution nobody reads. */
.safety {
  border: 1px solid #C9A227;
  border-left: 4px solid #C9A227;
  background: #FDF8E7;
  border-radius: 0 6px 6px 0;
  padding: .9rem 1.15rem;
  margin: 1.6rem 0;
  max-width: 42rem;
}
.safety__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.02rem;
  margin: 0 0 .3rem;
  color: #6B5310;
}
.safety p { margin: 0; font-size: .95rem; color: #4A3B0C; }

/* Kept in print: the ads and images go, but the warnings stay on the sheet
   somebody carries out to the shed. */
@media print {
  .safety { border-color: #000; background: none; break-inside: avoid; }
  .safety__title, .safety p { color: #000; }
}
