/* ============================================================
   Оформление статьи журнала Hericium Rex
   Структура: полноширинный hero → широкая раскладка с липким
   оглавлением → контентные блоки (врезки, KPI, графики, bleed-фото).
   Палитра и шрифты — фирменные (cream linen + бронза, Old Standard TT).
   ============================================================ */

/* --- прогресс чтения --- */
.read-prog {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 100;
  background: linear-gradient(90deg, var(--c-accent-light), var(--c-accent));
  transition: width .1s linear;
}

/* --- hero статьи: тёмная «редакционная» подача (фото работает фоном) --- */
.hero-cinema--editorial { min-height: 74vh; align-items: flex-end; }
.hero-cinema--editorial .hero-cinema__bg img { object-position: center; }
.hero-cinema--editorial .hero-cinema__overlay {
  background:
    linear-gradient(90deg, rgba(30, 21, 13, .93) 0%, rgba(30, 21, 13, .74) 46%, rgba(30, 21, 13, .28) 100%),
    linear-gradient(to top, rgba(30, 21, 13, .9), rgba(30, 21, 13, 0) 55%);
}
.hero-cinema--editorial .hero-cinema__content { padding: 48px 24px; align-items: flex-start; text-align: left; }
.hero-cinema--editorial .hero-cinema__content > * { max-width: 640px; }
.hero-cinema--editorial .hero-cinema__eyebrow {
  align-self: flex-start; background: rgba(138, 90, 59, .28); border: 1px solid rgba(241, 227, 210, .45);
  color: var(--c-accent-light); backdrop-filter: blur(6px); margin-bottom: 18px;
}
.hero-cinema--editorial .hero-cinema__title {
  color: #fff; text-shadow: 0 2px 24px rgba(20, 12, 4, .5); margin-bottom: 18px; max-width: 19ch;
}
.hero-cinema--editorial .hero-cinema__lead { color: rgba(255, 255, 255, .82); max-width: 62ch; margin-bottom: 26px; }
.hero-cinema--editorial .hero-cinema__byline { color: rgba(255, 255, 255, .62); }
.hero-cinema--editorial .hero-cinema__byline b { color: #fff; }
.hero-cinema--editorial .hero-cinema__byline .dot { background: rgba(255, 255, 255, .45); }
.hero-cinema--editorial .hero-cinema__byline .av { border-color: rgba(255, 255, 255, .3); }

@media (max-width: 720px) {
  .hero-cinema--editorial { min-height: 66vh; }
  .hero-cinema--editorial .hero-cinema__content { padding: 32px 20px; align-items: flex-start; text-align: left; }
  .hero-cinema--editorial .hero-cinema__overlay {
    background: linear-gradient(to top, rgba(30, 21, 13, .95) 30%, rgba(30, 21, 13, .55) 75%, rgba(30, 21, 13, .35) 100%);
  }
}

/* --- hero статьи: мета с автором --- */
.hero-cinema__byline {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 0.88rem; color: var(--c-text-soft);
  width: auto !important; max-width: max-content !important;
}
.hero-cinema__byline .av {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: top;
  border: 2px solid rgba(255,255,255,.75); box-shadow: var(--shadow-sm); flex: none;
}
.hero-cinema__byline .av--initials {
  display: flex; align-items: center; justify-content: center;
  background: var(--c-accent); color: #fff;
  font-family: "Old Standard TT", serif; font-size: 1.25rem; line-height: 1;
}
.hero-cinema__byline b { display: block; color: var(--c-accent-dark); font-size: 0.95rem; }
.hero-cinema__byline .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--c-muted); flex: none; }

/* --- раскладка --- */
.art-wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
/* без align-items:start — колонка сайдбара должна тянуться на всю высоту,
   иначе sticky-блоку некуда «ехать» и он уплывает вверх при прокрутке */
.art-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 56px;
  padding: 40px 0 72px;
}

/* --- сайдбар --- */
.art-aside-in { position: sticky; top: 88px; display: grid; gap: 16px; }
.toc {
  border: 1px solid var(--c-border); border-radius: 16px; padding: 20px;
  background: var(--c-bg-elev);
  max-height: calc(100vh - 240px); overflow-y: auto; overscroll-behavior: contain;
}
.toc-t {
  font-family: "Montserrat", sans-serif; font-size: 0.7rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted); margin-bottom: 12px;
}
.toc a {
  display: block; font-size: 0.86rem; color: var(--c-text-soft); text-decoration: none;
  padding: 7px 0 7px 12px; border-left: 2px solid var(--c-border);
  transition: color var(--d-fast) var(--ease-out), border-color var(--d-fast) var(--ease-out);
}
.toc a:hover { color: var(--c-accent-dark); }
.toc a.on { color: var(--c-accent); border-left-color: var(--c-accent); font-weight: 600; }

.side-cta {
  border-radius: 16px; padding: 20px; color: #fff;
  background: linear-gradient(160deg, var(--c-bg-deep), var(--c-accent-dark));
}
.side-cta b { font-family: "Old Standard TT", serif; font-size: 1.05rem; display: block; margin-bottom: 6px; }
.side-cta p { font-size: 0.8rem; color: rgba(255,255,255,.72); margin: 0 0 14px; line-height: 1.5; }
.side-cta a {
  display: block; text-align: center; background: var(--c-accent-light); color: var(--c-accent-dark);
  font-weight: 700; font-size: 0.86rem; padding: 11px; border-radius: 9px; text-decoration: none;
  transition: transform var(--d-fast) var(--ease-out);
}
.side-cta a:hover { transform: translateY(-1px); }

/* --- типографика статьи --- */
.art { min-width: 0; }
.art h2 {
  font-family: "Old Standard TT", serif; font-weight: 700;
  font-size: clamp(1.5rem, 2vw + .6rem, 2rem); color: var(--c-accent-dark);
  margin: 48px 0 16px; line-height: 1.2; scroll-margin-top: 96px;
}
.art h2:first-child { margin-top: 0; }
.art h3 {
  font-family: "Old Standard TT", serif; font-weight: 700; font-size: 1.2rem;
  color: var(--c-text); margin: 30px 0 10px;
}
.art p { font-size: 1.06rem; line-height: 1.78; margin: 0 0 17px; max-width: 74ch; color: var(--c-text-soft); }
.art ul, .art ol { margin: 16px 0; padding-left: 22px; max-width: 74ch; }
.art li { margin-bottom: 9px; font-size: 1.06rem; line-height: 1.7; color: var(--c-text-soft); }
.art strong { color: var(--c-text); font-weight: 700; }
.art a { color: var(--c-accent); text-decoration: underline; text-underline-offset: 2px; }
.art a:hover { color: var(--c-accent-dark); }

/* --- изображения --- */
.art figure { margin: 34px 0; }
.art figure img { width: 100%; border-radius: 18px; object-fit: cover; aspect-ratio: 16 / 8; display: block; }
.art figcaption { font-size: 0.85rem; color: var(--c-muted); margin-top: 10px; }
/* вырывающаяся на всю ширину */
.art .bleed { margin: 44px calc(-50vw + 50%); width: 100vw; max-width: 100vw; }
.art .bleed img { border-radius: 0; aspect-ratio: 21 / 8; }
.art .bleed figcaption { max-width: 1280px; margin: 10px auto 0; padding: 0 24px; }

/* --- врезка --- */
.art .note {
  background: var(--c-accent-light); border-left: 3px solid var(--c-accent);
  border-radius: 0 12px 12px 0; padding: 16px 18px; margin: 28px 0; max-width: 74ch;
}
.art .note p { margin: 0; font-size: 1rem; color: var(--c-text); }

/* --- KPI-счётчики --- */
.art .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 32px 0; }
.art .stat {
  border: 1px solid var(--c-border); border-radius: 16px; padding: 22px 18px;
  text-align: center; background: var(--c-bg-elev);
}
.art .stat b {
  font-family: "Old Standard TT", serif; font-size: 1.9rem; font-weight: 700; color: var(--c-accent);
  display: block; line-height: 1; font-variant-numeric: tabular-nums;
}
.art .stat span { font-size: 0.8rem; color: var(--c-text-soft); margin-top: 9px; display: block; line-height: 1.45; }

/* --- графики --- */
.art .viz {
  margin: 34px 0; padding: 26px; border: 1px solid var(--c-border);
  border-radius: 18px; background: var(--c-bg-elev);
}
.art .viz-t { font-family: "Old Standard TT", serif; font-size: 1.05rem; font-weight: 700; color: var(--c-accent-dark); margin: 0 0 4px; }
.art .viz-s { font-size: 0.82rem; color: var(--c-muted); margin: 0 0 20px; }
.art .viz .row { display: grid; grid-template-columns: 104px 1fr auto; align-items: center; gap: 12px; margin: 12px 0; }
.art .viz .lbl { font-size: 0.86rem; font-weight: 600; color: var(--c-text); }
.art .viz .trk { position: relative; height: 13px; background: var(--c-border-soft); border-radius: 7px; overflow: hidden; }
/* ширину/смещение полосы задаёт inline-стиль в разметке — без JS график читается сразу;
   при наличии JS полосы обнуляются и анимируются при появлении блока */
.art .viz .fil {
  position: absolute; top: 0; height: 13px; border-radius: 7px;
  background: linear-gradient(90deg, var(--c-accent), var(--c-accent-dark));
  transition: width 1s cubic-bezier(.22, 1, .36, 1), left 1s cubic-bezier(.22, 1, .36, 1);
}
.art .viz .val { font-size: 0.8rem; font-weight: 700; color: var(--c-accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.art .viz .axis { display: flex; justify-content: space-between; margin: 9px 0 0 116px; font-size: 0.7rem; color: var(--c-muted); }

/* --- таблицы --- */
.art table { width: 100%; border-collapse: collapse; margin: 26px 0; font-size: 0.94rem; }
.art th {
  background: var(--c-accent-light); padding: 12px; text-align: left; font-weight: 700;
  color: var(--c-accent-dark); border-bottom: 2px solid var(--c-border);
}
.art td { padding: 12px; border-bottom: 1px solid var(--c-border-soft); vertical-align: top; color: var(--c-text-soft); }

/* Появление блоков при скролле — общий механизм .reveal/.is-revealed из main.css,
   классы навешивает motion.js (без JS блоки остаются видимыми). */

/* --- FAQ / источники / товары --- */
.art-block { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--c-border); }
.art-block > h2 { margin-top: 0; }
.faq-item {
  margin-bottom: 8px; padding: 14px 18px; background: var(--c-bg-elev);
  border: 1px solid var(--c-border-soft); border-radius: 10px;
}
.faq-item summary { font-weight: 600; cursor: pointer; color: var(--c-text); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--c-accent); font-size: 1.2rem; line-height: 1; flex: none; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 10px 0 0; font-size: 0.98rem; color: var(--c-text-soft); }

.src-list { font-size: 0.9rem; color: var(--c-text-soft); padding-left: 20px; }
.src-list li { margin-bottom: 8px; }

.art-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.art-product {
  display: flex; gap: 14px; align-items: center; background: var(--c-bg-elev);
  border: 1px solid var(--c-border-soft); padding: 12px 16px; border-radius: 12px;
  text-decoration: none; color: var(--c-text); transition: transform var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out);
}
.art-product:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.art-product img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; flex: none; }
.art-product .n { font-weight: 600; font-size: 0.92rem; line-height: 1.3; }
.art-product .p { color: var(--c-accent); font-weight: 700; font-size: 0.92rem; margin-top: 3px; }

/* --- читайте также --- */
.art-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.art-more a {
  background: var(--c-bg-elev); border: 1px solid var(--c-border-soft); padding: 18px;
  border-radius: 12px; text-decoration: none; color: var(--c-text); display: block;
  transition: transform var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out);
}
.art-more a:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.art-more strong { font-family: "Old Standard TT", serif; font-size: 1rem; line-height: 1.35; display: block; }
.art-more span { color: var(--c-muted); font-size: 0.8rem; margin-top: 8px; display: block; }

/* --- адаптив --- */
@media (max-width: 1080px) {
  .art-grid { grid-template-columns: 1fr; gap: 0; padding: 28px 0 56px; }
  .art-aside { display: none; }
  .art-wrap { padding: 0 20px; }
  .art .bleed { margin: 32px -20px; width: calc(100% + 40px); }
  .art .bleed img { aspect-ratio: 16 / 9; }
  .art .bleed figcaption { padding: 0 20px; }
}
@media (max-width: 640px) {
  .art .stats { grid-template-columns: 1fr; }
  .art .viz .row { grid-template-columns: 76px 1fr auto; gap: 8px; }
  .art .viz .axis { margin-left: 84px; }
  .art p, .art li { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .art .viz .fil { transition: none; }
  .read-prog { transition: none; }
}
