/* ============================================
   Recipe-specific styles
   ============================================ */

/* Recipe timing bar on detail page */
.recipe-timings {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-block-end: var(--space-xl);
  border: 1px solid oklch(0.9 0.01 106);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
  width: fit-content;
}

.recipe-timing {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: var(--space-md) var(--space-lg);
  border-inline-end: 1px solid oklch(0.9 0.01 106);
}

.recipe-timing:last-child {
  border-inline-end: none;
}

.recipe-timing__label {
  font-family: var(--font-display);
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: oklch(0.44 0.03 252);
}

.recipe-timing__value {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-headline);
  font-family: var(--font-display);
}

/* Servings scaler */
.recipe-servings {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background-color: var(--color-surface);
  border: 1px solid oklch(0.9 0.01 106);
  border-radius: var(--radius-lg);
  margin-block-end: var(--space-xl);
  width: fit-content;
}

.recipe-servings__label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-paragraph);
}

.recipe-servings__controls {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.recipe-servings__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background-color: oklch(0.93 0.02 246 / 0.5);
  border: 1px solid oklch(0.85 0.02 246 / 0.3);
  border-radius: var(--radius-md);
  color: var(--color-headline);
  font-size: 1.25rem;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.recipe-servings__btn:hover:not(:disabled) {
  background-color: oklch(0.71 0.16 246 / 0.15);
  border-color: oklch(0.71 0.16 246 / 0.4);
}

.recipe-servings__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.recipe-servings__count {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-headline);
  font-family: var(--font-display);
  min-width: 2.5rem;
  text-align: center;
}

/* Recipe sections */
.recipe-section {
  margin-block-end: var(--space-2xl);
}

.recipe-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-block-end: var(--space-lg);
  flex-wrap: wrap;
}

.recipe-section__title {
  font-family: var(--font-display-editorial);
  font-size: 1.75rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.01em;
  color: var(--color-headline);
  margin-block-end: var(--space-lg);
}

.recipe-section__header .recipe-section__title {
  margin-block-end: 0;
}

/* Ingredients list */
.recipe-ingredients {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-sm);
}

.recipe-ingredient {
  display: flex;
  gap: 0.375rem;
  align-items: baseline;
  padding-block: var(--space-sm);
  border-block-end: 1px solid oklch(0.93 0.005 106);
  font-family: var(--font-serif);
  font-size: 1rem;
}

.recipe-ingredient__amount {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-headline);
  min-width: 2.5rem;
  text-align: right;
}

.recipe-ingredient__unit {
  font-weight: 400;
  color: var(--color-paragraph);
  min-width: 3rem;
}

.recipe-ingredient__name {
  font-weight: 400;
  color: var(--color-headline);
}

/* Steps list */
.recipe-steps {
  display: grid;
  gap: var(--space-lg);
  padding-inline-start: 1.5rem;
}

/* Not from Phoenix: LiveView toggles step-by-step mode (and the recipes
   search empty-state, see #recipes-empty in recipes_index.html) by
   conditionally rendering one view or the other, so the alternate is
   never in the DOM. This static port instead keeps every alternate in
   the DOM and toggles the `hidden` attribute via JS - but an author
   stylesheet's `display` always wins over the UA default
   `[hidden] { display: none }` regardless of selector specificity, so
   .recipe-steps's/.recipe-step-mode's own `display: grid` would otherwise
   leave a "hidden" element still visible. */
.recipe-steps[hidden],
.recipe-step-mode[hidden] {
  display: none;
}

.recipe-step {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--color-headline);
}

/* Step-by-step mode */
.recipe-step-toggle {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-link);
  background-color: oklch(0.71 0.16 246 / 0.08);
  border: 1px solid oklch(0.71 0.16 246 / 0.2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.recipe-step-toggle:hover {
  background-color: oklch(0.71 0.16 246 / 0.15);
  border-color: oklch(0.71 0.16 246 / 0.4);
}

.recipe-step-mode {
  background-color: var(--color-surface);
  border: 1px solid oklch(0.9 0.01 106);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.recipe-step-mode__step {
  margin-block-end: var(--space-xl);
}

.recipe-step-mode__counter {
  display: block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-link);
  margin-block-end: var(--space-md);
}

.recipe-step-mode__text {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--color-headline);
}

.recipe-step-mode__nav {
  display: flex;
  gap: var(--space-sm);
}

.recipe-step-mode__btn {
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  background-color: var(--color-surface);
  border: 1px solid oklch(0.85 0.01 106);
  border-radius: var(--radius-md);
  color: var(--color-paragraph);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.recipe-step-mode__btn:hover:not(:disabled) {
  border-color: oklch(0.71 0.16 246 / 0.3);
  color: var(--color-headline);
}

.recipe-step-mode__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.recipe-step-mode__btn--primary {
  background-color: oklch(0.71 0.16 246 / 0.1);
  border-color: oklch(0.71 0.16 246 / 0.25);
  color: var(--color-link);
  font-weight: 600;
}

.recipe-step-mode__btn--primary:hover:not(:disabled) {
  background-color: oklch(0.71 0.16 246 / 0.18);
}

/* Recipe notes */
.recipe-notes {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.85;
  color: var(--color-paragraph);
  background-color: oklch(0.71 0.16 246 / 0.05);
  border-inline-start: 3px solid var(--color-link);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ============================================
   Recipe Page Layout
   ============================================ */

/* Wider canvas for two-column layout */
.recipe-page .post-article {
  max-width: 100ch;
}

/* Warm accent on nav elements */
.recipe-page .post-header {
  border-block-end-color: oklch(0.88 0.03 62 / 0.5);
}

.recipe-page .post-header__back {
  color: var(--recipe-accent-dark);
}

.recipe-page .post-header__back:hover,
.recipe-page .post-header__back:focus-visible {
  color: var(--recipe-accent-dark);
}

.recipe-page .post-header__tag {
  background-color: oklch(0.62 0.14 50 / 0.1);
  color: var(--recipe-accent-dark);
}

/* Total time stat has a warm accent value */
.recipe-page .recipe-timing--total .recipe-timing__value {
  color: var(--recipe-accent);
}

/* Two-column body */
.recipe-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  margin-block-start: var(--space-xl);
}

@media (min-width: 56rem) {
  .recipe-body {
    grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
    gap: var(--space-3xl);
    align-items: start;
  }

  .recipe-sidebar {
    position: sticky;
    top: calc(var(--navbar-height) + var(--space-lg));
  }
}

/* Sidebar: actions (servings + print) */
.recipe-sidebar .recipe-servings {
  width: 100%;
  border-color: oklch(0.88 0.04 62 / 0.35);
  margin-block-end: 0;
}

.recipe-sidebar .recipe-servings__btn {
  background-color: oklch(0.62 0.14 50 / 0.07);
  border-color: oklch(0.62 0.14 50 / 0.18);
}

.recipe-sidebar .recipe-servings__btn:hover:not(:disabled) {
  background-color: oklch(0.62 0.14 50 / 0.15);
  border-color: oklch(0.62 0.14 50 / 0.38);
}

/* Section title warm accent */
.recipe-page .recipe-section__title {
  font-size: 1.75rem;
  letter-spacing: -0.01em;
  color: var(--color-headline);
  margin-block-end: var(--space-md);
  padding-block-end: var(--space-sm);
  border-block-end: 2px solid var(--recipe-accent-light);
}

/* Ingredient list */
.recipe-page .recipe-ingredients {
  gap: 0;
}

.recipe-page .recipe-ingredient {
  padding-block: 0.75rem;
  border-block-end-color: oklch(0.92 0.015 70 / 0.7);
  gap: 0.5rem;
  font-size: 0.9375rem;
}

.recipe-page .recipe-ingredient:last-child {
  border-block-end: none;
}

@keyframes ingredient-flash {
  0% {
    background-color: var(--recipe-accent-light);
    border-radius: var(--radius-sm);
  }
  100% { background-color: transparent; }
}

.recipe-page .recipe-ingredient__amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--recipe-accent-dark);
  min-width: 2.25rem;
  text-align: right;
  animation: ingredient-flash 0.6s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .recipe-page .recipe-ingredient__amount {
    animation: none;
  }
}

.recipe-page .recipe-ingredient__unit {
  color: var(--color-paragraph);
  min-width: 2.5rem;
}

.recipe-page .recipe-ingredient__name {
  color: var(--color-headline);
}

/* Numbered steps with amber circles */
.recipe-page .recipe-steps {
  list-style: none;
  padding: 0;
  gap: 0;
  counter-reset: recipe-step;
}

.recipe-page .recipe-step {
  counter-increment: recipe-step;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: var(--space-md);
  padding-block: var(--space-lg);
  border-block-end: 1px solid oklch(0.92 0.01 70 / 0.7);
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.85;
  color: var(--color-headline);
  align-items: start;
}

.recipe-page .recipe-step::before {
  content: counter(recipe-step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--recipe-accent-light);
  color: var(--recipe-accent-dark);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8125rem;
  flex-shrink: 0;
  margin-block-start: 0.2rem;
}

.recipe-page .recipe-step:last-child {
  border-block-end: none;
}

/* Step-by-step mode — warm theme */
.recipe-page .recipe-step-toggle {
  color: var(--recipe-accent-dark);
  background-color: oklch(0.62 0.14 50 / 0.08);
  border-color: oklch(0.62 0.14 50 / 0.2);
}

.recipe-page .recipe-step-toggle:hover {
  background-color: oklch(0.62 0.14 50 / 0.14);
  border-color: oklch(0.62 0.14 50 / 0.35);
}

.recipe-page .recipe-step-mode {
  background-color: var(--recipe-accent-light);
  border-color: oklch(0.88 0.04 62 / 0.35);
}

.recipe-page .recipe-step-mode__counter {
  color: var(--recipe-accent);
}

.recipe-page .recipe-step-mode__btn--primary {
  background-color: oklch(0.62 0.14 50 / 0.1);
  border-color: oklch(0.62 0.14 50 / 0.25);
  color: var(--recipe-accent-dark);
}

.recipe-page .recipe-step-mode__btn--primary:hover:not(:disabled) {
  background-color: oklch(0.62 0.14 50 / 0.18);
}

/* Notes — warm left border */
.recipe-page .recipe-notes {
  border-inline-start-color: var(--recipe-accent);
  background-color: oklch(0.62 0.14 50 / 0.04);
}

.recipe-page .post-feedback--recipe {
  margin-block-start: var(--space-2xl);
  border-color: oklch(0.84 0.05 58 / 0.45);
  background:
    linear-gradient(145deg, oklch(0.985 0.018 80 / 0.98), oklch(0.96 0.04 62 / 0.95)),
    linear-gradient(180deg, oklch(1 0 0 / 0.65), transparent);
  box-shadow:
    0 22px 40px oklch(0.62 0.12 48 / 0.08),
    inset 0 1px 0 oklch(1 0 0 / 0.7);
}

.recipe-page .post-feedback--recipe::before {
  background:
    radial-gradient(circle at 14% 22%, oklch(0.72 0.15 62 / 0.14), transparent 36%),
    radial-gradient(circle at 86% 30%, oklch(0.62 0.14 50 / 0.14), transparent 42%),
    linear-gradient(120deg, transparent 0%, oklch(0.62 0.14 50 / 0.04) 100%);
}

.recipe-page .post-feedback--recipe .post-feedback__eyebrow {
  color: var(--recipe-accent-dark);
}

.recipe-page .post-feedback--recipe .post-feedback__title {
  color: oklch(0.33 0.05 48);
}

.recipe-page .post-feedback--recipe .post-feedback__body {
  color: oklch(0.39 0.03 45);
}

.recipe-page .post-feedback--recipe .post-feedback__link {
  border-color: oklch(0.78 0.07 58 / 0.45);
  background: linear-gradient(180deg, oklch(1 0 0 / 0.98), oklch(0.98 0.01 80 / 0.96));
  color: var(--recipe-accent-dark);
  box-shadow: 0 12px 28px oklch(0.62 0.12 48 / 0.08);
}

.recipe-page .post-feedback--recipe .post-feedback__link:hover,
.recipe-page .post-feedback--recipe .post-feedback__link:focus-visible {
  border-color: oklch(0.66 0.12 52 / 0.5);
  color: var(--recipe-accent);
  box-shadow: 0 16px 30px oklch(0.62 0.12 48 / 0.14);
}

.recipe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  align-items: stretch;
  margin-block-end: var(--space-xl);
}

.recipe-actions .recipe-servings {
  margin-block-end: 0;
}

.recipe-print-card {
  display: grid;
  gap: 0.6rem;
  min-width: min(100%, 18rem);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid oklch(0.88 0.02 62 / 0.6);
  border-radius: var(--radius-lg);
  background: var(--recipe-accent-light);
}

.recipe-print-card__link {
  gap: 0.55rem;
  width: fit-content;
  padding: 0.7rem 1rem;
  background: var(--recipe-accent-dark);
  color: white;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

.recipe-print-card__link:hover,
.recipe-print-card__link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px oklch(0.62 0.14 50 / 0.22);
  background: oklch(0.40 0.13 44);
}

.recipe-print-card__hint {
  color: oklch(0.38 0.04 252);
  font-size: 0.95rem;
  line-height: 1.55;
}@media (max-width: 40rem) {
  .recipe-servings,
  .recipe-step-mode__nav {
    width: 100%;
  }

  .recipe-step-mode__nav {
    flex-direction: column;
  }

  .recipe-page {
    padding-block-start: calc(var(--navbar-height) + 1rem);
  }

  .recipe-page .post-article {
    margin-block-start: 0;
  }

  .recipe-page .post-header {
    padding-block-end: var(--space-lg);
  }

  .recipe-page .post-header__meta {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 0.55rem;
    display: grid;
    margin-block-end: var(--space-lg);
  }

  .recipe-page .post-header__date {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
  }

  .recipe-page .post-header__title {
    font-size: clamp(2.1rem, 11vw, 3rem);
    line-height: 1.08;
    margin-block-end: 0.75rem;
  }

  .recipe-page .post-header__description {
    font-size: clamp(1rem, 4vw, 1.15rem);
    line-height: 1.72;
    margin-block-end: var(--space-md);
  }

  .recipe-page .recipe-timings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .recipe-page .recipe-timing {
    min-width: 0;
    padding: 0.95rem 1rem;
    border-inline-end: 1px solid oklch(0.9 0.01 106);
    border-block-end: 1px solid oklch(0.9 0.01 106);
  }

  .recipe-page .recipe-timing:nth-child(2n) {
    border-inline-end: none;
  }

  .recipe-page .recipe-timing:nth-last-child(-n + 2) {
    border-block-end: none;
  }

  .recipe-page .recipe-timing__value {
    font-size: 1.2rem;
  }

  .recipe-page .post-header__tags {
    gap: 0.45rem;
  }

  .recipe-page .post-header__tag {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
  }

  .recipe-body {
    gap: var(--space-xl);
    margin-block-start: var(--space-lg);
  }

  .recipe-actions {
    gap: 0.75rem;
    margin-block-end: var(--space-lg);
  }

  .recipe-sidebar .recipe-servings {
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0.95rem 1rem;
  }

  .recipe-sidebar .recipe-servings__controls {
    margin-inline-start: auto;
  }

  .recipe-print-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 0.9rem 1rem;
  }

  .recipe-print-card__link {
    justify-content: center;
    width: 100%;
  }

  .recipe-section__header {
    align-items: stretch;
  }

  .recipe-step-toggle {
    justify-content: center;
    width: 100%;
    display: inline-flex;
  }

  .recipe-page .recipe-step {
    grid-template-columns: 1.9rem 1fr;
    gap: 0.8rem;
    padding-block: 1rem;
  }

  .recipe-page .recipe-step::before {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.78rem;
  }

  .recipe-page .recipe-ingredient {
    gap: 0.45rem;
    font-size: 0.92rem;
  }

  .recipe-page .recipe-ingredient__amount {
    min-width: 2.1rem;
  }

  .recipe-page .recipe-ingredient__unit {
    min-width: 2.2rem;
  }
}
