/* Blade-port additions on top of the design CSS (tokens/base/components/pages stay identical to platform/ui). */

/* pagination: "previous" chevron points the other way */
.icon--dir-rev { transform: scaleX(-1); }
[dir="ltr"] .icon--dir-rev { transform: none; }
.pagination [aria-disabled="true"] { border: 1px solid var(--c-line-2); }

/* header: primary categories inline, the rest in a "more" dropdown (no JS) */
.nav-more { position: relative; display: flex; align-items: stretch; }
.nav-more summary {
  height: var(--header-h); display: flex; align-items: center; gap: 4px; list-style: none; cursor: pointer;
  border-bottom: 2px solid transparent; color: var(--c-muted); transition: color .15s, border-color .15s;
}
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary:hover, .nav-more[open] summary { color: var(--c-text); border-bottom-color: var(--c-line-2); }
.nav-more summary[aria-current] { border-bottom-color: var(--c-pink); color: var(--c-text); font-weight: var(--fw-bold); }
.nav-more[open] .icon { transform: rotate(180deg); }
.nav-more__panel {
  position: absolute; top: calc(100% - 6px); inset-inline-start: -16px; z-index: 60; min-width: 190px;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg);
  box-shadow: 0 20px 40px rgba(39, 32, 29, .14); padding: 8px; display: flex; flex-direction: column; gap: 2px;
}
.main-nav .nav-more__panel a {
  height: 44px; padding: 0 12px; gap: 10px; border-bottom: 0; border-radius: var(--r-sm);
  color: var(--c-text); font-weight: var(--fw-medium);
}
.main-nav .nav-more__panel a:hover { background: var(--c-surface-2); }
.main-nav .nav-more__panel a[aria-current] { background: var(--c-tint); font-weight: var(--fw-bold); }
.main-nav .nav-more__panel img { width: 22px; height: 22px; }
@media (max-width: 1150px) { .main-nav { gap: 16px; } }

/* links used where the design had buttons */
a.chip, a.tab { text-decoration: none; }
.sort-form { display: flex; align-items: center; gap: 8px; }

/* article: stable column positions with or without TOC / action rail */
.article-layout > .toc { grid-column: 1; }
.article-layout > .article { grid-column: 2; }
.toc__sub { padding-inline-start: 26px; font-size: 13px; }
.med-stamp {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 8px 14px; border-radius: var(--r-pill); background: var(--c-tint); border: 1px solid #F3B7C7;
  color: #8E1F42; font-size: 13px; font-weight: var(--fw-bold);
}
.med-stamp .icon { color: var(--c-ok); }
.med-note-short { margin: 0 0 14px; font-size: 14px; line-height: 1.8; color: var(--c-muted); }
.med-note {
  margin: 28px 0 0; padding: 16px 18px; border: 1px solid var(--c-line-3); border-radius: var(--r-md);
  background: var(--c-surface-2); color: var(--c-text-2); break-inside: avoid;
}
.med-note__title { margin: 0 0 6px; font-size: 16px; font-weight: var(--fw-bold); color: var(--c-text); }
.pad > .med-note { margin-top: 20px; }
.med-note__body { margin: 0; font-size: 15px; line-height: 1.9; }
@media print { .med-note { border: 1px solid #999; background: #fff; color: #000; } .med-note-short { color: #000; } }
.prose h2, .prose h3 { scroll-margin-top: calc(var(--header-h) + 16px); }
.prose img { height: auto; }
.article-share { margin-top: 6px; }
.article-share .feedback__share { margin-inline-start: 0; }
@media (max-width: 1023px) {
  .article-layout > .toc, .article-layout > .article { grid-column: auto; }
}

/* in-article recipes */
.recipe-block { display: flex; flex-direction: column; gap: 16px; scroll-margin-top: calc(var(--header-h) + 16px); }
.recipe-block--inline {
  margin-top: 8px; padding: 22px; border: 1px solid var(--c-line); border-radius: var(--r-2xl); background: var(--c-tint-3);
}
.recipe-block__head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; }
.recipe-block__head h2, .recipe-block__head h3 { font-size: 24px; font-weight: var(--fw-bold); line-height: 1.5; }
.recipe-block__permalink { margin-inline-start: auto; font-size: 13px; font-weight: var(--fw-medium); }
.recipe-block__notes { font-size: 15px; color: var(--c-muted); line-height: 1.85; }
.recipe-block--inline .recipe-body { grid-template-columns: 1fr; gap: 22px; padding: 0; }
.recipe-block--inline .ingredients { position: static; background: var(--c-surface); }
.recipe-block .steps .recipe-block__h { font-size: 20px; font-weight: var(--fw-bold); padding-bottom: 10px; }
.recipe-block .ingredients__head .recipe-block__h { font-size: 20px; font-weight: var(--fw-bold); }
.recipe-block .facts { margin: 0; }
.recipe-hero__from { font-size: 14px; color: var(--c-muted-2); }
.recipe-hero__facts { display: contents; }
.prose .recipe-block h2 { margin-top: 0; }

/* search */
.search-empty { padding: 48px 0; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.search-empty h1, .search-empty h2 { font-size: 24px; font-weight: var(--fw-bold); }
.search-empty p { color: var(--c-muted-2); }
.result-row { text-decoration: none; }
.result-row__title mark, .result-row__snippet mark { background: #FFE3EC; color: inherit; padding: 0 2px; border-radius: 3px; }

/* modal login (only rendered when engagement_enabled) */
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* facts: 1 to 5 items, whatever the recipe has */
.facts { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
@media (max-width: 639px) {
  .facts > div:nth-child(n+3) { border-top: 1px solid var(--c-line); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- QA: layout stability + accessibility ---------- */
/* Reserve the header auth slot so account.js hydration (guest button <-> heart/bookmark/avatar) never moves the search pill. */
.header-auth { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 172px; }
@media (max-width: 1023px) { .header-auth { min-width: 152px; } }
@media (max-width: 639px) { .header-auth { min-width: 44px; gap: 8px; } }
/* like/save buttons: fixed minimum width so label/count changes on hydration do not shift neighbours */
.zq-actions .btn { min-width: 112px; }
.zq-actions .btn--lg { min-width: 128px; }
/* links inside running text must not rely on colour alone */
.static-body a, .prose a, .recipe-hero__from a, .med-stamp a { text-decoration: underline; text-underline-offset: 3px; }
.prose img { max-width: 100%; height: auto; }

/* article body images without known dimensions: reserve a 16/9 box so the page does not jump when they load */
.body-img { display: block; aspect-ratio: 16 / 9; width: 100%; overflow: hidden; background: var(--surface-2, rgba(127,127,127,.12)); border-radius: 8px; }
.body-img > img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* generic library cover (AI illustration used when an article has no cover_image) */
.cover--generic .cover__img { filter: saturate(.96); }
