/* ==========================================================================
   О центре (макеты cjFcT мобайл, X0oj4 десктоп).
   Мобайл — база, затем 768 (десктопная структура) и 1200 (десктоп).
   ========================================================================== */

/* Заголовки разделов: «История выставки», «Экспозиция выставки», «Посещение», «Контакты». */
/* На мобайле кегль уменьшается вместе с шириной экрана, чтобы самое длинное слово
   («Фотоматериалы» — 10,45 кегля) помещалось в колонку: 40 px от ~460 px, на 375 — 32 px.
   Все заголовки страницы при этом одного размера. */
.about-page__heading {
  color: var(--ink);
  font-size: min(40px, (100vw - 32px) / 10.6);
  line-height: 1;
}

/* ── 1. Вводный блок: только обложка — плашки с цифрами убраны по правкам заказчика,
   до «Истории выставки» обычный просвет между разделами страницы. ─────────── */
.about-intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.about-intro__cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 480px;
  padding: 0 18px 22px;
  overflow: hidden;
  border-radius: var(--radius-12);
  background: var(--photo-placeholder);
}

.about-intro__photo {
  position: absolute;
  inset: 0;
}

/* Затемнение как в макете: #00000059 → #00000026 (35 %) → #000000E6. */
.about-intro__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(0 0 0 / 0.35) 0%, rgb(0 0 0 / 0.15) 35%, rgb(0 0 0 / 0.9) 100%);
}

.about-intro__text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.about-intro__place {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  background: var(--overlay-ink-72);
  color: var(--cream);
  font-size: 10.5px;
  white-space: nowrap;
}

.about-intro__place .icon {
  width: 13px;
  height: 13px;
}

.about-intro__title {
  color: var(--cream);
  font-size: 48px;
  line-height: 49px;
}

.about-intro__lead {
  color: var(--surface);
  font-size: 13px;
  font-weight: 300;
  line-height: 21px;
}

/* Абзацы вводного текста (через пустую строку в админке) — с отступом примерно в полстроки. */
.about-intro__lead > p + p,
.about-history__lead > p + p {
  margin-top: 0.8em;
}

/* ── 2. История выставки ─────────────────────────────────────────────────── */
/* Отступ от заголовка раздела до содержимого — как в «Залах», «Посещении» и «Контактах»:
   18 px на мобайле, 32 px от 768. */
.about-history {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.about-history__lead {
  color: var(--ink);
  font-size: 15px;
  font-weight: 300;
  line-height: 24px;
}

.about-history__points {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 8px;
}

.about-history__point {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* «01 ———» — номер и черта до края колонки. */
.about-history__number {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.5px;
}

.about-history__number::after {
  content: "";
  flex: 1 1 0;
  height: 1px;
  background: var(--line);
}

.about-history__text {
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 300;
  line-height: 21px;
}

/* Врезка-цитата: на мобайле — вид компонента, на десктопе — в одну строку. */
.quote--about .quote__role,
.quote--about .quote__name {
  white-space: nowrap;
}

/* Хронология и Фотоматериалы — отдельные разделы с обычным отступом между разделами. */
.about-chronology {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Хронология: на мобайле столбиком, на десктопе в ряд. */
.about-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.about-timeline__item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius-10);
  background: var(--surface);
}

.about-timeline__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.about-timeline__head::after {
  content: "";
  flex: 1 1 0;
  height: 1px;
  background: var(--line);
}

.about-timeline__year {
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--accent);
  font-size: 13px;
  white-space: nowrap;
}

.about-timeline__text {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 300;
  line-height: 19px;
}

.about-timeline__item--current {
  background: var(--brown);
}

.about-timeline__item--current .about-timeline__head::after {
  background: var(--line-on-dark);
}

.about-timeline__item--current .about-timeline__year {
  background: var(--accent);
  color: var(--cream);
}

.about-timeline__item--current .about-timeline__text {
  color: var(--bg);
}

/* Фотоматериалы: крупное фото и пара под ним (на десктопе — справа). */
.about-photos {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.about-photos__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.about-photos__item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.about-photos__item--large {
  grid-column: 1 / -1;
}

/* Фото под крупным идут парами; оставшееся без пары — на всю ширину. */
@media (max-width: 767.98px) {
  .about-photos__item:not(.about-photos__item--large):last-child:nth-child(even) {
    grid-column: 1 / -1;
  }
}

.about-photos__photo {
  display: block;
  height: 130px;
  overflow: hidden;
  border-radius: var(--radius-10);
  background: var(--photo-placeholder);
}

.about-photos__item--large .about-photos__photo {
  height: 190px;
}

.about-photos__caption {
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 300;
  line-height: 15px;
}

/* ── 3. Экспозиция выставки: карточки залов ─────────────────────────────── */
.about-halls {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.about-halls__head {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.about-halls__intro {
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 300;
  line-height: 21px;
}

.about-halls__grid {
  --grid-gap: 16px;
}

/* ── 4. Посещение ────────────────────────────────────────────────────────── */
.about-visit {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.about-visit__columns {
  display: flex;
  flex-direction: column;
  gap: 50px;
}

/* Режим работы: тёмная панель с днями недели. */
.about-hours {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-12);
  background: var(--brown);
}

.about-hours__top {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.about-hours__label {
  color: var(--muted-on-dark);
  font-family: var(--font-text);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.about-hours__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  background: var(--line-on-dark);
  color: var(--bg);
  font-size: 10px;
  white-space: nowrap;
}

.about-hours__badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.about-hours__day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  font-size: 12.5px;
  white-space: nowrap;
}

.about-hours__day + .about-hours__day {
  border-top: 1px solid var(--line-on-dark);
}

.about-hours__day dt {
  color: var(--bg);
  font-weight: 300;
}

.about-hours__day dd {
  color: var(--cream);
  font-weight: 600;
}

.about-hours__day--off dt,
.about-hours__day--off dd {
  color: var(--muted-on-dark);
  font-weight: 300;
}

.about-hours__button {
  --btn-h: 50px;
  font-size: 14px;
  font-weight: 400;
}

/* Запись на экскурсию. */
.about-booking {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.about-booking__title {
  color: var(--ink);
  font-size: 40px;
  line-height: 40px;
}

.about-booking__steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.about-booking__step {
  display: flex;
  gap: 13px;
  padding: 15px;
  border-radius: var(--radius-10);
  background: var(--surface);
}

.about-booking__number {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--cream);
  font-size: 12px;
  font-weight: 600;
}

.about-booking__text {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.about-booking__step-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 17px;
}

.about-booking__step-desc {
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 300;
  line-height: 18px;
}

/* К услугам посетителей. */
.about-services {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 32px; /* на мобайле блок отделён от шагов на 50 px */
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-10);
}

.about-services__label {
  color: var(--accent);
  font-family: var(--font-text);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.about-services__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-services__item {
  display: flex;
  gap: 10px;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 300;
  line-height: 18px;
}

.about-services__item .icon {
  width: 15px;
  height: 15px;
}

.about-services__item span {
  flex: 1 1 0;
  min-width: 0;
}

/* ── 5. Контакты ─────────────────────────────────────────────────────────── */
.about-contacts {
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-margin-top: 20px;
}

.about-contacts__columns {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.about-contacts__card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-12);
  background: var(--surface);
}

.about-contacts__row {
  display: flex;
  gap: 13px;
  padding: 16px;
}

.about-contacts__row + .about-contacts__row {
  border-top: 1px solid var(--line);
}

.about-contacts__icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--bg);
  color: var(--accent);
}

.about-contacts__icon .icon {
  width: 16px;
  height: 16px;
}

.about-contacts__text {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.about-contacts__label {
  color: var(--ink-2);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  white-space: nowrap;
}

.about-contacts__value {
  color: var(--ink);
  font-size: 13px;
  line-height: 19px;
  overflow-wrap: anywhere;
}

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

@media (hover: hover) {
  a.about-contacts__value:hover {
    opacity: 0.75;
  }
}

/* Карта Яндекса: виджет во весь блок. Фон блока виден, пока карта загружается. */
.about-map {
  position: relative;
  height: 260px;
  overflow: hidden;
  border-radius: var(--radius-12);
  background: var(--photo-placeholder);
}

.about-map__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Десктопная структура (≥ 768) ────────────────────────────────────────── */
@media (min-width: 768px) {
  .about-page__heading {
    font-size: 54px;
    line-height: 54px;
  }

  .about-intro__cover {
    min-height: 560px;
    padding: 0 48px 48px;
  }

  .about-intro__text {
    gap: 20px;
  }

  .about-intro__place {
    gap: 8px;
    padding: 9px 14px;
    font-size: 12px;
  }

  .about-intro__place .icon {
    width: 14px;
    height: 14px;
  }

  .about-intro__title {
    font-size: 62px;
    line-height: 64px;
  }

  .about-intro__lead {
    max-width: 760px;
    font-size: 15px;
    line-height: 26px;
  }

  /* История выставки */
  .about-history,
  .about-chronology {
    gap: 32px;
  }

  /* Ширина вводного абзаца — не шире первой колонки пунктов (половина минус зазор 20 px). */
  .about-history__lead {
    max-width: calc((100% - 20px) / 2);
    font-size: 19px;
    line-height: 30px;
  }

  /* Две колонки, нумерация сверху вниз: 01, 02 слева, 03, 04 справа. Пунктов сколько угодно:
     число строк (--rows — половина пунктов с округлением вверх) задаёт шаблон. */
  .about-history__points {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(var(--rows, 2), auto);
    gap: 30px 20px;
    padding-top: 0;
  }

  .about-history__point {
    gap: 14px;
  }

  .about-history__number {
    gap: 14px;
    font-size: 14px;
  }

  .about-history__text {
    font-size: 13.5px;
    line-height: 24px;
  }

  /* Врезка в одну строку: знак, цитата, подпись справа. */
  .quote--about {
    flex-direction: row;
    align-items: center;
    gap: 32px;
    width: 100%;
    padding: 32px 36px;
    text-align: left;
  }

  .quote--about .quote__mark {
    width: 30px;
    height: 30px;
  }

  .quote--about .quote__text {
    flex: 1 1 0;
    min-width: 0;
    font-size: 19px;
    line-height: 29px;
  }

  .quote--about .quote__author {
    flex: none;
  }

  .quote--about .quote__emblem {
    width: 34px;
    height: 34px;
  }

  .quote--about .quote__name {
    font-size: 12.5px;
  }

  .quote--about .quote__role {
    font-size: 10.5px;
  }

  /* Хронология: 3 колонки на планшете, 5 в ряд на десктопе. */
  .about-timeline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }

  .about-timeline__item {
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius-12);
  }

  .about-timeline__head::after {
    display: none;
  }

  .about-timeline__year {
    padding: 6px 12px;
  }

  .about-timeline__text {
    min-height: 104px;
  }

  /* Фотоматериалы */
  .about-photos {
    gap: 32px;
  }

  /* Фото сколько угодно (решение владельца). Первое — крупно слева на два ряда, два следующих
     справа, как в макете (колонки 854 и 405 ≈ 4 и 2 из шести). Остальные — по три в ряд;
     если в последнем ряду остаётся два фото, они делят его пополам, если одно — последние
     четыре встают двумя парами. Одно фото — во всю ширину; два — крупное и второе во весь
     его рост; четыре — крупное на три ряда и три справа. */
  .about-photos__grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: start;
    gap: 20px;
  }

  .about-photos__item {
    grid-column: span 2;
    gap: 10px;
  }

  .about-photos__item--large {
    grid-row: span 2;
    grid-column: span 4;
  }

  /* Последние фото — половинами ряда. */
  .about-photos__item:nth-child(3n + 4):nth-last-child(2),
  .about-photos__item:nth-child(3n + 5):last-child,
  .about-photos__item:nth-child(3n + 4):nth-last-child(4),
  .about-photos__item:nth-child(3n + 4):nth-last-child(4) ~ .about-photos__item {
    grid-column: span 3;
  }

  .about-photos__photo {
    height: 145px;
    border-radius: var(--radius-12);
  }

  .about-photos__item--large .about-photos__photo {
    height: 348px;
  }

  .about-photos__item:nth-child(3n + 4):nth-last-child(2) .about-photos__photo,
  .about-photos__item:nth-child(3n + 5):last-child .about-photos__photo,
  .about-photos__item:nth-child(3n + 4):nth-last-child(4) .about-photos__photo,
  .about-photos__item:nth-child(3n + 4):nth-last-child(4) ~ .about-photos__item .about-photos__photo {
    height: 200px;
  }

  /* Одно фото — во всю ширину. */
  .about-photos__item--large:only-child {
    grid-row: auto;
    grid-column: 1 / -1;
  }

  /* Два фото: второе справа во весь рост крупного, а не половиной высоты. */
  .about-photos__item--large:nth-last-child(2) + .about-photos__item {
    grid-row: span 2;
    align-self: stretch;
  }

  .about-photos__item--large:nth-last-child(2) + .about-photos__item .about-photos__photo {
    flex: 1 1 0;
    min-height: 145px;
    height: auto;
  }

  /* Четыре фото: крупное на три ряда, рядом три фото столбиком. */
  .about-photos__item--large:nth-last-child(4) {
    grid-row: span 3;
    align-self: stretch;
  }

  .about-photos__item--large:nth-last-child(4) .about-photos__photo {
    flex: 1 1 0;
    min-height: 348px;
    height: auto;
  }

  .about-photos__caption {
    font-size: 11.5px;
    line-height: 17px;
  }

  /* Экспозиция выставки */
  .about-halls {
    gap: 32px;
  }

  .about-halls__head {
    gap: 12px;
  }

  .about-halls__intro {
    max-width: 660px;
    font-size: 14px;
    line-height: 23px;
  }

  .about-halls__grid {
    --grid-gap: 20px;
  }

  /* Посещение: режим работы слева, запись и услуги справа. */
  .about-visit {
    gap: 32px;
  }

  .about-visit__columns {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 32px;
  }

  .about-hours {
    padding: 24px;
  }

  .about-hours__top {
    gap: 16px;
  }

  .about-hours__label {
    font-size: 9.5px;
  }

  .about-hours__badge {
    font-size: 10.5px;
  }

  .about-hours__day {
    padding: 12px 0;
    font-size: 13px;
  }

  .about-booking__title {
    font-size: 30px;
    line-height: 33px;
  }

  .about-booking__steps {
    gap: 12px;
  }

  .about-booking__step {
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius-12);
  }

  .about-booking__number {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .about-booking__step-title {
    font-size: 15px;
    line-height: 20px;
  }

  .about-booking__step-desc {
    font-size: 13px;
    line-height: 21px;
  }

  .about-services {
    gap: 16px;
    margin-top: 0;
    padding: 20px;
    border-radius: var(--radius-12);
  }

  .about-services__label {
    font-size: 9.5px;
  }

  .about-services__item {
    font-size: 12.5px;
    line-height: 19px;
  }

  .about-services__item .icon {
    width: 16px;
    height: 16px;
  }

  /* Контакты: реквизиты слева, схема справа. */
  .about-contacts {
    gap: 32px;
  }

  .about-contacts__columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
  }

  .about-contacts__row {
    gap: 14px;
    padding: 20px;
  }

  .about-contacts__icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-10);
  }

  .about-contacts__icon .icon {
    width: 17px;
    height: 17px;
  }

  .about-contacts__label {
    font-size: 9px;
  }

  .about-contacts__value {
    font-size: 13.5px;
    line-height: 20px;
  }

  .about-contacts__note {
    font-size: 11px;
  }

  /* Карта растягивается по высоте реквизитов (в макете обе 368 px). */
  .about-map {
    height: auto;
    min-height: 368px;
  }
}

/* Планшет: подпись врезки переносится под цитату, иначе текст зажат в узкую колонку. */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .quote--about {
    flex-wrap: wrap;
    row-gap: 20px;
  }

  .quote--about .quote__author {
    flex-basis: 100%;
    padding-left: 62px; /* под текстом цитаты: знак 30 + зазор 32 */
  }
}

/* ── Десктоп (≥ 1200) ────────────────────────────────────────────────────── */
@media (min-width: 1200px) {
  .about-timeline {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  /* В макете колонки 405 и 843 px из 1280 (треть и две трети за вычетом зазоров). */
  .about-visit__columns,
  .about-contacts__columns {
    grid-template-columns: minmax(0, 405fr) minmax(0, 843fr);
  }

  .about-services__list {
    flex-direction: row;
    gap: 24px;
  }

  .about-services__item {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* Широкий экран: фото держат пропорции макета 1440, а не высоту в px. */
@media (min-width: 1200px) {
  /* Обложка с текстом: 560 px на 1440, растёт с шириной, но не выше 680. */
  .about-intro__cover {
    min-height: clamp(560px, 39vw, 680px);
  }

  /* Пара фото справа — в пропорциях макета; крупное фото тянется
     на их общую высоту, чтобы низ блоков совпадал. */
  .about-photos__photo {
    height: auto;
    aspect-ratio: 405 / 145;
  }

  .about-photos__item--large {
    align-self: stretch;
  }

  .about-photos__item--large .about-photos__photo {
    flex: 1 1 0;
    min-height: 0;
    height: auto;
    aspect-ratio: auto;
  }

  /* Половины ряда — в тех же пропорциях, что и фото справа от крупного. */
  .about-photos__item:nth-child(3n + 4):nth-last-child(2) .about-photos__photo,
  .about-photos__item:nth-child(3n + 5):last-child .about-photos__photo,
  .about-photos__item:nth-child(3n + 4):nth-last-child(4) .about-photos__photo,
  .about-photos__item:nth-child(3n + 4):nth-last-child(4) ~ .about-photos__item .about-photos__photo {
    height: auto;
  }

  .about-photos__item--large:nth-last-child(4) .about-photos__photo {
    min-height: 0;
  }

  /* Крупному фото не на что тянуться, когда фото одно или два: свои пропорции. */
  .about-photos__item--large:only-child .about-photos__photo {
    flex: none;
    aspect-ratio: 3 / 1;
  }

  .about-photos__item--large:nth-last-child(2) .about-photos__photo {
    flex: none;
    aspect-ratio: 854 / 348;
  }

  .about-photos__item--large:nth-last-child(2) + .about-photos__item .about-photos__photo {
    min-height: 0;
    aspect-ratio: auto;
  }
}

/* Широкий десктоп (≥ 1720): первая часть цитаты помещается в строку — переносим
   по \n из данных (QUOTE), «в дело» начинает вторую строку. Уже — переносы сами. */
@media (min-width: 1720px) {
  .quote--about .quote__text {
    white-space: pre-line;
  }
}
