/* ==========================================================================
   База: сброс, типографика, колонка, кнопки, теги, служебные классы.
   Значения сняты с макетов 1:1 (дробные размеры шрифта — как в макете).
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-weight: 400;
  line-height: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Пока открыто меню или окно — страница под ним не прокручивается. */
body.is-locked {
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote {
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
}

ul, ol {
  padding: 0;
  list-style: none;
}

img, video, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Касание без стандартной цветной подложки браузера; фокус — ниже в :focus-visible. */
a, button, summary {
  -webkit-tap-highlight-color: transparent;
}

/* Тексты из админки (exhibition/formatting.py): **жирный** и [ссылки](…). Ссылка в тексте
   подчёркнута, иначе её не отличить от слов вокруг; цвет — как у текста, поэтому она
   читается и на светлом, и на тёмном фоне. */
.text-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: currentColor;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  transition: text-decoration-color 0.15s ease;
}

/* Телефон (в том числе подстановка {телефон}) не разрывается по дефису: «22-20-31». */
.text-link[href^="tel:"] {
  white-space: nowrap;
}

@media (hover: hover) {
  .text-link:hover {
    text-decoration-color: currentColor;
  }
}

strong {
  font-weight: 600;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

/* Фокус с клавиатуры — стиль из спецификации вопроса FAQ (AiEy6). */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Иконки Lucide (спрайт static/icons/lucide.svg) ─────────────────────── */
.icon {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Колонка контента ────────────────────────────────────────────────────── */
/* Полоса (фон) тянется на всю ширину, содержимое — по центру. */
.container {
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

/* Страница: блоки идут столбиком, между ними 50 / 96 px (как в макетах). */
.page {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--page-gap);
  padding-top: var(--page-top, 50px);
  padding-bottom: var(--page-gap);
}

/* ── Кнопки ──────────────────────────────────────────────────────────────── */
.btn {
  --btn-h: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: var(--btn-h);
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-8);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn--accent {
  background: var(--accent);
  color: var(--cream);
}

.btn--outline {
  border-color: var(--ink);
  color: var(--ink);
}

.btn--outline-accent {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--light {
  background: var(--bg);
  color: var(--ink);
}

.btn--block {
  display: flex;
  width: 100%;
}

/* Ховеры в макетах не нарисованы: лёгкое затемнение, цвета не меняются. */
@media (hover: hover) {
  .btn:hover {
    filter: brightness(0.92);
  }

  .btn--outline:hover,
  .btn--outline-accent:hover {
    filter: none;
    background-color: rgb(0 0 0 / 0.04);
  }
}

/* «Подробнее →» в карточках. */
.more-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.more-link .icon {
  width: 12px;
  height: 12px;
}

/* ── Теги и плашки ───────────────────────────────────────────────────────── */
/* Тег на карточке: «№ 7», «ЗАЛ 1», «ОДЕЖДА». */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: var(--radius-6);
  background: var(--chip);
  color: var(--accent);
  font-size: 10px;
  font-weight: 400;
  white-space: nowrap;
}

.tag .icon {
  width: 11px;
  height: 11px;
}

/* Плашка-пилюля: «6 залов», «45 экспонатов». */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 10.5px;
  white-space: nowrap;
}

.pill--accent {
  background: var(--accent);
  color: var(--cream);
}

@media (min-width: 768px) {
  .pill {
    padding: 8px 14px;
    font-size: 12.5px;
  }
}

/* Счётчик со значком: «6 залов», «45 экспонатов» (страница «Экспозиция выставки»). */
.counter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: var(--radius-5);
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  white-space: nowrap;
}

.counter .icon {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

@media (min-width: 768px) {
  .counter {
    gap: 9px;
    padding: 11px 16px;
    border-radius: var(--radius-6);
    font-size: 13px;
  }

  .counter .icon {
    width: 16px;
    height: 16px;
  }
}

/* Надзаголовок прописными: «В ЭТОМ ЗАЛЕ», «ТИП МАТЕРИАЛА», «КОНТАКТЫ». */
.eyebrow {
  color: var(--ink-2);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Служебные классы ────────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Мобайл < 768, десктопная структура ≥ 768. */
@media (min-width: 768px) {
  .mobile-only {
    display: none !important;
  }
}

@media (max-width: 767.98px) {
  .desktop-only {
    display: none !important;
  }
}

/* Фото-обложки: фон-картинка или <img> с object-fit. */
.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  background: var(--photo-placeholder);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important; /* иначе блоки появляются с задержкой анимации */
    scroll-behavior: auto !important;
  }
}
