/* KnowThePepper recipe page (UI redesign v2): the head extras (lede, meta strip, Jump to recipe / Print),
   the recipe card (ingredient checklist, numbered steps, nutrition row) and the prose blocks the recipe
   renderer emits. Loaded by templates/recipe.php after article.css (the shared article frame owns the head
   band, hero figure, TOC, callouts, FAQ and the related carousel). Type-only: tokens, no raw hex.
   Two widths only: wide 1200 (hero, recipe card) and read 720 (prose, lede, meta strip).
   Comps: art-src/style-refs/ktp-v2/ktp-v2-23-recipe-head.webp and -24-recipe-body.webp (body blocks only).
   Plan: docs/plans/2026-11-12-ui-redesign-v2.md. Labels and steps in the card are div/span, never p,
   so AdSense auto ads cannot land inside it. */

/* ── Head extras (inside the shared .article-head band, right after the H1) ── */
.recipe-head__lede {
  width: min(100%, var(--ktp-w-read));
  margin: var(--ktp-space-3) auto 0;
  box-sizing: border-box;
  color: var(--ktp-ink);
  font-size: 1.25rem;
  line-height: 1.5;
  text-wrap: balance;
}
.recipe-head__lede > div + div { margin-top: var(--ktp-space-2); }

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  width: min(100%, var(--ktp-w-read));
  margin: var(--ktp-space-5) auto 0;
  box-sizing: border-box;
  overflow: hidden; /* clips the outer edge of the L-shaped dividers below */
  border: var(--ktp-line);
  border-radius: 16px;
  background: var(--ktp-white);
  box-shadow: var(--ktp-shadow);
  text-align: left;
}
.recipe-meta__item {
  flex: 1 1 128px;
  display: flex;
  align-items: center;
  gap: var(--ktp-space-3);
  min-width: 0;
  padding: var(--ktp-space-3) var(--ktp-space-4);
  box-shadow: -1.5px -1.5px 0 0 var(--ktp-hairline); /* top + left divider; wrapped rows stay ruled */
}
.recipe-meta__icon { flex: none; display: grid; place-items: center; color: var(--ktp-ink); }
.recipe-meta__text { display: flex; flex-direction: column; min-width: 0; }
.recipe-meta__label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--ktp-muted);
}
.recipe-meta__value {
  font-family: var(--ktp-font-display);
  font-size: 1.0625rem;
  font-weight: var(--ktp-fw-number);
  line-height: 1.25;
  color: var(--ktp-ink);
}

.recipe-head__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--ktp-space-3);
  margin-top: var(--ktp-space-5);
}
.recipe-head__actions + .article-byline { margin-top: var(--ktp-space-5); }

main .recipe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 var(--ktp-space-5);
  border: 1.5px solid transparent;
  border-radius: 10px;
  font-family: var(--ktp-font-display);
  font-size: 1.0625rem;
  font-weight: var(--ktp-fw-number);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
main .recipe-btn--primary { background: var(--ktp-chili); border-color: var(--ktp-chili); color: var(--ktp-white); }
main .recipe-btn--primary:hover { background: var(--ktp-chili-dark); border-color: var(--ktp-chili-dark); color: var(--ktp-white); }
main .recipe-btn--outline { background: var(--ktp-white); border-color: var(--ktp-ink); color: var(--ktp-ink); }
main .recipe-btn--outline:hover { background: var(--ktp-smoke); color: var(--ktp-ink); }
main .recipe-btn--sm { min-height: 44px; padding: 0 var(--ktp-space-4); font-size: 1rem; }
main .recipe-btn:focus-visible { outline: 2px solid var(--ktp-ink); outline-offset: 2px; }
.recipe-icon { flex: none; }

/* Hero: a near-square or portrait file sits whole inside the 1.91:1 frame (landscape files set the frame by their own ratio) */
.recipe-hero .article-hero__frame--contain { aspect-ratio: 1200 / 630; }

/* ── Prose blocks the recipe renderer emits (read column; the callouts reuse the shared .info-box) ── */
main .ktp-article .content-section > h2.recipe-h2 { margin-top: var(--ktp-space-7); }
main .ktp-article .content-section > h2.recipe-h2:first-child { margin-top: 0; }
main .ktp-article .recipe-lead-callout { margin-top: 0; }
main .ktp-article .recipe-chefs-tip h3 {
  margin: 0 0 var(--ktp-space-1);
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: var(--ktp-tracking-display);
  color: var(--ktp-ink);
}
main .ktp-article .content-section :where(ul.recipe-list, ol.recipe-list) { padding-left: 1.3em; }
main .ktp-article .content-section .recipe-list li + li { margin-top: .35em; }
main .ktp-article .ktp-handy-tools { margin-block: var(--ktp-space-6); } /* tool-callout.php, shared legacy partial */

/* ── Recipe card band (smoke): one white card at the wide width ── */
.recipe-band { padding-block: var(--ktp-space-7); }
.recipe-card {
  --recipe-gap: clamp(24px, 4vw, 56px);
  scroll-margin-top: calc(var(--ktp-header-h) + var(--ktp-space-5));
  padding: var(--ktp-space-6);
  box-sizing: border-box;
  border: var(--ktp-line);
  border-radius: 16px;
  background: var(--ktp-white);
  box-shadow: var(--ktp-shadow);
  color: var(--ktp-ink);
}

.recipe-card__head {
  display: flex;
  align-items: center;
  gap: var(--ktp-space-5);
  padding-bottom: var(--ktp-space-5);
  border-bottom: var(--ktp-line);
}
.recipe-card__thumb {
  flex: none;
  width: 104px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 10px;
  background: var(--ktp-smoke);
}
.recipe-card__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.recipe-card__id { flex: 1 1 auto; min-width: 0; }
.recipe-card__title {
  font-family: var(--ktp-font-display);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: var(--ktp-fw-display);
  line-height: 1.12;
  letter-spacing: var(--ktp-tracking-display);
  text-wrap: balance;
}
.recipe-card__meta { display: flex; flex-wrap: wrap; gap: 4px var(--ktp-space-4); margin-top: var(--ktp-space-2); }
.recipe-card__fact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ktp-fs-small);
  line-height: 1.4;
  color: var(--ktp-muted);
}
.recipe-card__fact .recipe-icon { width: 18px; height: 18px; }
.recipe-card__actions { flex: none; display: flex; flex-wrap: wrap; gap: var(--ktp-space-2); }

.recipe-card__body {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: var(--recipe-gap);
  padding-top: var(--ktp-space-5);
}
.recipe-card__body--single { grid-template-columns: minmax(0, 1fr); }
.recipe-card__body > .recipe-steps-card { padding-left: var(--recipe-gap); border-left: var(--ktp-line); }
.recipe-card__body--single > .recipe-steps-card { padding-left: 0; border-left: 0; }
main .recipe-card .recipe-card__heading {
  margin: 0 0 var(--ktp-space-4);
  font-family: var(--ktp-font-display);
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
  font-weight: var(--ktp-fw-display);
  line-height: 1.15;
  letter-spacing: var(--ktp-tracking-display);
  color: var(--ktp-ink);
}

/* Ingredients: a real checkbox per line (state is client-side only, nothing is stored) */
.recipe-ing-list { margin: 0; padding: 0; list-style: none; }
.recipe-ing { margin: 0; padding: 0; }
.recipe-ing label {
  display: flex;
  align-items: flex-start;
  gap: var(--ktp-space-3);
  padding: 7px 0;
  font-size: 1.0625rem;
  line-height: 1.45;
  cursor: pointer;
}
.recipe-ing__box {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  border: 2px solid var(--ktp-ink);
  border-radius: 6px;
  background: var(--ktp-white) center / 14px 14px no-repeat;
  cursor: pointer;
}
.recipe-ing__box { position: relative; }
.recipe-ing__box:checked { background-color: var(--ktp-ancho); }
.recipe-ing__box:checked::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  background-color: var(--ktp-white);
  -webkit-mask: url(/assets/images/icons/check-mark-icon.webp) center / contain no-repeat;
  mask: url(/assets/images/icons/check-mark-icon.webp) center / contain no-repeat;
}
.recipe-ing__box:focus-visible { outline: 2px solid var(--ktp-ink); outline-offset: 2px; }
.recipe-ing__box:checked + .recipe-ing__text { color: var(--ktp-muted); text-decoration: line-through; text-decoration-color: var(--ktp-muted); }

/* Steps: ancho circle, bold lead (the first words), the full step text */
.recipe-step-list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--ktp-space-5); }
.recipe-step { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: var(--ktp-space-4); margin: 0; padding: 0; }
.recipe-step__num {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ktp-ancho);
  color: var(--ktp-white);
  font-family: var(--ktp-font-display);
  font-size: 1.0625rem;
  font-weight: var(--ktp-fw-display);
  line-height: 1;
}
main .recipe-step__body > h3 {
  margin: 4px 0 2px;
  font-family: var(--ktp-font-body);
  font-size: var(--ktp-fs-small);
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--ktp-muted);
}
.recipe-step__text { font-size: 1.0625rem; line-height: 1.6; color: var(--ktp-ink); }
.recipe-step__text + .recipe-step__text { margin-top: var(--ktp-space-2); }

/* Nutrition row (only when the recipe row carries nutrition values) */
.recipe-nutrition {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--ktp-space-1) var(--ktp-space-5);
  margin-top: var(--ktp-space-6);
  padding: var(--ktp-space-3) var(--ktp-space-4);
  border-radius: 10px;
  background: var(--ktp-smoke);
  font-size: var(--ktp-fs-small);
  line-height: 1.5;
}
.recipe-nutrition__title { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ktp-muted); }
.recipe-nutrition__item strong { font-weight: var(--ktp-fw-number); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .recipe-card__head { flex-wrap: wrap; }
  .recipe-card__actions { width: 100%; }
  .recipe-card__body { grid-template-columns: minmax(0, 1fr); row-gap: var(--ktp-space-6); }
  .recipe-card__body > .recipe-steps-card { padding-left: 0; border-left: 0; padding-top: var(--ktp-space-6); border-top: var(--ktp-line); }
}
@media (max-width: 640px) {
  .recipe-card { padding: var(--ktp-space-4); }
  .recipe-card__thumb { width: 80px; }
  .recipe-head__lede { font-size: 1.125rem; }
  .recipe-meta__item { flex-basis: 45%; }
  .recipe-card__actions .recipe-btn { flex: 1 1 auto; }
}

/* ── Print: the recipe card only ── */
@media print {
  main > :not(.recipe-band) { display: none !important; }
  .recipe-band { padding: 0; background: none; }
  .recipe-band .rule-heat { display: none; }
  .recipe-card { padding: 0; border: 0; box-shadow: none; }
  .recipe-card__actions { display: none; }
  .recipe-card__body { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .recipe-step,
  .recipe-ing { break-inside: avoid; }
}
