/* =============================================================================
   NORNICKEL — INFOGRAFIKA
   main.css
   =============================================================================

   Структура:
   1. Переменные
   2. Reset
   3. Базовая типографика
   4. Утилиты
   5. Лейаут (страница, шапка, прогресс)
   6. Герой / титульный экран
   7. Основной контент — секции
   8. Текстовые блоки
   9. Двухколоночная сетка
  10. Графики
  11. Парниковый эффект — sticky-зона
  12. Слайдер
  13. Карточки причин (5 шт.)
  14. Физические карточки (p5.js)
  15. Таблица факторов климатических моделей
  16. Учёные
  17. Учреждения
  18. Outro / переход к следующей главе
  19. Футер
  20. Тултип
  21. Медиазапросы
   ============================================================================= */


/* =============================================================================
   0. ШРИФТЫ
   ============================================================================= */

@font-face {
  font-family: 'Mabry Pro';
  src: url('../fonts/Mabry Pro.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Mabry Pro';
  src: url('../fonts/Mabry Pro Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Mabry Pro';
  src: url('../fonts/Mabry Pro Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}


/* =============================================================================
   1. ПЕРЕМЕННЫЕ
   ============================================================================= */

:root {
  --color-accent:       #94a491;       /* основной зелёный */
  --color-accent-faint: rgba(148, 164, 145, 0.1);
  --color-accent-mid:   rgba(148, 164, 145, 0.3);
  --color-accent-hover: rgba(148, 164, 145, 0.7);

  --color-bg:           #fffbf5;       /* тёплый белый фон страницы */
  --color-card-bg:      #f5eee3;       /* фон карточек-графиков */
  --color-text:         #1a1a1a;
  --color-white:        #ffffff;

  --font-main:    'Mabry Pro', Arial, sans-serif;
  --font-heading: 'Mabry Pro', Arial, sans-serif;

  --radius-sm:  8px;
  --radius-md:  16px;
  --radius-lg:  40px;

  --max-text:   640px;
  --large-image: 960px;
  --max-graph:  1400px;
  --max-wide:   1400px;
}


/* =============================================================================
   2. RESET
   ============================================================================= */

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  /* Тёмный «холст» под цвет снимков: смягчает микропроблеск при переходе
     между страницами (промежуточная перерисовка красится тёмным, а не белым).
     Светлый фон контента даёт body, поэтому на страницах это не видно. */
  background-color: #0f1412;
}

/* Поэкранный скролл-снап только на главной (класс is-home на <html>).
   Каждый экран (герой и полноэкранные главы) «доводится» до верха окна. */
html.is-home {
  scroll-snap-type: y mandatory;
}

html.is-home .hero,
html.is-home .chapter-screen {
  scroll-snap-align: start;
}

/* Последний экран выше вьюпорта (внутри футер) — не залипаем на нём
   принудительно, чтобы футер оставался доступен прокруткой */
html.is-home .chapter-screen--last {
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}

@media (prefers-reduced-motion: reduce) {
  html.is-home { scroll-snap-type: none; }
}

body {
  margin: 0;
  color: var(--color-text);
  background-color: var(--color-bg);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 20px;
}

img {
  border: 0;
  vertical-align: middle;
  max-width: 100%;
  display: inline-block;
}

a {
  background-color: transparent;
  text-decoration: none;
}

.body-text a,
.card-expanding__body a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:active,
a:hover {
  outline: 0;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: bold;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding-left: 40px;
}


/* =============================================================================
   3. БАЗОВАЯ ТИПОГРАФИКА
   ============================================================================= */

.heading-xl {
  /* Заголовок главы на герое */
  text-align: center;
  font-family: var(--font-heading);
  font-size: 5vw;
  font-weight: 700;
  /* Было 4vw (0.8 от кегля) — строки слипались, и верх/низ букв
     выходил за пределы размытой плашки героя. */
  line-height: 4.6vw;
  margin: 0;
}

.heading-lg {
  /* Заголовок раздела h2 */
  text-align: center;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 400;
  line-height: 36px;
  margin: 0;
}

.heading-md {
  /* Подзаголовок раздела h3 */
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 400;
  line-height: 32px;
  position: relative;
  z-index: 1;
  margin: 0;
}

.heading-sm {
  /* Заголовок термина / пары погода–климат h4 */
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
  margin: 0;
}

.body-text {
  /* Основной текст абзаца */
  font-family: var(--font-main);
  font-size: 20px;
  line-height: 28px;
  position: relative;
  z-index: 1;
  margin: 0;
}

.body-list {
  font-family: var(--font-main);
  font-size: 20px;
  line-height: 28px;
  margin: 0 0 0 -1.2em;
  padding: 0;
  list-style: disc;
  padding-left: 1.2em;
}

.body-list li + li {
  margin-top: 12px;
}

.caption-italic {
  /* Цитата / подпись курсивом */
  color: var(--color-accent);
  font-family: var(--font-main);
  font-size: 16px;
  font-style: italic;
  line-height: 22px;
}

.caption-label {
  /* Подпись капсом над графиком */
  text-align: center;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  position: relative;
  z-index: 1;
}

.caption-regular {
  /* Подпись обычным текстом */
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 20px;
  position: relative;
  z-index: 1;
}

.caption-date {
  /* Годы жизни учёного */
  color: var(--color-accent);
  font-family: var(--font-main);
  font-size: 14px;
  font-style: italic;
  line-height: 18px;
}

.caption-note {
  /* Примечание 16px, зелёный */
  color: var(--color-accent);
  font-size: 16px;
  font-weight: 400;
  line-height: 22px;
}

.label-chapter {
  /* «ГЛАВА 1» */
  letter-spacing: .15vw;
  text-transform: uppercase;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}

.text-center {
  text-align: center;
}


/* =============================================================================
   4. УТИЛИТЫ
   ============================================================================= */

.flex-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.flex-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
}

.img-darken {
  mix-blend-mode: darken;
}


/* =============================================================================
   5. ЛЕЙАУТ СТРАНИЦЫ
   ============================================================================= */

/* Обёртка всей страницы */
.page {
  background-color: var(--color-bg);
  display: flex;
  flex-flow: column;
  width: 100%;
  min-height: 100dvh;
  position: relative;
}

/* ----- Прогресс-бар скролла ----- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  width: 0%;
  height: 4px;
  background-color: var(--color-accent);
  transition: width .1s linear;
}

/* ----- Шапка ----- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  flex-flow: row;
  justify-content: space-between;
  align-items: center;
  /* width: 100vw убран — left:0/right:0 уже растягивают шапку по контенту,
     а 100vw включает ширину скроллбара и даёт горизонтальный скролл */
  height: 50px;
  padding: 4px 10px;
  /* Цвет текста/иконок шапки — молочный по умолчанию (над фото) */
  --header-color: var(--color-white);
  color: var(--header-color);
  transition: color .3s ease;
}

/* Над молочным фоном страницы текст шапки становится чёрным */
.site-header--dark {
  --header-color: var(--color-text);
}

.site-header__logo-link {
  color: var(--header-color);
  padding: 10px 0;
  position: relative;
}

.site-header__logo {
  display: block;
  width: 128px;
  aspect-ratio: 95 / 20;
  /* Логотип перекрашивается вместе с текстом шапки через маску */
  background-color: var(--header-color);
  -webkit-mask: url(img/logo.svg) no-repeat center / contain;
  mask: url(img/logo.svg) no-repeat center / contain;
  transition: background-color .3s ease;
}
/* Английская версия: свой логотип — замените файл en/img/logo.svg */
html[lang="en"] .site-header__logo {
  -webkit-mask-image: url(en/img/logo.svg);
  mask-image: url(en/img/logo.svg);
}

/* ----- Навигация по главам ----- */
.nav-chapters {
  position: relative;
  padding: 8px 16px;
  color: var(--header-color);
  cursor: pointer;
  background: rgba(255, 251, 245, 0.88);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(26, 26, 26, 0.07);
  /*box-shadow: 0 8px 32px rgba(26, 26, 26, 0.12);*/
  border-radius: var(--radius-md);
  transition: color .3s ease, border-radius .2s ease;
}

.nav-chapters__toggle {
  letter-spacing: .15vw;
  text-transform: uppercase;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  color: var(--color-text);
}

.nav-chapters__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0px;
  display: flex;
  flex-flow: column;
  align-items: stretch;
  gap: 4px;
  width: calc(100vw - 40px);
  max-width: 360px;
  padding: 8px 16px 12px;
  background: rgba(255, 251, 245, 0.95);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(26, 26, 26, 0.07);
  border-radius: var(--radius-md);
  color: var(--color-text);
  transform-origin: top right;
  transform: scaleY(1) translateY(0);
  opacity: 1;
  transition: opacity .2s ease, transform .2s ease;
}

.nav-chapters__menu[hidden] {
  display: flex !important;
  opacity: 0;
  transform: scaleY(0.92) translateY(-8px);
  pointer-events: none;
  visibility: hidden;
}

.nav-chapters__menu-label {
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 700;
  margin-bottom: 6px;
  text-align: right;
}

.nav-chapters__item {
  display: block;
  padding: 4px 0;
  color: var(--color-text);
  text-align: left;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  transition: opacity .2s;
}

.nav-chapters__item:hover          { opacity: .7; }
.nav-chapters__item--active        { font-weight: 700; }
.nav-chapters__item--disabled      { opacity: .35; cursor: default; pointer-events: none; }

.nav-chapters__wip {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(26, 26, 26, 0.35);
}

.nav-chapters__arrow {
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
  transition: transform .2s ease;
}

.nav-chapters__toggle[aria-expanded="true"] .nav-chapters__arrow {
  transform: rotate(180deg);
}

/* ----- Группы шапки: логотип + соцсети слева, язык + содержание справа ----- */
.site-header__left,
.site-header__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-header__right { gap: 8px; }

.site-header__social {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-header__social-link {
  display: flex;
  color: var(--header-color);
  transition: color .3s ease, opacity .2s ease;
}

.site-header__social-link:hover { opacity: .7; }

/* ----- Переключатель языка RU / EN ----- */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  /* Без плашки: цвет следует за шапкой (светлый над фото, тёмный над светлым фоном) */
  padding: 8px 4px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: .15vw;
  color: var(--header-color);
  transition: color .3s ease;
}

.lang-switch__item { padding: 0 6px; }
.lang-switch__item + .lang-switch__item { border-left: 1px solid currentColor; }
/* EN пока неактивен — английской версии ещё нет */
.lang-switch__item--disabled { opacity: .45; cursor: default; }
a.lang-switch__item:hover { opacity: .7; }
a.lang-switch__item { color: inherit; text-decoration: none; }

/* Соцсети внутри меню «Содержание» — показываются только на мобильных */
.nav-chapters__social {
  display: none;
  gap: 16px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(26, 26, 26, 0.1);
}

.nav-chapters__social-link {
  display: flex;
  color: var(--color-text);
}

@media screen and (max-width: 600px) {
  .site-header__social   { display: none; }
  .nav-chapters__social  { display: flex; }
  .lang-switch           { padding: 8px 2px; }
  .nav-chapters          { padding: 8px 12px; }
  .nav-chapters__toggle  { white-space: nowrap; }
}

@media screen and (max-width: 480px) {
  .site-header .site-header__logo { width: 100px; }
  .lang-switch,
  .nav-chapters__toggle  { font-size: 12px; letter-spacing: .08em; }
  .lang-switch           { padding: 8px 0; }
  .nav-chapters          { padding: 8px 10px; }
  .nav-chapters__arrow   { margin-left: 4px; }
}



/* =============================================================================
   6. ГЕРОЙ / ТИТУЛЬНЫЙ ЭКРАН
   ============================================================================= */

.hero {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
  background-color: #0f1412;
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* На главной фон героя закрепляем как в главах — контент «пролистывается»
   поверх неподвижной картинки. Собственную <img> прячем. */
.hero--home {
  background-image: url('img/ch0-hero.jpeg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.hero--home .hero__bg {
  display: none;
}


.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-flow: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 48px;
  text-align: center;
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  max-width: 900px;
}

/* Титульный экран ГЛАВНОЙ — контент на всю высоту, без плашки.
   Общий .hero__content выше не трогаем: он нужен главам. */
.hero--home .hero__content {
  justify-content: space-between;
  gap: clamp(24px, 4vw, 48px);
  width: 100%;
  height: 100%;
  max-width: none;
  padding: 44px 24px 96px;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 0;
}

/* Верхняя группа: вводный текст + крупный заголовок */
.hero__top {
  display: flex;
  flex-flow: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.hero__eyebrow {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0;
  text-align: center;
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.5;
  opacity: 0.95;
}

.hero__title {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(34px, 5.5vw, 150px);
  line-height: 0.9;
  color: rgba(255, 255, 255, 0.92);
  text-wrap: balance;
}

.hero__intro-text {
  position: relative;
  z-index: 1;
  max-width: var(--max-text);
  text-align: center;
  font-size: 18px;
  line-height: 24px;
}

.hero--home .hero__intro-text {
  max-width: 720px;
  margin: 0;
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.55;
}

.hero__scroll-icon {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: 24px;
  animation: scroll-hint 2s ease-in-out infinite;
}

@keyframes scroll-hint {
  0%   { transform: translateX(-50%) translateY(0); }
  50%  { transform: translateX(-50%) translateY(8px); }
  100% { transform: translateX(-50%) translateY(0); }
}


/* =============================================================================
   6a. ГЛАВЫ НА ГЛАВНОЙ — ПОЛНОЭКРАННЫЕ СЕКЦИИ
   ============================================================================= */

/* Контейнер списка глав: убираем стандартные отступы .content,
   чтобы секции шли встык, экран за экраном */
.content.chapters {
  gap: 0;
  padding: 0;
  width: 100%;
  max-width: none;
  align-items: stretch;   /* секции тянутся на всю ширину */
}

.chapter-screen {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  padding: 60px 8vw;
  overflow: hidden;
  text-decoration: none;
  color: var(--color-white);
  /* фон по секциям с эффектом параллакса */
  background-color: #0f1412;
  background-image: var(--chapter-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Затемнение фона для читаемости.
   Чуть смещаем градиент в сторону текста */
.chapter-screen__overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.chapter-screen--left .chapter-screen__overlay {
  background: linear-gradient(
    90deg,
    rgba(15, 20, 18, 0.78) 0%,
    rgba(15, 20, 18, 0.55) 38%,
    rgba(15, 20, 18, 0.15) 70%,
    rgba(15, 20, 18, 0.05) 100%
  );
}

.chapter-screen--right .chapter-screen__overlay {
  background: linear-gradient(
    270deg,
    rgba(15, 20, 18, 0.78) 0%,
    rgba(15, 20, 18, 0.55) 38%,
    rgba(15, 20, 18, 0.15) 70%,
    rgba(15, 20, 18, 0.05) 100%
  );
}

.chapter-screen__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-flow: column;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  max-width: 720px;
  text-align: left;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

/* Чередование стороны текста */
.chapter-screen--left  { justify-content: flex-start; }
.chapter-screen--right { justify-content: flex-end; }

.chapter-screen__title {
  font-family: var(--font-heading);
  font-size: 74px;
  font-weight: 700;
  line-height: 64px;
  margin-left: -0.07em;
}

.chapter-screen__text {
  font-family: var(--font-main);
  font-size: 20px;
  line-height: 28px;
  margin: 0;
  opacity: .92;
}

.chapter-screen__cta {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 10px 25px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: var(--font-main);
  font-size: 14px;
  background-color: rgba(255, 255, 255, .18);
  border-radius: 50px;
  transition: all .2s;
}

.chapter-screen__content:hover .chapter-screen__cta {
  background-color: rgba(255, 255, 255, .32);
  padding-left: 35px;
  padding-right: 35px;
}

/* Последний блок — внутри лежит футер, резервируем место снизу.
   Весь блок и его содержимое выровнены по центру. */
.chapter-screen--last {
  justify-content: center;
  padding-bottom: 300px;
}

.chapter-screen--last .chapter-screen__content {
  align-items: center;
  text-align: center;
}

.chapter-screen--last .chapter-screen__overlay {
  background: linear-gradient(
    180deg,
    rgba(15, 20, 18, 0.35) 0%,
    rgba(15, 20, 18, 0.55) 100%
  );
}

.chapter-screen--last .site-footer {
  left: 0;
}

/* =============================================================================
   Плавный переход «экран главы на главной → титульный экран главы».
   Фон одинаковый на обоих экранах и остаётся на месте.
   ============================================================================= */

/* Уходим с главной: текст и затемнение блока плавно гаснут (фон не трогаем) */
.chapter-screen.is-leaving .chapter-screen__content,
.chapter-screen.is-leaving .chapter-screen__overlay {
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

/* Приходим на главу: плашка с заголовком плавно проявляется.
   Только на титульном экране главы (не на герое главной .hero--home). */
.hero:not(.hero--home) .hero__content {
  animation: hero-plate-in 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes hero-plate-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .chapter-screen.is-leaving .chapter-screen__content,
  .chapter-screen.is-leaving .chapter-screen__overlay { transition: none; }
  .hero:not(.hero--home) .hero__content { animation: none; }
}


/* =============================================================================
   7. ОСНОВНОЙ КОНТЕНТ — СЕКЦИИ
   ============================================================================= */

.content {
  display: flex;
  flex-flow: column;
  align-items: center;
  gap: 80px;
  width: 100%;
  padding-top: 80px;
  padding-bottom: 80px;
}

/* Раздел — крупный вертикальный блок */
.section {
  position: relative;
  display: flex;
  flex-flow: column;
  justify-content: flex-start;
  align-items: center;
  gap: 20px;
  width: 100%;
}


/* =============================================================================
   8. ТЕКСТОВЫЕ БЛОКИ
   ============================================================================= */

/* Контейнер для текста с ограниченной шириной */
.text-block {
  position: relative;
  z-index: 1;
  display: flex;
  flex-flow: column;
  gap: 15px;
  max-width: var(--max-text);
  margin-bottom: 20px;
}

/* Подпись с декоративной иконкой слева */
.caption-block {
  position: relative;
}

.caption-block__icon {
  position: absolute;
  top: 2px;
  left: -34px;
  width: 24px;
}

/* Обёртка изображения внутри колонки */
.col-image {
  width: 100%;
  margin-top: 10px;
}

.col-image img {
  width: 100%;
  border-radius: 12px;
  mix-blend-mode: darken;
}

/* Термин с тултипом */
.term-tooltip {
  cursor: help;
  display: inline-block;
  padding: 0 10px;
  border: 1px solid var(--color-accent-hover);
  border-radius: var(--radius-sm);
  position: relative;
}


/* =============================================================================
   9. ДВУХКОЛОНОЧНАЯ СЕТКА
   ============================================================================= */

.two-col {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  width: 100%;
  max-width: 800px;
}

.two-col__col {
  display: flex;
  flex-flow: column;
  gap: 5px;
  background-color: var(--color-bg);
}


/* =============================================================================
  10. ГРАФИКИ
   ============================================================================= */

/* Обёртка широкого графика */
.graph-wide-wrapper {
  width: 100%;
  max-width: 1440px;
  padding: 0 40px;
}

.graph-wide {
  position: relative;
  display: flex;
  flex-flow: column;
  width: 100%;
  padding: 30px 20px 50px;
  background-color: var(--color-card-bg);
  border-radius: var(--radius-lg);
}

.graph-wide--clear {
  background: none;
  padding: 0;
  border-radius: 0;
  max-width: 1440px;
}

/* Обёртка среднего графика */
.graph-mid {
  position: relative;
  display: flex;
  gap: 20px;
  flex-flow: column;
  width: 100%;
  max-width: 960px;
  margin-bottom: 40px;
  padding: 40px;
  background-color: var(--color-card-bg);
  border-radius: var(--radius-lg);
}

.graph-mid__title {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
  font-family: var(--font-main);
  font-size: 24px;
  line-height: 32px;
}

/* Скролл-контейнер изображения графика */
.graph-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  position: relative;
}

/* Подсказка «свайп» — только мобилка */
@media (max-width: 767px) {
  .graph-scroll::after {
    content: '';
    position: absolute;
    left: 12px;
    top: 12px;
    width: 40px;
    height: 40px;
    background: url('../assets/swipe.svg') center / 24px 24px no-repeat,
                rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10;
    animation: swipe-hint 1.4s ease-in-out infinite;
    transition: opacity 0.3s ease;
  }
  .graph-scroll.scrolled::after {
    opacity: 0;
  }
  /* Карточки без горизонтального скролла — не показывать подсказку свайпа */
  .graph-scroll--no-swipe::after {
    display: none;
  }
}

@keyframes swipe-hint {
  0%   { transform: translateX(0); }
  30%  { transform: translateX(-7px); }
  60%  { transform: translateX(5px); }
  100% { transform: translateX(0); }
}

.graph-image {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 600px;
  /*margin: 20px 0;*/
}

/* Изображение, вписанное по ширине контейнера (без принудительного min-width) */
.graph-image--fit {
  width: 100%;
  min-width: 0;
  height: auto;
  display: block;
}

/* =============================================================================
   Кликабельная картинка → зум-лайтбокс
   ============================================================================= */

/* Триггер: кнопка-обёртка вокруг картинки (доступность + клик) */
.zoom-trigger {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}

.zoom-trigger img {
  border-radius: var(--radius-md);
  display: block;
}

/* Иконка-подсказка «можно увеличить» в углу */
.zoom-trigger__hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  opacity: 0.9;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
  .zoom-trigger:hover .zoom-trigger__hint { opacity: 1; transform: scale(1.06); }
}

/* Подпись «Увеличить карту» — только мобилка (стиль .source-caption) */
.zoom-trigger__caption {
  display: none;
}

@media (max-width: 767px) {
  .zoom-trigger {
    cursor: pointer;
  }
  .zoom-trigger__hint {
    display: none;            /* на мобилке вместо угловой иконки — подпись снизу */
  }
  .zoom-trigger__caption {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
    font-style: italic;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(26, 26, 26, 0.45);
  }
  .zoom-trigger__caption svg {
    flex: none;
    opacity: 0.7;
  }
  .zoom-trigger__caption-text {
    text-decoration: underline dashed;
    text-decoration-color: rgba(26, 26, 26, 0.3);
    text-underline-offset: 3px;
  }
}

/* ----- Лайтбокс на нативном <dialog> ----- */
.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lightbox[open] { display: flex; }
.lightbox.is-visible { opacity: 1; }

.lightbox::backdrop {
  background: rgba(20, 18, 14, 0.92);
}

/* Область просмотра — здесь живёт зум/пан, задаётся из JS через transform */
.lightbox__stage {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;          /* перехватываем жесты сами (pinch/pan) */
  cursor: zoom-in;
}
.lightbox__stage.is-zoomed { cursor: grab; }
.lightbox__stage.is-panning { cursor: grabbing; }

.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
  will-change: transform;
}

/* Кнопка закрытия */
.lightbox__close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease;
}
.lightbox__close:hover { background: rgba(255, 255, 255, 0.26); }

/* Подсказка по жестам — гаснет после первого взаимодействия */
.lightbox__hint {
  position: absolute;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 2;
  padding: 8px 14px;
  font-family: var(--font-main);
  font-size: 13px;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.is-interacted .lightbox__hint { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox.is-visible { transition: none; }
}

/* Контейнер для горизонтально прокручиваемого графика */
.graph-fullwidth-wrapper {
  display: flex;
  flex-flow: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  overflow-x: auto;
}

.graph-fullwidth--desktop {
  width: 100%;
  max-width: 1440px;
  margin: 40px 0;
}

.graph-fullwidth--mobile {
  display: none;
}


/* =============================================================================
  11. ПАРНИКОВЫЙ ЭФФЕКТ — STICKY-ЗОНА
   ============================================================================= */

/* Внешний контейнер sticky-блока */
.sticky-section {
  position: relative;
  z-index: 0;
  display: flex;
  flex-flow: column;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  margin-bottom: 50px;
}

/* Sticky-контейнер с фоновыми изображениями */
.sticky-images {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
}

.sticky-images__img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .5s ease-in-out;
}

/* По умолчанию (десктоп) показываем только десктопные фото */
.sticky-images__img--mobile { display: none; }
.sticky-images__img--desktop { display: block; object-fit: cover; }

/* Текстовые карточки, которые триггерят смену фото */
.sticky-text-card {
  position: relative;
  z-index: 5;
  display: flex;
  flex-flow: column;
  gap: 10px;
  max-width: var(--max-text);
  margin-top: 5vh;
  margin-bottom: 100vh;
  padding: 30px 50px 50px;
  background-color: var(--color-bg);
  border-radius: var(--radius-md);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}


/* =============================================================================
  12. СЛАЙДЕР
   ============================================================================= */

.slider {
  position: relative;
  width: 100%;
  max-width: var(--max-graph);
  overflow: hidden;
  border-radius: var(--radius-md);
  background: transparent;
  height: auto;
}

.slider__track {
  display: flex;
  transition: transform .5s ease;
}

.slider__slide {
  min-width: 100%;
  flex-shrink: 0;
}

/* Карточка внутри слайда */
.slide-card {
  position: relative;
  display: flex;
  flex-flow: column;
  align-items: center;
  width: 100%;
  background-color: transparent;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.slide-card__image {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  mix-blend-mode: darken;
}

.slide-card__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 10px 16px;
  color: var(--color-accent);
}

/* Нумерованный кружок */
.step-badge {
  display: inline-flex;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-white);
  background-color: var(--color-accent);
  border-radius: 24px;
}

/* Кнопки-стрелки */
.slider__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, .8);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.slider__arrow--prev { left: 10px; }
.slider__arrow--next { right: 10px; }

.slider__arrow-icon { width: 14px; }

/* Точки пагинации */
.slider__dots {
  display: none;
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  z-index: 10;
  text-align: center;
}

.slider__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 3px;
  background: rgba(0, 0, 0, .3);
  border-radius: 50%;
  cursor: pointer;
}

.slider__dot--active {
  background: var(--color-accent);
}


/* =============================================================================
  13. КАРТОЧКИ ПРИЧИН (5 ШТ.)
   ============================================================================= */

/* Сетка на десктопе */
.causes-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 1640px;
  margin-bottom: 40px;
  padding: 0 40px;
}

.cause-card {
  position: relative;
  display: flex;
  flex-flow: column;
  align-items: center;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--color-bg);
}

.cause-card__image {
  width: 100%;
  object-fit: cover;
  mix-blend-mode: darken;
}

.cause-card__badge {

}

.cause-card__caption {
  padding: 8px;
  text-align: center;
  font-size: 16px;
}


/* =============================================================================
  14. ФИЗИЧЕСКИЕ КАРТОЧКИ (p5.js)
   ============================================================================= */

.physics-cards {
  display: flex;
  flex-flow: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  max-width: var(--max-wide);
  margin: 40px 0;
}

.physics-card {
  display: flex;
  flex-flow: column;
  width: 260px;
  height: 400px;
  padding-bottom: 50px;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.physics-card__canvas {
  aspect-ratio: 1;
  width: 100%;
}

.physics-card__info {
  display: flex;
  flex-flow: column;
  gap: 2px;
  justify-content: flex-start;
  align-items: center;
  padding: 10px;
}

.physics-card__desc {
  color: var(--color-accent);
  text-align: center;
  font-size: 16px;
  line-height: 20px;
}


/* =============================================================================
  15. ТАБЛИЦА ФАКТОРОВ КЛИМАТИЧЕСКИХ МОДЕЛЕЙ
   ============================================================================= */

.factors-block {
  position: relative;
  display: flex;
  flex-flow: column;
  gap: 10px;
  width: 960px;
  padding: 40px;
  background-color: var(--color-card-bg);
  border-radius: var(--radius-lg);
}

.factors-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 20px;
}

.factor-tag {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 8px;
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 20px;
  text-align: center;
  color: var(--color-text);
  background-color: var(--color-accent-faint);
  border-radius: var(--radius-sm);
}


/* =============================================================================
  15б. МОБИЛЬНАЯ КАРТОЧКА УЧЁНОГО (в слайдере)
   ============================================================================= */

.scientist-slide-card {
  width: calc(100vw - 20px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 20px;
  background: var(--color-card-bg);
  border-radius: var(--radius-md);
}

.scientist-slide-card__photo {
  width: 100%;
  height: 320px;
  object-fit: contain;
  align-self: center;
  mix-blend-mode: darken;
}

.scientist-slide-card__info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0 0;
  text-align: left;
}

.scientist-slide-card__info .scientist-item__name {
  margin-top: 0;
  text-align: left;
  font-size: 18px;
  line-height: 22px;
}

/* Слайдер учёных: убираем точки-навигацию, оставляем стрелки */
#slider-scientists .slider__dots {
  display: none;
}

/* Карточка с полями 10px по бокам, чтобы не упиралась в край экрана */
#slider-scientists .slider__slide {
  padding: 0 10px;
}

/* Стрелки с отступом 20px от края */
#slider-scientists .slider__arrow--prev { left: 20px; }
#slider-scientists .slider__arrow--next { right: 20px; }

/* Первый sticky-img видим по умолчанию */
.sticky-images__img--visible {
  opacity: 1;
}


/* =============================================================================
  16. УЧЁНЫЕ
   ============================================================================= */

.scientists-grid {
  position: relative;
  display: flex;
  flex-flow: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  width: 100%;
  max-width: 90vw;
  margin: 20px 0 80px;
}

.scientist-item {
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 15vw;
  min-width: 130px;
  cursor: pointer;
}

.scientist-item__card {
  display: flex;
  flex-flow: column;
  justify-content: flex-start;
  align-items: center;
  align-self: flex-start;
  width: 100%;
  background-color: var(--color-bg);
}

.scientist-item__photo {
  width: 100%;
  object-fit: contain;
  mix-blend-mode: darken;
}

.scientist-item__name {
  position: relative;
  z-index: 1;
  margin-top: 5px;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
}

/* Флип-карточка учёного: лицо — портрет, оборот — описание
   (та же механика, что у .card-white в гл. 3). Высоту .scientist-item__inner
   выравнивает по ряду js/chapter-1.js, чтобы текст на обороте не обрезался. */
.scientist-item {
  perspective: 1000px;
}

.scientist-item__inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.4, 0, .2, 1);
}

@media (hover: hover) {
  .scientist-item:hover .scientist-item__inner {
    transform: rotateY(180deg);
  }
}

/* Тачскрин (планшеты с desktop-сеткой) — флип по тапу, класс ставит JS */
.scientist-item--flipped .scientist-item__inner {
  transform: rotateY(180deg);
}

.scientist-item__card {
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Оборот с описанием */
.scientist-item__overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-flow: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 16px;
  color: var(--color-text);
  background-color: var(--color-card-bg);
  border-radius: var(--radius-md);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(180deg);
  overflow: hidden;
  hyphens: auto;
}

.scientist-item__overlay .caption-regular {
  font-size: 14px;
  line-height: 18px;
}

.scientists-hint {
  margin-top: 20px;
}

.scientist-item__overlay-name {
  position: relative;
  z-index: 1;
  margin-bottom: 8px;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
  text-align: left;
}


/* =============================================================================
  17. УЧРЕЖДЕНИЯ
   ============================================================================= */

.institutions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 48px 40px;
  width: 100%;
  max-width: 1200px;
  margin: 20px 0 40px;
}

.institution-item {
  display: flex;
  flex-flow: column;
  align-items: flex-start;
  gap: 8px;
  background-color: var(--color-bg);
}

.institution-item img {
  mix-blend-mode: darken;
}

.institution-item__logo {
  width: 100%;
  height: auto;
  /*aspect-ratio: 4/3;*/
  object-fit: cover;
  mix-blend-mode: darken;
  margin-bottom: 4px;
}

/* Единые пропорции картинок только в этом блоке (гл. 5),
   чтобы тексты под ними не «скакали». Не влияет на остальные главы. */
.institutions-grid--uniform {
  /* minmax(0,1fr) не даёт колонкам разъезжаться под ширину картинки */
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.institutions-grid--uniform .institution-item__logo {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  height: auto;
  object-fit: cover;
}

.institution-item__name {
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.institution-item .caption-regular {
  font-style: italic;
  color: var(--color-text);
}


/* =============================================================================
  18. OUTRO / ПЕРЕХОД К СЛЕДУЮЩЕЙ ГЛАВЕ
   ============================================================================= */

.outro {
  position: relative;
  display: flex;
  flex-flow: column;
  justify-content: flex-start;
  align-items: center;
  gap: 20px;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.outro__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.outro__content {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-flow: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  max-width: var(--max-graph);
  padding-bottom: 150px;
  text-align: center;
  color: var(--color-white);
  opacity: .9;
}

.outro__next-title {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 5vw;
  font-weight: 900;
  line-height: 4vw;
}

.btn-next-chapter {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  padding: 10px 25px;
  color: var(--color-white);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  font-family: var(--font-main);
  background-color: rgba(255, 255, 255, .2);
  border-radius: 50px;
  transition: all .2s;
}

.btn-next-chapter:hover {
  background-color: rgba(255, 255, 255, .3);
  padding-left: 35px;
  padding-right: 35px;
}


/* =============================================================================
  19. ФУТЕР
   ============================================================================= */

.site-footer {
  position: absolute;
  bottom: 0;
  z-index: 3;
  width: 100%;
  padding: 10px;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  justify-content: space-between;
  align-items: stretch;
  width: 100%;
  min-height: 200px;
  padding: 20px;
  color: var(--color-white);
  background-color: var(--color-accent-mid);
  border-radius: var(--radius-md);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.site-footer__left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  grid-column: span 2;
}

.site-footer__tagline {
  position: relative;
  z-index: 1;
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 20px;
}

.site-footer__meta {
  display: flex;
  flex-flow: row;
  align-items: center;
  gap: 10px;
}

.site-footer__copyright {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 20px;
  position: relative;
  z-index: 1;
}

.site-footer__credit {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, .3);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 20px;
  text-decoration: none;
}

.site-footer__right {
  display: flex;
  flex-flow: column;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 10px;
  height: 100%;
  grid-column: 4 / 5;
}

.site-footer__social {
  display: flex;
  flex-flow: row;
  gap: 8px;
}

.site-footer__social-link {
  position: relative;
  z-index: 1;
  color: var(--color-white);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 20px;
  text-decoration: none;
}

.site-footer__social-link:hover {
  opacity: .7;
}

/* Обратная связь (правый нижний угол футера) */
.site-footer__feedback {
  position: relative;
  z-index: 1;
  max-width: 400px;
  text-align: right;
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 20px;
  color: var(--color-white);
}

.site-footer__feedback-link {
  color: var(--color-white);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.site-footer__feedback-link:hover { opacity: .7; }

@media screen and (max-width: 767px) {
  .site-footer__feedback { text-align: center; max-width: none; }
}


/* =============================================================================
  20. ТУЛТИП
   ============================================================================= */

.tooltip {
  /* Базово скрыт. ВАЖНО: используем :not([open]), а не голый display:none —
     иначе при showModal() открытый <dialog> наследует display:none и не
     рендерится (был баг «попап не открывается»). Открытый dialog всегда виден. */
  position: fixed;
  z-index: 9999;
  width: 420px;
  max-width: calc(100vw - 20px);
  padding: 14px 16px;
  /* Сброс дефолтов нативного <dialog>: на десктопе позицию задаёт JS
     инлайн-стилями, поэтому центрирующий margin:auto и inset убираем. */
  margin: 0;
  inset: auto;
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-white);
  border: 1px solid var(--color-accent-mid);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
  /* лёгкое появление на десктопе */
  animation: tooltip-fade .14s ease;
}
/* Скрываем только ЗАКРЫТЫЙ диалог. Открытый (через show()/showModal())
   всегда получает display:block из UA-стиля и реально рендерится. */
.tooltip:not([open]) {
  display: none;
}

/* show()/showModal() переносят фокус на сам <dialog>, и браузер рисует
   вокруг него синюю фокусную рамку. Внутри тултипа нет интерактивных
   элементов — рамка не нужна (закрытие: Escape, тап по фону, клик вне). */
.tooltip:focus,
.tooltip:focus-visible {
  outline: none;
}

/* У слова-термина рамку по клику/тапу убираем, но для клавиатурной
   навигации (Tab) оставляем — это нужно для доступности. */
.term-tooltip:focus:not(:focus-visible) {
  outline: none;
}

/* Пока открыта мобильная шторка, фон не должен скроллиться: iOS Safari
   прокручивает страницу под модальным <dialog>, от этого прячется/появляется
   нижний тулбар браузера и шторка «скачет». Класс ставит/снимает tooltips.js.
   Лёгкий overflow:hidden, НЕ position:fixed-лок (тот сам давал скачки). */
html.tooltip-lock,
html.tooltip-lock body {
  overflow: hidden;
}

@keyframes tooltip-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Активное слово — подсвечиваем, пока тултип открыт */
.term-tooltip--active {
  background: var(--color-accent-faint);
  border-color: var(--color-accent);
}

/* Иконка-подсказка рядом со словом (assets/tooltip.svg).
   Через mask, чтобы красить в цвет акцента и подсвечивать в активном состоянии. */
.term-tooltip::after {
  content: '';
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-left: 5px;
  vertical-align: -2px;
  background: var(--color-accent-hover);
  -webkit-mask: url('../assets/tooltip.svg') center / contain no-repeat;
          mask: url('../assets/tooltip.svg') center / contain no-repeat;
}

.term-tooltip--active::after {
  background: var(--color-accent);
}

/* Модификатор для термина на цветном/тёмном фоне (например, внутри
   .card-expanding, где фон сам того же зелёного цвета — обычные
   --color-accent-hover/--color-accent сливаются с ним и рамка с иконкой
   становятся не видны). Добавлять вторым классом: term-tooltip term-tooltip--light */
.term-tooltip--light {
  border-color: rgba(255, 255, 255, 0.6);
}

.term-tooltip--light::after {
  background: var(--color-white);
}

.term-tooltip--light.term-tooltip--active {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--color-white);
}

.term-tooltip--light.term-tooltip--active::after {
  background: var(--color-white);
}

/* ─── Мобильная шторка снизу (нативный <dialog> в модальном режиме) ─── */
@media screen and (max-width: 768px) {
  /* Открытый модальный <dialog> по умолчанию центрируется (margin:auto,
     inset:0). Переопределяем на нижнюю шторку, прижатую к низу вьюпорта.
     Браузер сам держит её поверх вьюпорта и блокирует скролл фона —
     поэтому адресная строка больше не дёргается и попап не «скачет». */
  .tooltip--mobile[open] {
    display: block;       /* перебиваем .tooltip { display:none } */
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: env(safe-area-inset-bottom, 0px);
    top: auto;
    inset: auto 10px env(safe-area-inset-bottom, 0px) 10px;
    width: auto;
    max-width: none;
    /* высоту меряем в динамических vh, чтобы при сворачивании адресной
       строки шторка не обрезалась; длинный текст прокручивается внутри */
    max-height: 80dvh;
    overflow-y: auto;
    /* свайп внутри шторки не должен передаваться странице под ней */
    overscroll-behavior: contain;
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    font-size: 16px;
    border: none;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, .18);
    transform: translateY(100%);
    opacity: 0;
    animation: none;                 /* на мобилке свой transition */
    transition: transform .25s ease, opacity .25s ease;
  }
  .tooltip--mobile[open].is-visible {
    transform: translateY(0);
    opacity: 1;
  }
  /* маленький «грабельный» индикатор сверху шторки */
  .tooltip--mobile[open]::before {
    content: '';
    position: sticky;
    top: 0;
    display: block;
    width: 36px;
    height: 4px;
    margin: 0 auto 12px;
    border-radius: 2px;
    background: var(--color-accent-mid);
  }
  /* Затемнение фона рисует сам <dialog> — отдельный оверлей не нужен. */
  .tooltip--mobile[open]::backdrop {
    background: rgba(0, 0, 0, .3);
  }
}


/* =============================================================================
  21. МЕДИАЗАПРОСЫ
   ============================================================================= */

/* Планшет */
@media screen and (max-width: 991px) {
  .two-col {
    grid-template-columns: 1fr;
    max-width: 540px;
  }

  .factors-block {
    width: calc(100% - 40px);
  }

  .graph-wide-wrapper {
    padding: 0 16px;
  }

  .graph-mid {
    width: calc(100% - 80px);
  }

  .scientists-grid {
    max-width: 540px;
    justify-content: flex-start;
  }

  .scientist-item {
    width: 160px;
    min-width: 130px;
  }

  .causes-grid {
    grid-template-columns: repeat(3, 1fr);
    padding: 0 20px;
  }
}

/* Мобильный */
@media screen and (max-width: 767px) {
  /* Показываем слайдер, прячем десктопные сетки */
  .causes-grid   { display: none; }
  .physics-cards { display: none; }
  .slider        { display: block; max-width: 100%; }

  /* Портретный слайдер экосистем: карточка во весь экран минус поля 10px.
     Контейнер растягиваем на 100vw и центрируем, чтобы overflow:hidden
     слайдера не срезал карточку по краям. */
  #slider-ecosystems {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
  #slider-ecosystems .portrait-card {
    width: calc(100vw - 20px);
    margin: 0 auto;
  }

  /* Слайдер на мобиле во всю ширину */
  .slider--mobile-full {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
  }

  /* Графики */
  .graph-wide-wrapper       { padding: 0 12px; }
  .graph-wide               { padding: 20px 16px 30px; border-radius: var(--radius-md); }
  .graph-mid                { width: calc(100% - 20px); padding: 20px 16px; border-radius: var(--radius-md); }
  .graph-fullwidth--desktop { display: none; }
  .graph-fullwidth--mobile  { display: block; width: 100%; margin: 24px 0; padding: 0 20px;}
  .factors-block            { width: calc(100% - 24px); padding: 20px 16px; border-radius: var(--radius-md); }

  /* Герой */
  /* Было 15vw — на ширинах ~480–767px длинное слово («проявляются»)
     не помещалось в плашку и вылезало за её края. Кегль подобран так,
     чтобы самое длинное слово заголовка (11 букв) влезало в плашку. */
  .heading-xl       { font-size: clamp(34px, 10.5vw, 72px); line-height: 0.95; }
  .hero:not(.hero--home) .hero__content { padding: 32px 24px; max-width: calc(100vw - 20px); }
  .hero__intro-text { font-size: 16px; line-height: 22px; }
  /* Титульный экран главной: заголовок — сверху, вводный текст — снизу
     у иконки скролла; нижний абзац скрыт. */
  .hero--home .hero__content    { gap: 24px; padding: 96px 20px 96px; justify-content: space-between; }
  .hero--home .hero__top        { display: contents; }          /* разгруппируем */
  .hero--home .hero__title      { order: 1; font-size: clamp(30px, 10vw, 72px); }
  .hero--home .hero__eyebrow    { order: 2; }
  .hero--home .hero__intro-text { display: none; }

  /* Контент */
  .content { gap: 48px; padding-top: 60px; padding-bottom: 60px; }
  .section { gap: 16px; }
  .text-block { padding: 0 16px; }

  /* Типографика */
  .body-text  { font-size: 16px; line-height: 24px; }
  .body-list  { font-size: 16px; line-height: 24px; margin-left: 0; }
  .heading-lg { font-size: 24px; line-height: 30px; }
  .heading-md { font-size: 20px; line-height: 26px; }

  /* Sticky-зона: та же sticky-механика, что и на десктопе,
     но с мобильными фото и более узкими карточками */
  .sticky-section { margin-bottom: 20px; }

  /* На мобиле показываем мобильные фото, прячем десктопные */
  .sticky-images__img--desktop { display: none; }
  .sticky-images__img--mobile  { display: block; }

  .sticky-text-card {
    width: calc(100% - 32px);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  }

  /* Slider card */
  .slide-card { width: calc(100vw - 20px); margin: 0 auto; background-color: var(--color-bg); }
  /*.slide-card__image { max-height: 56vw; }*/

  /* Убираем точки-навигацию у слайдера причин */
  #slider-causes .slider__dots { display: none; }

  /* Outro */
  .outro__next-title { font-size: 10vw; line-height: 9vw; }
  .outro__content    { padding-bottom: 80px; width: 90%; }

  /* Главы на главной */
  .chapter-screen {
    padding: 80px 24px;
    background-attachment: scroll;   /* fixed ненадёжен на мобильных */
  }
  .hero--home { background-attachment: scroll; }
  .chapter-screen--last { padding-bottom: 280px; }
  .chapter-screen--left,
  .chapter-screen--right { justify-content: center; }
  .chapter-screen__content { max-width: 100%; align-items: center; text-align: center; gap: 8px; }
  .chapter-screen--left  .chapter-screen__overlay,
  .chapter-screen--right .chapter-screen__overlay {
    background: linear-gradient(
      180deg,
      rgba(15, 20, 18, 0.45) 0%,
      rgba(15, 20, 18, 0.65) 100%
    );
  }
  .chapter-screen__title { font-size: 30px; line-height: 34px; }
  .chapter-screen__text  { font-size: 16px; line-height: 24px; }

  /* Учёные */
  .scientists-grid { display: none; }
  .scientists-hint { display: none; }
  .scientist-item  { width: 100px; min-width: 90px; }

  /* Учреждения */
  .institutions-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 24px; padding: 0 16px; }
  /* В блоке гл. 5 клампим колонки, чтобы картинки были одной ширины → одной высоты */
  .institutions-grid--uniform { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /*.institution-item__logo { aspect-ratio: 4/3; }*/

  /* Футер: переверстаем в один центрированный столбец.
     Порядок: соцсети сверху → копирайт/кредит в столбик. Форма скрыта. */
  .site-footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    grid-template-columns: none;
    min-height: 0;            /* убираем min-height у всего футера */
    gap: 32px;                /* единый гэп между блоками */
  }

  .site-footer__left,
  .site-footer__right {
    grid-column: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: auto;
    gap: 0;
  }

  /* 1. Соцсети — сверху, по центру */
  .site-footer__right  { order: 1; }
  .site-footer__left   { order: 2; }
  .site-footer__social {
    justify-content: center;
    flex-wrap: wrap;
  }

  /* 2. Копирайт и кредит — в столбик, без гэпа, по центру */
  .site-footer__meta {
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
  }

  /* Длинный тэглайн не нужен в компактном мобильном футере */
  .site-footer__tagline { display: none; }
}

/* Совсем маленький экран */
@media screen and (max-width: 479px) {
  .site-header__logo { width: 120px; }
  .hero__content     {
    padding: 20px;
    max-width: calc(100vw - 20px);
  }
  .hero--home .hero__content { padding: 84px 16px 84px; max-width: none; }
  .heading-xl        { font-size: clamp(30px, 10.5vw, 48px); line-height: 0.95; }
  .two-col           { gap: 24px; padding: 0 10px; }
  .adaptation-col__list { gap: 0; }
}

/* Десктоп — явно показываем сетки, прячем слайдер */
@media screen and (min-width: 768px) {
  .slider        { display: none; }
  .causes-grid   { display: grid; }
  .physics-cards { display: flex; }
}

@media screen and (min-width: 768px) {
  .caption-label--mobile-only { display: none; }
}

@media screen and (max-width: 767px) {
  .caption-label--desktop-only { display: none; }

  /* Боковые отступы для заголовков-подписей, чтобы текст не упирался в край экрана */
  .caption-label {
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }
  .graph-image--scroll-mobile { min-width: 800px; }
  .graph-image--scroll-mobile.graph-image--mw-1000 { min-width: 1000px; }
  .graph-image--scroll-mobile.graph-image--mw-1200 { min-width: 1200px; }
  .ipcc-chart-canvas { min-width: 800px; }

  /* Карта точек невозврата: вписана по ширине экрана, без боковых полей обёртки */
  .graph-wide-wrapper--flush-mobile { padding: 0; }
}


/* =============================================================================
  22. КОМПОНЕНТЫ ГЛАВЫ 2
   ============================================================================= */

/* ----- Блок с одиночным изображением ----- */
.image-block {
  width: 100%;
  max-width: 1200px;
  padding: 0 40px;
}

.image-medium {
  width: 100%;
  max-width: 900px;
}

.image-block__img {
  width: 100%;
  border-radius: var(--radius-lg);
  mix-blend-mode: darken;
}

.image-block__img--medium {
  width: 800px;
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

/* ----- Центрированное изображение с подписью ----- */
.image-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 640px;
}

.image-centered__img {
  width: 100%;
  border-radius: var(--radius-md);
}

/* ----- Нумерованные карточки (5 шт., секция «Течения») ----- */
.numbered-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 1640px;
  padding: 0 40px;
  margin-bottom: 20px;
}

.numbered-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-white);
  padding-bottom: 12px;
}

.numbered-card .step-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}

.numbered-card__image {
  width: 100%;
  object-fit: cover;
  mix-blend-mode: darken;
}

.numbered-card .caption-italic {
  padding: 0 10px;
  text-align: center;
  font-size: 13px;
}

/* Варианты цветов badge */
.step-badge--red    { background-color: #c0392b; }
.step-badge--yellow { background-color: #d4a017; }

/* ----- Хронология кратера ----- */
.history-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 800px;
  padding: 0 40px;
}

.history-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.history-card .caption-date {
  padding-top: 6px;
  font-size: 14px;
}

.history-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  mix-blend-mode: darken;
}

/* ----- Before/After слайдер ----- */
.before-after-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: var(--max-graph);
  padding: 0 40px;
}

.before-after {
  position: relative;
  width: 100%;
  aspect-ratio: 1440 / 1276;
  max-height: 80vh;
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;
  border-radius: var(--radius-md);
  touch-action: none;
}

.before-after__img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
}

.before-after__img--bottom {
  display: block;
  height: 100%;
}

.before-after__img--top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  clip-path: inset(0 50% 0 0);
}

.before-after__divider {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: rgba(26, 26, 26, 0.6);
  transform: translateX(-50%);
  pointer-events: none;
}

.before-after__handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 40px;
  background: var(--color-card-bg);
  border: 2px solid var(--color-text);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* ----- Портретные карточки (экосистемы) ----- */
.portrait-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 1640px;
  padding: 0 40px;
  margin-bottom: 20px;
}

.portrait-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-card-bg);
}

.portrait-card__image {
  width: 100%;
  object-fit: cover;
  mix-blend-mode: darken;
}

.portrait-card__label {
  padding: 10px 12px 12px;
  font-size: 14px;
  line-height: 18px;
}

/* В слайдере — вертикальный порядок (сначала текст, потом фото) */
.slider .portrait-card {
  flex-direction: column-reverse;
}

.slider .portrait-card__label {
  padding: 12px 12px 8px;
}

/* ----- Таблица влияния на экономику ----- */
.impact-table-wrapper {
  width: 100%;
  max-width: var(--max-wide);
  padding: 0 40px;
  overflow-x: auto;
}

.impact-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.impact-table__row {
  display: grid;
  grid-template-columns: 1fr 2fr 2fr;
}

.impact-table__row--header {
  background: var(--color-accent-mid);
}

.impact-table__cell {
  padding: 16px 20px;
  font-size: 16px;
  line-height: 22px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.impact-table__row:last-child .impact-table__cell {
  border-bottom: none;
}

.impact-table__cell--header {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--color-text);
}

/* ----- Quiz-виктория ----- */
.quiz-wrapper {
  width: 100%;
  max-width: 640px;
  padding: 40px;
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  text-align: center;
}

.quiz__label {
  color: var(--color-accent);
  letter-spacing: 3px;
  font-size: 14px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.quiz__question {
  font-size: 24px;
  line-height: 1.3;
  margin-bottom: 32px;
  font-weight: 500;
}

.quiz__value {
  font-size: 32px;
  color: var(--color-accent);
  margin-bottom: 12px;
  font-weight: 700;
}

.quiz__range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 10px;
  background: linear-gradient(var(--color-accent), var(--color-accent)) 0/0% 100% no-repeat,
              rgba(0,0,0,0.12);
  margin-bottom: 8px;
  cursor: pointer;
}

.quiz__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 40px;
  border-radius: 12px;
  background: var(--color-bg);
  border: 2px solid var(--color-text);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.quiz__range::-moz-range-thumb {
  width: 22px;
  height: 40px;
  border-radius: 12px;
  background: var(--color-bg);
  border: 2px solid var(--color-text);
  cursor: pointer;
}

.quiz__button {
  display: inline-block;
  margin-top: 24px;
  padding: 14px 36px;
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 18px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.quiz__button:hover { opacity: 0.85; }

.quiz__progress {
  margin-top: 16px;
  color: var(--color-accent);
  font-style: italic;
  font-size: 15px;
}

.quiz__answer {
  font-size: 22px;
  line-height: 1.4;
  margin: 24px 0;
  font-weight: 500;
}

.quiz__source {
  margin-top: 16px;
  font-size: 13px;
  color: rgba(26,26,26,0.4);
}

.quiz__source a {
  color: rgba(26,26,26,0.4);
  text-decoration: underline;
}

/* Медиа-адаптация новых компонентов */
@media screen and (max-width: 991px) {
  .numbered-cards-grid { grid-template-columns: repeat(3, 1fr); padding: 0 20px; }
  .portrait-cards-grid  { grid-template-columns: repeat(3, 1fr); padding: 0 20px; }
  .history-grid         { grid-template-columns: repeat(4, 1fr); padding: 0 20px; }
  .image-block          { padding: 0 16px; }
  .sdg-grid             { padding: 0 16px; gap: 8px; }
  .before-after-wrapper { padding: 0 16px; }
  .impact-table-wrapper { padding: 0 20px; }
}

@media screen and (max-width: 767px) {
  .numbered-cards-grid  { display: none; }
  .portrait-cards-grid  { display: none; }
  .history-grid         { grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0 12px; }
  .image-block          { padding: 0; }
  .image-block__img     { border-radius: 0; }
  .sdg-grid             { grid-template-columns: repeat(3, 1fr); padding: 0 12px; gap: 6px; }
  .sdg-grid__item       { border-radius: 7px; }
  .before-after-wrapper { padding: 0 12px; }
  .before-after         { border-radius: var(--radius-sm); }
  .impact-table-wrapper { padding: 0 12px; }
  .impact-table__row    { grid-template-columns: 1fr; }
  .impact-table__cell--header:not(:first-child) { display: none; }
  .quiz-wrapper         { padding: 24px 16px; border-radius: var(--radius-md); width: calc(100vw - 20px); }
  .quiz__question       { font-size: 20px; }
  .quiz__value          { font-size: 28px; }
}

@media screen and (min-width: 768px) {
  .numbered-cards-grid { display: grid; }
  .portrait-cards-grid { display: grid; }
}


/* =============================================================================
  23. FADE-IN ПРИ СКРОЛЛЕ
   ============================================================================= */

/*
 * Добавьте класс .reveal к любому блоку — он плавно появится
 * когда попадёт в viewport. Класс .reveal--visible добавляется
 * через IntersectionObserver в js/components.js.
 */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity   0.55s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Задержки для дочерних элементов (опционально) */
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }

/* Не анимируем тех, кто предпочитает меньше движения */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}


/* =============================================================================
   24. КОМПОНЕНТЫ ГЛАВЫ 3 — «КАК ИЗМЕНЕНИЕ КЛИМАТА ВЛИЯЕТ НА ЭКОНОМИКУ»
   ============================================================================= */

/* ─── Раскрывающиеся карточки (аккордеон) ─── */

.card-expanding {
  background: var(--color-accent);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: background 0.2s;
}

.card-expanding__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 32px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.card-expanding__title {
  font-size: 20px;
  font-weight: 400;
  line-height: 28px;
  flex: 1;
  color: var(--color-white);
}

.card-expanding__arrow {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-expanding__arrow svg {
  width: 20px;
  height: 20px;
  stroke: var(--color-white);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-expanding--open .card-expanding__arrow {
  transform: rotate(180deg);
}

.card-expanding__body {
  display: none;
  padding: 0 32px 28px;
  font-size: 20px;
  line-height: 28px;
  color: var(--color-white);
}

.card-expanding--open .card-expanding__body {
  display: block;
}

.card-expanding__body p + p {
  margin-top: 12px;
}

.card-expanding__body ol {
  padding-left: 24px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-expanding__body ol li {
  padding-left: 4px;
}


/* ─── Группа раскрывающихся карточек ─── */
.expanding-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: calc(var(--max-text) + 64px);
}

/* ─── Белые карточки (транспорт) ─── */

.cards-white-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  gap: 12px;
  padding: 0 40px;
}

/* .card-white — это флип-карточка с perspective + preserve-3d и
   overflow:hidden на лицевой/оборотной стороне (см. ниже). Если сама
   .cards-white-grid анимируется через .reveal (там есть transition
   transform: translateY(...)), браузер иногда после проигрывания этой
   анимации "залипает" на неверном clip-регионе у вложенных 3D-карточек —
   подпись на лицевой стороне обрезается overflow:hidden и остаётся
   обрезанной (баг компоновки слоёв, а не реальная нехватка места).
   Поэтому именно для этой сетки отключаем translateY у .reveal и
   оставляем только fade по opacity — так карточки, попадающие в
   вьюпорт при скролле, ведут себя так же, как при загрузке страницы
   сразу на этом месте (когда анимация вообще не проигрывается). */
.cards-white-grid.reveal {
  transform: none;
}

.cards-white-grid > * {
  flex: 0 1 270px;
  max-width: 270px;
}

/* Флип-обёртка */
.card-white {
  perspective: 1000px;
  cursor: default;
  min-height: 260px;
  border-radius: var(--radius-md);
  transition: box-shadow .35s ease;
}

.card-white__inner {
  position: relative;
  width: 100%;
  max-width: 270px;
  height: 380px;
  min-height: 260px;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.4, 0, .2, 1);
  border-radius: var(--radius-md);
}

/* Десктоп — flip по hover */
@media (hover: hover) {
  .card-white:not(.card-white--no-flip):hover .card-white__inner {
    transform: rotateY(180deg);
  }
}

/* Тачскрин — flip по классу, добавляемому JS */
.card-white--flipped .card-white__inner {
  transform: rotateY(180deg);
}

/* Лицо */
.card-white__front {
  position: absolute;
  inset: 0;
  background: #fff;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

/* Оборот */
.card-white__back {
  position: absolute;
  inset: 0;
  background: var(--color-card-bg);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  padding: 20px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(180deg);
  overflow: hidden;
  hyphens: auto;
}

.card-white__back-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--color-text);
}

.card-white__back-text {
  font-size: 15px;
  line-height: 1.45;
  color: rgba(26, 26, 26, 1);
}

.card-white__icon {
  width: 100%;
  /*height: 200px;*/
  flex-shrink: 0;
  object-fit: cover;
  object-position: center;
}

.card-white__label {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 500;
  margin-top: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
  text-align: center;
}

.card-white__label + p {
  margin-top: -8px;
  font-size: 15px;      /* одинаковый кегль с заголовком .card-white__label */
  line-height: 1.4;
}

.card-white__label--back {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 500;
  margin-top: 0;
  margin-bottom: 8px;
  flex-shrink: 0;
  text-align: left;
}

/* Модификатор для сеток с длинными (двухстрочными) подписями карточек —
   даём .card-white__inner больше высоты, чтобы подпись на лицевой стороне
   не обрезалась через overflow:hidden. Отдельный класс на обёртке .cards-white-grid,
   чтобы НЕ трогать базовый .card-white — им пользуются и другие сетки
   (например, транспорт в главе 3), где подписи короткие и всё и так помещается.
   min-width: 481px — не мешает мобильному правилу высоты для .card-white__inner
   на экранах ≤480px (см. медиа-запрос ниже по файлу). */
@media screen and (min-width: 481px) {
  .cards-white-grid--tall-label .card-white__inner {
    height: 440px;
  }
}

/* Подсказка над сеткой */
.cards-white-hint {
  text-align: center;
  font-size: 13px;
  color: rgba(26, 26, 26, 0.45);
  padding: 0 40px;
  margin-bottom: -4px;
}

/* ─── Карточки углеродного следа ─── */
.cards-footprint-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: 100%;
  max-width: var(--max-wide);
  gap: 12px;
  padding: 0 40px;
}

.card-footprint {
  background: #fff;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 24px;
  overflow: hidden;
}

.card-footprint__img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  margin-bottom: 16px;
}

.card-footprint__title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  color: var(--color-text);
  padding: 0 12px;
  margin-bottom: 12px;
}

.card-footprint__value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  color: var(--color-text);
  margin-bottom: 4px;
}

.card-footprint__unit {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
  color: rgba(26, 26, 26, 0.55);
}

/* ─── Трёхколоночная сетка (Киото и т.д.) ─── */

.cards-three-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  max-width: var(--large-image);
  gap: 64px;
  padding: 0 40px;
  margin: 0 0 40px 0;
}

/* На десктопе обёртки слайдера прозрачны — содержимое лежит в гриде */
.cards-three-grid__track {
  display: contents;
}
.cards-three-grid__slide {
  /* без ограничений — это просто card-3 в гриде */
}
.cards-three-grid__dots {
  display: none;
}

.card-3 {
  background: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
}

.card-3__img {
  width: 75%;
  object-fit: cover;
  mix-blend-mode: darken;
}

.card-3__body {
  /*padding: 20px 24px 24px;*/
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-3__title {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.35;
}

.card-3__caption {
  font-size: 16px;
  line-height: 1.45;
  color: rgba(26, 26, 26, 0.7);
}

/* ─── Числовые карточки (углеродный след) ─── */

.cards-numbers-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 0 40px;
}

.card-number {
  background: var(--color-card-bg);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-number__value {
  font-size: 48px;
  font-weight: 500;
  line-height: 1;
  color: var(--color-text);
}

.card-number__label {
  font-size: 15px;
  line-height: 1.5;
  color: rgba(26, 26, 26, 0.7);
}

/* ─── Полноэкранное изображение ─── */

.image-fullscreen {
  width: 100%;
  overflow: hidden;
}

.image-fullscreen__img {
  width: 100%;
  display: block;
  object-fit: cover;
}

/* ─── Hotspot-подписи поверх fullscreen-картинок ─── */
/*
  Использование в HTML:
  <div class="image-fullscreen image-fullscreen--hotspot reveal">
    <img src="..." class="image-fullscreen__img">
    <div class="hotspot" style="--hx: 22%; --hy: 72%;">
      <div class="hotspot__label">Сфера 1<br><span>Прямые выбросы</span></div>
    </div>
  </div>
*/

.image-fullscreen--hotspot {
  position: relative;
}

.hotspot {
  position: absolute;
  left: var(--hx);
  top: var(--hy);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

/* Пунктирный кружок-индикатор */
.hotspot::before {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  border: 2px dashed var(--color-accent);
  border-radius: 50%;
  margin: 0 auto 0;
  animation: hotspot-spin 8s linear infinite;
  transition: border-color 0.2s ease, transform 0.2s ease;
  filter: drop-shadow(0 0 3px rgba(0,0,0,0.2));
}

.hotspot:hover::before {
  animation-play-state: paused;
  transform: scale(1.15);
}

@keyframes hotspot-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* На тачскрине — без анимации */
@media (hover: none) {
  .hotspot::before { animation: none; }
}

.hotspot__label {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: var(--radius-sm, 8px);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text, #1a1a1a);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hotspot__label span {
  font-weight: 400;
  color: var(--color-text-secondary, #555);
}

.hotspot:hover .hotspot__label,
.hotspot.is-visible .hotspot__label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* На тачскрине — показываем все подписи сразу */
@media (hover: none) {
  .hotspot__label {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ─── Изображение с mix-blend-mode: darken ─── */

.image-darken {
  width: 100%;
  max-width: var(--large-image);
  padding: 0 40px;
}

.image-darken__img {
  width: 100%;
  display: block;
  border-radius: var(--radius-md);
  mix-blend-mode: darken;
}

/* ─── Схема-слайдер (мобилка) ─── */
.scheme-desktop-only { display: block; }
.scheme-slider       { display: none; }

/* ─── Горизонтальная карточка-график ─── */

.card-horizontal {
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 40px;
  align-items: start;
  margin: 0 40px;
  width: 100%;
  max-width: calc(var(--max-graph) - 80px);
  box-sizing: border-box;
}

.card-horizontal__text-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-horizontal__title {
  font-size: 26px;
  font-weight: 400;
  line-height: 1.3;
}

.card-horizontal__body {
  font-size: 17px;
  line-height: 1.7;
  color: rgba(26, 26, 26, 0.8);
}

.card-horizontal__img-col {
  min-width: 0;
  width: 100%;
}

.card-horizontal__img-col img {
  width: 100%;
  display: block;
  border-radius: var(--radius-sm);
}

/* ─── Секция с таблицей мер адаптации ─── */

.adaptation-table {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 0 32px;
  background: var(--color-card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  max-width: calc(var(--max-text) + 64px);
  margin: 0 auto;
}

.adaptation-col {
  padding: 32px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.adaptation-col:last-child {
  border-right: none;
}

.adaptation-col__badge {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
  /* Одинаковая высота всех заголовков (по самому высокому — 2 строки),
     чтобы списки в колонках начинались на одном уровне.
     2 строки = line-height 1.3 × 2 = 2.6em. */
  min-height: 2.6em;
}

.adaptation-col__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.adaptation-col__list li {
  font-size: 15px;
  line-height: 1.5;
  color: rgba(26, 26, 26, 0.75);
  padding-top: 16px;
  border-top: 1px solid rgba(26, 26, 26, 0.08);
}

.adaptation-col__list li:first-child {
  padding-top: 0;
  border-top: none;
}

/* ─────────────────────────────────────────────────────────────
   Таблица влияния (глава 2). Связь по горизонтали:
   признак → влияние → кто пострадает.
   Десктоп: grid 3 колонки. Заголовки колонок — отдельный ряд,
   ячейки одного ряда автоматически выровнены по высоте (свойство grid).
   Мобилка: одна колонка, у каждой ячейки своя метка сверху.
   ───────────────────────────────────────────────────────────── */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 16px;
  row-gap: 0;
  padding: 0 32px;
  background: var(--color-card-bg);
  border-radius: var(--radius-md);
  max-width: calc(var(--max-text) + 64px);
  margin: 0 auto;
}

/* Заголовки колонок (первый ряд grid) */
.impact-grid__head {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
  padding: 32px 0 20px;
}

/* Ячейка с пунктом */
.impact-grid__cell {
  font-size: 15px;
  line-height: 1.5;
  color: rgba(26, 26, 26, 0.75);
  padding: 16px 0;
  border-top: 1px solid rgba(26, 26, 26, 0.08);
}

/* Верхняя граница только у первого ряда данных (3 ячейки после заголовков).
   Заголовки и первый ряд разделяет линия; между рядами — тоже линии. */
.impact-grid__head {
  border-top: none;
}

/* Метка над пунктом — нужна только на мобилке, на десктопе скрыта */
.impact-grid__label {
  display: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}

/* ─── Сетка иконок ЦУР ─── */

.sdg-grid {
  width: 100%;
  max-width: var(--max-text);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-bottom: 40px;
  gap: 4px;
}

.sdg-grid__item {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  display: block;
}

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

/* ─── Подпись источника под блоком ─── */

.source-caption {
  text-align: center;
  font-style: italic;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(26, 26, 26, 0.45);
  padding: 0 40px;
  margin: 0;
}

.source-caption a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(26, 26, 26, 0.25);
}

/* ─── Одиночная широкая карточка (card-s) ─── */

.card-s {
  background: var(--color-card-bg);
  border-radius: var(--radius-md);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: calc(var(--max-text) + 64px);
  box-sizing: border-box;
}

.card-s__title-center {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
}

/* ─── Обёртка с отступами для inline-svg / изображений в card-s ─── */

.card-s__svg-wrap {
  width: 100%;
  overflow: hidden;
}

/* Примеры климатических проектов (гл. 3) — две колонки
   в стилистике прежней SVG-таблицы: жирная шапка с линией, список под ней */
.project-types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
  width: 100%;
}

.project-types__head {
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--color-text);
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
}

.project-types__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 20px;
}

@media screen and (max-width: 767px) {
  .project-types { gap: 0 16px; }
  .project-types__head,
  .project-types__list { font-size: 14px; line-height: 18px; }
  .project-types__list { hyphens: auto; }
}

.card-s__svg-wrap img,
.card-s__svg-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ─── Медиа-адаптация chapter-3 ─── */

@media screen and (max-width: 991px) {
  .cards-white-grid    { padding: 0 20px; }
  .cards-three-grid    { padding: 0 20px; }
  .cards-numbers-grid  { grid-template-columns: repeat(3, 1fr); padding: 0 20px; }
  .adaptation-table    { margin: 0 20px; padding: 0; }
  .image-darken        { padding: 0 20px; }
  .card-horizontal     { margin: 0 20px; padding: 28px 32px; max-width: calc(100% - 40px); }
}

@media screen and (max-width: 767px) {
  /* Сетки карточек */
  .cards-white-grid    { padding: 0 12px; gap: 8px; }
  .cards-white-grid > * { flex: 0 1 calc(50% - 4px); max-width: calc(50% - 4px); }
  .cards-three-grid    { display: block; padding: 0; width: 100vw; max-width: 100vw; overflow: hidden; margin-left: calc(-1 * (100vw - 100%) / 2); }
  .cards-three-grid__track {
    display: flex;
    transition: transform .4s ease;
    will-change: transform;
  }
  .cards-three-grid__slide {
    min-width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    flex-shrink: 0;
    margin-left: 10px;
    padding: 24px;
    box-sizing: border-box;
    background: var(--color-card-bg);
    border-radius: var(--radius-md);
  }
  .cards-three-grid__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px 0 4px;
  }
  .cards-three-grid__dots .slider__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(26, 26, 26, 0.2);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background .2s, transform .2s;
  }
  .cards-three-grid__dots .slider__dot--active {
    background: var(--color-accent);
    transform: scale(1.2);
  }
  .cards-numbers-grid  { grid-template-columns: repeat(2, 1fr); padding: 0 12px; gap: 8px; }

  /* Таблица адаптации */
  .adaptation-table    { grid-template-columns: 1fr; margin: 0 12px; padding: 0; gap: 0;}
  .adaptation-col      { border-right: none; border-bottom: 1px solid rgba(26,26,26,0.1); padding: 20px 16px; }
  .adaptation-col:last-child { border-bottom: none; }
  /* В одну колонку выравнивать заголовки не нужно — убираем резерв высоты */
  .adaptation-col__badge { min-height: 0; }

  /* Таблица влияния (гл. 2): одна колонка, метка над каждым пунктом */
  .impact-grid {
    grid-template-columns: 1fr;
    column-gap: 0;
    margin: 0 12px;
    padding: 16px;
  }
  /* Заголовки колонок прячем — их роль берут метки внутри ячеек */
  .impact-grid__head { display: none; }
  .impact-grid__label { display: block; }
  /* Внутри одного логического блока (3 пункта ряда) линий нет, отступы поджаты */
  .impact-grid__cell {
    padding: 8px 0;
    border-top: none;
  }
  /* Разделитель только между рядами — перед каждым новым признаком (3n+1) */
  .impact-grid__cell:nth-of-type(3n+1) {
    border-top: 1px solid rgba(26, 26, 26, 0.18);
    margin-top: 16px;
    padding-top: 16px;
  }
  /* Первый блок — без линии и верхнего отступа */
  .impact-grid__cell:first-of-type {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
  }

  /* Аккордеон */
  .card-expanding__header { padding: 16px 20px; }
  .card-expanding__title  { font-size: 16px; line-height: 22px; }
  .card-expanding__body   { padding: 0 20px 20px; font-size: 16px; line-height: 24px; }

  /* Изображения */
  .image-darken        { padding: 0; width: 100%; max-width: 100%; }
  .image-darken__img   { border-radius: 0; }

  /* Схема-слайдер — скрываем десктопный вариант, показываем слайдер */
  .scheme-desktop-only { display: none; }
  .scheme-slider {
    display: block;
    width: 100%;
    background: transparent;
    padding: 0 0 4px;
  }
  .scheme-slider__title {
    font-family: var(--font-heading, sans-serif);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: center;
    color: var(--color-muted, #9aab97);
    line-height: 1.4;
    margin: 0 0 24px;
    padding: 0 20px;
  }
  .scheme-slider__viewport {
    width: 100%;
    overflow: hidden;
  }
  .scheme-slider__track {
    display: flex;
    transition: transform .4s ease;
    will-change: transform;
  }
  .scheme-slider__slide {
    min-width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .scheme-slider__slide-img-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg);
  }
  .scheme-slider__slide img {
    width: 70%;
    display: block;
    mix-blend-mode: darken;
  }
  .scheme-slider__arrow {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
  }
  .scheme-slider__arrow svg {
    width: 36px;
    height: 20px;
  }
  /* Последний слайд — стрелку не показываем */
  .scheme-slider__slide:last-child .scheme-slider__arrow {
    display: none;
  }
  .scheme-slider__caption {
    font-size: 16px;
    line-height: 1.4;
    text-align: center;
    color: var(--color-text);
    margin: 16px 0 0;
    padding: 0 10px;
  }
  .scheme-slider__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 24px 0 0;
  }
  .scheme-slider__dots .slider__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(26, 26, 26, 0.2);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background .2s, transform .2s;
  }
  .scheme-slider__dots .slider__dot--active {
    background: var(--color-accent);
    transform: scale(1.2);
  }
  .image-fullscreen__img { aspect-ratio: 16 / 9; }

  /* Горизонтальная карточка */
  .card-horizontal     { grid-template-columns: 1fr; margin: 0 12px; padding: 24px 20px; gap: 24px; width: calc(100% - 24px); max-width: calc(100% - 24px); display: flex; flex-direction: column; }

  /* Числовые карточки */
  .card-number__value  { font-size: 36px; }

  /* card-s */
  .card-s              { padding: 24px 20px; border-radius: var(--radius-md); max-width: calc(100% - 24px); }

  /* Флип-карточки транспорта — на тачскрине тап */
  .cards-white-hint    { display: none; }
  .cards-white-hint--touch { display: block; padding: 0 12px; }
  .card-white          { min-height: 200px; }
  /*.card-white__inner   { min-height: 200px; }*/
  .card-white__back    { padding: 12px 14px; }
  .card-white__back-title { font-size: 13px; margin-bottom: 6px; }
  .card-white__back-text  { font-size: 12px; line-height: 1.5; -webkit-hyphens: auto; }

  /* source-caption */
  .source-caption      { padding: 0 12px; }

  /* expanding-group */
  .expanding-group     { padding: 0 12px; }
}

/* =============================================================================
   ГЛАВА 4 — Дополнительные компоненты
   ============================================================================= */

/* ─── Зелёный вариант аккордеона ─── */

.card-expanding--green {
  background: #94a491;
}

/* ─── Блок документов (docs-grid) ─── */

.docs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 960px;
}

.doc-card {
  border: 1px solid rgba(26, 26, 26, 0.15);
  border-radius: var(--radius-md);
  padding: 28px 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.doc-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-card__title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}

.doc-card__text {
  font-size: 14px;
  line-height: 1.55;
  opacity: 0.7;
  margin: 0;
}

.doc-card__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  letter-spacing: 0.01em;
  align-self: flex-start;
  transition: opacity 0.2s;
}

.doc-card__link:hover { opacity: 0.7; }

/* ─── Карта рисков ─── */

.risk-map-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 40px 0;
}

.risk-map__tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.risk-map__tab {
  --risk-color: var(--color-accent);
  padding: 8px 20px;
  border-radius: 100px;
  border: 1.5px solid rgba(26, 26, 26, 0.2);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  color: var(--color-text);
  font-family: inherit;
}

.risk-map__tab:hover {
  border-color: var(--risk-color);
}

.risk-map__tab--active {
  background: var(--risk-color);
  border-color: var(--risk-color);
  color: var(--color-white);
}

/* ─── Интерактивная SVG-карта ─── */

.risk-map__stage {
  --risk-color: var(--color-accent);
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 14px auto 0;
  border-radius: var(--radius-md);
  background-color: var(--color-bg);
  padding: 12px;
  box-sizing: border-box;
}

.risk-map__svg {
  width: 100%;
  height: auto;
  display: block;
}

@media screen and (min-width: 768px) {
  .risk-map__svg {
    display: block;
    width: auto;
    height: 75vh;
    max-width: 100%;
    margin: 0 auto;
  }
}

/* Регионы: базовый «приглушённый» вид и заметная заливка для топ-риска */
.risk-map__svg path[id^="RU-"] {
  fill: #e3ddd0;
  stroke: var(--color-bg);
  stroke-width: 0.6;
  stroke-linejoin: round;
  transition: fill 0.35s ease, opacity 0.2s ease;
  cursor: default;
}

.risk-map__svg path[id^="RU-"].is-top {
  fill: var(--risk-color);
}

.risk-map__svg path[id^="RU-"].is-hover {
  fill: color-mix(in srgb, var(--risk-color) 45%, #e3ddd0);
}

.risk-map__svg path[id^="RU-"].is-top.is-hover {
  fill: color-mix(in srgb, var(--risk-color) 78%, #1a1a1a);
}

/* Легенда в левом верхнем углу */
.risk-map__legend {
  position: absolute;
  top: 22px;
  left: 22px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: rgba(255, 251, 245, 0.92);
  backdrop-filter: blur(3px);
  box-shadow: 0 2px 10px rgba(26, 26, 26, 0.06);
  border: 1px solid rgba(26, 26, 26, 0.08);
  border-radius: 12px;
  font-size: 13px;
  pointer-events: none;
}

.risk-map__legend-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.risk-map__legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.risk-map__legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.risk-map__legend-dot--top  { background: var(--risk-color); }
.risk-map__legend-dot--rest { background: #e3ddd0; }

/* Тултип с названием региона */
.risk-map__tooltip {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, calc(-100% - 12px));
  padding: 6px 12px;
  background: var(--color-text);
  color: var(--color-white);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.risk-map__tooltip.is-visible {
  opacity: 1;
}

/* ─── Прогресс-бар Сахалинского эксперимента ─── */

.sakhalin-progress {
  width: 100%;
  max-width: 800px;
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  padding: 40px 48px 56px;
  box-sizing: border-box;
}

.sakhalin-progress__track {
  position: relative;
  height: 8px;
  background: rgba(26, 26, 26, 0.12);
  border-radius: 4px;
  margin-bottom: 8px;
}

.sakhalin-progress__bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 64%;
  background: #94a491;
  border-radius: 4px;
}

.sakhalin-progress__years {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  opacity: 0.5;
  margin-top: 8px;
}

.sakhalin-progress__points {
  position: relative;
  height: 120px;
  margin-top: 24px;
}

.sakhalin-progress__point {
  position: absolute;
  left: var(--pos);
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 160px;
}

.sakhalin-progress__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #94a491;
  border: 3px solid var(--color-bg, #fffbf5);
  box-shadow: 0 0 0 2px #94a491;
  flex-shrink: 0;
}

.sakhalin-progress__dot--reached {
  background: #3a7a3a;
  box-shadow: 0 0 0 2px #3a7a3a;
}

.sakhalin-progress__dot--pending {
  background: rgba(26, 26, 26, 0.2);
  box-shadow: 0 0 0 2px rgba(26, 26, 26, 0.2);
}

.sakhalin-progress__label {
  text-align: center;
  font-size: 12px;
  line-height: 1.45;
}

.sakhalin-progress__label strong {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}

.sakhalin-progress__label p {
  margin: 0;
  opacity: 0.65;
}

/* ─── Медиазапросы для новых компонентов ─── */

@media screen and (max-width: 767px) {
  .docs-grid {
    grid-template-columns: 1fr;
  }

  .sakhalin-progress {
    padding: 28px 20px 40px;
    overflow-x: auto;
  }

  .sakhalin-progress__points {
    min-width: 560px;
  }

  .risk-map-block {
    padding: 0 12px;
    margin: 24px 0;
  }

  .risk-map-block .caption-label {
    text-align: center;
  }

  .risk-map__tabs {
    gap: 8px;
    justify-content: center;
  }

  .risk-map__tab {
    padding: 7px 14px;
    font-size: 13px;
  }

  .risk-map__stage {
    padding: 8px;
    margin-top: 16px;
  }

  /* Легенда — вынимаем из absolute, кладём под карту в одну строку */
  .risk-map__legend {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    font-size: 12px;
    margin-top: 8px;
    width: 100%;
    box-sizing: border-box;
  }

  .risk-map__legend-title {
    font-size: 13px;
    margin-bottom: 0;
    margin-right: auto;
  }

  .risk-map__legend-dot { width: 11px; height: 11px; }
  .risk-map__legend .risk-map__legend-item:last-child { display: none; }
}

/* =============================================================================
   ГЛАВА 5 — Дополнительные компоненты
   ============================================================================= */

/* ─── No-flip card-white: высота по контенту, без обрезки ─── */
/* У этих карточек нет оборота, поэтому абсолютная фиксированная высота
   не нужна — пускаем лицо в поток, чтобы текст не обрезался на мобилке. */
.card-white--no-flip {
  height: auto;
  min-height: 0;
  display: flex;          /* флекс-элемент строки растягивается по высоте — */
  flex-direction: column; /* пробрасываем эту высоту вниз до __front */
}

.card-white--no-flip .card-white__inner {
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.card-white--no-flip .card-white__front {
  position: static;
  inset: auto;
  flex: 1 1 auto;         /* лицо занимает всю высоту карточки */
  overflow: visible;
  padding: 24px 0;
}

/* ─── Портретный вариант card-white (нет flip-back, выше картинка) ─── */

.card-white--portrait .card-white__icon {
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  margin-bottom: 0;
}

.card-white--portrait .card-white__front {
  padding: 0 0 20px;
}

.card-white--portrait .card-white__label {
  padding: 12px 16px 0;
  font-size: 13px;
}

/* ─── Цепочка образование → климат ─── */

.edu-chain-block {
  width: 100%;
  max-width: 1120px;
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  box-sizing: border-box;
}

/* Десктоп: горизонтальная цепочка */
.edu-chain {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.edu-chain__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edu-chain__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edu-chain__arrow {
  flex-shrink: 0;
  font-size: 20px;
  color: var(--color-text);
  padding: 0 16px;
  margin-top: 18px;
  opacity: 0.4;
}

.edu-chain__num {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  opacity: 0.4;
  line-height: 1.2;
}

.edu-chain__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
  margin: 0;
}

.edu-chain__text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
  opacity: 0.7;
  margin: 0;
}

/* ─── Медиа для главы 5 ─── */

/* Десктоп: SVG видим, мобильная цепочка скрыта */
.edu-chain-desktop { display: block; }
.edu-chain-mobile  { display: none; }

@media screen and (max-width: 991px) {
  .edu-chain-block { padding: 28px 24px; }
  .docs-grid[style*="repeat(5"] { grid-template-columns: repeat(3, 1fr); }
}

@media screen and (max-width: 767px) {
  .edu-chain-block {
    padding: 24px 20px;
    width: calc(100vw - 20px);
    margin: 0 auto;
    box-sizing: border-box;
  }

  /* Переключаем: прячем SVG, показываем HTML-цепочку */
  .edu-chain-desktop { display: none; }
  .edu-chain-mobile  { display: flex; flex-direction: column; gap: 16px; }

  .edu-chain__item {
    flex-direction: row;
    gap: 16px;
    align-items: flex-start;
  }

  /* Колонка с цифрой: позиционируем стрелку относительно неё */
  .edu-chain__num {
    position: relative;
    font-size: 16px;
    opacity: 1;
    font-weight: 700;
    min-width: 20px;
    padding-top: 2px;
    align-self: stretch;
  }

  /* Аккуратная стрелочка между цифрами, чтобы считывалась последовательность */
  .edu-chain__item:not(:last-child) .edu-chain__num::after {
    content: "";
    position: absolute;
    left: 25%;
    top: 26px;
    bottom: -12px;
    width: 1.5px;
    transform: translateX(-50%);
    background: currentColor;
    opacity: 0.35;
  }

  .edu-chain__item:not(:last-child) .edu-chain__num::before {
    content: "";
    position: absolute;
    left: 25%;
    bottom: -12px;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translate(-50%, 0) rotate(45deg);
    opacity: 0.35;
  }

  .edu-chain__arrow { display: none; }

  .docs-grid[style*="repeat(5"] { grid-template-columns: 1fr; }

  /* Карточки углеродного следа: 5 колонок → 2 на мобиле */
  .cards-footprint-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 12px;
    gap: 8px;
  }
}

/* ─── Полезные ресурсы (глава 5) ─── */

.resources-block {
  border: 1px dashed rgba(26, 26, 26, 0.25);
  border-radius: var(--radius-lg);
  padding: 32px 40px 40px;
  box-sizing: border-box;
  max-width: 1200px;
}

.resources-block__label {
  text-align: center;
  margin-bottom: 32px;
}

.resources-block__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.resources-block__item {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 180px;
  max-width: 220px;
  background-color: var(--color-bg);
}

.resources-block__logo {
  height: 56px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  mix-blend-mode: darken;
  margin-bottom: 6px;
}

.resources-block__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 4px;
  color: var(--color-text);
}

.resources-block__text {
  font-size: 13px;
  line-height: 1.55;
  opacity: 0.65;
  margin: 0;
}

.resources-block__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  margin-top: 4px;
}

.resources-block__link:hover { opacity: 0.6; }

.resources-block__grid--3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media screen and (max-width: 767px) {
  .resources-block { padding: 24px 20px; border-radius: var(--radius-md); max-width: calc(100vw - 20px); }
  .resources-block__grid { gap: 16px; }
  .resources-block__item { flex: 0 0 calc(50% - 8px); }
  .resources-block__grid--3col { grid-template-columns: repeat(2, 1fr); gap: 16px; }

  /* Одна колонка только на мобилке: документы списком на всю ширину */
  .resources-block__grid--1col {
    flex-direction: column;
    gap: 20px;
  }
  .resources-block__grid--1col .resources-block__item {
    flex: 1 1 auto;
    max-width: 100%;
  }
}

@media screen and (max-width: 480px) {
  .adaptation-col__list { gap: 0; }
  .adaptation-col__list li {border-top: none; padding-top: 8px;}
  .card-3__img {width: 50%;}
  .cards-three-grid { gap: 16px; }
  .site-footer__tagline { display: none; }
  .card-white__inner { height: 100%; }
  .card-white--no-flip .card-white__inner { height: auto; }
}

/* ─── Сетка компаний (co-grid / co-card) ─── */

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

.co-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 16px;
}

.co-card__title {
  font-weight: 700;
  margin: 0;
}

.co-card__text {
  opacity: 0.85;
  font-size: 16px;
  line-height: 22px;
  margin: 0 !important;
}

@media screen and (max-width: 767px) {
  .co-grid { grid-template-columns: repeat(2, 1fr); }
  .co-card__title,
  .co-card__text {
    hyphens: auto;
    -webkit-hyphens: auto;
    overflow-wrap: break-word;
    word-break: break-word;
  }
}


/* =============================================================================
   САХАЛИНСКИЙ ЭКСПЕРИМЕНТ — схема целей/задач/результатов
   ============================================================================= */

.sakhalin-goals {
  width: 100%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 0 20px;
  box-sizing: border-box;
}

.sakhalin-goals__section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.sakhalin-goals__label {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
}

.sakhalin-goals__row {
  display: grid;
  gap: 12px;
  width: 100%;
}

.sakhalin-goals__row--center {
  grid-template-columns: 1fr;
  max-width: 320px;
}

.sakhalin-goals__row--3 {
  grid-template-columns: repeat(3, 1fr);
}

.sakhalin-goals__row--4 {
  grid-template-columns: repeat(4, 1fr);
}

.sakhalin-goals__row--offset {
  max-width: calc(75% + 8px); /* 3 из 4 колонок */
}

.sakhalin-goals__card {
  border-radius: 16px;
  padding: 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text);
}

.sakhalin-goals__card strong {
  display: block;
  font-weight: 700;
}

.sakhalin-goals__card p {
  margin: 4px 0 0;
}

.sakhalin-goals__card--blue   { background: #c9d9e8; }
.sakhalin-goals__card--yellow { background: #f5e6b8; }
.sakhalin-goals__card--gray   { background: #e2ddd6; }

/* Мобильная версия */
@media screen and (max-width: 767px) {
  .sakhalin-goals {
    padding: 0 12px;
    gap: 28px;
  }

  .sakhalin-goals__row--3,
  .sakhalin-goals__row--4 {
    grid-template-columns: 1fr;
  }

  .sakhalin-goals__row--center {
    max-width: 100%;
  }

  .sakhalin-goals__row--offset {
    max-width: 100%;
  }

  .sakhalin-goals__card {
    padding: 16px;
    font-size: 14px;
  }
}
