/* ==========================================================================
   Страница экспоната (07): lBuky — мобайл, d18Zdw — десктоп
   («вариант 3 · Лонгрид с фотолентой»). Лайтбокс (18, VgSdf) — css/lightbox.css.
   Колонки текста 760 / 960 / 1080 px — через max-width, резиново.
   ========================================================================== */

/* Между блоками страницы на мобайле 44 px (в макете страницы, не 50). */
.exhibit-page {
  --page-gap: 44px;
}

@media (min-width: 768px) {
  .exhibit-page {
    --page-gap: var(--section-gap-desktop);
    --page-top: 72px;
  }
}

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

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

.exhibit-head__number,
.exhibit-head__hall,
.exhibit-head__status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
}

.exhibit-head__number {
  background: var(--accent);
  color: var(--cream);
  font-size: 15px;
  white-space: nowrap;
}

.exhibit-head__hall {
  gap: 7px;
  max-width: 100%;
  border: 1px solid var(--ink);
  font-size: 11.5px;
  overflow-wrap: anywhere; /* длинное название зала переносится внутри плашки */
  text-align: left;
  transition: background-color 0.15s ease;
}

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

/* «Сейчас не экспонируется» — плашка рядом с номером: заливка без обводки и серая точка
   (у «Вход свободный» точка акцентная — здесь знак, что экспонат не в зале). */
.exhibit-head__status {
  gap: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11.5px;
  white-space: nowrap;
}

.exhibit-head__status::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-2);
}

.exhibit-head__title {
  max-width: min(1100px, 100%);
  font-size: 30px;
  line-height: 32px;
  overflow-wrap: break-word; /* слова переносятся целиком, без дефисов */
}

.exhibit-head__lead {
  max-width: min(760px, 100%);
  overflow-wrap: break-word; /* длинное слово из админки не распирает страницу */
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 300;
  line-height: 23px;
}

/* Затемняется только плашка-ссылка: у экспоната скрытого зала плашка без ссылки. */
@media (hover: hover) {
  a.exhibit-head__hall:hover {
    background-color: rgb(0 0 0 / 0.04);
  }
}

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

  .exhibit-head__tags {
    gap: 10px;
  }

  .exhibit-head__number,
  .exhibit-head__hall,
  .exhibit-head__status {
    min-height: 40px;
    padding: 0 18px;
  }

  .exhibit-head__status {
    font-size: 12.5px;
  }

  .exhibit-head__number {
    font-size: 18px;
  }

  .exhibit-head__hall {
    gap: 8px;
    font-size: 12.5px;
  }

  .exhibit-head__hall .icon {
    width: 14px;
    height: 14px;
  }

  .exhibit-head__title {
    font-size: 76px;
    line-height: 78px;
  }

  .exhibit-head__lead {
    font-size: 16px;
    line-height: 27px;
  }
}

/* На планшете заголовок 76 px не помещается в колонку — кегль по ширине окна. */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .exhibit-head__title {
    font-size: clamp(48px, 6.3vw, 76px);
    line-height: 1.03;
  }
}

/* ── 2. Фотолента ────────────────────────────────────────────────────────────
   Мобайл: по одному фото на экран, листается свайпом (scroll-snap) и стрелками.
   Десктоп: лента начинается от левого края колонки и уходит за правый край окна
   (обрезка — по макету). Ширина кадра — по пропорциям фото (--ratio). */
.exhibit-gallery {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.exhibit-gallery__track {
  --strip-h: 340px;
  --strip-left: var(--gutter);
  display: flex;
  gap: 16px;
  padding-inline: var(--strip-left);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-padding-inline: var(--strip-left);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

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

.exhibit-gallery__item {
  flex: 0 0 100%;
  height: var(--strip-h);
  scroll-snap-align: start;
}

.exhibit-gallery__photo {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-12);
  background: var(--photo-placeholder);
  cursor: zoom-in;
  transition: filter 0.15s ease;
}

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

@media (hover: hover) {
  .exhibit-gallery__photo:hover {
    filter: brightness(0.94);
  }
}

.exhibit-gallery__controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.exhibit-gallery__counter {
  display: flex;
  flex: none;
  align-items: flex-end;
  gap: 5px;
  white-space: nowrap;
}

.exhibit-gallery__current {
  font-size: 22px;
  line-height: 22px;
}

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

.exhibit-gallery__progress {
  position: relative;
  flex: 1 1 0;
  min-width: 24px;
  height: 2px;
  background: var(--line);
}

.exhibit-gallery__progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.25s ease;
}

.exhibit-gallery__buttons {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

/* Одно фото: на телефоне строка не нужна (фото открывается касанием), на десктопе
   остаётся «На весь экран» — по центру под фото. */
.exhibit-gallery__controls--single {
  display: none;
}

.exhibit-gallery__full,
.exhibit-gallery__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: var(--radius-pill);
  color: var(--ink);
  transition: filter 0.15s ease, background-color 0.15s ease;
}

.exhibit-gallery__full {
  display: none;
}

.exhibit-gallery__arrow {
  width: 40px;
  height: 40px;
}

.exhibit-gallery__arrow .icon {
  width: 16px;
  height: 16px;
}

@media (hover: hover) {
  .exhibit-gallery__full:hover,
  .exhibit-gallery__arrow:hover {
    background-color: rgb(0 0 0 / 0.05);
  }
}

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

  .exhibit-gallery__track {
    /* 480 px на макете 1440; на планшете лента ниже. */
    --strip-h: clamp(300px, 33.34vw, 480px);
    /* Левый край колонки .container. */
    --strip-left: max(var(--gutter), (100% - var(--container)) / 2);
    gap: 12px;
  }

  .exhibit-gallery__item {
    flex: none;
    aspect-ratio: var(--ratio, 1);
  }

  /* Карусель (класс ставит exhibit.js): лента не прокручивается, первый слот
     большой и всегда широкий — --lead-ratio от 3:2 до 16:9 (вертикальное фото обрезается). */
  .exhibit-gallery.is-carousel .exhibit-gallery__track {
    overflow-x: hidden;
    scroll-snap-type: none;
  }

  .exhibit-gallery.is-carousel .exhibit-gallery__item.is-active {
    aspect-ratio: var(--lead-ratio, var(--ratio, 1));
  }

  .exhibit-gallery__controls {
    gap: 32px;
  }

  /* Одно фото: отдельный широкий кадр по центру, как в макете 960 × 560. */
  .exhibit-gallery--single .exhibit-gallery__track {
    width: min(960px, 100% - 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: 0;
    overflow-x: hidden;
    scroll-snap-type: none;
  }

  .exhibit-gallery--single .exhibit-gallery__item {
    flex: 0 0 100%;
    height: auto;
    aspect-ratio: 12 / 7;
  }

  .exhibit-gallery__controls--single {
    display: flex;
    justify-content: center;
  }

  .exhibit-gallery__counter {
    gap: 6px;
  }

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

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

  .exhibit-gallery__full {
    display: inline-flex;
    gap: 8px;
    height: 48px;
    padding: 0 18px;
    font-size: 12.5px;
    white-space: nowrap;
  }

  .exhibit-gallery__full .icon {
    width: 15px;
    height: 15px;
  }

  .exhibit-gallery__arrow {
    width: 48px;
    height: 48px;
  }

  .exhibit-gallery__arrow .icon {
    width: 18px;
    height: 18px;
  }
}

/* Экспонат без фото: заглушка на месте ленты, той же высоты (ТЗ 3.6). */
.exhibit-gallery-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 340px;
  border-radius: var(--radius-12);
  background: var(--photo-placeholder);
  color: var(--accent-40);
}

.exhibit-gallery-empty .icon {
  width: 52px;
  height: 52px;
}

@media (min-width: 768px) {
  .exhibit-gallery-empty {
    height: clamp(300px, 33.34vw, 480px);
  }

  .exhibit-gallery-empty .icon {
    width: 72px;
    height: 72px;
  }
}

/* ── 3. Полное описание ──────────────────────────────────────────────────── */
.exhibit-body {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Характеристики. Мобайл: две колонки с линиями между рядами. */
.exhibit-specs {
  padding: 20px 20px 2px;
  border-radius: var(--radius-12);
  background: var(--surface);
}

.exhibit-specs__title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  color: var(--accent);
  font-family: var(--font-text);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.exhibit-specs__title .icon {
  width: 15px;
  height: 15px;
}

.exhibit-specs__list {
  display: grid;
  /* Как в макете: левая колонка 151 + 16, правая 16 + 135 (при ширине 318). */
  grid-template-columns: minmax(0, 167fr) minmax(0, 151fr);
}

.exhibit-specs__item {
  position: relative;
  display: flex;
  flex-direction: column-reverse; /* значение над подписью, в разметке dt → dd */
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  padding: 20px 16px 20px 0;
  border-top: 1px solid var(--line);
}

.exhibit-specs__item:nth-child(even) {
  padding: 20px 0 20px 16px;
}

/* Вертикальная линия между колонками не доходит до горизонтальных на 6 px. */
.exhibit-specs__item:nth-child(even)::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 1px;
  background: var(--line);
}

.exhibit-specs__item:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.exhibit-specs__value {
  font-size: 16px;
  overflow-wrap: break-word;
}

.exhibit-specs__label {
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 300;
}

/* Текст. */
.exhibit-text {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.exhibit-text--intro {
  gap: 20px;
}

.exhibit-text__title {
  font-size: 30px;
  line-height: 30px;
}

.exhibit-text__lead {
  font-size: 15px;
  font-weight: 300;
  line-height: 25px;
}

.exhibit-text__subtitle {
  font-size: 21px;
  line-height: 25px;
}

.exhibit-text__p,
.exhibit-text__list li {
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 300;
}

.exhibit-text__p {
  line-height: 24px;
}

.exhibit-text__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Маркер — акцентная черта 10×2 в поле 12×22, отступ до текста 12. */
.exhibit-text__list li {
  position: relative;
  padding-left: 24px;
  line-height: 22px;
}

.exhibit-text__list li::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 1px;
  width: 10px;
  height: 2px;
  background: var(--accent);
}

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

.exhibit-figure__img {
  width: 100%;
  height: auto;
  aspect-ratio: 358 / 280;
  border: 2px solid var(--accent);
  border-radius: var(--radius-12);
  background: var(--photo-placeholder);
}

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

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

@media (min-width: 768px) {
  .exhibit-body {
    align-items: center;
    gap: 56px;
  }

  .exhibit-body > * {
    width: min(760px, 100%);
  }

  .exhibit-body > .exhibit-specs,
  .exhibit-body > .exhibit-figure {
    width: min(1080px, 100%);
  }

  .exhibit-body > .quote {
    width: min(960px, 100%);
  }

  .exhibit-specs {
    padding: 32px 36px;
  }

  .exhibit-specs__title {
    margin-bottom: 28px;
    font-size: 10px;
  }

  .exhibit-specs__title .icon {
    width: 16px;
    height: 16px;
  }

  /* Колонки подбираются под число характеристик (--cols-tablet / --cols-desktop
     из шаблона, фильтр grid_columns): до 3 / 5 в один ряд на всю ширину, больше —
     ровными рядами. Линия между колонками — в середине зазора; у первой колонки
     каждой строки она уходит за левый край списка и обрезается. */
  .exhibit-specs__list {
    grid-template-columns: repeat(var(--cols-tablet, 3), minmax(0, 1fr));
    gap: 28px 40px;
    overflow: hidden;
  }

  .exhibit-specs__item,
  .exhibit-specs__item:nth-child(even) {
    gap: 10px;
    padding: 0;
    border-top: 0;
  }

  .exhibit-specs__item::before,
  .exhibit-specs__item:nth-child(even)::before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: -20px;
    width: 1px;
    background: var(--line);
  }

  .exhibit-specs__item:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .exhibit-specs__value {
    font-size: 19px;
  }

  .exhibit-specs__label {
    font-size: 11.5px;
  }

  .exhibit-text {
    gap: 22px;
  }

  .exhibit-text--intro {
    gap: 28px;
  }

  .exhibit-text__title {
    font-size: 44px;
    line-height: 44px;
  }

  .exhibit-text__lead {
    font-size: 19px;
    line-height: 31px;
  }

  .exhibit-text__subtitle {
    font-size: 28px;
    line-height: 34px;
  }

  .exhibit-text__p,
  .exhibit-text__list li {
    font-size: 16px;
  }

  .exhibit-text__p {
    line-height: 29px;
  }

  .exhibit-text__list {
    gap: 12px;
  }

  /* Маркер 12×2 в поле 16×28, отступ до текста 14. */
  .exhibit-text__list li {
    padding-left: 30px;
    line-height: 28px;
  }

  .exhibit-text__list li::before {
    top: 13px;
    left: 2px;
    width: 12px;
  }

  .exhibit-figure {
    gap: 14px;
  }

  .exhibit-figure__img {
    aspect-ratio: 1080 / 560;
  }

  .exhibit-figure__caption {
    gap: 10px;
    padding-right: min(160px, 15%);
    font-size: 12.5px;
    line-height: 19px;
  }

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



@media (min-width: 1200px) {
  .exhibit-specs__list {
    grid-template-columns: repeat(var(--cols-desktop, 5), minmax(0, 1fr));
  }
}

/* Цитата — тёмная врезка components/quote.html, как на других страницах. */

/* ── 4. Переходы к соседним экспонатам ───────────────────────────────────── */
.exhibit-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exhibit-nav__pair {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exhibit-nav__card {
  display: flex;
  overflow: hidden;
  border-radius: var(--radius-12);
  background: var(--surface);
  color: var(--ink);
  transition: filter 0.15s ease;
}

.exhibit-nav__photo {
  display: none;
}

.exhibit-nav__text {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding: 12px 16px;
}

.exhibit-nav__card--next .exhibit-nav__text {
  align-items: flex-end;
  text-align: right;
}

.exhibit-nav__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  white-space: nowrap;
}

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

/* «Предыдущий экспонат» — на десктопе; на мобайле и планшете — «Предыдущий». */
.exhibit-nav__label-long {
  display: none;
}

@media (min-width: 1200px) {
  .exhibit-nav__label-long {
    display: inline;
  }
}

.exhibit-nav__name {
  display: flex;
  gap: 8px;
  max-width: 100%;
}

.exhibit-nav__number {
  flex: none;
  color: var(--accent);
  font-size: 14px;
  line-height: 16px;
  white-space: nowrap;
}

.exhibit-nav__title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 300;
  line-height: 16px;
}

/* Первый / последний экспонат зала — неактивная карточка (как у переходов между залами). */
.exhibit-nav__card--disabled {
  border: 1px solid var(--line);
  background: transparent;
}

.exhibit-nav__card--disabled .exhibit-nav__label .icon {
  color: var(--line);
}

.exhibit-nav__empty {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 300;
  line-height: 18px;
}

.exhibit-nav__catalog {
  --btn-h: 52px;
  width: 100%;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 400;
}

@media (hover: hover) {
  a.exhibit-nav__card:hover {
    filter: brightness(0.97);
  }
}

@media (min-width: 768px) {
  .exhibit-nav {
    align-items: center;
    gap: 24px;
  }

  .exhibit-nav__pair {
    flex-direction: row;
    gap: 20px;
    width: 100%;
  }

  .exhibit-nav__card {
    flex: 1 1 0;
    min-width: 0;
    min-height: 168px;
  }

  .exhibit-nav__photo {
    position: relative;
    display: block;
    flex: 0 0 35%;
    max-width: 220px;
    background: var(--photo-placeholder);
  }

  .exhibit-nav__photo img {
    position: absolute;
    inset: 0;
  }

  .exhibit-nav__text {
    justify-content: space-between;
    gap: 16px;
    padding: 24px 28px;
  }

  .exhibit-nav__label {
    gap: 8px;
    font-size: 9px;
    letter-spacing: 1px;
  }

  .exhibit-nav__label .icon {
    width: 16px;
    height: 16px;
  }

  .exhibit-nav__name {
    flex-direction: column;
    gap: 6px;
  }

  .exhibit-nav__card--next .exhibit-nav__name {
    align-items: flex-end;
  }

  .exhibit-nav__number {
    font-size: 22px;
    line-height: normal;
  }

  .exhibit-nav__title {
    font-size: 14px;
    line-height: 19px;
  }

  .exhibit-nav__empty {
    font-size: 14px;
    line-height: 19px;
  }

  .exhibit-nav__catalog {
    gap: 10px;
    width: auto;
    padding: 0 28px;
  }
}

/* ── 5. Другое в этом зале ───────────────────────────────────────────────── */
.exhibit-other {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.exhibit-other__title {
  font-size: 30px;
  line-height: 32px;
  text-align: center;
}

.exhibit-other__grid > li {
  display: flex;
}

.exhibit-other__grid .exhibit-card {
  flex: 1 1 auto;
  min-width: 0;
}

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

  .exhibit-other__title {
    font-size: 40px;
    line-height: 40px;
  }

  .exhibit-other__grid .exhibit-card {
    --ec-photo-h: 200px;
    --ec-title-size: 15px;
    --ec-title-lh: 20px;
    --ec-title-lines: 4;
  }
}

/* Широкий экран: фото держат пропорции макета 1440, а не высоту в px. */
@media (min-width: 1200px) {
  .exhibit-other__grid .exhibit-card {
    --ec-photo-h: auto;
    --ec-photo-ratio: 385 / 200;
  }
}
