/* ==========================================================================
   Лонгриды: 10 Страница материала (NYpwy / luZKg) и 12 Страница истории
   (QFnLL / cpI7H). Общая разметка: заголовок, обложка, текст, «Файлы»,
   «Фотоархив», «Видео», «Другие …». Десктоп у обеих страниц одинаковый,
   мобайл истории компактнее — правила .article-page--story в конце файла.

   Колонки на десктопе: текст 760, цитата 960, фото и «Файлы» 1080 —
   через max-width, сжимаются вместе с колонкой.
   ========================================================================== */

/* Отступы между блоками: материал 44 / 88, история 50 / 88. */
.article-page--material {
  --page-gap: 44px;
}

@media (min-width: 768px) {
  .article-page {
    --page-top: 72px;
    --page-gap: 88px;
  }
}

/* ── Заголовок ───────────────────────────────────────────────────────────── */
.article-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.article-head__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.article-head__type {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--cream);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  white-space: nowrap;
}

.article-head__date {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px; /* 14 − 1 px рамки */
  border: 1px solid var(--ink);
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  white-space: nowrap;
}

.article-head__date .icon {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.article-head__title {
  width: 100%;
  font-size: 30px;
  line-height: 32px;
  overflow-wrap: break-word;
}

.article-head__lead {
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 300;
  line-height: 23px;
}

/* Герой истории: портрет, ФИО, должность. */
.article-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.article-hero__portrait {
  flex: none;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--photo-placeholder);
}

.article-hero__who {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.article-hero__name {
  font-size: 12.5px;
  line-height: 16px;
}

.article-hero__role {
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 300;
}

@media (min-width: 768px) {
  .article-head {
    gap: 28px;
  }

  .article-head__tags {
    gap: 12px;
  }

  .article-head__type {
    height: 36px;
    padding: 0 16px;
    font-size: 11px;
  }

  .article-head__date {
    gap: 8px;
    height: 36px;
    padding: 0 15px;
    font-size: 12.5px;
  }

  .article-head__date .icon {
    width: 14px;
    height: 14px;
  }

  .article-head__title {
    max-width: 1000px;
    font-size: 76px;
    line-height: 78px;
  }

  .article-head__lead {
    max-width: 780px;
    font-size: 17px;
    line-height: 29px;
  }

  .article-hero {
    flex: none;
    gap: 14px;
    padding-top: 4px;
  }

  .article-hero__portrait {
    width: 56px;
    height: 56px;
  }

  .article-hero__who {
    flex: none;
    gap: 4px;
  }

  .article-hero__name {
    font-size: 15px;
    line-height: normal;
  }

  .article-hero__role {
    font-size: 12.5px;
  }
}

/* ── Обложка ─────────────────────────────────────────────────────────────── */
.article-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 250px;
  overflow: hidden;
  border-radius: var(--radius-12);
  background: var(--photo-placeholder);
  color: var(--accent-40);
}

/* Материал без обложки — заливка и иконка типа, как в карточке. */
.article-cover > .icon {
  width: 52px;
  height: 52px;
}

@media (min-width: 768px) {
  .article-cover {
    height: auto;
    aspect-ratio: 1280 / 580;
  }

  .article-cover > .icon {
    width: 72px;
    height: 72px;
  }
}

/* ── Основной текст ──────────────────────────────────────────────────────── */
.article-body {
  --section-gap: 18px;
  --title-size: 21px;
  --title-lh: 25px;
  --text-size: 13.5px;
  --text-lh: 23px;
  --list-size: var(--text-size);
  --list-lh: var(--text-lh);
  --list-gap: 10px;
  --item-gap: 12px;
  --marker-w: 12px;
  --dot: 5px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.article-section {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

.article-section__title {
  font-size: var(--title-size);
  line-height: var(--title-lh);
}

.article-section__text {
  color: var(--ink-2);
  font-size: var(--text-size);
  font-weight: 300;
  line-height: var(--text-lh);
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: var(--list-gap);
}

/* Пункт: маркер-точка --accent по центру первой строки. */
.article-list li {
  display: flex;
  gap: var(--item-gap);
  color: var(--ink-2);
  font-size: var(--list-size);
  font-weight: 300;
  line-height: var(--list-lh);
}

.article-list li::before {
  content: "";
  flex: none;
  width: var(--dot);
  height: var(--dot);
  margin: calc((var(--list-lh) - var(--dot)) / 2) calc((var(--marker-w) - var(--dot)) / 2) 0;
  border-radius: 50%;
  background: var(--accent);
}

/* Фото в тексте. */
.article-figure {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-figure__photo {
  display: block;
  height: 260px;
  overflow: hidden;
  border: 2px solid var(--accent);
  border-radius: var(--radius-12);
  background: var(--photo-placeholder);
}

.article-figure__caption {
  display: flex;
  gap: 8px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 300;
  line-height: 17px;
}

.article-figure__caption .icon {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

/* Цитата во врезке на мобайле материала — по центру, без разделителя. */
@media (max-width: 767.98px) {
  .article-quote--center {
    align-items: center;
    gap: 20px;
    padding: 28px 22px;
    text-align: center;
  }

  .article-quote--center .quote__mark {
    width: 26px;
    height: 26px;
  }

  .article-quote--center .quote__text {
    font-size: 17px;
    line-height: 25px;
  }

  .article-quote--center .quote__divider {
    display: none;
  }

  .article-quote--center .quote__author {
    text-align: left;
  }

  .article-quote--center .quote__emblem .icon {
    width: 14px;
    height: 14px;
  }

  .article-quote--center .quote__name {
    font-size: 12px;
  }

  .article-quote--center .quote__role {
    font-size: 10px;
  }
}

@media (min-width: 768px) {
  .article-body {
    --section-gap: 24px;
    --title-size: 30px;
    --title-lh: 36px;
    --text-size: 16px;
    --text-lh: 28px;
    --list-gap: 14px;
    --item-gap: 14px;
    --marker-w: 16px;
    --dot: 6px;
    align-items: center;
    gap: 56px;
  }

  .article-section,
  .article-figure,
  .article-body .article-files {
    width: 100%;
  }

  .article-section {
    max-width: 760px;
  }

  .article-figure,
  .article-files {
    max-width: 1080px;
  }

  .article-figure {
    gap: 14px;
  }

  .article-figure__photo {
    height: auto;
    aspect-ratio: 2 / 1;
  }

  .article-figure__caption {
    gap: 10px;
    font-size: 12.5px;
    line-height: 19px;
  }

  .article-figure__caption .icon {
    width: 14px;
    height: 14px;
  }
}

/* ── Файлы ───────────────────────────────────────────────────────────────── */
.article-files {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-12);
  background: var(--surface);
}

.article-files__title {
  font-size: 21px;
  line-height: 21px;
}

.article-files__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-files__list > li {
  display: flex;
}

.article-file {
  display: grid;
  flex: 1;
  grid-template-areas: "icon text download";
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  padding: 14px;
  border-radius: var(--radius-10);
  background: var(--bg);
  transition: filter 0.15s ease;
}

.article-file__icon {
  display: flex;
  grid-area: icon;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-8);
  background: var(--surface);
  color: var(--accent);
}

.article-file__icon .icon {
  width: 16px;
  height: 16px;
}

.article-file__text {
  display: flex;
  grid-area: text;
  flex-direction: column;
  gap: 4px;
}

.article-file__name {
  font-size: 12.5px;
  line-height: 17px;
}

.article-file__meta {
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 300;
  white-space: nowrap;
}

.article-file__download {
  grid-area: download;
  width: 18px;
  height: 18px;
  color: var(--accent);
}

@media (hover: hover) {
  .article-file:hover {
    filter: brightness(0.97);
  }
}

/* Десктоп: три карточки в ряд, значок и «скачать» сверху, название снизу. */
@media (min-width: 768px) {
  .article-files {
    gap: 24px;
    padding: 32px;
  }

  .article-files__title {
    font-size: 28px;
    line-height: 28px;
  }

  .article-files__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .article-file {
    grid-template-areas:
      "icon download"
      "text text";
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    row-gap: 24px;
    min-height: 184px;
    padding: 20px;
  }

  .article-file__icon {
    width: 44px;
    height: 44px;
  }

  .article-file__icon .icon {
    width: 18px;
    height: 18px;
  }

  .article-file__text {
    align-self: stretch;
    justify-content: space-between;
    gap: 6px;
  }

  .article-file__name {
    font-size: 14px;
    line-height: 19px;
  }

  .article-file__meta {
    font-size: 11.5px;
  }

  .article-file__download {
    justify-self: end;
    width: 20px;
    height: 20px;
  }
}

/* ── Фотоархив ───────────────────────────────────────────────────────────── */
.article-gallery {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.article-gallery__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.article-gallery__title {
  font-size: 24px;
  line-height: 24px;
}

.article-gallery__count {
  flex: none;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.article-gallery__controls {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

/* Счётчик «01 / 10» между стрелками — как у фотоленты экспоната: номер крупно,
   «/ 10» мелко и светлее, без подложки. Ширина числа не меняется при листании. */
.article-gallery__counter {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  padding-inline: 4px;
  white-space: nowrap;
}

.article-gallery__current {
  font-size: 22px;
  line-height: 22px;
  font-variant-numeric: tabular-nums;
}

.article-gallery__total {
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 300;
  line-height: 14px;
}

/* Стрелки — как у фотоленты экспоната: круглые, с тонкой обводкой. */
.article-gallery__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-pill);
  color: var(--ink);
  transition: background-color 0.15s ease;
}

.article-gallery__arrow .icon {
  width: 15px;
  height: 15px;
}

/* Лента: в ряд ровно 3 фото, остальные — за правым краем, листаются. */
.article-gallery__track {
  --slide-gap: 8px;
  display: flex;
  gap: var(--slide-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.article-gallery__track::-webkit-scrollbar {
  display: none;
}

.article-gallery__slide {
  flex: 0 0 calc((100% - 2 * var(--slide-gap)) / 3);
  scroll-snap-align: start;
}

.article-gallery__item {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-8);
  background: var(--photo-placeholder);
  transition: filter 0.15s ease;
}

/* Обводку фокуса рисуем внутри фото — лента обрезает всё, что выходит за неё. */
.article-gallery__item:focus-visible {
  outline-offset: -2px;
}

@media (hover: hover) {
  .article-gallery__item:hover {
    filter: brightness(0.9);
  }

  .article-gallery__arrow:hover {
    background-color: rgb(0 0 0 / 0.05);
  }
}

@media (min-width: 768px) {
  .article-gallery {
    gap: 22px;
  }

  .article-gallery__title {
    font-size: 40px;
    line-height: 40px;
  }

  .article-gallery__controls {
    gap: 10px;
  }

  .article-gallery__count {
    padding: 7px 14px;
    font-size: 13px;
  }

  .article-gallery__counter {
    gap: 6px;
    padding-inline: 6px;
  }

  .article-gallery__current {
    font-size: 28px;
    line-height: 28px;
  }

  .article-gallery__total {
    font-size: 13px;
    line-height: 16px;
  }

  .article-gallery__arrow {
    width: 44px;
    height: 44px;
  }

  .article-gallery__arrow .icon {
    width: 17px;
    height: 17px;
  }

  .article-gallery__track {
    --slide-gap: 12px;
  }

  .article-gallery__item {
    border-radius: var(--radius-12);
  }
}

/* ── Видео ───────────────────────────────────────────────────────────────── */
.article-video {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.article-video__title {
  font-size: 24px;
  line-height: 24px;
}

.article-video__player {
  position: relative;
  display: flex;
  align-items: flex-start;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 12px;
  overflow: hidden;
  border-radius: var(--radius-12);
  background: var(--photo-placeholder);
  text-align: left;
}

.article-video__player > .cover-img {
  position: absolute;
  inset: 0;
}

.article-video__player::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--overlay-ink-40);
  transition: background-color 0.15s ease;
}

.article-video__play {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--cream);
  transform: translate(-50%, -50%);
  transition: filter 0.15s ease;
}

.article-video__play .icon {
  width: 24px;
  height: 24px;
}

/* Плеер Rutube на месте превью (js/video.js): тот же размер и скругление. */
.article-video__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-12);
  background: var(--camera-bg);
}

.article-video__frame > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.article-video__caption {
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 300;
  line-height: 16px;
}

@media (hover: hover) {
  .article-video__player:hover::after {
    background-color: var(--overlay-ink-72);
  }

  .article-video__player:hover .article-video__play {
    filter: brightness(0.92);
  }
}

@media (min-width: 768px) {
  .article-video {
    gap: 28px;
  }

  .article-video__title {
    font-size: 40px;
    line-height: 40px;
  }

  .article-video__player {
    padding: 24px;
  }

  .article-video__play {
    width: 88px;
    height: 88px;
  }

  .article-video__play .icon {
    width: 34px;
    height: 34px;
  }

  .article-video__caption {
    max-width: 760px;
    font-size: 14px;
    line-height: 22px;
  }
}

/* ── Другие материалы / истории ──────────────────────────────────────────── */
.article-others {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.article-others__title {
  font-size: 24px;
  line-height: 25px;
  text-align: center;
}

.article-others__grid > li {
  display: flex;
  flex-direction: column;
}

.article-others__grid > li > * {
  flex: 1;
}

@media (max-width: 767.98px) {
  .article-others__grid {
    --grid-gap: 16px;
  }
}

@media (min-width: 768px) {
  .article-others {
    gap: 32px;
  }

  .article-others__title {
    font-size: 40px;
    line-height: 40px;
  }
}

/* ==========================================================================
   История на мобайле: заголовок слева, плашка «ИСТОРИЯ» и «с 1986» без рамки,
   лид первым абзацем, текст мельче и плотнее, «Файлы» списком после «Видео».
   ========================================================================== */
@media (max-width: 767.98px) {
  .article-page--story .article-head {
    align-items: stretch;
    gap: 14px;
    text-align: left;
  }

  .article-page--story .article-head__tags {
    justify-content: flex-start;
    gap: 9px;
  }

  .article-page--story .article-head__type {
    height: auto;
    padding: 6px 10px;
    border-radius: var(--radius-6);
    font-size: 9px;
    letter-spacing: 0.6px;
  }

  .article-page--story .article-head__date {
    height: auto;
    padding: 0;
    border: 0;
    color: var(--ink-2);
    font-weight: 300;
  }

  .article-page--story .article-head__date .icon,
  .article-page--story .article-head__date-role {
    display: none;
  }

  .article-page--story .article-head__title {
    font-size: 24px;
    line-height: 28px;
  }

  .article-page--story .article-body {
    --section-gap: 20px;
    --title-size: 18px;
    --title-lh: 23px;
    --text-size: 12.5px;
    --text-lh: 22px;
    --list-size: 12px;
    --list-lh: 19px;
    --item-gap: 10px;
    --marker-w: 16px;
    gap: 20px;
  }

  .article-body__lead {
    font-size: 13.5px;
    font-weight: 300;
    line-height: 22px;
  }

  .article-page--story .article-figure {
    gap: 8px;
  }

  .article-page--story .article-figure__photo {
    height: 190px;
    border: 0;
  }

  .article-page--story .article-figure__caption {
    font-size: 10px;
    line-height: 15px;
  }

  .article-page--story .article-figure__caption .icon {
    display: none;
  }

  .article-page--story .article-video {
    align-items: stretch;
    text-align: left;
  }

  .article-page--story .article-others__title {
    text-align: left;
  }

  .article-page--story .article-others__grid {
    --grid-gap: 12px;
  }

  /* «Файлы» истории: заголовок над карточкой, строки через разделитель. */
  .article-files--list {
    order: 1;
    gap: 14px;
    padding: 0;
    border-radius: 0;
    background: none;
  }

  .article-page--story .article-others {
    order: 2;
  }

  .article-files--list .article-files__title {
    font-size: 24px;
    line-height: 24px;
  }

  .article-files--list .article-files__list {
    gap: 0;
    overflow: hidden;
    border-radius: var(--radius-12);
    background: var(--surface);
  }

  .article-files--list .article-files__list > li + li {
    border-top: 1px solid var(--line);
  }

  .article-files--list .article-file {
    border-radius: 0;
    background: none;
  }

  /* Список обрезан по скруглению — обводку фокуса рисуем внутри. */
  .article-files--list .article-file:focus-visible {
    outline-offset: -3px;
  }

  .article-files--list .article-file__icon {
    width: 36px;
    height: 36px;
    background: var(--bg);
  }
}

/* История на десктопе: «Файлы» — продолжение текста (56 px от фото). */
@media (min-width: 768px) {
  .article-page--story .article-head__title {
    max-width: 1080px;
    font-size: 56px;
    line-height: 60px;
  }

  .article-files--list {
    max-width: 1080px;
    margin-top: calc(56px - var(--page-gap));
  }

  .article-page--story .article-others .story-card {
    min-height: 212px;
    gap: 20px;
    padding: 24px;
  }

  .article-page--story .article-others .story-card__title {
    font-size: 19px;
    line-height: 25px;
  }

  .article-page--story .article-others .story-card__portrait {
    width: 48px;
    height: 48px;
  }

  .article-page--story .article-others .story-card__name {
    font-size: 14px;
    line-height: 18px;
  }

  .article-page--story .article-others .story-card__role {
    font-size: 11.5px;
  }

  .article-page--story .article-others .story-card__go {
    width: 36px;
    height: 36px;
  }
}

