/* color-scheme объявлена в base.css. Здесь не дублируем. */

@layer detail-tokens {
  .detail-page {
    --detail-radius-xs: 8px;
    --detail-radius-sm: 14px;
    --detail-radius-md: 16px;
    --detail-radius-base: 22px;
    --detail-radius-lg: calc(var(--detail-radius-base) + 2px);
    --detail-radius-xl: calc(var(--detail-radius-base) + 6px);
    --detail-radius-pill: 999px;

    --detail-border-soft: rgb(20 33 43 / 0.08);
    --detail-border-faint: rgb(20 33 43 / 0.06);
    --detail-border-strong: rgb(20 33 43 / 0.12);

    --detail-shadow-soft: 0 8px 20px rgb(20 33 43 / 0.04);
    --detail-shadow-card-hover: 0 12px 24px rgb(20 33 43 / 0.12);
    --detail-shadow-button: 0 14px 28px rgb(139 115 85 / 0.22);
    --detail-shadow-button-hover: 0 16px 32px rgb(139 115 85 / 0.30);

    --detail-green-1: #a8874e;
    --detail-green-2: #8b6e3a;
    --detail-green-3: #6e5830;

    --detail-text-main: #24313a;
    --detail-text-secondary: #223038;
    --detail-text-muted: rgb(247 242 234 / 0.82);
    --detail-text-muted-2: rgb(247 242 234 / 0.76);

    --detail-header-radius: 32px;
    --detail-header-radius-mobile: 28px;
    --detail-gallery-transition: 520ms cubic-bezier(0.22, 0.61, 0.36, 1);

    --detail-space-3xs: 0.25rem;
    --detail-space-2xs: 0.45rem;
    --detail-space-xs: 0.65rem;
    --detail-space-sm: 0.85rem;
    --detail-space-md: 0.95rem;
    --detail-space-stack: 0.9rem;
    --detail-space-lg: 1rem;
    --detail-space-lg-tight: 1.05rem;
    --detail-space-xl: 1.15rem;
    --detail-space-content-pad: 1.2rem;
    --detail-space-layout: 1.25rem;
    --detail-space-grid: 1.35rem;
    --detail-space-header-top: 1.55rem;
    --detail-space-2xl: 1.6rem;
    --detail-space-3xl: 1.85rem;

    --detail-space-card-inline: 1.05rem;

    --detail-topbar-pill-min-height: 34px;
    --detail-topbar-pill-padding-block: 0.52rem;

    --detail-focus-outline-width: 2px;
    --detail-focus-outline-color: rgb(168 135 78 / 0.55);
    --detail-focus-outline-offset: 2px;
    --detail-focus-ring: 0 0 0 4px rgb(168 135 78 / 0.12);
  }
}

@layer detail-page {
  .detail-page {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    margin-inline: auto;
    container-type: inline-size;
    container-name: detail-page;
  }

  .site-messages {
    padding-block-start: var(--detail-space-lg);
  }

  .detail-page__back-link {
    align-self: flex-start;
    margin-block: var(--detail-space-xs);
    color: var(--ink-soft);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
  }

  .detail-page__back-link:hover,
  .detail-page__back-link:focus-visible {
    color: var(--brand);
    text-decoration: underline;
  }

.site-message {
    margin-block-end: 0.75rem;
    padding-block: 1rem;
    padding-inline: clamp(1rem, 2.4vw, 1.5rem);
    border-radius: 18px;
    border: 1px solid var(--detail-border-soft);
    background: var(--surface-soft);
    color: var(--ink);
    box-shadow: var(--detail-shadow-soft);
    line-height: 1.45;
  }

  .site-message--success {
    border-color: rgb(168 135 78 /0.18);
    border-inline-start-width: 4px;
    background:
      linear-gradient(135deg, rgb(168 135 78 /0.14), rgb(168 135 78 /0.07));
    box-shadow:
      0 12px 24px rgb(168 135 78 /0.08),
      inset 0 1px 0 rgb(255 255 255 / 0.35);
  }

  .site-message--warning {
    border-color: rgb(185 117 20 / 0.18);
    background: rgb(185 117 20 / 0.08);
  }

  .site-message--error {
    border-color: rgb(160 49 49 / 0.18);
    background: rgb(160 49 49 / 0.08);
  }

  .detail-page__breadcrumb {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    inline-size: 100%;
    max-inline-size: 980px;
    margin-inline: auto;
    margin-block-start: -1.25rem;
    margin-block-end: 0.75rem;
    padding-block: 0.75rem;
    padding-inline: var(--detail-space-2xl);
  }

  .detail-page__breadcrumb-list {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    list-style: none;
    min-inline-size: 0;
    margin: 0;
    padding: 0;
    font-size: 0.84rem;
    color: var(--ink-soft);
  }

  .detail-page__breadcrumb-item + .detail-page__breadcrumb-item::before {
    content: "/";
    margin-inline-end: 0.5rem;
    color: var(--ink-soft);
    opacity: 0.5;
  }

  .detail-page__breadcrumb-item a {
    color: var(--ink-soft);
    text-decoration: none;
  }

  .detail-page__breadcrumb-item a:hover,
  .detail-page__breadcrumb-item a:focus-visible {
    color: var(--brand);
    text-decoration: none;
  }

  .detail-page__breadcrumb-item--current {
    color: var(--ink);
    font-weight: 600;
  }

  .detail-page__breadcrumb-date {
    flex: 0 0 auto;
    font-size: 0.84rem;
    color: var(--ink-soft);
    white-space: nowrap;
  }

  /* ── Shared white container: category nav + gallery ── */
  .detail-gallery-block {
    background: var(--surface);
    border-inline: 1px solid var(--line);
    margin-block-end: 0;
  }

  /* Gallery inside the block inherits the container's bg/border */
  .detail-gallery-block .recipe-gallery {
    background: none;
    border-inline: none;
  }

  /* Category nav sits above the gallery inside the white block */
  .category-nav-block--detail {
    margin: 0;
    padding-block: 0.75rem 0;
    padding-inline: var(--detail-space-lg);
    gap: 0.5rem;
  }

  .category-nav-block--detail .category-nav-wrap::after {
    background: linear-gradient(to bottom, transparent, var(--surface));
  }

  .detail-page__header {
    position: relative;
    overflow: hidden;
    color: #f7f2ea;
    border-radius: var(--detail-header-radius) var(--detail-header-radius) 0 0;
    background:
      linear-gradient(90deg, rgb(11 24 18 / 0.72) 0%, rgb(11 24 18 / 0.48) 36%, rgb(11 24 18 / 0.24) 58%, rgb(11 24 18 / 0.44) 100%),
      linear-gradient(180deg, rgb(11 24 18 / 0.24) 0%, rgb(11 24 18 / 0.42) 100%),
      var(--detail-hero-image, url("../images/hero.00ccbe74ac4b.jpg")) center / cover no-repeat;
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / 0.08),
      0 22px 46px rgb(11 45 32 / 0.16);
  }

  .detail-page__header::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(180deg, rgb(255 255 255 / 0.04), transparent 24%),
      linear-gradient(0deg, rgb(11 24 18 / 0.16), transparent 38%);
    pointer-events: none;
  }

  .detail-page__header-inner {
    position: relative;
    z-index: 1;
    max-width: 980px;
    margin-inline: auto;
    padding-block-start: var(--detail-space-header-top);
    padding-block-end: var(--detail-space-3xl);
    padding-inline: var(--detail-space-lg);
  }

  .detail-page__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--detail-space-sm);
    margin-block-end: var(--detail-space-layout);
  }

  .detail-page__taxonomy {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex-wrap: wrap;
  }

  .detail-page__taxonomy-chip {
    display: inline-flex;
    align-items: center;
    min-height: var(--detail-topbar-pill-min-height);
    padding-block: var(--detail-topbar-pill-padding-block);
    padding-inline: 0.82rem;
    border-radius: var(--detail-radius-pill);
    border: 1px solid rgb(255 255 255 / 0.16);
    background: rgb(247 242 234 / 0.03);
    color: rgb(255 250 245 / 0.97);
    font-size: 0.82rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
    white-space: nowrap;
  }

  .detail-page__taxonomy-chip--muted {
    color: rgb(255 250 245 / 0.92);
  }

  .detail-page__taxonomy-divider {
    color: rgb(255 250 245 / 0.62);
    font-size: 0.95rem;
    line-height: 1;
  }

  :where(.detail-page__timing-pill, .detail-page__action-pill),
  :where(.detail-page__action-pill:visited) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: var(--detail-topbar-pill-min-height);
    padding-block: var(--detail-topbar-pill-padding-block);
    padding-inline: var(--detail-space-lg);
    border-radius: var(--detail-radius-pill);
    border: 1px solid rgb(255 255 255 / 0.16);
    background: rgb(247 242 234 / 0.03);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06);
    backdrop-filter: blur(8px);
    white-space: nowrap;
    color: #ffffff;
  }

  .detail-page__action-pill,
  .detail-page__action-pill:visited {
    text-decoration: none;
    outline: var(--detail-focus-outline-width) solid transparent;
    outline-offset: var(--detail-focus-outline-offset);
  }

  .detail-page__timing-item {
    display: inline-flex;
    align-items: center;
    gap: var(--detail-space-2xs);
  }

  .detail-page__timing-label {
    color: var(--detail-text-muted);
    font-size: 0.82rem;
    line-height: 1;
    font-weight: 500;
  }

  .detail-page__action-label {
    color: var(--detail-text-muted);
    font-size: 0.9rem;
    line-height: 1;
    font-weight: 500;
  }

  .detail-page__timing-value {
    color: #ffffff;
    font-size: 0.82rem;
    line-height: 1;
    font-weight: 700;
  }

  .detail-page__action-value {
    color: #ffffff;
    font-size: 0.95rem;
    line-height: 1;
    font-weight: 700;
  }

  .detail-page__timing-dot {
    color: rgb(247 242 234 / 0.5);
    font-size: 0.82rem;
    line-height: 1;
  }

  .detail-page__action-pill:hover,
  .detail-page__action-pill:focus-visible {
    background: rgb(247 242 234 / 0.16);
    border-color: rgb(255 255 255 / 0.24);
    color: #ffffff;
    text-decoration: none;
  }

  .detail-page__action-pill:focus-visible {
    outline-color: var(--detail-focus-outline-color);
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / 0.06),
      var(--detail-focus-ring);
  }

  .detail-page__hero-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .detail-page__header--recipe .detail-page__hero-copy {
    inline-size: 100%;
    max-inline-size: 100%;
  }

  .detail-page__header h1 {
    max-width: 12ch;
    margin-block-end: 0.9rem;
    color: #fffdf9;
    font-size: clamp(2.65rem, 4.7vw, 5.05rem);
    line-height: 0.93;
    letter-spacing: -0.05em;
    text-wrap: balance;
    overflow-wrap: anywhere;
    text-shadow: 0 2px 12px rgb(8 35 24 / 0.22);
  }

  .detail-page--article .detail-page__header h1 {
    max-width: 18ch;
    width: auto;
    white-space: normal;
    text-wrap: balance;
  }

  .detail-page__header .eyebrow {
    color: rgb(247 242 234 / 0.9);
    margin-block-end: var(--detail-space-xs);
  }

  .detail-page__meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--detail-space-2xs);
    margin-block-end: 0.9rem;
    padding-block: 0.55rem;
    padding-inline: 0.9rem;
    background: rgb(247 242 234 / 0.03);
    border: 1px solid rgb(247 242 234 / 0.14);
    border-radius: var(--detail-radius-pill);
    font-size: 0.95rem;
    line-height: 1.45;
    color: rgb(247 242 234 / 0.96);
  }

  .detail-page__intro {
    max-width: 58ch;
    margin-inline: auto;
    margin-block-end: 1.05rem;
    font-size: 1.08rem;
    line-height: 1.72;
    color: rgb(255 248 240 / 0.94);
    text-wrap: pretty;
    overflow-wrap: anywhere;
  }

  .detail-page__header--recipe .detail-page__intro {
    inline-size: 100%;
    max-inline-size: 100%;
  }

  .detail-page__author {
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    min-height: 44px;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0.18rem 0;
    border-radius: var(--detail-radius-pill);
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .detail-page__author-label {
    font-size: 0.86rem;
    line-height: 1;
    color: var(--ink-soft);
  }

  .detail-page__author-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    color: var(--ink);
    text-decoration: none;
    outline: var(--detail-focus-outline-width) solid transparent;
    outline-offset: var(--detail-focus-outline-offset);
  }

  .detail-page__author-link:hover,
  .detail-page__author-link:focus-visible {
    color: var(--brand);
    text-decoration: none;
  }

  .detail-page__author-link:focus-visible {
    outline-color: rgb(168 135 78 /0.32);
    outline-offset: 3px;
    border-radius: 999px;
  }

  .detail-page__author-avatar {
    display: block;
    inline-size: 40px;
    block-size: 40px;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 50%;
  }

  .detail-page__author-avatar--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgb(247 242 234 / 0.12);
    color: #ffffff;
    font-size: 0.88rem;
    line-height: 1;
    font-weight: 700;
  }

  .detail-page__author-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.96rem;
    line-height: 1.2;
    font-weight: 700;
    color: currentColor;
  }

  .detail-page__header .detail-page__author-label,
  .detail-page__header .detail-page__author-link {
    color: #fff8ee;
  }

  .detail-page__header .detail-page__author {
    min-height: 36px;
    padding: 0.42rem 0.82rem;
    border: 1px solid rgb(255 255 255 / 0.16);
    border-radius: 999px;
    background: rgb(247 242 234 / 0.1);
    box-shadow: 0 8px 18px rgb(0 0 0 / 0.1);
    backdrop-filter: blur(6px);
    transition:
      background-color 0.32s ease,
      color 0.32s ease,
      box-shadow 0.32s ease;
  }

  .detail-page__header .detail-page__author:hover,
  .detail-page__header .detail-page__author:focus-within {
    background: rgb(247 242 234 / 0.26);
    border-color: rgb(255 255 255 / 0.24);
    box-shadow: 0 10px 22px rgb(0 0 0 / 0.12);
  }

  .detail-page__header .detail-page__author-link:hover,
  .detail-page__header .detail-page__author-link:focus-visible {
    color: #ffffff;
  }

  .recipe-gallery {
    --gallery-stage-height: clamp(250px, 28vw, 420px);
    --gallery-main-width: min(46%, 560px);
    --gallery-side-width: min(38%, 460px);
    /* tuned for balanced side-image peek without overpowering the main slide */
    --gallery-side-shift: 28%;
    --gallery-side-scale: 0.92;
    --gallery-arrow-size: 56px;
    /* --gallery-side-center-offset removed; arrows are now edge-anchored */

    background: var(--surface);
    padding-block: var(--detail-space-lg) 0;
    padding-inline: var(--detail-space-lg);
    border-inline: 1px solid var(--line);
    border-radius: 0;
    overflow: hidden;
    outline: var(--detail-focus-outline-width) solid transparent;
    outline-offset: var(--detail-focus-outline-offset);
  }

  .recipe-gallery:focus-visible {
    outline-color: var(--detail-focus-outline-color);
    box-shadow:
      inset 0 0 0 2px rgb(168 135 78 /0.24),
      var(--detail-focus-ring);
  }

  .recipe-gallery__viewport {
    position: relative;
    width: 100%;
    height: var(--gallery-stage-height);
  }

  .recipe-gallery__stage {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .recipe-gallery__item {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 50%;
    width: var(--gallery-main-width);
    margin: 0;
    transform: translate(-50%, -50%) scale(0.9);
    transform-origin: center center;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transition:
      transform var(--detail-gallery-transition),
      opacity var(--detail-gallery-transition),
      width var(--detail-gallery-transition),
      filter var(--detail-gallery-transition);
  }

  .recipe-gallery__item.is-current,
  .recipe-gallery__item.is-prev,
  .recipe-gallery__item.is-next {
    will-change: transform, opacity;
  }

  .recipe-gallery__image-shell {
    position: relative;
    overflow: hidden;
    border-radius: var(--detail-radius-lg);
    border: 1px solid var(--line);
    background: var(--surface-soft);
    box-shadow: var(--shadow-sm);
  }

  .recipe-gallery__media {
    display: block;
    width: 100%;
    height: var(--gallery-stage-height);
    object-fit: cover;
    background: #000;
  }

  .recipe-gallery__item.is-current {
    width: var(--gallery-main-width);
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
    z-index: 3;
    filter: none;
  }

  .recipe-gallery__item.is-prev {
    width: var(--gallery-side-width);
    transform: translate(calc(-50% - var(--gallery-side-shift)), -50%) scale(var(--gallery-side-scale));
    opacity: 0.5;
    pointer-events: auto;
    z-index: 2;
    cursor: pointer;
  }

  .recipe-gallery__item.is-next {
    width: var(--gallery-side-width);
    transform: translate(calc(-50% + var(--gallery-side-shift)), -50%) scale(var(--gallery-side-scale));
    opacity: 0.5;
    pointer-events: auto;
    z-index: 2;
    cursor: pointer;
  }

  .recipe-gallery__item.is-hidden,
  .recipe-gallery__item.is-far-prev,
  .recipe-gallery__item.is-far-next {
    opacity: 0;
    pointer-events: none;
    z-index: 1;
  }

  .recipe-gallery__item.is-far-prev {
    transform: translate(calc(-50% - 54%), -50%) scale(0.84);
  }

  .recipe-gallery__item.is-far-next {
    transform: translate(calc(-50% + 54%), -50%) scale(0.84);
  }

  .recipe-gallery__item.is-prev:hover,
  .recipe-gallery__item.is-next:hover {
    opacity: 0.62;
  }

  .recipe-gallery__item.is-prev:focus-visible,
  .recipe-gallery__item.is-next:focus-visible {
    opacity: 0.7;
    outline: var(--detail-focus-outline-width) solid var(--detail-focus-outline-color);
    outline-offset: 4px;
  }

  .recipe-gallery__arrow {
    position: absolute;
    inset-block-start: 50%;
    width: var(--gallery-arrow-size);
    height: var(--gallery-arrow-size);
    display: grid;
    place-items: center;
    border: 1px solid rgb(255 255 255 / 0.18);
    border-radius: var(--detail-radius-pill);
    background: rgb(12 18 14 / 0.48);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 16px rgb(0 0 0 / 0.22);
    z-index: 5;
    outline: var(--detail-focus-outline-width) solid transparent;
    outline-offset: var(--detail-focus-outline-offset);
    transition:
      transform 180ms ease,
      background-color 180ms ease,
      border-color 180ms ease,
      box-shadow 180ms ease,
      opacity 180ms ease;
  }

  .recipe-gallery__arrow[hidden] {
    display: none;
  }

  .recipe-gallery__arrow[aria-disabled="true"] {
    pointer-events: none;
    opacity: 0.45;
  }

  .recipe-gallery__arrow--prev {
    inset-inline-start: calc(50% - var(--gallery-main-width) / 2 - var(--gallery-arrow-size) / 2);
    inset-inline-end: auto;
    transform: translateY(-50%);
  }

  .recipe-gallery__arrow--next {
    inset-inline-start: auto;
    inset-inline-end: calc(50% - var(--gallery-main-width) / 2 - var(--gallery-arrow-size) / 2);
    transform: translateY(-50%);
  }

  .recipe-gallery__arrow:hover {
    background: rgb(12 18 14 / 0.70);
    border-color: rgb(255 255 255 / 0.30);
    box-shadow: 0 4px 20px rgb(0 0 0 / 0.32);
  }

  .recipe-gallery__arrow--prev:hover,
  .recipe-gallery__arrow--next:hover {
    transform: translateY(-50%);
  }

  .recipe-gallery__arrow:active {
    transform: translateY(-50%) scale(0.92);
    background-color: rgb(8 12 10 / 0.80);
    transition-duration: 80ms;
  }

  .recipe-gallery__arrow:focus-visible {
    outline-color: var(--detail-focus-outline-color);
    box-shadow:
      var(--detail-shadow-card-hover),
      var(--detail-focus-ring);
  }

  .recipe-gallery__caption {
    min-height: 2rem;
    padding-block: 0.9rem var(--detail-space-lg);
    padding-inline: var(--detail-space-3xs);
    text-align: center;
    font-size: 0.98rem;
    line-height: 1.5;
    color: var(--ink-soft);
  }

  .recipe-gallery--single .recipe-gallery__viewport {
    height: var(--gallery-stage-height);
  }

  .recipe-gallery--single .recipe-gallery__item {
    width: min(860px, 100%);
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }

  .recipe-gallery--single .recipe-gallery__caption {
    text-align: center;
  }

  .detail-page__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding-block: 0.75rem;
    padding-inline: var(--detail-space-xl);
    border-radius: 0;
    background: var(--surface);
    border-inline: 1px solid var(--line);
  }

  .detail-page__share {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  :where(.detail-page__action-btn, .detail-page__copy-btn),
  :where(.detail-page__action-btn, .detail-page__copy-btn):visited {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding-block: 0.45rem;
    padding-inline: 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 0.82rem;
    line-height: 1;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    background: var(--surface);
    cursor: pointer;
  }

  :where(.detail-page__action-btn, .detail-page__copy-btn):hover,
  :where(.detail-page__action-btn, .detail-page__copy-btn):focus-visible {
    color: var(--brand);
    border-color: var(--brand);
    text-decoration: none;
  }

  .detail-page__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(290px, 0.92fr);
    row-gap: var(--detail-space-grid);
    column-gap: var(--detail-space-xl);
    align-items: start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-block-start: none;
    border-radius: 0;
    padding-block: var(--detail-space-md) var(--detail-space-xl);
    padding-inline: var(--detail-space-xl);
  }

  .detail-page__actions + .detail-page__grid {
    padding-block-start: 0;
  }

  .detail-page__grid--single {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-page__grid--article {
    grid-template-columns: minmax(0, 1.72fr) minmax(250px, 0.78fr);
    gap: var(--detail-space-2xl);
    padding: var(--detail-space-xl);
  }

  :where(.detail-page__main, .detail-page__sidebar) {
    min-width: 0;
  }

  .detail-page__main,
  .detail-page__sidebar,
  .comments-forms,
  .comments-list,
  .recipe-form {
    display: flex;
    flex-direction: column;
    gap: var(--detail-space-stack);
  }

  .detail-page__section h2 {
    margin: 0;
    font-size: clamp(1.2rem, 1.6vw, 1.4rem);
    line-height: 1.05;
    text-align: center;
  }

  .detail-page__section + .detail-page__section {
    margin-block-start: 0.05rem;
  }

  .detail-page__section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.45rem;
    margin-block-end: 0.45rem;
    text-align: center;
  }

  .detail-page__section-head > h2 {
    flex: 1 1 100%;
  }

  .detail-page__section-head:not(:has(.detail-page__section-note)) {
    justify-content: center;
    text-align: center;
  }

  .detail-page__section-note {
    flex: 1 1 100%;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--ink-soft);
    text-align: center;
  }

  .recipe-summary {
    background: var(--surface-soft);
    border: 1px solid var(--detail-border-soft);
    border-radius: var(--detail-radius-lg);
    padding: 0.55rem;
    box-shadow: var(--detail-shadow-soft);
  }

  .recipe-summary__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .recipe-summary__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.08rem;
    min-block-size: 54px;
    padding-block: 0.5rem;
    padding-inline: 0.62rem;
    border-radius: var(--detail-radius-sm);
    background: #ffffff;
    border: 1px solid var(--detail-border-faint);
    text-align: center;
  }

  .recipe-summary__item--rating {
    grid-column: span 2;
  }

  .recipe-summary__label {
    font-size: 0.76rem;
    line-height: 1.15;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ink-soft);
    font-weight: 700;
    text-align: center;
  }

  .recipe-summary__value {
    font-size: 1.08rem;
    line-height: 1.15;
    color: var(--ink);
    font-weight: 700;
    text-align: center;
  }

  .rating-overview {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.22rem 0.4rem;
    margin-block-start: 0.06rem;
  }

  .rating-overview__stars {
    position: relative;
    display: inline-block;
    font-size: 0.78rem;
    line-height: 1;
    letter-spacing: 0.1em;
  }

  .rating-overview__stars-base {
    color: rgb(20 33 43 / 0.18);
  }

  .rating-overview__stars-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--rating-fill, 0%);
    overflow: hidden;
    white-space: nowrap;
    color: #d89b2b;
  }

  .rating-overview__count {
    font-size: 0.7rem;
    color: var(--ink-soft);
    text-align: center;
  }

  .ingredients-panel {
    background: var(--surface-soft);
    border: 1px solid var(--detail-border-soft);
    border-radius: var(--detail-radius-lg);
    padding: 0;
    box-shadow: var(--detail-shadow-soft);
    overflow: hidden;
  }

  .ingredients-panel__head,
  .method-panel__head {
    padding: 0.75rem 1rem 0.7rem;
    border-bottom: 1px solid var(--detail-border-soft);
    text-align: center;
  }

  .ingredients-panel__head h2,
  .method-panel__head h2 {
    margin: 0;
  }

  .ingredients-panel__scroll {
    height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  }

  .ingredients-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .ingredients-list__item + .ingredients-list__item {
    border-block-start: 1px solid rgb(20 33 43 / 0.07);
  }

  .ingredient-check {
    position: relative;
    display: grid;
    grid-template-columns: 18px 1fr;
    align-items: start;
    gap: 0.6rem;
    padding-block: 0.72rem;
    padding-inline: 0.75rem;
    cursor: pointer;
  }

  .ingredient-check__input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* Fixed decorative square controls intentionally keep width/height
     for readability; logical sizing is reserved for accessibility utilities. */
  .ingredient-check__box {
    position: relative;
    width: 18px;
    height: 18px;
    margin-block-start: 0.12rem;
    border-radius: var(--detail-radius-xs);
    border: 1px solid rgb(20 33 43 / 0.16);
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.7);
    transition:
      border-color 160ms ease,
      background-color 160ms ease,
      box-shadow 160ms ease,
      transform 160ms ease;
  }

  .ingredient-check__box::after {
    content: "";
    position: absolute;
    inset: 2px 5px 4px 5px;
    border-right: 2px solid transparent;
    border-bottom: 2px solid transparent;
    transform: rotate(45deg);
    opacity: 0;
    transition:
      opacity 160ms ease,
      border-color 160ms ease;
  }

  .ingredient-check__input:focus-visible + .ingredient-check__box {
    outline: var(--detail-focus-outline-width) solid var(--detail-focus-outline-color);
    outline-offset: var(--detail-focus-outline-offset);
    box-shadow: var(--detail-focus-ring);
  }

  .ingredient-check__input:checked + .ingredient-check__box {
    background: linear-gradient(135deg, var(--detail-green-1) 0%, var(--detail-green-2) 100%);
    border-color: var(--detail-green-1);
    box-shadow: 0 6px 14px rgb(139 115 85 /0.16);
  }

  .ingredient-check__input:checked + .ingredient-check__box::after {
    border-color: #ffffff;
    opacity: 1;
  }

  .ingredient-check__text {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem;
    font-size: 0.98rem;
    line-height: 1.5;
    color: var(--ink);
    text-wrap: pretty;
  }

  .ingredient-check__name {
    color: var(--ink);
    font-weight: 700;
  }

  /* Colon separator only when a detail span follows */
  .ingredient-check__text:has(.ingredient-check__detail) .ingredient-check__name::after {
    content: ":";
  }

  .ingredient-check__detail {
    color: var(--detail-text-secondary);
  }

  .method-panel {
    background: var(--surface-soft);
    border: 1px solid var(--detail-border-soft);
    border-radius: var(--detail-radius-lg);
    padding: 0;
    box-shadow: var(--detail-shadow-soft);
    overflow: hidden;
  }

  .method-panel__scroll {
    height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  }

  .method-steps {
    counter-reset: recipe-method-step;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .method-steps__item {
    counter-increment: recipe-method-step;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
    padding-block: 0.72rem;
    padding-inline: 0.75rem;
    border-block-start: 1px solid rgb(20 33 43 / 0.07);
  }

  .method-steps__item:first-child {
    border-block-start: none;
  }

  /* Fixed decorative square controls intentionally keep width/height
     for readability; logical sizing is reserved for accessibility utilities. */
  .method-steps__item::before {
    content: counter(recipe-method-step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--detail-green-1) 0%, var(--detail-green-2) 100%);
    color: #ffffff;
    font-size: 0.72rem;
    line-height: 1;
    font-weight: 700;
    box-shadow: 0 6px 12px rgb(139 115 85 /0.14);
  }

  .method-steps__body {
    display: flex;
    align-items: center;
    min-height: 22px;
  }

  .method-steps__body p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.62;
    color: var(--detail-text-main);
    text-wrap: pretty;
  }

  .comments-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    inline-size: 100%;
    max-inline-size: 900px;
    margin-inline: auto;
    background: var(--surface-soft);
    border: 1px solid var(--detail-border-soft);
    border-radius: var(--detail-radius-lg);
    padding: 0.35rem;
    box-shadow: var(--detail-shadow-soft);
  }

  .comments-panel .comments-list {
    gap: 0.5rem;
  }

  .comments-panel__form {
    background: #ffffff;
    border: 1px solid var(--detail-border-faint);
    border-radius: var(--detail-radius-base);
    padding: 1rem;
  }

  .comment-compose__topbar {
    display: flex;
    justify-content: flex-end;
  }

  .comment-compose__login-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--brand);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 140ms ease;
  }

  .comment-compose__login-link:hover {
    opacity: 0.75;
    text-decoration: underline;
  }

  /* compose form — reference layout */
  .comment-compose {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
  }

  .comment-compose__avatar {
    flex-shrink: 0;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    overflow: hidden;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    font-family: var(--font-ui, sans-serif);
    margin-block-start: 0.1rem;
  }

  .comment-compose__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .comment-compose__right {
    flex: 1;
    min-inline-size: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }

  .comment-compose__right {
    border: 1px solid var(--detail-border-soft);
    border-radius: var(--detail-radius-base);
    background: var(--surface-soft);
    padding-block-end: 0.65rem;
    padding-inline: 0.75rem;
  }

  .comment-compose__editor {
    margin-inline: -0.75rem;
    margin-block-start: 0;
  }

  .comment-compose__editor textarea {
    display: block;
    width: 100%;
    min-height: 6.5rem;
    padding: 0.75rem 0.9rem;
    border: none;
    outline: none;
    font: inherit;
    font-size: 0.95rem;
    color: var(--ink);
    background: transparent;
    resize: vertical;
    line-height: 1.6;
    border-radius: calc(var(--detail-radius-base) - 2px) calc(var(--detail-radius-base) - 2px) 0 0;
  }

  .comment-compose__editor textarea::placeholder {
    color: var(--ink-soft);
    opacity: 0.6;
    font-style: italic;
  }

  .comment-compose__toolbar {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    padding: 0.3rem 0.5rem;
    border-block-start: 1px solid var(--detail-border-soft);
    border-block-end: 1px solid var(--detail-border-soft);
    background: color-mix(in srgb, var(--surface-soft) 60%, #fff);
    margin-block-end: 0.55rem;
  }

  .comment-compose__toolbar-toggle {
    display: none;
  }

  .comment-compose__tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    background: transparent;
    color: var(--ink-soft);
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    border-radius: 3px;
    transition: background 100ms ease, color 100ms ease;
  }

  .comment-compose__tool:hover {
    background: var(--detail-border-soft);
    color: var(--ink);
  }

  .comment-compose__tool-sep {
    display: inline-block;
    width: 1px;
    height: 1.1rem;
    background: var(--detail-border-soft);
    margin-inline: 0.25rem;
  }

  .comment-compose__rating {
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }

  .comment-compose__rating-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-soft);
    white-space: nowrap;
  }

  .comment-compose__stars {
    display: flex;
    gap: 0.15rem;
  }

  .comment-compose__star {
    cursor: pointer;
    color: var(--ink-soft);
    opacity: 0.35;
    transition: color 80ms ease, opacity 80ms ease;
  }

  .comment-compose__star input {
    display: none;
  }

  .comment-compose__star svg {
    display: block;
  }

  .comment-compose__star.is-active {
    color: var(--brand);
    opacity: 1;
  }

  .comment-compose__star.is-active svg {
    fill: currentColor;
  }

  .comment-compose__stars--readonly {
    pointer-events: none;
  }

  .comment-compose__stars--readonly .comment-compose__star {
    cursor: default;
  }

  .comment-compose__bottom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .comment-compose__posting-as {
    font-size: 0.82rem;
    color: var(--ink-soft);
    line-height: 1.3;
    flex: 1;
  }

  .comment-compose__posting-as strong {
    color: var(--ink);
    font-weight: 700;
  }

  /* Force visible gold pill at all times — overrides .detail-button base and
     all btn--ready / btn--not-ready states via chained selector specificity */
  .comment-compose .comment-compose__submit {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding-block: 0.55rem;
    padding-inline: 1.4rem;
    background: #a8874e;
    color: #fff;
    border: none;
    border-radius: var(--detail-radius-pill);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 14px rgb(168 135 78 / 0.28);
    transition: background 140ms ease, transform 80ms ease, box-shadow 140ms ease;
  }

  .comment-compose .comment-compose__submit:hover {
    background: #8b6e3a;
    box-shadow: 0 6px 18px rgb(168 135 78 / 0.38);
  }

  .comment-compose .comment-compose__submit:active {
    transform: scale(0.97);
  }

  .comments-panel__login-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.5rem;
    margin: 0;
    padding: 0;
    text-align: center;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    color: var(--ink-soft);
  }

  .comment-compose__turnstile {
    flex: 1 1 100%;
    margin-block-start: 0.5rem;
    min-inline-size: 0;
  }

  .detail-page__sidebar .detail-page__card--form .recipe-form {
    align-items: center;
  }

  .detail-page__sidebar .detail-page__card--form .recipe-form > :not(.detail-button) {
    inline-size: 100%;
  }

  .detail-page__sidebar .detail-page__card--form .detail-button {
    align-self: center;
  }

  :where(.comment-card, .empty-state-card, .detail-page__card) {
    background: var(--surface-soft);
    border: 1px solid var(--detail-border-soft);
    border-radius: var(--detail-radius-base);
    padding-inline: var(--detail-space-card-inline);
    box-shadow: var(--detail-shadow-soft);
    overflow-wrap: break-word;
    min-inline-size: 0;
  }

  .comment-card,
  .empty-state-card {
    padding-block: var(--detail-space-3xs);
  }

  .comment-card {
    padding-inline: var(--detail-space-2xs);
  }

  .empty-state-card {
    text-align: center;
    color: var(--ink-soft);
  }

  /* comment card inner layout: avatar | main content */
  .comment-card__inner {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
  }

  .comment-card__avatar {
    flex-shrink: 0;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    overflow: hidden;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    font-family: var(--font-ui, sans-serif);
  }

  .comment-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .comment-card__main {
    flex: 1;
    min-inline-size: 0;
  }

  .comment-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    margin-block-end: 0.45rem;
  }

  .comment-card__name {
    color: var(--ink);
    font-size: 0.97rem;
    line-height: 1.3;
  }

  .comment-card__date {
    color: var(--ink-soft);
    font-size: 0.82rem;
    line-height: 1.3;
  }

  .comment-card__body {
    color: var(--detail-text-main);
    line-height: 1.7;
    font-size: 0.95rem;
  }

  .comment-card__body p {
    margin-block-end: 0.7rem;
  }

  .comment-card__body p:last-child {
    margin-block-end: 0;
  }

  /* replies — messenger style (right side) */
  .comment-reply-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }

  .comment-replies {
    margin-block-start: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }

  .comment-reply {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0.6rem;
  }

  .comment-reply__bubble {
    max-inline-size: 78%;
    min-inline-size: 0;
    overflow: hidden;
    background: color-mix(in srgb, var(--brand) 10%, var(--surface-soft));
    border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
    border-radius: var(--detail-radius-base);
    border-bottom-right-radius: 4px;
    padding: 0.65rem 0.85rem;
    box-sizing: border-box;
  }

  .comment-reply__head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-block-end: 0.3rem;
    flex-wrap: wrap;
  }

  .comment-reply__date {
    color: var(--ink-soft);
    font-size: 0.78rem;
    line-height: 1.3;
    order: -1;
  }

  .comment-reply__name {
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.3;
  }

  .comment-reply__content {
    color: var(--detail-text-main);
    line-height: 1.65;
    font-size: 0.9rem;
    text-align: left;
  }

  .comment-reply__content p {
    margin-block-end: 0.5rem;
  }

  .comment-reply__content p:last-child {
    margin-block-end: 0;
  }

  .comment-reply__actions {
    margin-block-start: 0.45rem;
    display: flex;
    justify-content: flex-end;
  }

  .comment-reply__avatar {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    overflow: hidden;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    font-family: var(--font-ui, sans-serif);
    align-self: flex-end;
  }

  .comment-reply__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .detail-page__section-head__right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .comment-delete-all-btn {
    border: 1px solid rgb(192 32 32 / 0.35);
    border-radius: 999px;
    background: transparent;
    color: #b91c1c;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    padding-block: 0.2rem;
    padding-inline: 0.75rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 140ms ease, background 140ms ease;
  }

  .comment-delete-all-btn:hover {
    opacity: 1;
    background: rgb(185 28 28 / 0.07);
  }

  .comment-delete-form {
    display: inline-flex;
    margin: 0;
  }

  .comment-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--ink-soft);
    opacity: 0.35;
    transition: opacity 140ms ease, color 140ms ease;
  }

  .comment-delete-btn:hover {
    opacity: 1;
    color: #b91c1c;
  }

  .comment-card__actions {
    margin-block-start: 0.55rem;
  }

  .comment-reply-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: none;
    background: transparent;
    color: var(--ink-soft);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    opacity: 0.6;
    transition: opacity 140ms ease, color 140ms ease;
    letter-spacing: 0.01em;
  }

  .comment-reply-toggle:hover {
    opacity: 1;
    color: var(--brand);
  }

  .comment-reply-form {
    margin-block-start: 0.75rem;
  }

  .comment-reply-form .recipe-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .comment-reply-form .recipe-form__field {
    width: 100%;
  }

  .comment-reply-form .recipe-form__field textarea {
    width: 100%;
    box-sizing: border-box;
  }

  .comment-reply-form__actions {
    display: flex;
    gap: 0.5rem;
    margin-block-start: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .comment-reply-form__turnstile {
    margin-block-start: 0.5rem;
    display: flex;
    justify-content: center;
  }

  .detail-page__card {
    padding-block: var(--detail-space-md) var(--detail-space-lg);
  }

  .detail-page__card--form {
    padding-block: var(--detail-space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .detail-page__card--form .recipe-form {
    align-items: center;
    width: 100%;
  }

  .detail-page__card--form .detail-button {
    align-self: center;
  }

  .detail-page__card--meta {
    min-height: 96px;
    text-align: center;
  }

  .detail-page__card--meta p {
    margin-block-end: 0;
  }

  .detail-page__card h2 {
    margin-block-end: 0.55rem;
    font-size: clamp(1.2rem, 1.6vw, 1.4rem);
    line-height: 1.15;
  }

  .detail-page__sidebar .detail-page__card h2 {
    text-align: center;
  }

  .detail-page__card h3 {
    margin-block-end: 0.45rem;
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1.25;
    font-weight: 700;
  }

  .detail-page__card p {
    margin-block-end: 0.8rem;
    line-height: 1.62;
    color: var(--detail-text-secondary);
  }

  .detail-page__card-copy {
    display: grid;
    gap: 0.72rem;
  }

  .detail-page__card--context,
  .detail-page__card--tips,
  .detail-page__card--author-commentary {
    overflow: hidden;
  }

  .detail-page__card--context .detail-page__card-copy,
  .detail-page__card--tips .detail-page__card-copy,
  .detail-page__card--author-commentary .detail-page__card-copy {
    height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    padding-inline-end: 0.6rem;
  }

  .detail-page__card-copy p {
    margin: 0;
    text-wrap: pretty;
  }

  /* ── Credits & Source redesign ── */
  .source-header {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.6rem;
  }

  .source-badge {
    display: inline-block;
    padding: 0.18rem 0.65rem;
    border-radius: 999px;
    background: rgb(11 76 58 / 0.08);
    border: 1px solid rgb(11 76 58 / 0.14);
    color: #0b4c3a;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .source-badge--amber {
    background: rgb(160 90 0 / 0.09);
    border-color: rgb(160 90 0 / 0.18);
    color: #7a4200;
  }

  .source-badge--slate {
    background: rgb(55 75 105 / 0.08);
    border-color: rgb(55 75 105 / 0.16);
    color: #3a4f6e;
  }

  .source-header--left {
    justify-content: flex-start;
  }

  .source-header__author {
    color: var(--ink-soft);
    font-size: 0.88rem;
  }

  .source-title {
    margin: 0 0 0.8rem;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
  }

  .source-note {
    margin: 0 0 0.85rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid rgb(11 76 58 / 0.2);
    background: rgb(11 76 58 / 0.04);
    border-radius: 0 8px 8px 0;
    color: var(--ink-soft);
    font-size: 0.85rem;
    font-style: italic;
    line-height: 1.6;
    text-align: left;
    text-wrap: pretty;
  }

  /* legacy — keep for any old templates still using these classes */
  .detail-page__source-list { display: grid; gap: 0.75rem; }
  .detail-page__source-item {
    display: grid; gap: 0.28rem;
    padding-block: 0.7rem; padding-inline: 0.85rem;
    border: 1px solid var(--detail-border-soft);
    border-radius: var(--detail-radius-sm);
    background: rgb(255 255 255 / 0.62); text-align: center;
  }
  .detail-page__source-label {
    color: var(--ink-soft); font-size: 0.82rem;
    line-height: 1.2; font-weight: 500;
  }
  .detail-page__source-links {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem;
  }
  .detail-page__source-value {
    margin: 0; color: var(--ink); font-size: 0.98rem;
    line-height: 1.45; font-weight: 600; text-wrap: pretty;
  }

  .detail-page__source-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: fit-content;
    padding-block: 0.45rem;
    padding-inline: 0.5rem;
    border: 1px solid var(--detail-border-soft);
    border-radius: 999px;
    background: #ffffff;
    color: var(--brand);
    font-size: 0.9rem;
    line-height: 1.2;
    font-weight: 700;
    text-decoration: none;
    align-self: center;
  }

  .detail-page__card--source {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .detail-page__source-link:hover,
  .detail-page__source-link:focus-visible {
    border-color: rgb(168 135 78 /0.24);
    background: rgb(168 135 78 /0.06);
    text-decoration: none;
  }

  .source-support {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.38rem;
    margin-top: 0.15rem;
    color: var(--ink-soft);
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .source-support a {
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
  }

  .source-support a:hover,
  .source-support a:focus-visible {
    text-decoration: none;
  }

  .allergen-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .allergen-list__item {
    margin: 0;
  }

  .allergen-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem 0.3rem 0.5rem;
    border: 1px solid var(--detail-border-soft);
    border-radius: var(--detail-radius-pill);
    background: rgb(255 255 255 / 0.62);
    white-space: nowrap;
  }

  .allergen-check--present {
    border-color: rgb(168 135 78 /0.18);
    background: rgb(168 135 78 /0.08);
  }

  .allergen-check__box {
    position: relative;
    inline-size: 16px;
    block-size: 16px;
    flex: 0 0 auto;
    margin-block-start: 0;
    border-radius: var(--detail-radius-xs);
    border: 1px solid rgb(20 33 43 / 0.16);
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.7);
  }

  .allergen-check--present .allergen-check__box {
    background: linear-gradient(135deg, var(--detail-green-1) 0%, var(--detail-green-2) 100%);
    border-color: var(--detail-green-1);
    box-shadow: 0 6px 14px rgb(139 115 85 /0.16);
  }

  .allergen-check--present .allergen-check__box::after {
    content: "";
    position: absolute;
    inset: 2px 5px 4px 5px;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(45deg);
  }

  .allergen-check__text {
    color: var(--ink);
    font-size: 0.82rem;
    line-height: 1.3;
    font-weight: 600;
    text-align: center;
    text-wrap: pretty;
  }

  .allergen-check--absent .allergen-check__text {
    color: var(--detail-text-secondary);
    font-weight: 500;
  }

  .detail-page__card p:last-child {
    margin-block-end: 0;
  }

  .detail-page__card a {
    color: var(--brand);
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .detail-page__card strong {
    color: var(--ink);
  }

  .detail-page__content-card {
    background: var(--surface);
    border: 1px solid var(--detail-border-soft);
    border-radius: var(--detail-radius-base);
    padding-block: var(--detail-space-xl) var(--detail-space-content-pad);
    padding-inline: var(--detail-space-content-pad);
    box-shadow: var(--detail-shadow-soft);
  }

  .detail-page__content-card .rich-text > *:first-child {
    margin-block-start: 0;
  }

  .detail-page__content-card .rich-text > *:last-child {
    margin-block-end: 0;
  }

  .recipe-form__field {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
  }

  .recipe-form__field label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink);
  }

  .recipe-form__field input,
  .recipe-form__field textarea {
    width: 100%;
    border: 1px solid var(--detail-border-strong);
    border-radius: var(--detail-radius-md);
    padding-block: var(--detail-space-sm);
    padding-inline: 0.95rem;
    font: inherit;
    line-height: 1.5;
    color: var(--ink);
    background: #ffffff;
    outline: var(--detail-focus-outline-width) solid transparent;
    outline-offset: var(--detail-focus-outline-offset);
    transition:
      border-color 160ms ease,
      box-shadow 160ms ease,
      background-color 160ms ease,
      outline-color 160ms ease;
  }

  .recipe-form__field textarea {
    block-size: 100px;
    min-block-size: 100px;
  }

  .recipe-form__field input:focus-visible,
  .recipe-form__field textarea:focus-visible {
    outline-color: var(--detail-focus-outline-color);
    border-color: rgb(168 135 78 /0.44);
    box-shadow: var(--detail-focus-ring);
  }

  .recipe-form__field--hidden {
    display: none;
  }

  .detail-button {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    inline-size: fit-content;
    min-height: 46px;
    padding-block: 0.8rem;
    padding-inline: 1.1rem;
    border: none;
    border-radius: var(--detail-radius-pill);
    background: linear-gradient(135deg, var(--detail-green-1) 0%, var(--detail-green-2) 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    outline: var(--detail-focus-outline-width) solid transparent;
    outline-offset: var(--detail-focus-outline-offset);
    box-shadow: var(--detail-shadow-button);
    transition:
      transform 180ms ease,
      box-shadow 180ms ease,
      filter 180ms ease,
      outline-color 180ms ease;
  }

  .detail-button:hover,
  .detail-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: var(--detail-shadow-button-hover);
    filter: brightness(1.02);
  }

  .detail-button:focus-visible {
    outline-color: var(--detail-focus-outline-color);
  }

  .detail-button--secondary {
    background: transparent;
    color: var(--detail-green-1);
    border: 1px solid var(--detail-green-1);
    box-shadow: none;
  }

  .detail-button--secondary:hover,
  .detail-button--secondary:focus-visible {
    background: rgb(168 135 78 /0.06);
    box-shadow: none;
    filter: none;
  }

  .rating-reset-form {
    display: inline-flex;
    margin: 0;
  }

  .rating-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--ink-soft);
    opacity: 0.45;
    transition: opacity 160ms ease, color 160ms ease;
    vertical-align: middle;
  }

  .rating-reset-btn:hover {
    opacity: 1;
    color: #c0392b;
  }

  .detail-page__card--form h2 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }

  .rating-form {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.6rem;
  }

  .rating-form__option {
    position: relative;
    display: inline-flex;
  }

  .rating-form__option input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .rating-form__option span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1.5px solid var(--detail-border-strong);
    background: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink-soft);
    cursor: pointer;
    outline: var(--detail-focus-outline-width) solid transparent;
    outline-offset: var(--detail-focus-outline-offset);
    transition:
      border-color 160ms ease,
      background-color 160ms ease,
      color 160ms ease,
      transform 160ms ease,
      box-shadow 160ms ease,
      outline-color 160ms ease;
  }

  .rating-form__option input:checked + span {
    border-color: var(--detail-green-1);
    background: linear-gradient(135deg, var(--detail-green-1), var(--detail-green-2));
    color: #ffffff;
    box-shadow: 0 6px 16px rgb(168 135 78 /0.28);
    transform: translateY(-2px);
  }

  .rating-form__option span:hover {
    border-color: var(--detail-green-1);
    background: rgb(168 135 78 /0.07);
    color: var(--detail-green-1);
    transform: translateY(-1px);
  }

  .rating-form__option input:focus-visible + span {
    outline-color: var(--detail-focus-outline-color);
    box-shadow: var(--detail-focus-ring);
  }

  .rich-text {
    color: var(--detail-text-main);
  }

  .rich-text p {
    margin-block-end: 1.1rem;
    font-size: 1.04rem;
    line-height: 1.86;
  }

  .rich-text p:last-child {
    margin-block-end: 0;
  }

  .rich-text h2,
  .rich-text h3 {
    color: var(--ink);
    letter-spacing: -0.02em;
  }

  .rich-text ul,
  .rich-text ol {
    margin-block-end: 1.15rem;
    margin-inline-start: 1.2rem;
    color: var(--detail-text-main);
  }

  .rich-text li {
    margin-block-end: 0.45rem;
    line-height: 1.75;
  }

  .rich-text blockquote {
    margin-block: 1.5rem;
    margin-inline: 0;
    padding-block: 0.8rem;
    padding-inline: 1.25rem;
    border-inline-start: 3px solid var(--brand);
    background: rgb(31 44 37 / 0.04);
    border-radius: 0 6px 6px 0;
    color: var(--ink-soft);
    font-style: italic;
  }

  .rich-text blockquote p {
    margin-block-end: 0;
  }

  @media (forced-colors: active) {
    .recipe-form__field input:focus-visible,
    .recipe-form__field textarea:focus-visible,
    .ingredient-check__input:focus-visible + .ingredient-check__box,
    .rating-form__option input:focus-visible + span,
    .detail-button:focus-visible,
    .detail-page__action-pill:focus-visible,
    .recipe-gallery:focus-visible,
    .recipe-gallery__arrow:focus-visible {
      outline-color: Highlight;
      border-color: Highlight;
      box-shadow: none;
    }

    .ingredient-check__input:checked + .ingredient-check__box {
      background: Highlight;
      border-color: Highlight;
      box-shadow: none;
    }

    .ingredient-check__input:checked + .ingredient-check__box::after {
      border-color: HighlightText;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .recipe-gallery__item,
    .recipe-gallery__arrow,
    .detail-button,
    .ingredient-check__box,
    .ingredient-check__box::after,
    .rating-form__option span,
    .recipe-form__field input,
    .recipe-form__field textarea,
    .detail-page__action-pill {
      transition: none;
    }

    .recipe-gallery__item.is-current,
    .recipe-gallery__item.is-prev,
    .recipe-gallery__item.is-next {
      will-change: auto;
    }

    .recipe-gallery__arrow:hover,
    .recipe-gallery__arrow--prev:hover,
    .recipe-gallery__arrow--next:hover,
    .detail-button:hover,
    .detail-button:focus-visible,
    .rating-form__option span:hover,
    .rating-form__option input:checked + span {
      transform: none;
    }
  }

  @container detail-page (max-width: 1100px) {
    .recipe-gallery {
      --gallery-main-width: min(54%, 540px);
      --gallery-side-width: min(40%, 380px);
      --gallery-side-shift: 29%;
    }

    .detail-page__grid,
    .comments-layout,
    .detail-page__grid--article {
      grid-template-columns: 1fr;
    }
  }

  @container detail-page (max-width: 820px) {
    .detail-page__header {
      border-radius: var(--detail-header-radius-mobile) var(--detail-header-radius-mobile) 0 0;
    }

    .detail-page__breadcrumb {
      padding-inline: var(--detail-space-lg);
    }

    .detail-page__header-inner {
      padding-block: 1.2rem 1.45rem;
      padding-inline: var(--detail-space-lg);
    }

    .detail-page__topbar {
      flex-direction: column;
      align-items: stretch;
    }

    .detail-page__taxonomy,
    .detail-page__timing-pill,
    .detail-page__action-pill {
      width: 100%;
      justify-content: center;
    }

    .detail-page__header h1 {
      max-width: 100%;
      font-size: clamp(2.2rem, 9vw, 3.35rem);
      line-height: 0.98;
    }

    .detail-page__intro {
      font-size: 1rem;
      line-height: 1.68;
    }

    .recipe-gallery {
      --gallery-stage-height: clamp(220px, 66vw, 330px);
      --gallery-main-width: min(74%, 460px);
      --gallery-side-width: min(46%, 240px);
      --gallery-side-shift: 30%;
      --gallery-arrow-size: 48px;
    }

    .recipe-summary__grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .recipe-summary__item--rating {
      grid-column: span 2;
    }

    .detail-page__grid,
    .detail-page__grid--article {
      padding: 0.9rem;
    }

    .detail-page__content-card {
      padding: var(--detail-space-lg);
    }

    .method-steps__item {
      grid-template-columns: 24px minmax(0, 1fr);
      gap: 0.65rem;
      padding-block: 0.66rem;
      padding-inline: 0.65rem;
    }

    .method-steps__item::before {
      width: 22px;
      height: 22px;
      border-radius: 999px;
      font-size: 0.72rem;
    }
  }

  @container detail-page (max-width: 560px) {
    .recipe-gallery {
      --gallery-stage-height: clamp(210px, 64vw, 280px);
      --gallery-main-width: min(84%, 380px);
      --gallery-side-width: min(52%, 190px);
      --gallery-side-shift: 31%;
    }

    .recipe-gallery__caption {
      font-size: 0.92rem;
    }

    .recipe-summary__grid {
      grid-template-columns: 1fr;
    }

    .recipe-summary__item,
    .recipe-summary__item--rating {
      grid-column: span 1;
      min-block-size: auto;
    }

    .rating-form {
      gap: 0.35rem;
    }

    .rating-form__option span {
      width: 36px;
      height: 36px;
      font-size: 0.88rem;
    }

    .rich-text p,
    .method-steps__body p,
    .ingredient-check__text {
      font-size: 1rem;
      line-height: 1.74;
    }
  }

  @media (max-width: 640px) {
    .detail-page__actions {
      flex-wrap: wrap;
      justify-content: center;
      gap: 0.45rem;
      padding-inline: 0.75rem;
    }

    .detail-page__share {
      display: contents;
    }

    .detail-page__breadcrumb {
      justify-content: center;
      margin-block-start: -1.25rem;
    }

    .detail-page__breadcrumb-date {
      display: none;
    }

    .detail-page__breadcrumb-list {
      justify-content: center;
      flex-wrap: nowrap;
      max-inline-size: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .detail-page__breadcrumb-item {
      flex: 0 1 auto;
      min-width: 0;
    }

    .detail-page__breadcrumb-item:not(:first-child):not(.detail-page__breadcrumb-item--current) {
      flex-shrink: 2;
      display: none;
    }

    .detail-page__breadcrumb-item a {
      display: block;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .detail-page__breadcrumb-item--current {
      flex-shrink: 1;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .detail-page--article .detail-page__action-pill {
      flex-wrap: wrap;
      white-space: normal;
      text-align: center;
    }

    .detail-page--article .detail-page__action-value {
      min-width: 0;
      overflow-wrap: anywhere;
    }

    .detail-page--article .recipe-gallery {
      --gallery-stage-height: clamp(210px, 62vw, 280px);
      --gallery-main-width: 100%;
      --gallery-side-width: 0;
      --gallery-side-shift: 0;
      --gallery-arrow-size: 44px;
      padding-inline: 0.65rem;
    }

    .detail-page--article .recipe-gallery__item.is-current {
      width: 100%;
    }

    .detail-page--article .recipe-gallery__item.is-prev,
    .detail-page--article .recipe-gallery__item.is-next {
      opacity: 0;
      pointer-events: none;
    }

    /* article arrow overrides removed — base is now edge-anchored for all galleries */
  }

  @media (max-width: 520px) {
    /* avatar stacks above editor */
    .comment-compose {
      flex-direction: column;
      gap: 0.5rem;
    }

    .comment-compose__avatar {
      align-self: flex-start;
      width: 2.6rem;
      height: 2.6rem;
      font-size: 1rem;
    }

    .comment-compose__right {
      width: 100%;
    }

    /* toolbar: show burger, hide tools */
    .comment-compose__toolbar-toggle {
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
      padding: 0.2rem 0.45rem;
      border-radius: 4px;
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--ink-soft);
      background: none;
      border: 1px solid var(--detail-border-soft);
      cursor: pointer;
      margin-inline-start: auto;
    }

    .comment-compose__toolbar-toggle:hover {
      color: var(--ink);
      background: var(--detail-border-soft);
    }

    .comment-compose__tool,
    .comment-compose__tool-sep {
      display: none;
    }

    /* open state: tools wrap below toggle */
    .comment-compose__toolbar.is-open {
      flex-wrap: wrap;
      row-gap: 0.25rem;
    }

    .comment-compose__toolbar.is-open .comment-compose__tool {
      display: inline-flex;
    }

    .comment-compose__toolbar.is-open .comment-compose__tool-sep {
      display: inline-block;
    }

    .comment-compose__toolbar.is-open .comment-compose__toolbar-toggle {
      background: var(--detail-border-soft);
      color: var(--ink);
    }

    .comment-compose__bottom {
      flex-direction: column;
      align-items: center;
      gap: 0.4rem;
    }

    .comment-compose__posting-as {
      text-align: center;
    }

    .comment-compose__submit {
      justify-content: center;
      align-self: center;
    }

    .comment-compose__rating {
      flex-wrap: wrap;
      gap: 0.4rem;
    }

    .comment-reply__bubble {
      max-inline-size: 90%;
    }
  }
}

/* ==== Recipe rebuilt layout ==== */

.recipe-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1rem;
  background: var(--surface-soft);
  border-inline: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.recipe-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-width: 60px;
  padding: 0.35rem 0.65rem;
  background: #ffffff;
  border: 1px solid var(--detail-border-faint);
  border-radius: var(--detail-radius-sm);
  text-align: center;
}

.recipe-stat--rating {
  min-width: 120px;
}

.recipe-stat__label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1.2;
}

.recipe-stat__value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.recipe-stat__value--inline {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.recipe-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--surface);
  border-inline: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.recipe-body__col {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.recipe-extras {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--surface);
  border-inline: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.recipe-footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--surface);
  border-inline: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.recipe-comments {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--detail-radius-base) var(--detail-radius-base);
}

.recipe-comments .detail-page__section-head {
  margin-block-end: 0.35rem;
}

.comments-panel__stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin-block-end: 0.9rem;
  text-align: center;
}

.comments-panel__rating-mini {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.comments-panel__count {
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

@container detail-page (max-width: 720px) {
  .recipe-body,
  .recipe-extras,
  .recipe-footer {
    grid-template-columns: 1fr;
  }
}

/* ==== Recipe detail hero ==== */

.detail-hero__breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: rgb(247 242 234 / 0.7);
  margin-block-end: 0.6rem;
}

.detail-hero__breadcrumb a {
  color: rgb(247 242 234 / 0.7);
  text-decoration: none;
}

.detail-hero__breadcrumb a:hover {
  color: #fff;
}

.detail-hero__meta {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.detail-hero__timing {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgb(247 242 234 / 0.9);
}

.detail-hero__author {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: rgb(247 242 234 / 0.9);
  text-decoration: none;
}

.detail-hero__author img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgb(255 255 255 / 0.25);
}

.detail-hero__author:hover {
  color: #fff;
}

/* ── Comments form (unlayered — overrides layer) ── */
.comments-panel__form {
  display: block;
}

.comments-panel__form:has(.comment-compose__guest) {
  padding-block: 0.5rem;
}

.comment-compose__guest {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.comment-compose__guest .comments-panel__login-prompt {
  width: auto;
  min-height: unset;
  display: inline;
}

.comment-reply-form {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  padding-block-start: 0.5625rem;
  padding-block-end: 11px;
  margin-top: 0;
}

.comment-replies {
  margin-block-start: 10px;
}

.comment-reply-form:not([hidden]) + .comment-replies {
  margin-block-start: 0;
  padding-block-end: 0.5rem;
}

.comment-reply-form .recipe-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  gap: 0;
}

.comment-reply-form .recipe-form__field {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-block-end: 15px;
}

.comment-reply-form .recipe-form__field textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: block;
}

.comment-reply-form__turnstile {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-block-start: 0;
  margin-block-end: 7px;
}

.comment-reply-form .cf-turnstile {
  margin: 0 !important;
}

.comment-reply-form__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  margin-block-start: 0;
}


.detail-button:active,
.comment-compose__submit:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: none;
  filter: brightness(0.97);
  transition-duration: 60ms;
}

.empty-state-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  text-align: center;
}

.empty-state-card p {
  margin: 0;
}


.breadcrumb {
  background: rgb(11 76 58 / 0.04);
  border-bottom: 1px solid rgb(11 76 58 / 0.08);
  padding: 0.55rem 0;
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
}

.breadcrumb__item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: rgb(31 44 37 / 0.55);
}

.breadcrumb__item + .breadcrumb__item::before {
  content: "›";
  color: rgb(11 76 58 / 0.35);
}

.breadcrumb__link {
  color: #0b4c3a;
  text-decoration: none;
}

.breadcrumb__link:hover {
  text-decoration: underline;
}

.breadcrumb__item--current {
  color: rgb(31 44 37 / 0.7);
  font-weight: 500;
  max-width: 40ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Rating panel popup ── */

.rating-overview__count--btn {
  all: unset;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 0.7rem;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  transition: color 160ms ease;
}

.rating-overview__count--btn:hover,
.rating-overview__count--btn:focus-visible {
  color: var(--brand);
  outline: none;
}

.recipe-stat--rating {
  position: relative;
}

.rating-panel {
  position: absolute;
  inset-block-start: calc(100% + 0.5rem);
  inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: 200;
  min-inline-size: 240px;
  max-inline-size: min(320px, calc(100vw - 2rem));
  background: #ffffff;
  border: 1px solid var(--detail-border-soft);
  border-radius: var(--detail-radius-base);
  box-shadow: 0 12px 32px rgb(20 33 43 / 0.14), 0 2px 8px rgb(20 33 43 / 0.06);
  padding: 1rem;
  animation: panel-in 160ms ease;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.rating-panel__loading,
.rating-panel__error {
  text-align: center;
  font-size: 0.88rem;
  color: var(--ink-soft);
  padding-block: 0.5rem;
}

.rating-panel__summary {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.3rem;
  margin-block-end: 0.85rem;
}

.rating-panel__avg {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.rating-panel__avg-label {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.rating-panel__bars {
  display: grid;
  gap: 0.3rem;
  margin-block-end: 0.85rem;
}

.rating-panel__bar-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr 1.8rem;
  align-items: center;
  gap: 0.4rem;
}

.rating-panel__bar-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: right;
}

.rating-panel__bar-track {
  height: 6px;
  border-radius: 999px;
  background: rgb(20 33 43 / 0.08);
  overflow: hidden;
}

.rating-panel__bar-fill {
  height: 100%;
  border-radius: 999px;
  background: #d89b2b;
  transition: width 400ms ease;
}

.rating-panel__bar-count {
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-align: left;
}

.rating-panel__raters-heading {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-block-start: 1px solid var(--detail-border-faint);
  padding-block-start: 0.75rem;
}

.rating-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  max-block-size: 160px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.rating-panel__list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.rating-panel__author {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  text-decoration: none;
  color: var(--ink);
  flex: 1 1 0;
}

.rating-panel__author:hover .rating-panel__author-name {
  color: var(--brand);
  text-decoration: underline;
}

.rating-panel__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--detail-border-faint);
}

.rating-panel__author-name {
  font-size: 0.82rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rating-panel__stars {
  font-size: 0.7rem;
  color: #d89b2b;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

/* Rejection note banner — visible to content owners and moderators */
.mod-note-banner {
  background: #fff7f0;
  border-top: 3px solid #c04000;
  padding: 1rem 0;
}

.mod-note-banner__inner {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mod-note-banner__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b03000;
}

.mod-note-banner__text {
  margin: 0;
  font-size: 0.9rem;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
}

.mod-note-banner__meta {
  margin: 0;
  font-size: 0.75rem;
  color: #777;
}

/* ── Related content section ── */
.page-section--related {
  background: rgb(31 44 37 / 0.025);
  border-block-start: 1px solid rgb(31 44 37 / 0.07);
  padding-block: 3rem;
}

/* ── Comments section ── */
.page-section--comments {
  padding-block: 2.5rem;
}

/* ── Related content grid (rcg) ── */
.rcg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 360px));
  justify-content: center;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rcg-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgb(31 44 37 / 0.09);
  border-top: 3px solid #0b4c3a;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.rcg-card:hover {
  box-shadow: 0 6px 28px rgb(11 76 58 / 0.12);
  transform: translateY(-3px);
}

.rcg-card--article {
  border-top-color: #6b8c6a;
}

.rcg-card__eyebrow {
  display: block;
  padding: 0.7rem 1.1rem 0;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #0b4c3a;
}

.rcg-card--article .rcg-card__eyebrow {
  color: #6b8c6a;
}

.rcg-card__link {
  display: block;
  flex-grow: 1;
  padding: 0.35rem 1.1rem 0.9rem;
  text-decoration: none;
}

.rcg-card__title {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 0.4rem;
  transition: color 0.15s;
}

.rcg-card__link:hover .rcg-card__title {
  color: #0b4c3a;
}

.rcg-card__meta {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.rcg-card__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 1.1rem 0.9rem;
}

.rcg-card__tag {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgb(11 76 58 / 0.07);
  border: 1px solid rgb(11 76 58 / 0.13);
  color: #0b4c3a;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.rcg-card__tag:hover {
  background: rgb(11 76 58 / 0.14);
}

.related-articles-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-articles-list__item {
  border-radius: 8px;
  border: 1px solid rgb(31 44 37 / 0.09);
  background: #fff;
}

.related-articles-list__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s;
}

.related-articles-list__link:hover {
  background: rgb(31 44 37 / 0.04);
}

.related-articles-list__title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}

.related-articles-list__meta {
  font-size: 0.8rem;
  color: var(--ink-soft);
  white-space: nowrap;
  flex-shrink: 0;
}

.related-articles-list__cats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  padding: 0 1rem 0.65rem;
}

.related-articles-list__cats-label {
  font-size: 0.74rem;
  color: var(--ink-soft);
  margin-right: 0.1rem;
}

.related-articles-list__cat-tag {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgb(11 76 58 / 0.07);
  border: 1px solid rgb(11 76 58 / 0.13);
  color: #0b4c3a;
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.related-articles-list__cat-tag:hover {
  background: rgb(11 76 58 / 0.13);
  border-color: rgb(11 76 58 / 0.22);
}

/* ══════════════════════════════════════════════════════════════
   Phase 5 — Article visual & editorial polish
   All selectors scoped to .detail-page--article.
   Outside @layer so these naturally override the layered styles
   above with no specificity tricks needed.
   ══════════════════════════════════════════════════════════════ */

/* ── 1. Body — comfortable reading width & long-form rhythm ── */
.detail-page--article .detail-page__content-card {
  padding-block: 2rem 1.8rem;
  padding-inline: clamp(1.25rem, 4.5vw, 2.5rem);
}

.detail-page--article .rich-text {
  max-width: 70ch;
  margin-inline: auto;
}

.detail-page--article .article-body-heading {
  max-width: 70ch;
  margin-inline: auto;
  margin-block-end: 1.2rem;
  padding-block-end: 0.8rem;
  border-block-end: 1px solid var(--detail-border-faint);
  text-align: left;
}

.detail-page--article .article-body-heading__label {
  margin-block-end: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.detail-page--article .article-body-heading__title {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 2.3vw, 2.15rem);
  font-weight: 700;
  line-height: 1.12;
  text-align: left;
}

.detail-page--article .rich-text p {
  font-size: 1.06rem;
  line-height: 1.82;
  margin-block-end: 1rem;
}

.detail-page--article .rich-text h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.28rem, 1.7vw, 1.65rem);
  line-height: 1.22;
  letter-spacing: -0.03em;
  margin-block-start: 1.7rem;
  margin-block-end: 0.7rem;
  color: var(--ink);
  text-align: left;
}

.detail-page--article .rich-text h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-block-start: 1.35rem;
  margin-block-end: 0.55rem;
  color: var(--ink);
  text-align: left;
}

.detail-page--article .rich-text a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.detail-page--article .rich-text a:hover {
  text-decoration-thickness: 2px;
}

.detail-page--article .rich-text .editorial-link {
  color: #0f5f45;
  text-decoration-color: rgb(15 95 69 / 0.34);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.detail-page--article .rich-text .editorial-link:hover,
.detail-page--article .rich-text .editorial-link:focus-visible {
  color: #0b4c3a;
  text-decoration-color: currentColor;
}

.detail-page--article .rich-text li {
  margin-block-end: 0.55rem;
  line-height: 1.82;
}

.detail-page--article .rich-text blockquote {
  border-inline-start-width: 4px;
  padding-block: 1rem;
  padding-inline: 1.5rem;
  margin-block: 2rem;
  background: rgb(168 135 78 /0.04);
  border-radius: 0 10px 10px 0;
}

.detail-page--article .rich-text blockquote p {
  font-size: 1.06rem;
  line-height: 1.78;
}

/* ── 3. Source / Credits card — editorial, not boxy ── */
.detail-page--article .detail-page__card--source h3 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-block-end: 0.75rem;
}

.detail-page--article .detail-page__source-list {
  gap: 0;
}

.detail-page--article .detail-page__source-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-block: 0.62rem;
  padding-inline: 0;
  border: none;
  border-top: 1px solid var(--detail-border-faint);
  border-radius: 0;
  background: none;
  text-align: left;
}

.detail-page--article .detail-page__source-item:first-child {
  border-top: none;
  padding-block-start: 0;
}

.detail-page--article .detail-page__source-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.detail-page--article .detail-page__source-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}

.detail-page--article .detail-page__source-link {
  align-self: flex-start;
  margin-block-start: 0.2rem;
  font-size: 0.88rem;
  padding-block: 0.35rem;
  padding-inline: 0.65rem;
}

/* ── 4. Published sidebar card ── */
.detail-page--article .detail-page__card--meta {
  min-height: auto;
}

.detail-page--article .detail-page__card--meta h3 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-block-end: 0.4rem;
}

.detail-page--article .detail-page__card--meta time {
  display: block;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
}

/* ── 4b. Lead paragraph — first paragraph gets editorial weight ── */
.detail-page--article .rich-text .lead {
  font-size: clamp(1rem, 0.8vw, 1.06rem);
  line-height: 1.82;
  color: var(--ink);
  font-weight: 400;
  margin-block-end: 1rem;
}

/* Second paragraph — bridge between standfirst and first heading */
.detail-page--article .rich-text .lead + p {
  color: var(--ink);
  margin-block-end: 1rem;
}

.detail-page--article .rich-text p + p {
  text-indent: 0;
}

/* ── 5. Gallery caption — softer & italic ── */
.detail-page--article .recipe-gallery__caption {
  font-style: italic;
  font-size: 0.9rem;
  padding-block: 0.7rem 0.85rem;
}

/* ── 6. Mobile overrides ── */
@container detail-page (max-width: 820px) {
  .detail-page--article .detail-page__content-card {
    padding-block: 1.35rem;
    padding-inline: 1.1rem;
  }

  .detail-page--article .rich-text {
    max-width: 100%;
  }
}

@container detail-page (max-width: 560px) {
  .detail-page--article .rich-text p {
    font-size: 1rem;
    line-height: 1.82;
    margin-block-end: 0.95rem;
  }

  .detail-page--article .rich-text h2 {
    margin-block-start: 1.45rem;
  }

  .detail-page--article .rich-text h3 {
    margin-block-start: 1.2rem;
  }

  .detail-page--article .rich-text blockquote {
    padding-inline: 1.1rem;
    margin-block: 1.5rem;
  }
}

/* ── Editorial quality checklist (author/moderator only) ── */
.editorial-checklist {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.editorial-checklist__title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-block-end: 0.6rem;
}

.editorial-checklist__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-block: 0.38rem;
  border-top: 1px solid var(--detail-border-faint);
  font-size: 0.86rem;
  line-height: 1.3;
  color: var(--ink-soft);
}

.editorial-checklist__item:first-of-type {
  border-top: none;
}

.editorial-checklist__icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
}

.editorial-checklist__icon--ok {
  background: rgb(168 135 78 /0.12);
  color: #a8874e;
}

.editorial-checklist__icon--warn {
  background: rgb(185 117 20 / 0.12);
  color: #835200;
}

/* ── Part F: Article body-first single-column layout ──────────────────────────
   Collapse the article grid to single-column at a wider breakpoint than the
   recipe grid (1200px vs 1100px).  This gives the article body full reading
   width at intermediate screen sizes and keeps body-before-sidebar order. */

@container detail-page (max-width: 1200px) {
  .detail-page__grid--article {
    grid-template-columns: 1fr;
  }
}

/* Ensure article body comes first visually in all column modes. */
.detail-page--article .detail-page__main {
  order: 0;
}

.detail-page--article .detail-page__sidebar {
  order: 1;
}
