/* ─────────────────────────────────────────
   TALAP — основной CSS
   ───────────────────────────────────────── */

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
input, button, textarea, select { font: inherit; }

/* === Design tokens === */
:root {
  /* Цвета (из палитры TALAP) */
  --ink:           #0F2E5C;
  --ink-deep:      #08203F;
  --ink-soft:      #1A3F70;
  --paper:         #F2EEE6;
  --paper-2:       #E8E2D5;
  --paper-3:       #D5CDBC;
  --blue:          #1E5FA8;
  --blue-dark:     #164685;
  --highlight:     #7AA9D4;
  --highlight-soft:#9EC2DF;
  --blue-veil:     rgba(30, 95, 168, 0.15);  /* полупрозрачный --blue (подсветка) */
  --terracotta:    #C26142;
  --terracotta-dark:#A85037;
  --terracotta-veil:rgba(194, 97, 66, 0.2);  /* полупрозрачный --terracotta (подсветка дня события) */
  --muted:         #6B6759;
  --line:          rgba(15, 46, 92, 0.12);
  --line-light:    rgba(242, 238, 230, 0.15);

  /* Типографика */
  --font-serif:    'Lora', Georgia, 'Times New Roman', serif;
  --font-sans:     'Mulish', system-ui, -apple-system, sans-serif;
  --font-mono:     'IBM Plex Mono', 'Courier New', monospace;

  /* Раскладка */
  --container:     1280px;
  --gutter:        clamp(16px, 4vw, 48px);
  --section-y:     clamp(48px, 8vw, 96px);

  /* Брейкпоинты (Tailwind-совместимые sm / md / lg).
     Использовать в самих @media запросах нельзя — CSS-переменные не
     поддерживаются внутри media-condition. Эти токены — справочные,
     меняешь значение здесь → обнови соответствующие литералы в @media. */
  --bp-sm: 640px;   /* выше: альбомный смартфон / маленький планшет */
  --bp-md: 768px;   /* выше: планшет в портретной                  */
  --bp-lg: 1024px;  /* выше: десктоп / широкий планшет             */
}

/* === Base === */
body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);

  /* Sticky-footer: body — flex column на всю высоту viewport,
     <main> растягивается, footer прижимается к низу. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.1;
  color: var(--ink);
}

/* ─────────────────────────────────────────
   HEADER
   ───────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

/* Utility bar — navy */
.utility-bar {
  background: var(--ink);
  color: white;
  padding: 22px 0;
  border-bottom: 1px solid var(--ink-soft);
}

.utility-bar .container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.utility-bar__search,
.utility-bar__right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.utility-bar__right { justify-content: flex-end; }

.utility-bar__logo {
  display: block;
  height: 42px;
  width: auto;
}

.utility-bar__logo svg {
  height: 100%;
  width: auto;
}

.utility-bar a, .utility-bar button {
  color: white;
  font-size: 15px;
  font-weight: 500;
  transition: color .15s;
}

.utility-bar a:hover, .utility-bar button:hover {
  color: var(--highlight);
}

/* Поле поиска в шапке (центр utility-bar). Лупа — submit-кнопка слева
   внутри поля; ввод + Enter / клик по лупе → /search/?q=. На navy-фоне:
   полупрозрачный фон, светлый текст. */
.header-search {
  position: relative;
  display: flex;
  align-items: center;
}
.header-search input {
  width: 320px;
  max-width: 38vw;
  padding: 9px 14px 9px 40px;
  background: var(--ink);            /* как у хэдера — поле сливается с фоном */
  border: 1px solid var(--line-light);
  border-radius: 2px;
  color: white;
  font-size: 14px;
}
.header-search input::placeholder { color: rgba(255, 255, 255, 0.6); }
.header-search input:focus {
  outline: none;
  border-color: var(--highlight);    /* фокус — подсветкой рамки, фон не меняем */
}
.header-search__btn {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--highlight-soft);
}
.header-search__btn svg { width: 18px; height: 18px; stroke: currentColor; }
.header-search__btn:hover { color: white; }

/* ─── Lang-menu (переключатель языка как dropdown) ─────────
   Используется и в utility-bar (тёмный фон, белый текст), и в
   footer'е бургер-меню (светлый фон, тёмный текст). Цвет триггера
   наследуется через color: inherit, hover-фоны разные по контексту. */

.lang-menu {
  position: relative;
}

.lang-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: inherit;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.utility-bar .lang-menu__trigger:hover,
.utility-bar .lang-menu__trigger[aria-expanded="true"] {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}

.mobile-menu__foot .lang-menu__trigger:hover,
.mobile-menu__foot .lang-menu__trigger[aria-expanded="true"] {
  background: var(--paper-3);
}

.lang-menu__chevron {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  transition: transform .15s;
}

.lang-menu__trigger[aria-expanded="true"] .lang-menu__chevron {
  transform: rotate(180deg);
}

.lang-menu__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 160px;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(15, 46, 92, 0.18);
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lang-menu__menu[hidden] { display: none; }

/* Модификатор для раскрытия вверх (footer бургера). */
.lang-menu--up .lang-menu__menu {
  top: auto;
  bottom: calc(100% + 8px);
}

/* В utility-bar dropdown справа от триггера — лучше прижать к правому
   краю (lang-menu сидит рядом с user-menu, который растягивается). */
.utility-bar .lang-menu__menu {
  left: auto;
  right: 0;
}

/* Селекторы для пунктов меню принудительно специфичнее, чем
   .utility-bar a { color: white } — иначе в попапе lang-menu
   неактивный пункт получает белый цвет и сливается с фоном. */
.lang-menu__menu .lang-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  border-radius: 2px;
  text-decoration: none;
  transition: background .15s, color .15s;
}

.lang-menu__menu .lang-menu__item-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
  min-width: 22px;
}

.lang-menu__menu .lang-menu__item:hover {
  background: var(--paper-2);
  color: var(--blue);
}

.lang-menu__menu .lang-menu__item.is-active {
  background: var(--paper-2);
  color: var(--blue);
  font-weight: 700;
}
.lang-menu__menu .lang-menu__item.is-active .lang-menu__item-code { color: var(--blue); }

/* Перевода нет (switch_lang_url вернул пусто) — кликов не принимаем,
   убираем hover-эффект, оставляем layout, чтобы меню не «прыгало». */
.lang-menu__menu .lang-menu__item.is-disabled {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
}
.lang-menu__menu .lang-menu__item.is-disabled:hover {
  background: transparent;
  color: var(--ink);
}

/* Primary nav — paper */
.primary-nav {
  background: var(--paper);
  padding: 22px 0;
}

.primary-nav .container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.primary-nav ul {
  display: flex;
  gap: clamp(24px, 4vw, 56px);
}

.primary-nav a {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  padding: 6px 0;
  position: relative;
  transition: color .15s;
}

.primary-nav a:hover { color: var(--blue); }

.primary-nav a.is-active::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: -23px;
  height: 2px;
  background: var(--blue);
}

/* Burger menu (mobile) */
.nav-toggle {
  display: none; /* виден только на мобильном */
  width: 32px;
  height: 32px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle__icon,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
  content: '';
  display: block;
  width: 22px;
  height: 2px;
  background: white;
  position: relative;
  transition: transform .2s, top .2s, bottom .2s, opacity .2s;
}

.nav-toggle__icon::before { position: absolute; top: -7px; left: 0; }
.nav-toggle__icon::after  { position: absolute; bottom: -7px; left: 0; }

#nav-state { display: none; }

#nav-state:checked ~ .utility-bar .nav-toggle__icon { background: transparent; }
#nav-state:checked ~ .utility-bar .nav-toggle__icon::before { top: 0; transform: rotate(45deg); }
#nav-state:checked ~ .utility-bar .nav-toggle__icon::after  { bottom: 0; transform: rotate(-45deg); }

/* Мобильное меню — раскрывается burger'ом */
/* Мобильное меню — выезжающий drawer: ВСЯ панель целиком (поиск + пункты +
   нижний бар) выезжает из-под хедера через translateY. На ДРАГЕ кап снят
   (.nav-dragging) — панель полной высоты «протягивается» мимо окна: из-под
   хедера первым выходит нижний бар (язык/вход), последним сверху доезжает поиск.
   В ПОКОЕ (#nav-state:checked) кап «вьюпорт − хедер» + внутренний скролл: верх
   (поиск/пункты) виден, низ докручивается. Чтобы при выезде не просвечивала
   страница — затемняющая подложка .mobile-menu-backdrop. Скорость выезда
   (мультипликатор D) — только на открытии (menu-drag.js). Состояние держит
   #nav-state:checked, живой драг — .nav-dragging + --nav-progress. */
.mobile-menu-wrap { display: none; }
.mobile-menu-backdrop { display: none; }

.mobile-menu {
  transform: translateY(-100%);
  transition: transform .32s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .mobile-menu { transition: none; }
}

.mobile-menu__search,
.mobile-menu__foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 var(--gutter);
  background: var(--paper-2);
  min-height: 68px;
}

.mobile-menu__search { border-bottom: 1px solid var(--line); }

/* Footer бургера: на узких экранах (Galaxy Fold, iPhone 12/13 mini)
   lang + auth-блок не помещаются в одну строку — разрешаем перенос
   самого footer'а и заменяем фиксированный min-height на вертикальный
   padding, чтобы при переносе высота нарастала естественно. Сам
   auth-блок остаётся nowrap, чтобы «Войти» и «Зарегистрироваться»
   никогда не были в разных строках. */
.mobile-menu__foot {
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 12px;
  min-height: 0;
  padding-top: 16px;
  padding-bottom: 16px;
}

.mobile-menu__search svg {
  width: 20px;
  height: 20px;
  stroke: var(--muted);
  flex-shrink: 0;
}

.mobile-menu__search input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 16px;
  color: var(--ink);
  outline: none;
}

.mobile-menu__search input::placeholder { color: var(--muted); }

.mobile-menu__nav {
  list-style: none;
}

.mobile-menu__nav li {
  border-bottom: 1px solid var(--line);
}

.mobile-menu__nav a {
  display: block;
  padding: 16px var(--gutter);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
}

.mobile-menu__nav a:hover { color: var(--blue); }

.mobile-menu__nav a.is-active {
  color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

/* ─────────────────────────────────────────
   SECTIONS — общая логика
   ───────────────────────────────────────── */

.section {
  padding: var(--section-y) 0;
}

.section--dark {
  background: var(--ink-deep);
  color: var(--paper);
}

.section--dark h1, .section--dark h2, .section--dark h3 {
  color: var(--paper);
}

.section--alt {
  background: var(--paper-2);
}

.section-header {
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin-top: 8px;
}

.section-header .actions {
  margin-top: 16px;
}

.section-header .actions a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--blue);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.section-header .actions a:hover { color: var(--blue-dark); }

/* ─────────────────────────────────────────
   HERO
   ───────────────────────────────────────── */

.hero {
  padding: clamp(48px, 6vw, 80px) 0 clamp(48px, 8vw, 96px);
  border-bottom: 1px solid var(--line);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}

.hero__text .eyebrow { margin-bottom: 24px; }

.hero__title {
  font-size: clamp(36px, 5.5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.hero__dek {
  font-size: clamp(17px, 1.3vw, 19px);
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 32px;
  max-width: 540px;
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.hero__meta a {
  color: var(--blue);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

.hero__image {
  position: relative;     /* якорь иконки атрибуции изображения */
  aspect-ratio: 5 / 4;
  background: linear-gradient(135deg, var(--paper-3), var(--paper-2));
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Картинка накрывает рамку целиком: рендишн fill-900x720 совпадает с
   аспектом контейнера (5:4), object-fit — страховка от округлений.
   Серверный кроп учитывает focal point изображения (как у карточек). */
.hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__image::before {
  content: '';
  position: absolute;
  inset: 24px;
  border: 1px solid var(--line);
}

.hero__image-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
}

/* ─────────────────────────────────────────
   TRUST STRIP
   ───────────────────────────────────────── */

.trust-strip {
  /* фон — на section-модификаторе (.section--alt/--dark), см. blocks/trust_strip.html */
  padding: 48px 0;
}

.trust-strip__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.trust-item {
  text-align: left;
  border-left: 2px solid var(--ink);
  padding-left: 20px;
}

.trust-item__number {
  font-family: var(--font-serif);
  font-size: 52px;
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
  display: block;
  margin-bottom: 8px;
}

.trust-item__label {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
}

/* ─────────────────────────────────────────
   CARDS — общий стиль
   ───────────────────────────────────────── */

.card {
  display: block;
  color: inherit;
}

.card__image-link {
  display: block;
  color: inherit;
}

/* Обёртка изображения карточки: позиционирующий якорь иконки атрибуции
   (кнопка — сестра ссылки card__image-link, не внутри <a>) */
.card__media { position: relative; }
.card__image {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--paper-3), var(--paper-2));
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.card__image-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Статус-бейдж карточки — поверх изображения/плейсхолдера, в левом нижнем углу.
   Экономит строку в теле карточки (бейдж есть только у событий). */
.card__badges {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  z-index: 1;
}
.card__badges .badge { margin: 0; }
/* Плейсхолдер-подпись уходит наверх, чтобы не пересекаться с бейджем внизу. */
.card__image--badged .card__image-label { top: 12px; bottom: auto; }

.card__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
  display: block;
  text-decoration: none;
}

a.card__eyebrow:hover { text-decoration: underline; }

.card__title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 8px;
}

.card__title-link {
  color: var(--ink);
  text-decoration: none;
  transition: color .15s;
}

.card__title-link:hover { color: var(--blue); }

.card__excerpt {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.card__excerpt-link {
  color: inherit;
  text-decoration: none;
}

.card__excerpt-link:hover { color: var(--blue); }

.card__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.card__meta a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 2px;
  transition: color .15s, text-decoration-color .15s;
}

.card__meta a:hover {
  color: var(--blue);
  text-decoration-color: currentColor;
}

/* Magazine grid: 1 large + 2 medium */
.latest-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
}
/* Один материал — side-колонку и разделитель не рендерим (см.
   _page_latest.html); lead растягивается во всю ширину обычной вертикальной
   карточкой (картинка сверху, текст снизу) — одиночный featured-материал. */
.latest-grid--single {
  grid-template-columns: 1fr;
}

.latest-grid__lead .card__title { font-size: 32px; }
.latest-grid__lead .card__image { aspect-ratio: 16 / 9; }

.latest-grid__side {
  display: grid;
  gap: 32px;
  border-left: 1px solid var(--line);
  padding-left: 48px;
}

.latest-grid__side .card__image { aspect-ratio: 16 / 10; }
.latest-grid__side .card__title { font-size: 18px; }

/* ─────────────────────────────────────────
   DATALAB SHOWCASE
   ───────────────────────────────────────── */

.datalab-showcase {
  /* фон — на section-модификаторе (.section--alt/--dark), см. blocks/datalab.html */
  padding: var(--section-y) 0;
}

.datalab-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
}

.datalab-featured {
  background: var(--paper);
  padding: 40px;
  border: 1px solid var(--line);
  position: relative;
}

.datalab-featured .eyebrow {
  color: var(--blue);
  margin-bottom: 12px;
}

.datalab-featured__big-number {
  font-family: var(--font-serif);
  font-size: clamp(60px, 8vw, 96px);
  line-height: 1;
  color: var(--ink);
  margin: 8px 0 12px;
}

.datalab-featured__caption {
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 32px;
  font-family: var(--font-serif);
}

.datalab-featured__sparkline {
  height: 80px;
  width: 100%;
  margin-bottom: 16px;
}

.datalab-featured__source {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.datalab-text h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 20px;
}

.datalab-text p {
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 28px;
}

.datalab-text .btn-link {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

/* ─────────────────────────────────────────
   EVENTS
   ───────────────────────────────────────── */

.events-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.event-card {
  border-top: 2px solid var(--ink);
  padding-top: 16px;
}

.event-card__date {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Время всегда под датой: .event-card__when — вертикальный стек
   (месяц-год сверху, время снизу). Чип формата — на одной строке. */
.event-card__when {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}
.event-card__month,
.event-card__time { white-space: nowrap; }
.event-card__format { white-space: nowrap; }

.event-card__date-big {
  font-family: var(--font-serif);
  font-size: 32px;
  color: var(--ink);
  line-height: 1;
}

/* Компактная карточка без изображения (списки upcoming/past) — бейдж
   аккуратной строкой между датой и заголовком, без «плавающих» отступов. */
.event-card__badges {
  margin: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.event-card__badges .badge { margin: 0; }

.event-card__title {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 16px;
}

.event-card__meta {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.event-card__format {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  border: 1px solid var(--line);
  padding: 4px 10px;
  margin-left: auto;
}

/* ─────────────────────────────────────────
   ПРОФАЙЛЫ — карточки (на тёмном/светлом фоне)
   ───────────────────────────────────────── */

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.profile-card {
  background: var(--ink);
  padding: 32px;
  border: 1px solid var(--ink-soft);
}

.profile-card__photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ink-soft), var(--blue));
  margin-bottom: 20px;
  overflow: hidden;
}

.profile-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-card__name {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--paper);
  margin-bottom: 4px;
}

.profile-card__position {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--highlight);
  margin-bottom: 16px;
}

.profile-card__quote {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.5;
  color: var(--highlight-soft);
  font-style: italic;
  margin-bottom: 20px;
}

.profile-card__link {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--highlight);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

/* ─────────────────────────────────────────
   НАПРАВЛЕНИЯ (тематические рубрики)
   ───────────────────────────────────────── */

.topics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}

.topic {
  padding: 32px 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: block;
  color: inherit;
  transition: background .15s;
}

.topic:hover { background: var(--paper-2); }
.topic:last-child { border-right: none; }

.topic__number {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}

.topic__title {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 12px;
}

.topic__desc {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ─────────────────────────────────────────
   SUBSCRIBE BAND
   ───────────────────────────────────────── */

.subscribe-band {
  /* фон — на section-модификаторе (.section--alt/--dark), см. blocks/subscribe.html */
  padding: 64px 0;
  border-top: 1px solid var(--line);
}

.subscribe-band__inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.subscribe-band__title {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 32px);
  margin-bottom: 12px;
}

.subscribe-band__text {
  font-size: 16px;
  color: var(--ink-soft);
  margin-bottom: 32px;
}

.subscribe-form {
  display: flex;
  gap: 8px;
  max-width: 480px;
  margin: 0 auto;
}

.subscribe-form input {
  flex: 1;
  padding: 14px 18px;
  border: 1px solid var(--ink);
  background: var(--paper);
  font-size: 15px;
  color: var(--ink);
}

.subscribe-form input::placeholder { color: var(--muted); }

.subscribe-form button {
  padding: 14px 24px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background .15s;
}

.subscribe-form button:hover { background: var(--blue-dark); }

/* ─────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────── */

.site-footer {
  background: var(--ink-deep);
  color: var(--paper);
  padding: 80px 0 32px;
}

.footer-wordmark {
  margin-bottom: 64px;
  width: 100%;
  max-width: 720px;
}

.footer-wordmark svg {
  width: 100%;
  height: auto;
  display: block;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line-light);
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--highlight);
  margin-bottom: 20px;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col a {
  font-size: 14px;
  color: var(--highlight-soft);
  transition: color .15s;
}

.footer-col a:hover { color: var(--paper); }

/* Соц-иконки футера: ряд одинаковых скруглённых чипов. Единый контейнер
   задаёт визуальную сетку, поэтому разные по форме глифы смотрятся ровно. */
.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
}
.footer-social li { margin-bottom: 0; }
.footer-social a {
  display: inline-flex;
  color: var(--highlight-soft);
  transition: color .15s;
}
.footer-social a:hover { color: var(--paper); }
.social-icon { display: block; width: 20px; height: 20px; }

.footer-bottom {
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--highlight);
  letter-spacing: 0.05em;
}

/* ─────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────── */

@media (max-width: 1024px) {
  .hero__grid,
  .datalab-grid { grid-template-columns: 1fr; }

  .trust-strip__grid { grid-template-columns: repeat(2, 1fr); }
  .events-grid,
  .profile-grid,
  .topics-grid { grid-template-columns: repeat(2, 1fr); }

  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* «Журнальная» сетка (Свежее / афиша event_upcoming_hero) → одна колонка
     на среднем брейкпоинте: на планшете (768–1024) остаётся lead + side. */
  .latest-grid { grid-template-columns: 1fr; }
  .latest-grid__side {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 32px;
  }

  /* Utility bar на мобильном: лого по центру, бургер справа.
     На десктопе лого слева (1-я колонка), поиск — в центре; на мобильном
     поиск скрыт, поэтому возвращаем лого в центральную колонку
     (`grid-column: 2`), а бургер занимает правую. user-menu/lang/auth-кнопки
     прячем — вся эта навигация уже живёт в самом бургер-меню. */
  /* Явно сажаем все три в строку 1 по колонкам 1fr/auto/1fr (поиск col1 — пуст,
     лого col2 — центр, бургер col3 — справа). `grid-row: 1` обязателен: лого —
     первый в DOM, но форсирован в col2, а следующий поиск с col1 (< col2) при
     row-упаковке падал бы на 2-ю строку (курсор не идёт назад). */
  .utility-bar { padding: 16px 0; }
  .utility-bar__search { grid-column: 1; grid-row: 1; }
  .utility-bar__logo { height: 32px; grid-column: 2; grid-row: 1; }
  .utility-bar__right { grid-column: 3; grid-row: 1; }

  .utility-bar .header-search,
  .utility-bar .lang-menu,
  .utility-bar .btn-auth,
  .utility-bar .user-menu { display: none; }

  .nav-toggle { display: flex; }
  .utility-bar__right { justify-content: flex-end; }

  /* Скрываем горизонтальную навигацию */
  .primary-nav { display: none; }

  /* Мобильное меню — выезжающий drawer (клип-обёртка + transform). */
  .mobile-menu-wrap {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    overflow: hidden;          /* клипает drawer, когда он уехал вверх */
    z-index: 90;               /* поверх страницы, под контентом utility-bar */
    pointer-events: none;      /* закрытый drawer не перехватывает тапы */
  }

  /* Открыт (чекбокс) или тянется — drawer кликабелен */
  #nav-state:checked ~ .mobile-menu-wrap,
  .site-header.nav-dragging .mobile-menu-wrap { pointer-events: auto; }

  .mobile-menu {
    border-top: 1px solid var(--ink-soft);
    background: var(--paper);
    box-shadow: 0 14px 26px -14px rgba(0, 0, 0, 0.4);
    /* Кап = «вьюпорт − хедер» + внутренний скролл: панель не выше окна, низ
       (язык/вход) достижим прокруткой. --header-h ставит menu-drag.js. */
    max-height: calc(100vh - var(--header-h, 88px));
    max-height: calc(100dvh - var(--header-h, 88px));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* Открыто (тап по бургеру / доводка после драга): вся панель выехала. */
  #nav-state:checked ~ .mobile-menu-wrap .mobile-menu { transform: translateY(0); }

  /* Живой драг: позицию задаёт --nav-progress (0 закрыто … 1 открыто), без
     transition. !important перебивает :checked при закрывающем драге.
     На время драга СНИМАЕМ кап — панель становится своей полной высоты
     (жёсткий блок), и translateY(-100%→0) «протягивает» её мимо окна: из-под
     хедера первым выходит футер, последним сверху доезжает поиск. На отпускании
     кап возвращается (см. :checked), футер уходит в скролл. */
  .site-header.nav-dragging .mobile-menu {
    transition: none !important;
    transform: translateY(calc((var(--nav-progress, 0) - 1) * 100%)) !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  /* Затемняющая подложка: пока панель выезжает, страница под ней притемнена
     (а не просвечивает в зазор). Кроет область ниже хедера; прозрачность ∝
     прогрессу (драг) либо .45 (открыто). */
  .mobile-menu-backdrop {
    display: block;
    position: fixed;
    top: var(--header-h, 88px);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .32s cubic-bezier(0.4, 0, 0.2, 1);
  }
  #nav-state:checked ~ .mobile-menu-backdrop { opacity: .45; }
  .site-header.nav-dragging .mobile-menu-backdrop {
    transition: none;
    opacity: calc(var(--nav-progress, 0) * .45);
  }

  /* Адаптив сетки */
  .trust-strip__grid,
  .events-grid,
  .profile-grid,
  .topics-grid,
  .footer-grid { grid-template-columns: 1fr; }

  .topic { border-right: none; }

  .subscribe-form { flex-direction: column; }
}

/* ============================================================
   Внутренние страницы: статьи, индексы
   ============================================================ */

.container--narrow {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ContentPage с раскладкой "wide": все блоки внутри игнорируют
   ограничение --narrow и тянутся до основного --container.
   Блоки сами не знают про режим страницы — они продолжают писать
   `.container container--narrow`, а каскад здесь поднимает потолок. */
.content-page--wide .container--narrow {
  max-width: var(--container);
}
.content-page--wide .content-page__intro {
  max-width: none;
}

/* ─────────────────────────────────────────
   CONTENT PAGE (StreamField-based generic pages)
   ───────────────────────────────────────── */

.content-page__header {
  padding: clamp(48px, 8vw, 96px) 0 clamp(24px, 4vw, 40px);
}

.content-page__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}

.content-page__title {
  font-family: var(--font-serif);
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  font-weight: 400;
  color: var(--ink);
  margin: 0;
}

.content-page__intro {
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.5;
  color: var(--muted);
  margin: 24px 0 0;
  max-width: 60ch;
}

.content-page__body { padding-bottom: clamp(64px, 10vw, 120px); }

.content-page__heading {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--ink);
  margin: clamp(32px, 4vw, 48px) 0 16px;
}
.content-page__heading--h2 { font-size: clamp(28px, 3.5vw, 36px); }
.content-page__heading--h3 { font-size: clamp(22px, 2.5vw, 26px); }

.content-page__rich-text {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  margin: 16px 0;
}
.content-page__rich-text p { margin: 0 0 14px; }
.content-page__rich-text p:last-child { margin-bottom: 0; }
.content-page__rich-text a {
  color: var(--blue);
  border-bottom: 1px solid currentColor;
}
.content-page__rich-text a:hover { opacity: 0.7; }
.content-page__rich-text ul,
.content-page__rich-text ol { padding-left: 24px; margin: 0 0 14px; }
.content-page__rich-text li { margin-bottom: 6px; }
.content-page__rich-text blockquote {
  border-left: 3px solid var(--paper-3);
  margin: 20px 0;
  padding: 4px 0 4px 20px;
  font-style: italic;
  color: var(--ink-soft);
}
.content-page__rich-text h3,
.content-page__rich-text h4 { margin: 28px 0 12px; }
.content-page__rich-text h3:first-child,
.content-page__rich-text h4:first-child { margin-top: 0; }
.content-page__rich-text h3 { font-size: 24px; }
.content-page__rich-text h4 { font-size: 19px; }

.content-page__profiles-section {
  padding: clamp(32px, 5vw, 64px) 0;
}

/* ─── ImageBlock ───────────────────────────────────────── */

.content-page__image {
  margin: clamp(24px, 4vw, 40px) 0;
}
.content-page__image img {
  display: block;
  width: 100%;
  height: auto;
}

/* CSS-кроп. Поля --t/--r/--b/--l задаются inline в шаблоне (см.
   common/blocks/image.html). Идея: контейнер с aspect-ratio равным
   соотношению ВИДИМОЙ области (после кропа), внутри — img отскейлен
   так, что его видимая часть заполняет контейнер, остальное отрезается
   overflow:hidden. При нулевых отступах поведение совпадает с обычной
   картинкой 100% ширины. */
.img-crop {
  --vis-w: calc(100 - var(--l) - var(--r));  /* % видимой ширины оригинала */
  --vis-h: calc(100 - var(--t) - var(--b));  /* % видимой высоты оригинала */
  aspect-ratio: calc(var(--iw) * var(--vis-w)) / calc(var(--ih) * var(--vis-h));
  overflow: hidden;
  position: relative;
  width: 100%;
}
.content-page__image .img-crop img {
  position: absolute;
  display: block;
  max-width: none;                       /* перебиваем глобальный img reset */
  width: calc(10000% / var(--vis-w));    /* 100% × 100 / vis-w */
  height: auto;
  top: calc(var(--t) * -100% / var(--vis-h));
  left: calc(var(--l) * -100% / var(--vis-w));
}

.content-page__image-caption {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
}

.content-page__image-link {
  display: block;
  transition: opacity .15s;
}
.content-page__image-link:hover { opacity: 0.85; }
.content-page__image-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

/* ─── QuoteBlock ───────────────────────────────────────── */

.content-page__quote {
  margin: clamp(32px, 5vw, 56px) 0;
  padding-left: clamp(20px, 3vw, 32px);
  border-left: 3px solid var(--terracotta);
}
.content-page__quote-text {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.5vw, 28px);
  font-style: italic;
  line-height: 1.35;
  color: var(--ink);
  margin: 0;
}
.content-page__quote-text p { margin: 0 0 12px; }
.content-page__quote-text p:last-child { margin-bottom: 0; }

.content-page__quote-attribution {
  margin-top: 16px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink-soft);
}
.content-page__quote-author {
  font-weight: 600;
  color: var(--ink);
}
.content-page__quote-role {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

/* ─── ButtonBlock ─────────────────────────────────────── */

.content-page__button-wrap {
  margin: clamp(24px, 3vw, 32px) 0;
}

/* ─── DividerBlock ────────────────────────────────────── */

.content-page__divider {
  margin: clamp(32px, 5vw, 56px) auto;
  border: 0;
}
/* Линия — тонкая черта во всю ширину колонки. */
.content-page__divider--line {
  height: 0;
  border-top: 1px solid var(--line);
}
/* Точки — три точки по центру (декоративный разрыв). */
.content-page__divider--dots {
  text-align: center;
  line-height: 1;
  color: var(--muted);
}
.content-page__divider--dots::before {
  content: "• • •";
  letter-spacing: 0.4em;
  font-size: 14px;
}
/* Пробел — только вертикальный отступ, без видимой черты. */
.content-page__divider--space {
  margin: clamp(16px, 3vw, 28px) auto;
}

/* ─────────────────────────────────────────
   FILE CARD (FileBlock — карточка файла)
   ───────────────────────────────────────── */

.file-card {
  border: 1px solid var(--line);
  padding: clamp(20px, 3vw, 32px);
  margin: clamp(16px, 2.5vw, 24px) 0;
}
/* Надстрочник («Документ N») — float-right (как в оригинале): заголовок
   обтекает его, первая строка переносится левее, нижние строки забирают всю
   ширину. Отрицательный margin приподнимает метку в padding-зону справа-сверху;
   margin-left держит зазор до текста заголовка. */
.file-card__eyebrow {
  float: right;
  margin: -10px -10px 4px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
}
.file-card__title {
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 400;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 14px;
}
.file-card__desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 16px;
}
.file-card__action {
  margin: 0 0 14px;
}
.file-card__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin: 0;
}

/* Список файлов (FileListBlock) — заголовок + стопка карточек */
.file-list__heading {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 4px;
}

/* Источники (AttributionListBlock) — выделенная панель атрибуции.
   Стиль выделения параметризован модификатором: card (рамка, как file-card),
   panel (подложка --paper-2), accent (левый кант --blue). */
.attribution {
  padding: clamp(20px, 3vw, 28px);
  margin: clamp(16px, 2.5vw, 24px) 0;
}
.attribution--card { border: 1px solid var(--line); }
.attribution--panel { background: var(--paper-2); }
.attribution--accent {
  border-left: 3px solid var(--blue);
  padding-top: 4px;
  padding-bottom: 4px;
}
.attribution--plain { padding: 0; }
.attribution__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 12px;
}
.attribution__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.attribution__item {
  font-size: 15px;
  line-height: 1.55;
  padding: 5px 0;
  color: var(--ink);
}
/* Нумерация (numbered) — CSS-счётчик моно-стилем, в духе file-card__eyebrow.
   Номер ВЫНЕСЕН из потока (висячий отступ): все строки элемента — включая
   видимый URL после <br/> (show_url) — выровнены по тексту названия. */
.attribution__list--numbered { counter-reset: attribution; }
.attribution__list--numbered .attribution__item {
  counter-increment: attribution;
  position: relative;
  padding-left: 30px;            /* место под номер до двух цифр */
}
.attribution__list--numbered .attribution__item::before {
  content: counter(attribution) '.';
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--blue);
}
a.attribution__label {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a.attribution__label:hover { color: var(--blue-dark); }
.attribution__note {
  color: var(--muted);
  margin-left: 8px;
  font-size: 14px;
}
/* «Показывать URL отдельно» — видимый адрес как есть, следующей строкой */
.attribution__url {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.attribution__url:hover { color: var(--blue-dark); }

/* Атрибуция изображения (свойство PortalImage) — иконка-«i» поверх картинки
   (ImageBlock), по клику поповер с текстом/ссылкой источника. Механика
   открытия/закрытия — generic dropdown.js (data-dropdown). */
.image-media { position: relative; }

/* Кадр фиксированных пропорций (ImageBlock ratio/fit — как у карусели):
   контейнер держит аспект, изображение накрывает (cover) или вписывается
   с полями на подложке (contain). Взаимоисключим с .img-crop (clean()). */
.img-frame {
  width: 100%;
  overflow: hidden;
  background: var(--paper-2);   /* поля при contain */
}
.img-frame img { width: 100%; height: 100%; display: block; }
.img-frame--fit-cover img { object-fit: cover; }
.img-frame--fit-contain img { object-fit: contain; }
.img-frame--16x9 { aspect-ratio: 16 / 9; }
.img-frame--4x3 { aspect-ratio: 4 / 3; }
.img-frame--1x1 { aspect-ratio: 1 / 1; }
.img-frame--3x4 { aspect-ratio: 3 / 4; }
.img-frame--9x16 { aspect-ratio: 9 / 16; }
.image-attribution {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;          /* поверх подписи слайда/градиентов (карусель) */
}
.image-attribution__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 4px;
  border: none;
  border-radius: 50%;
  background: rgba(8, 32, 63, 0.55);   /* --ink-deep с прозрачностью */
  color: #fff;
  cursor: pointer;
}
.image-attribution__btn:hover,
.image-attribution__btn[aria-expanded="true"] {
  background: rgba(8, 32, 63, 0.85);
}
.image-attribution__bubble {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: min(320px, 72vw);
  padding: 8px 12px;
  background: var(--ink-deep);
  color: var(--paper);
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 4px 14px rgba(8, 32, 63, 0.25);
}
.image-attribution__bubble a {
  color: var(--paper);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ─────────────────────────────────────────
   ERROR PAGES (404 / 500 / 403)
   ───────────────────────────────────────── */

.error-page {
  padding: clamp(64px, 12vw, 120px) 0 clamp(80px, 14vw, 140px);
}

/* Большая декоративная цифра 404 — приглушённая, чтобы не давила
   на заголовок ниже. Не аутлайн и не градиент — плотный paper-3
   оттенок, читается даже на slow connections. */
.error-page__numeral {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(120px, 20vw, 240px);
  line-height: 0.9;
  color: var(--paper-3);
  margin: 0 0 16px;
  user-select: none;
}

.error-page__title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 400;
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 24px;
}

.error-page__lead {
  font-family: var(--font-sans);
  font-size: clamp(18px, 2vw, 20px);
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 20px;
  max-width: 560px;
}

.error-page__body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 560px;
}
.error-page__body p { margin: 0 0 12px; }
.error-page__body p:last-child { margin-bottom: 0; }

.error-page__body a {
  color: var(--blue);
  border-bottom: 1px solid currentColor;
  transition: opacity .15s;
}
.error-page__body a:hover { opacity: 0.7; }

.error-page__meanwhile {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.error-page__meanwhile-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
  font-weight: 500;
}

.error-page__meanwhile-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.error-page__meanwhile-links a {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s;
}

.error-page__meanwhile-links a:hover {
  border-bottom-color: var(--blue);
}

.article {
  padding: 64px 0 96px;
  background: var(--paper);
}

.article__head {
  margin-bottom: 32px;
}

/* Мета-строка детальной страницы: eyebrow слева + «Поделиться» справа. */
.article__meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.article__meta .eyebrow {
  flex: 1;
  min-width: 0;
}

/* «Поделиться» — дропдаун в мета-строке (common/_share.html; механика —
   dropdown.js, копирование ссылки — share.js). Триггер в типографике
   eyebrow; на ≤--bp-sm подпись прячется, остаётся иконка (aria-label на
   кнопке). Меню — поверхность как у lang-menu. */
.share {
  position: relative;
  flex: none;
}

.share__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: none;
  border: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s;
}

.share__trigger:hover,
.share__trigger[aria-expanded="true"] {
  color: var(--blue);
}

.share__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.share__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 224px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(15, 46, 92, 0.18);
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.share__menu[hidden] { display: none; }

.share__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: none;
  border: 0;
  border-radius: 2px;
  font-family: var(--font-sans);
  font-size: 14px;
  text-align: left;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.share__item .social-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--blue);
}

.share__item:hover {
  background: var(--paper-2);
  color: var(--blue);
}

.share__item--copy {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 2px 2px;
  padding-top: 10px;
}

.share__item--copy.is-copied { color: var(--blue); }

@media (max-width: 640px) {
  .share__label { display: none; }
}

/* Счётчик просмотров в мета-строке (common/_views_count.html):
   иконка-глаз + число в типографике eyebrow. */
.views {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: text-bottom;
}

.views__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.article__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  margin: 12px 0 16px;
  color: var(--ink);
}

.article__lede {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--ink);
  margin: 8px 0;
}

/* «В календарь» на детальной странице события (этап 5a). */
/* «Когда / где / формат» — общий блок события (страница + manage).
   Двухколоночная label/value сетка с mono-меткой. */
.event-meta {
  display: grid;
  gap: 8px;
  margin: 0 0 24px;
}
.event-meta__row {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  align-items: start;
}
/* Метка-иконка вместо текстовых КОГДА/ГДЕ (текст уезжает в .visually-hidden для
   скринридеров): календарь у даты, пин у адреса. Видна на всех ширинах, включая
   телефон, — заодно различает строки, когда значение переносится. */
.event-meta__label {
  display: block;
}
.event-meta__icon {
  display: block;
  width: 16px;
  height: 16px;
  margin-top: 3px;             /* оптический центр по первой строке значения (15px/1.5) */
  color: var(--muted);
}
.event-meta__value {
  font-size: 15px;
  color: var(--ink);
}

/* Действия на странице события: «Зарегистрироваться» слева, онлайн-ссылка
   справа (margin-left:auto) на неузких экранах; на ≤--bp-sm — стопкой слева. */
.event-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 16px 0 0;
}
.event-actions__online { margin-left: auto; }
@media (max-width: 640px) {
  .event-actions { flex-direction: column; align-items: flex-start; }
  .event-actions__online { margin-left: 0; }
}
.event-cal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  margin: 12px 0 0;
}
.event-cal__label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Карта места: рамка 16/9 (фон-плейсхолдер, пока ленивый iframe не отрисован) +
   keyless-ссылка. Раскрывается под адресом в мета-блоке (см. .event-meta__reveal).
   iframe с native loading="lazy" — грузится только при раскрытии (закрытый
   <details> прячет содержимое). */
.event-map__frame {
  aspect-ratio: 16 / 9;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.event-map__frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}
.event-map__link {
  margin: 12px 0 0;
}

/* Раскрытие в мета-блоке «когда/где»: шеврон-тоггл у значения (нативный
   <details>) — под «Когда» мини-календарь, под «Где» карта. Без JS; карта
   (iframe) грузится только при раскрытии. Шевроны только на странице события
   (calendar/map переданы в партиал); в кабинете/на manage строки плоские. */
.event-meta__reveal {
  margin: 0;
}
.event-meta__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;            /* убрать дефолтный маркер-треугольник */
  color: var(--ink);
}
.event-meta__toggle::-webkit-details-marker { display: none; }  /* Safari */
.event-meta__toggle:hover { color: var(--blue); }
.event-meta__chevron {
  width: 15px;
  height: 15px;
  flex: none;
  align-self: flex-start;      /* держим шеврон на ПЕРВОЙ строке значения, а не по центру
                                  многострочного текста — в одну линию с иконкой-меткой */
  margin-top: 3px;             /* тот же оптический центр, что у .event-meta__icon (15px/1.5) */
  color: var(--blue);
  transition: transform 0.15s ease;
}
.event-meta__reveal[open] .event-meta__chevron { transform: rotate(180deg); }
.event-meta__panel {
  margin: 10px 0 2px;
}
/* Карта и мини-календарь в раскрытии тянутся на всю ширину колонки (как контент
   narrow-блока) — кап ширины не ставим, консистентно между «Где» и «Когда». */

/* Блок «Контакты» (страница /about/contacts/): данные из SiteSettings +
   карта проезда + соцсети. Две колонки (инфо | карта), стэк на мобильном. */
.contacts {
  padding: var(--section-y) 0;
}
.contacts__heading {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 32px;
}
.contacts__grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  align-items: start;
}
.contacts__grid--no-map {
  grid-template-columns: 1fr;
  max-width: 760px;
}
.contacts__item {
  margin-bottom: 24px;
}
.contacts__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}
.contacts__value {
  font-size: 18px;
  color: var(--ink);
}
a.contacts__value:hover,
.contacts__value a:hover {
  color: var(--blue);
}
.contacts__socials {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.contacts__socials a {
  display: inline-flex;
  color: var(--ink);
  transition: color 0.15s;
}
.contacts__socials a:hover {
  color: var(--blue);
}
.contacts__socials .social-icon {
  width: 22px;
  height: 22px;
}
.contacts__map-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--paper-2);
  border-radius: 4px;
  overflow: hidden;
}
.contacts__map-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* На тёмном фоне секции текст/иконки — светлые. */
.section--dark .contacts__value,
.section--dark .contacts__value a,
.section--dark .contacts__socials a {
  color: var(--paper);
}
@media (max-width: 768px) {
  .contacts__grid { grid-template-columns: 1fr; gap: 32px; }
}

/* Страница поиска /search/. */
.search-page {
  padding: clamp(32px, 5vw, 64px) 0 var(--section-y);
}
.search-page__form {
  display: flex;
  gap: 12px;
  max-width: 640px;
  margin: 0 0 40px;
}
.search-page__form input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  font: inherit;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
}
.search-page__form input[type="search"]:focus {
  outline: none;
  border-color: var(--blue);
}
.search-page__form button {
  padding: 12px 24px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 2px;
  font: inherit;
  cursor: pointer;
}
.search-page__form button:hover { background: var(--ink-soft); }
.search-page__count {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 24px;
}
.search-page__group { margin-bottom: 56px; }
.search-page__group-title {
  font-family: var(--font-serif);
  font-size: 24px;
  margin: 0 0 24px;
}
.search-page__empty,
.search-page__hint {
  color: var(--muted);
  font-size: 18px;
}
.pagination {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-top: 40px;
}
.pagination a { color: var(--blue); }
.pagination__status { color: var(--muted); font-size: 14px; }

/* Power BI-эмбед (блок powerbi): адаптивный iframe на всю ширину контейнера. */
.powerbi-embed {
  margin: 32px 0;
  aspect-ratio: 16 / 9;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.powerbi-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
@media (max-width: 768px) {
  .powerbi-embed { aspect-ratio: 3 / 4; }
}

/* YouTube-эмбед (блок youtube): адаптивный iframe 16:9, privacy-enhanced. */
.youtube-embed {
  margin: 32px 0;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  border-radius: 4px;
  overflow: hidden;
}
.youtube-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.youtube-embed__caption {
  margin-top: 8px;
  font-size: var(--text-sm);
  color: var(--ink-3);
  line-height: 1.5;
}

/* Блок «Яндекс.Карта» (common.blocks.YandexMapBlock): заголовок + адрес +
   описание + keyless-карта (iframe 16/9, native lazy). */
.yandex-map {
  margin: 32px 0;
}
.yandex-map__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(22px, 3vw, 28px);
  color: var(--ink);
  margin: 0 0 8px;
}
.yandex-map__address {
  color: var(--muted);
  margin: 0 0 12px;
}
.yandex-map__desc {
  color: var(--ink);
  line-height: 1.6;
  margin: 0 0 16px;
}
.yandex-map__desc p { margin: 0 0 12px; }
.yandex-map__desc p:last-child { margin-bottom: 0; }
.yandex-map__frame {
  aspect-ratio: 16 / 9;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.yandex-map__frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}
.yandex-map__link {
  margin: 12px 0 0;
}

/* Календарь-сетка месяца (этап 5d) — публичный блок афиши + кабинет «Мои
   события». Таблица 7 колонок; на узких экранах — горизонтальный скролл
   (min-width на сетке), ячейки остаются читаемыми. */
.event-calendar {
  margin: 0;
}
.event-calendar__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 0 0 16px;
}
.event-calendar__title {
  font-family: var(--font-serif);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 500;
  color: var(--ink);
  margin: 0;
}
.event-calendar__nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.event-calendar__nav-btn,
.event-calendar__today {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
  text-decoration: none;
  background: none;
}
.event-calendar__nav-btn {
  width: 34px;
  height: 34px;
  font-size: 20px;
  line-height: 1;
}
.event-calendar__today {
  height: 34px;
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.event-calendar__nav-btn:hover,
.event-calendar__today:hover {
  background: var(--paper-2);
}
.event-calendar__scroll {
  overflow-x: auto;
}
.event-calendar__grid {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  table-layout: fixed;
}
.event-calendar__grid th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  padding: 0 6px 8px;
}
.event-calendar__cell {
  width: 14.285%;
  height: 96px;
  vertical-align: top;
  border: 1px solid var(--line);
  padding: 4px 5px;
}
.event-calendar__cell.is-outside {
  background: var(--paper-2);
}
.event-calendar__cell.is-outside .event-calendar__daynum {
  color: var(--paper-3);
}
.event-calendar__daynum {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 4px;
}
.event-calendar__cell.is-today .event-calendar__daynum {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  background: var(--blue);
  color: var(--paper);
  border-radius: 2px;
  font-weight: 600;
}
.event-calendar__event {
  display: block;
  font-size: 12px;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper-2);
  border-radius: 2px;
  padding: 2px 5px;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
a.event-calendar__event:hover {
  background: var(--highlight-soft);
}
.event-calendar__event--nolink {
  color: var(--muted);
}
.event-calendar__event-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
a.event-calendar__event:hover .event-calendar__event-time {
  color: var(--ink);
}

/* Мини-календарь (сайдбар кабинета «Мои события», под навигацией). Компактный
   месяц: числа + точка-маркер на днях с событиями. max-width держит его
   «мини» и когда сайдбар стекается во всю ширину на узких экранах. */
.cal-mini {
  /* Базовый кегль: внутренние размеры — в `em`, поэтому весь календарь
     масштабируется пропорционально сменой одного font-size (см. текучие
     варианты на странице события и в мобильном кабинете ниже). 12px = прежний
     desktop-вид сайдбара. */
  font-size: 12px;
  max-width: 280px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.cal-mini__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5em;
  margin: 0 0 0.667em;
}
.cal-mini__title {
  font-size: 1.167em;
  font-weight: 600;
  color: var(--ink);
}
.cal-mini__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.167em;
  height: 2.167em;
  font-size: 1.417em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  border-radius: 2px;
}
.cal-mini__nav:hover {
  background: var(--paper-2);
}
.cal-mini__grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.cal-mini__grid th {
  font-family: var(--font-mono);
  font-size: 0.833em;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  padding: 0 0 0.333em;
}
.cal-mini__cell {
  text-align: center;
  padding: 0.083em;
}
.cal-mini__day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.167em;
  height: 2.167em;
  font-size: 1em;
  color: var(--ink);
  text-decoration: none;
  border-radius: 50%;
}
a.cal-mini__day:hover {
  background: var(--paper-2);
}
.cal-mini__cell.is-outside .cal-mini__day {
  color: var(--paper-3);
}
/* День с регистрациями — полупрозрачный синий фон. Правило стоит до .is-today:
   у «сегодня» (та же специфичность, ниже по тексту) фон — сплошной --blue. */
.cal-mini__cell.has-events .cal-mini__day {
  background: var(--blue-veil);
}
.cal-mini__cell.has-events a.cal-mini__day:hover {
  background: var(--highlight-soft);
}
/* Подсвеченный день соседнего месяца: число иначе слишком бледное (--paper-3)
   на синем фоне — делаем читаемым. */
.cal-mini__cell.is-outside.has-events .cal-mini__day {
  color: var(--muted);
}
/* День самого события (на его странице — highlight_date в build_calendar):
   тёплый полупрозрачный фон-вуаль (как --blue-veil у «занятых» дней, но
   terracotta); цвет цифры НЕ трогаем — остаётся обычным, а на «внешних» днях
   соседнего месяца приглушённым (читаемо в обоих случаях). Правило стоит ДО
   .is-today, чтобы «сегодня» доминировало (сплошной --blue), как и над
   .has-events. Ставится только из EventPage._month_calendar — в кабинете/блоке
   is-highlighted нет. */
.cal-mini__cell.is-highlighted .cal-mini__day {
  background: var(--terracotta-veil);
}
.cal-mini__cell.is-today .cal-mini__day {
  background: var(--blue);
  color: var(--paper);
  font-weight: 600;
}
  display: inline-block;
  margin-top: 0.667em;
  font-family: var(--font-mono);
  font-size: 0.917em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--blue);
  text-decoration: none;
}
.cal-mini__today:hover {
  text-decoration: underline;
}

/* Мини-календарь под «Когда» на странице события — текучий, тем же приёмом, что
   мобильный сайдбар-календарь кабинета (ниже): кегль каплет до 16px (от ~400px
   не растёт), а календарь просто расширяется на всю колонку (em-размеры — от
   vw-кегля). Так шрифт не «зумится» дальше и не выбивается из общего дизайна.
   Скоуп `.event-meta__panel` не трогает компактный кабинетный `.cal-mini`. */
.event-meta__panel .cal-mini {
  max-width: none;
  width: 100%;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  font-size: clamp(13px, 4vw, 16px);
}

/* «Мои события»: мини-календарь в сайдбаре — ТОЛЬКО десктоп (>--bp-lg, где
   сайдбар вертикальный 240px). На ≤--bp-lg сайдбар схлопывается (таб-полоса/
   дропдаун), мини прячем — вместо него внизу контента показывается полная
   сетка (.my-events-calendar ниже). */
@media (max-width: 1024px) {
  .cabinet__nav .cal-mini { display: none; }
}

/* Календарь внизу «Моих событий» — показывается только на ≤--bp-lg (там
   сайдбар-мини скрыт). Внутри развилка по ширине:
   • 641…1024 — полная сетка `.event-calendar` (`__full`);
   • ≤--bp-sm (640) — мини `.cal-mini` (`__mini`), т.к. ниже полная сетка
     начала бы скроллиться горизонтально. Мини на телефоне — текучий во всю
     ширину колонки (как на странице события). */
.my-events-calendar { display: none; }
@media (max-width: 1024px) {
  .my-events-calendar { display: block; margin-top: 36px; }
}
.my-events-calendar__mini { display: none; }   /* по умолчанию — полная сетка */
@media (max-width: 640px) {
  .my-events-calendar__full { display: none; }
  .my-events-calendar__mini { display: block; }
  .my-events-calendar__mini .cal-mini {
    max-width: none;
    width: 100%;
    font-size: clamp(13px, 4vw, 16px);
  }
}

/* Публичный блок «Календарь событий» (events/blocks/event_calendar.html):
   тот же приём и тот же порог 640px, что у кабинета выше, — полная сетка
   не ужимается на узких экранах и подменяется мини-календарём. */
.cal-switch__mini { display: none; }
@media (max-width: 640px) {
  .cal-switch__full { display: none; }
  .cal-switch__mini { display: block; }
  .cal-switch__mini .cal-mini {
    max-width: none;
    width: 100%;
    font-size: clamp(13px, 4vw, 16px);
  }
}

/* Кабинетная полная сетка: понижаем min-width до 590 (у общего `.event-calendar`
   — 640) и высоту ячейки до 90 (у общего — 96). 590 подобрано под границу
   перехода: при вьюпорте 641px (нижний край диапазона полной сетки) ширина
   колонки контента ≈590, сетка помещается БЕЗ горизонтального скролла во всём
   диапазоне 641…1024. Высота 90 ≈ ширине самой узкой колонки (590/7≈84), так что
   ячейки почти квадратные (у нижней границы возможна лёгкая портретность). Скоуп
   — только кабинет; публичный блок афиши не трогаем (принцип №2). */
.my-events-calendar__full .event-calendar__grid { min-width: 590px; }
.my-events-calendar__full .event-calendar__cell { height: 90px; }

.article__image {
  position: relative;     /* якорь иконки атрибуции изображения */
  margin: 32px 0;
}
.article__image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

/* Тело статьи/события — последовательность StreamField-блоков
   (common.blocks.content_blocks). Блоки сами задают контейнер (.container--narrow)
   и типографику (.content-page__* / .powerbi-embed / .youtube-embed); обёртка
   лишь отделяет тело сверху от шапки/обложки. */
.article__body {
  margin-top: clamp(16px, 2vw, 24px);
}

.article__attachments {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

/* Индексные страницы (список новостей/исследований) */

.lede {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink);
  max-width: 720px;
}

/* Index-страницы разделов (Новости, Аналитика).
   Шапка раздела + StreamField-блоки (featured / article_list). */
.index-intro {
  padding-top: clamp(40px, 5vw, 64px);
}
.index-intro h1 {
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.1;
  margin-top: 8px;
}

/* Чипы рубрик. Используются в двух местах:
   - На странице статьи/события: показывают рубрики материала, ссылка
     ведёт на индекс раздела с фильтром ?r=<slug>.
   - На индекс-странице раздела: панель фильтра по рубрикам, активный
     чип помечен (rubric-chip--active) и снимает фильтр кликом. */
.rubric-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.rubric-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--ink-mute, #d0d4dd);
  background: transparent;
  color: var(--ink, #1a1a1a);
  font-size: 0.9rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.rubric-chip:hover {
  background: var(--ink-soft, #f2f3f5);
  border-color: var(--ink, #1a1a1a);
}
.rubric-chip--active {
  background: var(--accent, #1a1a1a);
  border-color: var(--accent, #1a1a1a);
  color: #fff;
}
.rubric-chip--active:hover {
  background: var(--accent-strong, #000);
  border-color: var(--accent-strong, #000);
  color: #fff;
}
.rubric-chip__remove {
  font-size: 1.1em;
  line-height: 1;
  opacity: 0.8;
}

/* Вариант для шапки статьи (`{% rubric_chips_for page %}` отдаёт
   variant='eyebrow'): рубрики — текстовые ссылки в стиле eyebrow-меты,
   с «·»-разделителями между ними. Без pill-фона, чтобы не конкурировать
   визуально с заголовком. */
.rubric-chips--eyebrow {
  gap: 0;
  margin-top: 12px;
  font-size: 0.95rem;
  color: var(--ink-mute, #6b7280);
}
.rubric-chips--eyebrow .rubric-chip {
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
}
.rubric-chips--eyebrow .rubric-chip:hover {
  background: transparent;
  border-color: transparent;
  color: var(--ink, #1a1a1a);
  text-decoration: underline;
}
.rubric-chips--eyebrow .rubric-chips__sep {
  /* Разделитель между ссылками — отдельным span'ом, чтобы не входил
     в кликабельную зону <a> и не подчёркивался на hover. */
  color: var(--ink-mute, #6b7280);
  user-select: none;
}

/* hero внутри секции (FeaturedPageBlock) — тоньше сверху, чем hero
   главной, т.к. над ним уже стоит шапка раздела. */
.hero--section {
  padding-top: clamp(24px, 3vw, 40px);
}

/* Сетка карточек ленты (ArticleListBlock). */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: clamp(32px, 4vw, 48px);
}

.subsection-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--ink);
  margin: 48px 0 16px;
}

/* Иллюстрация карточки — реальное изображение перекрывает label */
.card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.event-card--past { opacity: 0.75; }

/* ============================================================
   Публичная страница профайла
   ============================================================ */

.profile {
  padding: 16px 0;
}

.profile__avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 24px;
  display: block;
}

.profile__name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 8px;
  color: var(--ink);
}

.profile__position {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.profile__quote {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--ink);
  padding: 16px 0 16px 20px;
  border-left: 3px solid var(--paper-3);
  margin: 24px 0 32px;
}

.profile__expertise,
.profile__bio {
  margin: 32px 0;
}
.profile__expertise h3,
.profile__bio h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.profile__links {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.profile__links a {
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}



/* ─────────────────────────────────────────
   ЛИЧНЫЙ КАБИНЕТ /account/
   ───────────────────────────────────────── */

.cabinet { padding: var(--section-y) 0; }

.cabinet__header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.cabinet__header h1 {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
  margin-top: 8px;
}

.cabinet__layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  align-items: start;
}

.cabinet__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 1px solid var(--line);
}

.cabinet__nav ul a {
  display: block;
  padding: 10px 16px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: color .15s, border-color .15s;
}

.cabinet__nav ul a:hover { color: var(--ink); }

.cabinet__nav ul a.is-active {
  color: var(--ink);
  border-left-color: var(--blue);
  font-weight: 500;
}

.cabinet__content {
  min-width: 0;
}

/* Заголовок-как-триггер навигации: на десктоп/планшете нейтрализован CSS
   (выглядит и ведёт себя как обычный h1), на телефоне (медиа ниже)
   становится кнопкой выпадающего меню разделов. */
.cabinet__title-toggle {
  display: inline;            /* десктоп/планшет: обычный заголовочный текст */
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: default;
  pointer-events: none;       /* заголовок не интерактивен вне телефона */
}
.cabinet__title-chevron {
  display: none;              /* шеврон только на телефоне */
  width: 0.62em;
  height: 0.62em;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform .15s;
}
.cabinet__title-menu { display: none; }   /* меню только на телефоне */

/* Раскладка кабинета схлопывается в одну колонку на ≤--bp-lg (1024px),
   как hero/datalab/latest. Поведение навигации — по диапазонам ниже. */
@media (max-width: 1024px) {
  .cabinet__layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Планшет (--bp-sm … --bp-lg): горизонтальная таб-полоса — 4 вкладки в
   строку помещаются. ul виден (правило .cabinet__nav ul выше бьёт
   UA-[hidden]); триггер скрыт (display:none по умолчанию). */
@media (min-width: 641px) and (max-width: 1024px) {
  .cabinet__nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    border-left: none;
    border-bottom: 1px solid var(--line);
  }
  .cabinet__nav ul a {
    border-left: none;
    border-bottom: 2px solid transparent;
    margin-left: 0;
    margin-bottom: -1px;
    padding: 10px 12px;
  }
  .cabinet__nav ul a.is-active {
    border-bottom-color: var(--blue);
    border-left-color: transparent;
  }
}

/* Телефон (≤--bp-sm, 640px): сайдбарный список скрыт; навигация — выпадающее
   меню, триггер которого — сам заголовок h1 (4+ вкладок в строку не влезают).
   data-dropdown-корень — `.cabinet__header` (см. base.html). */
@media (max-width: 640px) {
  .cabinet__header { position: relative; }

  /* Заголовок-триггер: full-width, шеврон справа. */
  .cabinet__title-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    pointer-events: auto;
    cursor: pointer;
  }
  .cabinet__title-toggle > span { min-width: 0; }   /* длинный заголовок переносится */
  .cabinet__title-chevron { display: inline-block; }
  .cabinet__title-toggle[aria-expanded="true"] .cabinet__title-chevron {
    transform: rotate(180deg);
  }

  /* Меню разделов — выпадает из-под заголовка. */
  .cabinet__title-menu {
    display: block;
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 40;
    margin: 6px 0 0;
    padding: 6px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(15, 46, 92, 0.18);
  }
  .cabinet__title-menu[hidden] { display: none; }
  .cabinet__title-menu li { margin: 0; }
  .cabinet__title-menu a {
    display: block;
    padding: 10px 12px;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--ink-soft);
    text-decoration: none;
    border-radius: 2px;
  }
  .cabinet__title-menu a:hover { background: var(--paper-2); }
  .cabinet__title-menu a.is-active {
    background: var(--paper-2);
    color: var(--blue);
  }

  /* Сайдбарный список заменён заголовком-меню; сам `.cabinet__nav` остаётся
     ради `cabinet_nav_extra` (мини-календарь на «Моих событиях»). */
  .cabinet__nav ul { display: none; }
}


/* ─────────────────────────────────────────
   CABINET FORMS
   ───────────────────────────────────────── */

.cabinet-msg {
  padding: 12px 16px;
  margin-bottom: 24px;
  border-left: 3px solid var(--blue);
  background: var(--paper-2);
  font-family: var(--font-sans);
  font-size: 14px;
}
.cabinet-msg--success { border-left-color: #2A8E4A; }
.cabinet-msg--error   { border-left-color: #B23B3B; }

.cabinet-form__readonly {
  padding: 16px 20px;
  margin-bottom: 32px;
  background: var(--paper-2);
  border-left: 3px solid var(--line);
}

.cabinet-form__readonly-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.cabinet-form__readonly-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  word-break: break-all;
}

.cabinet-form__readonly-value a {
  color: var(--blue);
  text-decoration: underline;
}

.cabinet-form__readonly-value--muted { color: var(--muted); }

/* ── Переключатель локали профайла в кабинете ──────────────────────
   Комбо-кнопка-меню в шапке формы. Переиспользуем .lang-menu (тот же
   data-dropdown JS), но позиционируем под cabinet'a (контрастный фон +
   правый край рядом с readonly-блоком). */
/* Переключатель локали-редактирования: нативный <select>, стилизованный
   inline под обычный текст «Версия для языка: Русский ▾» — select
   выглядит как ссылка (синий, пунктирное подчёркивание + шеврон-SVG),
   но остаётся native (a11y/мобильный picker). JS — cabinet_locale_switch.js. */
.cabinet-locale-switch {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin-bottom: 20px;
}
.cabinet-locale-switch__label {
  /* префикс перед select'ом — обычный текст «Версия для языка: » */
  color: var(--muted);
}
.cabinet-locale-switch__select {
  /* Снимаем native-внешний вид селекта. */
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  font: inherit;
  /* Стиль ссылки + пунктирное подчёркивание. */
  color: var(--blue);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0 14px 0 4px;  /* справа — место под шеврон */
  margin: 0;
  /* Шеврон через inline-SVG (цвет = --blue, #1E5FA8). */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%231E5FA8' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1px center;
  background-size: 10px 6px;
}
.cabinet-locale-switch__select:hover,
.cabinet-locale-switch__select:focus-visible {
  /* На hover — подчёркивание сплошным, цвет тот же. */
  text-decoration-style: solid;
  outline: none;
}
.cabinet-locale-switch__select:focus-visible {
  /* Без visible-outline, но добавим лёгкое фокус-кольцо для a11y. */
  border-radius: 2px;
  box-shadow: 0 0 0 2px var(--paper-2), 0 0 0 3px var(--blue);
}

/* Generic модальный confirm — компонент `app-modal` (см. static/js/modal.js).
   Используется в кабинете при смене языка профайла без существующего PT
   (confirm на отправку данных во внешний MT-сервис). Самостоятельный
   стиль, не зависит от других модалов сайта (если появятся — этот можно
   обобщить). Hidden по умолчанию через [hidden]. */
.app-modal[hidden] { display: none; }
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 22, 28, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.app-modal__dialog {
  position: relative;
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow: auto;
  padding: 24px 24px 20px;
  background: var(--paper);
  border-radius: 4px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
  font-family: var(--font-sans);
}
.app-modal__title {
  margin: 0 0 12px;
  font-family: var(--font-serif, var(--font-sans));
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.app-modal__body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 20px;
}
.app-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.app-modal__btn { min-width: 80px; }
/* Body не должен скроллиться, пока модал открыт. */
body.app-modal-open { overflow: hidden; }

/* «Моя регистрация» (manage-страница события): шапка записи —
   статус-бейдж + email с отступом до форм смены email / отмены. */
.reg-status { margin: 0 0 10px; }
.reg-status .badge { margin-left: 0; }
.reg-who { margin: 0 0 32px; }

.cabinet-form__hint {
  display: block;
  margin-top: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--muted);
  word-break: normal;
}

.cabinet-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 640px;
}

.cabinet-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cabinet-form__field label {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.cabinet-form__field input[type="text"],
.cabinet-form__field input[type="email"],
.cabinet-form__field input[type="url"],
.cabinet-form__field input[type="password"],
.cabinet-form__field input[type="file"],
.cabinet-form__field textarea,
.cabinet-form__field select {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: border-color .15s;
}

.cabinet-form__field input:focus,
.cabinet-form__field textarea:focus,
.cabinet-form__field select:focus {
  border-color: var(--blue);
  outline: none;
}

.cabinet-form__field textarea {
  resize: vertical;
  line-height: 1.5;
}

.cabinet-form__field--checkbox { gap: 4px; }

/* Поле с встроенной кнопкой-сабмитом справа (стрелка) — переиспользуемый
   input-group: input + наложенная icon-кнопка type=submit. Используется на
   manage-странице события (смена email). */
.input-submit { position: relative; display: block; }
.input-submit > input { width: 100%; padding-right: 52px; }
.input-submit__btn {
  position: absolute;
  /* инсет 1px — кнопка внутри рамки поля, не перекрывает её */
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  border: none;
  border-radius: 0 1px 1px 0;
  cursor: pointer;
  color: var(--paper);
  transition: background-color .15s;
}
.input-submit__btn:hover { background: var(--ink-soft); }
.input-submit__btn svg { width: 20px; height: 20px; }

/* Отделяем деструктивную «Отмену регистрации» от формы смены email
   тонким разделителем (стиль карточки — линия --line + отступ). */
.manage-cancel {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
/* В форме отмены кнопка — единственное содержимое; гасим штатный отступ
   .cabinet-form__actions (он для отделения действий от полей), иначе зазор
   «линия → кнопка» = padding-top + margin-top и больше, чем снизу. */
.manage-cancel .cabinet-form__actions { margin-top: 0; }

/* Шапка manage-страницы: «В календарь» поднят сразу под заголовок (до
   разделителя) — пользователю календарь виден первым. Разделитель переносим
   с .auth__title на обёртку, чтобы линия шла под календарём. Скоупим, чтобы
   не трогать .auth__title на других auth-страницах (design-system.md, №2). */
.manage-head {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.manage-head .auth__title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.manage-head .event-cal { margin-top: 14px; }

.cabinet-form__check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.cabinet-form__check input { width: auto; }

.cabinet-form__help {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.cabinet-form__errors {
  font-family: var(--font-sans);
  font-size: 13px;
  color: #B23B3B;
}

.cabinet-form__errors ul { padding-left: 16px; }

.cabinet-form__avatar-current {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--paper-2);
  border-radius: 2px;
}

.cabinet-form__avatar-current img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.cabinet-form__avatar-current span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.cabinet-form__actions {
  margin-top: 12px;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  border-radius: 2px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}

.btn--primary:hover {
  background: var(--ink-deep);
  border-color: var(--ink-deep);
}

/* ─────────────────────────────────────────
   CABINET — Identity-блок и аватар-виджет
   ───────────────────────────────────────── */

.cabinet-form__identity {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: start;
  padding-bottom: 24px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.cabinet-form__name-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* Скрываем лейбл визуально, оставляем для screen-readers. Использую
   там, где placeholder заменяет видимую метку (поля ФИО в identity-блоке). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .cabinet-form__identity {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  /* Аватар центрируем в его 1fr-ячейке, поля имён получают всю ширину
     (default stretch у grid item — без justify-items:start, который
     прижимал имена к их intrinsic-ширине). */
  .cabinet-form__identity .avatar-widget {
    justify-self: center;
  }
}

/* Аватар-виджет: один UI-элемент для upload + remove. */
.avatar-widget {
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.avatar-widget__preview {
  position: relative;
  width: 160px;
  height: 160px;
  border: 2px dashed var(--line);
  border-radius: 50%;
  background: var(--paper-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  /* overflow намеренно не hidden: кнопка «×» торчит за круг, иначе её
     обрезает border-radius. Картинку клипуем отдельно — на .avatar-widget__img. */
  transition: border-color .15s, background .15s;
}

.avatar-widget__preview:hover {
  border-color: var(--blue);
  background: var(--paper-3);
}

.avatar-widget--dragover .avatar-widget__preview {
  border-style: solid;
  border-color: var(--blue);
  background: var(--paper-3);
}

.avatar-widget__placeholder {
  font-family: var(--font-serif);
  font-size: 56px;
  font-weight: 300;
  line-height: 1;
  color: var(--muted);
}

.avatar-widget__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.avatar-widget__remove-btn {
  position: absolute;
  /* Сидим в правом верхнем углу описанного квадрата, чуть выходя за круг —
     так кнопка визуально «приколота» к аватару, но не перекрывается им
     и не клипуется border-radius'ом. */
  top: -6px;
  right: -6px;
  width: 32px;
  height: 32px;
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color .15s, transform .15s;
}

.avatar-widget__remove-btn:hover {
  color: #B23B3B;
  transform: scale(1.5);
}

.avatar-widget__caption {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
  max-width: 200px;
}

/* ─────────────────────────────────────────
   AVATAR (reusable, см. users/includes/_avatar.html)
   ───────────────────────────────────────── */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background: var(--blue);
  color: white;
  font-family: var(--font-sans);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0;
  flex-shrink: 0;
  user-select: none;
}

.avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar__initials {
  font-size: 0.42em;
  line-height: 1;
}

/* ─────────────────────────────────────────
   AUTH-BUTTONS в utility bar (гость)
   ───────────────────────────────────────── */

.btn-auth {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  border-radius: 2px;
  transition: background .15s, color .15s, border-color .15s;
}

.btn-auth--ghost {
  color: white;
  background: transparent;
  border: 1px solid transparent;
}
.btn-auth--ghost:hover {
  color: var(--highlight);
}

.btn-auth--primary {
  color: white;
  background: var(--terracotta);
  border: 1px solid var(--terracotta);
}
.btn-auth--primary:hover {
  background: var(--terracotta-dark);
  border-color: var(--terracotta-dark);
}

/* ─────────────────────────────────────────
   USER MENU (залогинен)
   ───────────────────────────────────────── */

.user-menu {
  position: relative;
}

.user-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  color: white;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  max-width: 280px;
}

.user-menu__trigger:hover,
.user-menu__trigger[aria-expanded="true"] {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}

.user-menu__avatar {
  /* размер задан inline-style'ом в шаблоне (32px) */
}

.user-menu__name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.user-menu__chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform .15s;
}

.user-menu__trigger[aria-expanded="true"] .user-menu__chevron {
  transform: rotate(180deg);
}

.user-menu__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(15, 46, 92, 0.18);
  padding: 6px;
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-menu__dropdown[hidden] { display: none; }

.user-menu__dropdown a,
.user-menu__dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.user-menu__dropdown a:hover,
.user-menu__dropdown button:hover {
  background: var(--paper-2);
  color: var(--blue);
}

.user-menu__dropdown form {
  margin: 0;
  display: block;
}

/* Mobile-меню: auth- и user-блоки — единая горизонтальная связка,
   которая при нехватке места переносится целиком (через wrap на
   родителе .mobile-menu__foot), а внутри сами кнопки не рвутся. */
.mobile-menu__auth,
.mobile-menu__user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.mobile-menu__foot form { margin: 0; }

/* Кнопки auth по умолчанию белым по тёмному navy (utility-bar). В
   бургер-foot фон светло-бежевый — перекрашиваем под него. */
.mobile-menu__foot .btn-auth { padding: 8px 14px; font-size: 14px; }
.mobile-menu__foot .btn-auth--ghost { color: var(--ink); }
.mobile-menu__foot .btn-auth--ghost:hover { color: var(--blue); }

/* ─────────────────────────────────────────
   AUTH — login / signup / password-reset / ...
   ───────────────────────────────────────── */

.auth {
  padding: var(--section-y) 0;
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.auth .container {
  width: 100%;
  display: flex;
  justify-content: center;
}

.auth__card {
  width: 100%;
  max-width: 480px;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: clamp(28px, 5vw, 48px);
}

.auth__title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.auth__links {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}

.auth__links a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 2px;
}

.auth__links a:hover {
  text-decoration-color: currentColor;
}

.auth__sep { color: var(--line); }

.auth__hints {
  list-style: disc;
  padding-left: 20px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: -4px 0 4px;
}

.auth__text {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 16px;
}

.auth__text:last-child { margin-bottom: 0; }

.auth__text--muted { color: var(--muted); font-size: 14px; }

.auth__text a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: var(--line);
}
.auth__text a:hover { text-decoration-color: currentColor; }

/* Соц-вход на login/signup */
.auth__social {
  margin-top: 24px;
}
.auth__or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
}
.auth__or::before,
.auth__or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth__social-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: background .15s, border-color .15s;
}
.btn-social:hover {
  background: var(--paper-2);
  border-color: var(--ink-soft);
}
.btn-social__icon {
  flex-shrink: 0;
}

/* ─────────────────────────────────────────
   CABINET / SECURITY
   ───────────────────────────────────────── */

.security-section {
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 24px;
  align-items: start;
}
.security-section:last-of-type { border-bottom: none; }
.security-section:first-of-type { padding-top: 0; }

.security-section__title {
  grid-column: 1 / -1;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 4px;
}

.security-section__body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}

.security-section__status { margin: 0; }
.security-section__status--warn { color: #B23B3B; }

.security-section__hint {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.security-section__muted { color: var(--muted); margin: 0 4px; }

.security-section__actions {
  align-self: center;
}

.security-section--danger .security-section__title { color: #B23B3B; }

@media (max-width: 640px) {
  .security-section {
    grid-template-columns: 1fr;
  }
}

/* «Мои события» (этап 4) — поверх .security-section (ряд = тело + действия) */
.cabinet-block { margin-bottom: 36px; }
.cabinet-block:last-child { margin-bottom: 0; }
.cabinet-block__title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 18px;
}
.my-event__title { font-family: var(--font-serif); font-size: 20px; font-weight: 400; margin: 0 0 8px; }
.my-event__title a { color: var(--ink); }
.my-event__badges { margin: 0 0 10px; }
.my-event__badges .badge:first-child { margin-left: 0; }
/* «Когда/где» в ряду — общий блок .event-meta (переиспользован из страницы
   события/manage); в компактном ряду гасим нижний отступ. */
.my-event .event-meta { margin-bottom: 0; }
/* Кнопку «Отменить» выравниваем по верху строки (к заголовку), а не по
   центру (штатное .security-section__actions) — строка события высокая. */
.my-event .security-section__actions { align-self: start; }
/* Статус-бейдж как ссылка на страницу управления записью. */
a.badge { text-decoration: none; cursor: pointer; }
a.badge:hover { opacity: 0.85; }
.cabinet-block--past .my-event__title a,
.cabinet-block--past .my-event .event-meta__value { color: var(--muted); }
.cabinet-empty { padding: 24px 0; color: var(--muted); font-size: 15px; }
.cabinet-empty .btn { margin-top: 12px; }

/* ─────────────────────────────────────────
   BADGES (verified / unverified / primary)
   ───────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 2px;
  vertical-align: middle;
  margin-left: 4px;
}
.badge--ok      { background: #2A8E4A; color: white; }
.badge--warn    { background: #C97A2A; color: white; }
.badge--primary { background: var(--ink); color: white; }
/* Бейдж с подсказкой (напр. «Перенесено» + причина переноса) — курсор-help. */
.badge[title]   { cursor: help; }

/* Рескин manage-элементов allauth (panel / table / button_group / hr).
   Появляются на manage-страницах allauth (mfa, usersessions, connections).
   См. docs/contracts.md → «Страницы allauth стилизуются через layout+elements». */
.auth-panel {
  margin-top: 32px;
}
.auth-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 14px;
}
.auth-table th,
.auth-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.auth-table th {
  font-weight: 600;
  color: var(--muted);
}
.auth-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.auth-btn-group--vertical {
  flex-direction: column;
  align-items: stretch;
}
.auth-hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}

/* ─────────────────────────────────────────
   BUTTONS — варианты помимо primary
   ───────────────────────────────────────── */

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn--ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--danger {
  background: #B23B3B;
  color: white;
  border: 1px solid #B23B3B;
}
.btn--danger:hover {
  background: #962F2F;
  border-color: #962F2F;
}

.cabinet-form__actions--row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* ─────────────────────────────────────────
   AUTH — email/connections list (allauth-страницы)
   ───────────────────────────────────────── */

.auth__subtitle {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  margin: 24px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.email-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.email-table tbody td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.email-table tbody td:first-child { padding-left: 0; }
.email-table tbody td:last-child  { padding-right: 0; }

.email-table tbody tr:last-child td { border-bottom: none; }

.email-table__addr {
  font-family: var(--font-mono);
  word-break: break-all;
  width: 100%;
}

.email-table__chip {
  white-space: nowrap;
  text-align: right;
}

.email-table__add-row td { padding-top: 16px; }

.social-table__provider {
  font-weight: 500;
  white-space: nowrap;
  padding-right: 16px !important;
}

.social-connect {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.social-connect__label {
  font-size: 13px;
  color: var(--muted);
  margin-right: 4px;
}

a.chip--action { text-decoration: none; }

.inline-form {
  display: inline;
  margin: 0;
}

/* ─── Chips (status + action) ─────────────────────────── */

.chip {
  display: inline-block;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  border-radius: 2px;
  line-height: 1.4;
  white-space: nowrap;
}

.chip--solid  { background: var(--ink);  color: white; }
.chip--ok     { background: #2A8E4A;     color: white; }

.chip--action {
  background: transparent;
  color: var(--ink);
  border: 1px dashed var(--line);
  cursor: pointer;
  font: inherit;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  transition: background 120ms ease, border-color 120ms ease;
}

.chip--action:hover {
  background: var(--paper-2);
  border-color: var(--ink);
}

.chip--action:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.chip--action.chip--danger {
  color: #B23B3B;
  border-color: rgba(178, 59, 59, 0.4);
}
.chip--action.chip--danger:hover {
  background: rgba(178, 59, 59, 0.08);
  border-color: #B23B3B;
}
.chip--action.chip--danger:focus-visible {
  outline-color: #B23B3B;
}

/* ─── Add-email row ───────────────────────────────────── */

.email-add-form__row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.email-add-form__row input[type="email"] {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
}

.email-add-form__row input[type="email"]:focus {
  outline: none;
  border-color: var(--ink);
}

@media (max-width: 640px) {
  .email-add-form__row { flex-direction: column; }

  /* В узкой ширине email и его управление не помещаются в строку.
     Превращаем строку email-таблицы в flex-контейнер, чтобы адрес занял
     всю верхнюю строчку, а чипы и × сложились под ним. Применяем только
     к таблице управления email — у соцсетей одна кнопка-× в строке,
     там стэкинг не нужен. */
  .email-table--manage tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
  }
  .email-table--manage tbody td {
    padding: 0 !important;
    border-bottom: none !important;
  }
  .email-table--manage tbody tr:not(:last-child) {
    border-bottom: 1px solid var(--line);
  }
  .email-table--manage .email-table__addr {
    flex-basis: 100%;
  }
  /* Чипы в строке email-таблицы: внутри пары — одинаковой ширины
     (через min-width на сам чип, выставленный по более длинной из
     двух надписей). «Удалить» — отдельный, своей ширины. */
  .email-table--manage .email-table__chip {
    text-align: left;
  }
  .email-table--manage .email-table__chip .inline-form { display: inline-block; }
  .email-table--manage .email-table__chip .chip {
    text-align: center;
    white-space: nowrap;
  }
  /* min-width должен покрыть длиннейший вариант в паре:
     primary — «сделать основным» (~133px), verify — «подтвердить» (~98px). */
  .email-table--manage .email-table__chip--primary .chip { min-width: 140px; }
  .email-table--manage .email-table__chip--verify  .chip { min-width: 100px; }
  /* Строка «добавить адрес» — одна <td> в flex-родителе, без явного
     flex-basis она съёживается до ширины содержимого, и input
     получается куцый. Растягиваем td на всю строку. */
  .email-table--manage .email-table__add-row td {
    flex-basis: 100%;
    width: 100%;
  }
}

.cabinet-form__readonly--danger {
  border-left-color: #B23B3B;
}

/* ── Карусель изображений (блок carousel / ImageCarouselBlock) ──────
   Один слайд = весь вьюпорт. Прогрессивное улучшение: база — горизонтальный
   scroll-snap (свайп без JS, все слайды доступны). carousel.js вешает
   .carousel--js → кольцевая модель «непрерывной позиции» (слайды абсолютны,
   transform:translateX по позиции; drag + инерция-Безье + бесконечный цикл).
   Соотношение — .carousel--<ratio> на вьюпорте (источник высоты для абсолютных
   слайдов); масштабирование — .carousel--fit-<fit> (object-fit). Режим показа
   — класс на обёртке .carousel-block (по ширине окна, --bp-md=768). */
.carousel { position: relative; }

/* Режим показа (только моб. / только ПК) — по ширине окна */
@media (min-width: 769px) { .carousel-block--mobile-only { display: none; } }
@media (max-width: 768px) { .carousel-block--desktop-only { display: none; } }

/* Соотношение сторон — на вьюпорте */
.carousel--16x9 .carousel__viewport { aspect-ratio: 16 / 9; }
.carousel--4x3  .carousel__viewport { aspect-ratio: 4 / 3; }
.carousel--1x1  .carousel__viewport { aspect-ratio: 1 / 1; }
.carousel--3x4  .carousel__viewport { aspect-ratio: 3 / 4; }
.carousel--9x16 .carousel__viewport { aspect-ratio: 9 / 16; }

.carousel__viewport {
  position: relative;
  /* no-JS fallback: свайп/скролл со снапом по слайдам */
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;            /* скроллбар не нужен — свайп/стрелки */
}
.carousel__viewport::-webkit-scrollbar { display: none; }
/* Фокус-кольцо — вьюпорт фокусируем (tabindex), чтобы ←/→ работали без фокуса
   на кнопке (был баг: события клавиш не доходили до неполучавшего фокус слайдера). */
.carousel__viewport:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.carousel__track {
  display: flex;
  height: 100%;
}

.carousel__slide {
  flex: 0 0 100%;                   /* один слайд = ширина вьюпорта */
  height: 100%;
  min-width: 0;
  scroll-snap-align: start;
}

.carousel__media {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--paper-2);
  overflow: hidden;
}
.carousel__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;                /* по умолчанию «накрыть» */
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
}
/* Масштабирование */
.carousel--fit-contain .carousel__media img { object-fit: contain; }
.carousel--fit-none .carousel__media img { object-fit: none; }

.carousel__media-link { display: block; height: 100%; }

/* Подпись — функциональная плашка у нижнего края (не декоративный градиент):
   так геометрия медиа не растёт и стрелки центрируются ровно по картинке. */
.carousel__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 16px;
  background: rgba(8, 32, 63, 0.72); /* --ink-deep с прозрачностью */
  color: var(--paper);
  font-family: var(--font-sans);
  line-height: 1.4;
}
/* Размер подписи: мелко (как подпись) / средне (как лид) / крупно (как h2). */
.carousel__caption--small  { font-size: 13px; }
.carousel__caption--medium { font-size: clamp(18px, 2vw, 22px); }
.carousel__caption--large {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3.5vw, 36px);
  line-height: 1.2;
  padding: 16px;
}

/* ── JS-режим: кольцевая раскладка ──────────────────────────────── */
.carousel--js .carousel__viewport {
  overflow: hidden;
  scroll-snap-type: none;
  touch-action: pan-y;              /* горизонталь — нам, вертикаль — странице */
  cursor: grab;
}
.carousel--js.carousel--dragging .carousel__viewport { cursor: grabbing; }
.carousel--js .carousel__track { display: block; height: 100%; }
.carousel--js .carousel__slide {
  position: absolute;
  inset: 0;
  flex: none;
  height: 100%;
  will-change: transform;
}

/* Стрелки / точки / эскизы — только в JS-режиме (в no-JS листаем свайпом) */
.carousel__arrow,
.carousel__dots,
.carousel__thumbs { display: none; }

/* Стрелки — ещё и только когда включены (data-arrows on / auto-не-моб. → JS
   вешает .carousel--show-arrows). */
.carousel--js.carousel--show-arrows .carousel__arrow {
  position: absolute;
  top: 50%;                          /* внутри вьюпорта → центр по картинке */
  transform: translateY(-50%);
  z-index: 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}
.carousel--js.carousel--show-arrows .carousel__arrow:hover { background: var(--ink-soft); opacity: 1; }
.carousel--js.carousel--show-arrows .carousel__arrow--prev { left: 12px; }
.carousel--js.carousel--show-arrows .carousel__arrow--next { right: 12px; }

/* Точки */
.carousel--js .carousel__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.carousel__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--paper-3);
  cursor: pointer;
}
.carousel__dot.is-active { background: var(--ink); } /* fallback без color-mix */
/* Непрерывная подсветка: фон точки = смесь ink/paper-3 по --a (0..1), которую
   carousel.js обновляет покадрово → активность плавно перетекает между точками. */
.carousel--js .carousel__dot {
  background: color-mix(in srgb, var(--ink) calc(var(--a, 0) * 100%), var(--paper-3));
}

/* Эскизы (лента превью под слайдером) */
.carousel--js .carousel__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 4px;
}
.carousel__thumb {
  flex: 0 0 auto;
  width: 96px;
  height: 60px;
  padding: 0;
  border: none;
  border-radius: 2px;
  overflow: hidden;
  background: var(--paper-2);
  cursor: pointer;
  opacity: 0.55;
}
.carousel__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.carousel__thumb:hover { opacity: 0.85; }
.carousel__thumb.is-active { opacity: 1; outline: 2px solid var(--blue); outline-offset: -2px; } /* fallback */
/* Непрерывная подсветка: прозрачность и яркость синей рамки эскиза пропорциональны
   --a (0..1, покадрово из carousel.js) → активный эскиз плавно «разгорается». */
.carousel--js .carousel__thumb {
  opacity: calc(0.55 + 0.45 * var(--a, 0));
  outline: 2px solid color-mix(in srgb, var(--blue) calc(var(--a, 0) * 100%), transparent);
  outline-offset: -2px;
}
.carousel--js .carousel__thumb:hover { opacity: calc(0.7 + 0.3 * var(--a, 0)); }

/* Лайтбокс изображений карусели (клик по слайду без ссылки раскрывает картинку).
   Курсор-zoom на кликабельных слайдах; раскрытие — FLIP-зум в carousel.js. */
.carousel__zoomable { cursor: zoom-in; }
.carousel--dragging .carousel__zoomable { cursor: grabbing; }

html.carousel-lightbox-lock { overflow: hidden; }      /* блокируем скролл под лайтбоксом */
.carousel-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  background: rgba(0, 0, 0, 0);
  transition: background-color 320ms ease;
  cursor: zoom-out;
}
.carousel-lightbox.is-open { background: rgba(0, 0, 0, 0.92); }
.carousel-lightbox__img {
  position: fixed;
  margin: 0;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  cursor: zoom-out;
  will-change: transform;
}
.carousel-lightbox__close {
  position: fixed;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 320ms ease;
}
.carousel-lightbox.is-open .carousel-lightbox__close { opacity: 1; }
.carousel-lightbox__close:hover { background: rgba(0, 0, 0, 0.65); }
@media (prefers-reduced-motion: reduce) {
  .carousel-lightbox, .carousel-lightbox__close { transition: none; }
}
