/* Recipe detail v2: editorial pass.
 * Asymmetric hero, drop cap, big-numeral steps, ingredient check-off,
 * live servings scaler, scroll-driven hero motion.
 * Layered AFTER recipe-page.css. New classes only; existing layout untouched. */

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Editorial hero ---------- */
.recipe-hero {
  max-width: 1140px;
  margin: 0.5rem auto 3rem;
  padding: 0 2rem;
}
.recipe-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3.5rem;
  align-items: center;
}
.recipe-hero-figure {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(43, 43, 43, 0.28),
              0 8px 24px -8px rgba(43, 43, 43, 0.12);
  background: var(--soft-gray);
}
.recipe-hero-figure::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  border-radius: inherit;
  pointer-events: none;
}
.recipe-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center center;
  transform: scale(1.04);
}
.recipe-hero-text {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.recipe-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--coral);
}
.recipe-eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: currentColor;
  display: inline-block;
}
.recipe-hero-text h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.1rem, 4.2vw, 3.5rem);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--charcoal);
  margin: 0;
  font-variation-settings: "opsz" 96;
}
.recipe-hero-lede {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.1rem;
  line-height: 1.55;
  color: #5a5a5a;
  margin: 0;
  max-width: 38ch;
}
.recipe-hero-meta {
  display: flex;
  gap: 2.25rem;
  margin-top: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(43, 43, 43, 0.1);
}
.meta-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.meta-stat-value {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.95rem;
  line-height: 1;
  color: var(--charcoal);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.meta-stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
  font-weight: 500;
}
.recipe-hero-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}
.recipe-hero-tag {
  font-size: 0.72rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid rgba(43, 43, 43, 0.12);
  border-radius: 999px;
  color: #5a5a5a;
  letter-spacing: 0.02em;
}

@media (max-width: 820px) {
  .recipe-hero { padding: 0 1.25rem; margin-bottom: 2rem; }
  .recipe-hero-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .recipe-hero-figure { aspect-ratio: 4 / 3; border-radius: 20px; }
  .recipe-hero-meta { gap: 1.5rem; }
  .meta-stat-value { font-size: 1.5rem; }
}

/* ---------- Scroll-driven hero motion (progressive enhancement) ---------- */
@supports (animation-timeline: scroll()) {
  .recipe-hero-image {
    animation: hero-zoom linear both;
    animation-timeline: scroll();
    animation-range: 0 600px;
  }
}
@keyframes hero-zoom {
  from { transform: scale(1.02); }
  to { transform: scale(1.08); }
}

/* ---------- Drop cap on description ---------- */
.recipe-description--lede::first-letter {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 4.25rem;
  line-height: 0.85;
  float: left;
  margin: 0.4rem 0.7rem -0.1rem 0;
  color: var(--coral);
}
.recipe-description--lede {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #3a3a3a;
}
.recipe-description--lede p:first-of-type {
  margin-top: 0;
}

/* ---------- Servings scaler ---------- */
.ingredients-block {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.scaler-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem 0.4rem 1.1rem;
  background: var(--soft-gray);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--charcoal);
  align-self: start;
  border: 1px solid rgba(43, 43, 43, 0.05);
}
.scaler-label {
  color: #5a5a5a;
  letter-spacing: 0.04em;
}
.scaler-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(43, 43, 43, 0.12);
  background: #fff;
  color: var(--charcoal);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
}
.scaler-btn:hover:not(:disabled) {
  background: var(--coral);
  border-color: var(--coral);
  color: #fff;
}
.scaler-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.scaler-value {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  min-width: 1.5ch;
  text-align: center;
  color: var(--charcoal);
  transition: color 0.2s;
}
.scaler-value.is-scaled {
  color: var(--coral);
}

/* ---------- Ingredients with check-off ---------- */
.ingredients-list-v2 {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(43, 43, 43, 0.06);
}
.ingredient-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid rgba(43, 43, 43, 0.06);
  cursor: pointer;
  user-select: none;
}
.ingredient-check {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  border: 1.5px solid rgba(43, 43, 43, 0.22);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.ingredient-check:hover {
  border-color: var(--coral);
}
.ingredient-check:checked {
  background: var(--coral);
  border-color: var(--coral);
}
.ingredient-check:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  animation: check-pop 0.22s ease-out;
}
@keyframes check-pop {
  from { transform: rotate(45deg) scale(0); opacity: 0; }
  to { transform: rotate(45deg) scale(1); opacity: 1; }
}
.ingredient-text {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--charcoal);
  transition: color 0.2s;
  font-variant-numeric: tabular-nums;
}
.ingredient-row:has(.ingredient-check:checked) .ingredient-text {
  color: #b0b0b0;
  text-decoration: line-through;
  text-decoration-color: #d4d4d4;
  text-decoration-thickness: 1px;
}

/* ---------- Instructions with big numerals ---------- */
.instructions-list-v2 {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.instruction-step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(43, 43, 43, 0.06);
  align-items: start;
}
.instruction-step:last-child {
  border-bottom: none;
}
.instruction-number {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 2.85rem;
  line-height: 0.9;
  color: var(--coral);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  font-style: italic;
}
.instruction-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--charcoal);
  margin: 0;
  padding-top: 0.45rem;
}

@media (max-width: 640px) {
  .instruction-step {
    grid-template-columns: 48px 1fr;
    gap: 0.9rem;
    padding: 1rem 0;
  }
  .instruction-number {
    font-size: 2.25rem;
  }
  .instruction-text {
    font-size: 1rem;
  }
}

/* ---------- Refined section heads inside .recipe-content ---------- */
.recipe-content h2 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.85rem;
  letter-spacing: -0.01em;
  color: var(--charcoal);
  margin: 2.5rem 0 1.25rem;
  font-variation-settings: "opsz" 36;
}
.recipe-content > h2:first-child,
.recipe-content > .recipe-description--lede + h2 {
  margin-top: 2rem;
}

/* ---------- Native share button (revealed by JS if supported) ---------- */
.share-native {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--coral);
  background: var(--coral);
  color: #fff;
  font-family: inherit;
}
.share-native:hover {
  background: #f57862;
  border-color: #f57862;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .recipe-hero-image {
    animation: none !important;
    transform: scale(1);
  }
  .ingredient-check:checked::after {
    animation: none;
  }
  .scaler-value,
  .ingredient-text,
  .meta-stat-value {
    transition: none;
  }
}
