/* ==========================================================================
   03 «Экспозиция выставки» — бывшие «Залы» (vNbtC мобайл, sqlKQ десктоп).
   Заголовок и счётчики — catalog.css, карточка зала — components.css.
   ========================================================================== */

/* Заголовок длиннее, чем «Залы» в макете: на телефоне кегль 44, а на экранах уже 366 px —
   чуть меньше, чтобы «Экспозиция» помещалась в строку. От 768 — общие 62 из catalog.css. */
.halls-page__title {
  font-size: min(44px, 12vw);
  line-height: 1.0455;
}

.halls-page__lead {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 300;
  line-height: 21px;
}

/* Мобайл — список, планшет — 2 колонки, десктоп — сетка 3×2 (.card-grid).
   Карточки в ряду одной высоты и с ровными линиями — .hall-card-grid в components.css. */
.halls-page__grid {
  --grid-gap: 16px;
}

@media (min-width: 768px) {
  .halls-page__title {
    font-size: 62px;
    line-height: 62px;
  }

  /* 720 px — текст ровно в две строки, «обучению» не уходит на третью. */
  .halls-page__lead {
    max-width: 720px;
    font-size: 14.5px;
    line-height: 25px;
  }

  .halls-page__grid {
    --grid-gap: 20px;
  }

  /* От заголовка до сетки — 40 px (между остальными блоками страницы 96). */
  .halls-page__list {
    margin-top: calc(40px - var(--page-gap));
  }
}

/* ── Экран на зал (≥ 1200 px, правки по вёрстке) ──────────────────────────────
   На компьютере вместо сетки карточек каждый зал — почти экран: крупный заголовок
   и «Смотреть все экспонаты» над плитками; плитка зала — как тёмная панель первого экрана
   страницы зала: фото во всю плитку и описание на тёплом затемнении; вокруг до четырёх
   плиток экспонатов — тоже фото во всю плитку, метка «№ 3», название и описание поверх
   снимка. У чётных залов плитки зеркально. Сетка — 3 колонки × 6 рядов, высота — по экрану:
   на 1920 × 1080 зал целиком в окне. Экспонатов меньше четырёх — плитка зала занимает их место. */
.halls-showcase {
  display: none;
}

@media (min-width: 1200px) {
  .halls-page__grid {
    display: none;
  }

  .halls-showcase {
    display: flex;
    flex-direction: column;
    gap: 120px;
  }

  .hall-show {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }

  /* Заголовок зала и кнопка — одной строкой, по центру строки. */
  .hall-show__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
  }

  .hall-show__title {
    min-width: 0;
    font-size: clamp(32px, 2.1vw, 40px);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.01em;
    text-wrap: balance;
    overflow-wrap: break-word;
  }

  .hall-show__title a {
    transition: color 0.15s ease;
  }

  .hall-show__all {
    flex: none;
    color: var(--bg);
  }

  /* Сетка: левая колонка шире (плитки экспонатов крупнее), правые две — под плитку зала. */
  .hall-show__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: repeat(6, minmax(0, 1fr));
    gap: 16px;
    height: clamp(560px, calc(100vh - 240px), 820px);
  }

  .hall-show--mirror .hall-show__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr);
  }

  .hall-show__hall { grid-area: hall; }
  .hall-show__exhibit--1 { grid-area: e1; }
  .hall-show__exhibit--2 { grid-area: e2; }
  .hall-show__exhibit--3 { grid-area: e3; }
  .hall-show__exhibit--4 { grid-area: e4; }

  .hall-show--n4 .hall-show__grid {
    grid-template-areas:
      "e1 hall hall" "e1 hall hall" "e1 hall hall"
      "e2 hall hall" "e2 e3 e4" "e2 e3 e4";
  }

  .hall-show--n3 .hall-show__grid {
    grid-template-areas:
      "e1 hall hall" "e1 hall hall" "e1 hall hall"
      "e2 hall hall" "e2 e3 e3" "e2 e3 e3";
  }

  .hall-show--n2 .hall-show__grid {
    grid-template-areas:
      "e1 hall hall" "e1 hall hall" "e1 hall hall"
      "e2 hall hall" "e2 hall hall" "e2 hall hall";
  }

  .hall-show--n1 .hall-show__grid {
    grid-template-areas: "e1 hall hall" "e1 hall hall" "e1 hall hall" "e1 hall hall" "e1 hall hall" "e1 hall hall";
  }

  /* Зал без экспонатов — одна плитка зала, невысокая: экран пустой плитки ни к чему. */
  .hall-show--n0 .hall-show__grid {
    grid-template-areas: "hall hall hall" "hall hall hall" "hall hall hall" "hall hall hall" "hall hall hall" "hall hall hall";
    height: clamp(300px, 36vh, 420px);
  }

  .hall-show--mirror.hall-show--n4 .hall-show__grid {
    grid-template-areas:
      "hall hall e1" "hall hall e1" "hall hall e1"
      "hall hall e2" "e3 e4 e2" "e3 e4 e2";
  }

  .hall-show--mirror.hall-show--n3 .hall-show__grid {
    grid-template-areas:
      "hall hall e1" "hall hall e1" "hall hall e1"
      "hall hall e2" "e3 e3 e2" "e3 e3 e2";
  }

  .hall-show--mirror.hall-show--n2 .hall-show__grid {
    grid-template-areas:
      "hall hall e1" "hall hall e1" "hall hall e1"
      "hall hall e2" "hall hall e2" "hall hall e2";
  }

  .hall-show--mirror.hall-show--n1 .hall-show__grid {
    grid-template-areas: "hall hall e1" "hall hall e1" "hall hall e1" "hall hall e1" "hall hall e1" "hall hall e1";
  }

  /* Плитки — фото во всю плитку, текст поверх снимка на затемнении снизу. */
  .hall-show__hall,
  .hall-show__exhibit {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 0;
    overflow: hidden;
    border-radius: var(--radius-12);
    background: var(--brown);
    color: var(--cream);
    isolation: isolate;
  }

  .hall-show__photo {
    position: absolute;
    z-index: -1;
    inset: 0;
    overflow: hidden;
  }

  .hall-show__photo::after {
    content: "";
    position: absolute;
    inset: 0;
  }

  /* Зал — тёплое коричневое затемнение, как у панели первого экрана страницы зала. */
  .hall-show__hall .hall-show__photo::after {
    background:
      linear-gradient(to top, var(--brown) 0%, color-mix(in srgb, var(--brown) 82%, transparent) 28%, transparent 62%),
      linear-gradient(to right, color-mix(in srgb, var(--brown) 45%, transparent) 0%, transparent 55%);
  }

  .hall-show__exhibit .hall-show__photo::after {
    background: linear-gradient(to top, var(--overlay-ink-72) 0%, color-mix(in srgb, var(--ink) 35%, transparent) 45%, transparent 70%);
  }

  .hall-show__hall-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
    padding: 40px;
  }

  .hall-show__hall-lead {
    display: -webkit-box;
    max-width: 30ch;
    overflow: hidden;
    color: var(--cream);
    font-size: clamp(20px, 1.45vw, 26px);
    font-weight: 300;
    line-height: 1.36;
    letter-spacing: -0.005em;
    text-wrap: pretty;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }

  /* «Перейти в зал» — светлая обводка; при наведении на плитку заливается. */
  .hall-show__go {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 20px;
    border: 1px solid var(--cream-60);
    border-radius: var(--radius-pill);
    font-size: 13.5px;
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  }

  .hall-show__go .icon {
    width: 16px;
    height: 16px;
  }

  /* Метка номера — та же, что на карточках экспонатов. */
  .hall-show__number {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 5px 9px;
    font-size: 11px;
  }

  .hall-show__exhibit-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 22px 22px;
  }

  .hall-show__exhibit-title {
    display: -webkit-box;
    overflow: hidden;
    font-size: 19px;
    font-weight: 400;
    line-height: 1.25;
    overflow-wrap: break-word;
    text-wrap: balance;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .hall-show__exhibit-arrow {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    vertical-align: -2px;
    color: var(--cream-70);
    transition: color 0.15s ease;
  }

  .hall-show__exhibit-lead {
    display: -webkit-box;
    max-width: 46ch;
    overflow: hidden;
    color: var(--cream-70);
    font-size: 13.5px;
    font-weight: 300;
    line-height: 20px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  /* Маленькие плитки под залом — только название, в одну-две строки. */
  .hall-show--n4 .hall-show__exhibit--3 .hall-show__exhibit-lead,
  .hall-show--n4 .hall-show__exhibit--4 .hall-show__exhibit-lead,
  .hall-show--n3 .hall-show__exhibit--3 .hall-show__exhibit-lead {
    display: none;
  }

  .hall-show--n4 .hall-show__exhibit--3 .hall-show__exhibit-title,
  .hall-show--n4 .hall-show__exhibit--4 .hall-show__exhibit-title {
    font-size: 16px;
  }

  .hall-show--n4 .hall-show__exhibit--3 .hall-show__exhibit-body,
  .hall-show--n4 .hall-show__exhibit--4 .hall-show__exhibit-body {
    padding: 16px 18px 18px;
  }

  /* Фокус с клавиатуры — обводка внутри плитки, по скруглению. */
  .hall-show__hall:focus-visible,
  .hall-show__exhibit:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }

  @media (hover: hover) {
    .hall-show__title a:hover {
      color: var(--accent);
    }

    .hall-show__hall:hover .hall-show__go {
      border-color: var(--cream);
      background: var(--cream);
      color: var(--ink);
    }

    .hall-show__exhibit:hover .hall-show__exhibit-arrow {
      color: var(--cream);
    }
  }
}
