/* ---------- Site header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 14, 18, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  /* nowrap всегда: .sh-nav — position:fixed ниже 1181px (не участвует
     в раскладке этого ряда), так что в потоке всегда только .brand +
     .header-cta. Раньше здесь был flex-wrap:wrap как "страховка от
     наезда на 320px" (см. комментарий у 1181px-версии этого правила
     ниже) — но именно это переносило кнопку-гамбургер на вторую
     строку на мобильных 360-428px, когда переносилось (2 строки)
     само название. Настоящая защита от 320px — min-width:0 на .brand
     (сжимается вместо переполнения), не flex-wrap на всём ряду. */
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  min-height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  transition: font-size 0.3s var(--ease), gap 0.3s var(--ease);
}

.brand img {
  width: 66px;
  height: 66px;
  transition: width 0.3s var(--ease), height 0.3s var(--ease);
}

.brand-name {
  line-height: 1.2;
}

/*
 * Полное название ("Донской Завод Высоковольтных Опор") — на всех
 * страницах сайта, "ДЗВО" нигде в шапке не показываем (короткая
 * аббревиатура осталась только в футере и на самом лого-значке).
 * База ниже — единственный размер на всех обычных страницах (там нет
 * увеличенного хиро) и в проскрученном состоянии на главной. В хиро
 * главной (пока не проскроллено) — крупнее через clamp() в
 * theme-steel.css, это явное переопределение той же специфичности
 * .brand-name--full, побеждает по источнику файла (позже в каскаде).
 * 1.25rem (обычный .brand) для полного названия рядом с 6 пунктами
 * меню + телефоном + кнопкой не помещается в одну строку на типичных
 * десктопных ширинах (1280–1440px) — кнопка уезжала на вторую строку.
 * Уменьшать шрифт до однострочной ширины делало подпись нечитаемо
 * мелкой — вместо этого разрешаем перенос на 2 строки (white-space:
 * normal перебивает общий nowrap ниже своей специфичностью) при чуть
 * более крупном шрифте: .brand — flex-item с flex-shrink:1 по
 * умолчанию, при переносе он просто становится выше, а не толкает
 * соседей на отдельную строку — nav/cta остаются в том же ряду,
 * центрируясь по увеличенной высоте (align-items:center на
 * контейнере). min-width:0 обязателен — иначе flex-item с
 * overflow:visible не сжимается ниже однострочной ширины вообще
 * (текст просто вылезал за .brand, перенос не срабатывал).
 * Селектор — двойной класс (.brand-name.brand-name--full), не просто
 * .brand-name--full: у обоих классов одинаковая специфичность (один
 * класс), и nowrap ниже (.brand-name, от 1181px) при равной
 * специфичности выигрывал по порядку в файле (позже объявлен) —
 * white-space:normal тихо проигрывал, текст рисовался в одну строку
 * поверх меню (getBoundingClientRect() этого не показывает: box
 * остаётся "ужатым" по grid-расчёту, а overflow:visible просто рисует
 * контент шире рамки — баг не ловился скриптовыми проверками, только
 * на скриншоте). Двойной класс поднимает специфичность до (0,2,0),
 * выше (0,1,0) у .brand-name — побеждает всегда, а не по везению
 * порядка объявления. */
.brand-name.brand-name--full {
  font-size: 0.95rem;
  white-space: normal;
  min-width: 0;
}

/* Раньше этот текст был подписью в font-body/500 (см. .brand-name small
   ниже), а без <small> просто наследовал жирный font-display от .brand.
   Возвращаем исходный шрифт подписи, размер уже настроен под этот текст. */
.brand-name--full {
  font-family: var(--font-body);
  font-weight: 500;
}

/* nowrap только там, где рядом есть .sh-nav (виден от 1180px) — иначе
   длинное название переносится криво прямо рядом с меню. Точечное
   исключение — theme-steel.css, хиро на невысоком окне. */
@media (min-width: 1181px) {
  .brand-name {
    white-space: nowrap;
  }

  /* Без этого flex-wrap (базовый, всегда включён — страховка от наезда
     гамбургера на 320px) решает поместится ли .header-cta на первой
     строке ДО того, как .brand успевает сжаться переносом текста на
     2 строки (решение о переносе всей строки принимается по
     "гипотетическому" max-content размеру каждого item, раньше
     flex-shrink) — кнопка стабильно улетала на вторую строку, даже
     разрешив .brand-name перенос (white-space:normal, components.css/
     theme-steel.css). Специфичность высокого хиро-правила
     (theme-steel.css, min-height:900px) выше этого — там намеренный
     перенос на 2 строки (крупное лого) не задет. */
  .site-header .container {
    flex-wrap: nowrap;
  }
}

.brand-name small {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.8rem;
  transition: font-size 0.3s var(--ease);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.sh-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.sh-nav a {
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
  position: relative;
}

.sh-nav a:hover,
.sh-nav a[aria-current="page"] {
  color: var(--text);
}

.sh-nav .has-dropdown {
  position: relative;
}

.sh-dropdown {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  min-width: 280px;
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.has-dropdown:hover .sh-dropdown,
.has-dropdown:focus-within .sh-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Мост над зазором (top: calc(100% + 16px) у .sh-dropdown) — без него
   :hover на .has-dropdown пропадал в момент, когда курсор покидает саму
   ссылку "Продукция" и идёт по диагонали вниз к панели: .sh-dropdown
   получает visibility:hidden МГНОВЕННО (transition есть только у
   opacity/transform), так что даже наведение на сам .sh-dropdown уже не
   успевает — его самого в этот момент нет в дереве наведения. Мост —
   псевдоэлемент именно у .has-dropdown (а не у .sh-dropdown), которая
   всегда наводима, вне зависимости от видимости панели. Только десктоп —
   на мобильном (max-width:1180px) .sh-dropdown в потоке (position:static,
   раскрывается по тапу), зазора там нет. */
@media (min-width: 1181px) {
  /* Ширина моста = ширина самой ссылки "Продукция" (100% родителя
     .has-dropdown, а не 280px панели .sh-dropdown) — иначе мост шире
     самого пункта меню и наведение под соседними "Завод"/"Клиенты"
     ошибочно раскрывало это подменю. */
  .has-dropdown::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 16px;
  }
}

.sh-dropdown a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
}

.sh-dropdown a:hover {
  background: var(--bg-card-hover);
  color: var(--accent-hover);
}

.header-cta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-cta .btn-label {
  white-space: nowrap;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1180px) {
  .sh-nav {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    padding: calc(var(--header-h, 76px) + 24px) 24px 24px;
    gap: 4px;
    overflow-y: auto;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  }

  .sh-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .sh-nav a {
    width: 100%;
    padding: 14px 4px;
    border-bottom: 1px solid var(--border);
    font-size: 1.05rem;
  }

  .sh-dropdown {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    background: none;
    padding: 0 0 0 12px;
    min-width: 0;
    display: none;
  }

  /* Тап по пункту с подменю фокусит ссылку и включает :focus-within —
     десктопное правило .has-dropdown:focus-within .sh-dropdown
     (специфичность 0,3,0) перебивает "transform: none" выше (0,1,0)
     и возвращает центрирующий translateX(-50%), рассчитанный на
     position:absolute — на мобильном (position:static, блок на всю
     ширину) это уводило подменю на добрую половину экрана влево. */
  .has-dropdown:hover .sh-dropdown,
  .has-dropdown:focus-within .sh-dropdown {
    transform: none;
  }

  .has-dropdown.is-expanded .sh-dropdown {
    display: block;
  }

  .header-cta .btn-label {
    display: none;
  }

  .nav-toggle {
    display: flex;
    flex-shrink: 0;
  }
}

@media (max-width: 560px) {
  .brand-name small {
    display: none;
  }

  .site-header .container {
    gap: 10px;
  }

  .header-cta {
    gap: 8px;
  }

  /* В самой шапке на узких экранах остаются только лого и кнопка меню —
     кнопка с текстом не помещается рядом с лого без переполнения.
     Сам CTA не теряется: продублирован как .nav-mobile-cta в открытом
     мобильном меню (см. ниже). */
  .header-cta .btn-primary {
    display: none;
  }
}

.sh-nav .nav-mobile-cta {
  display: none;
}

@media (max-width: 1180px) {
  .sh-nav .nav-mobile-cta {
    display: flex;
    margin-top: 16px;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
}

.btn-spark {
  background: var(--spark);
  color: #14100b;
}

.btn-spark:hover {
  background: var(--spark-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-light);
  color: var(--text);
}

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

.btn-sm {
  padding: 10px 18px;
  font-size: 0.85rem;
}

/* Кнопки-ссылки с длинным текстом (навигация "пред/след" на страницах
   кейсов и статей) — .btn по умолчанию white-space:nowrap, здесь это
   ломает мобильную раскладку на длинных заголовках. */
.btn-wrap {
  white-space: normal;
  text-align: left;
  max-width: 100%;
}

.btn-block {
  width: 100%;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  /* .hero — тоже <section>, обнуляем общий вертикальный ритм секций
     (base.css: section{padding:clamp(56px,8vw,120px) 0}), иначе он
     негласно добавляет ~230px сверху+снизу поверх padding у .hero-content */
  padding: 0;
  /* Шапка (.site-header) position:fixed и не занимает места в потоке
     (theme-steel.css) — hero просто заполняет экран целиком, шапка
     лежит поверх него прозрачным слоем. */
  min-height: clamp(440px, 100vh, 960px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--bg);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img,
.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media img {
  filter: saturate(0.85) contrast(1.05);
}

/* На видео contrast() усиливает пиксельный шум сжатия ровно на тонких
   антиалиased-границах (провода/решётка опоры на небе) — это читалось
   как дрожание именно там, хотя кадры в файле статичны. На фото такого
   эффекта нет, поэтому фильтр остаётся только для .hero-media img. */
.hero-media video {
  filter: saturate(0.85);
}

/* Опора в исходнике видео стоит примерно по центру кадра (~54% ширины).
   Первая попытка (видео шире контейнера, width:150%) сдвигала опору
   куда нужно, но заодно ощутимо увеличивала её (искусственный зум).
   Вместо зума сужаем "рамку" самого видео до правой части экрана —
   object-fit:cover считает масштаб по высоте рамки (она не меняется),
   поэтому опора остаётся в естественном размере, а не увеличенной;
   меняется только то, какая часть кадра видна и где именно она
   оказывается на экране. Только от 768px — на узких portrait-экранах
   и так сильный обрез по бокам, там video на всю ширину, center. */
@media (min-width: 768px) {
  .hero--video .hero-media video {
    position: absolute;
    top: 0;
    right: 0;
    left: auto;
    width: 55%;
    max-width: none;
    object-position: 58% center;
    /* Левый край рамки видео иначе даёт жёсткую вертикальную полосу
       (за кромкой ровно 0% видео, перед ней несколько % даже сквозь
       почти непрозрачную светлую подложку) — маска гасит сам видеослой
       у края, вместо резкого обреза получается плавное растворение. */
    mask-image: linear-gradient(90deg, transparent 0%, black 14%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 14%);
  }
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 7, 10, 0.35) 0%, rgba(5, 7, 10, 0.55) 45%, rgba(5, 7, 10, 0.96) 100%),
    linear-gradient(90deg, rgba(5, 7, 10, 0.85) 0%, rgba(5, 7, 10, 0.15) 55%);
}

/* Светлый вариант хиро (по фидбоку/референсу) — вместо тёмной подложки
   слева светлая (около --bg), сходящая на нет к ~60% ширины кадра, где
   остаётся видно опору на видео без затемнения. Базовый тёмный
   .hero-media::after (выше) не трогаем — его использует .page-banner
   на остальных страницах сайта, там тёмный оверлей должен остаться. */
.hero--video .hero-media::after {
  background: linear-gradient(90deg, rgba(244, 248, 251, 0.97) 0%, rgba(244, 248, 251, 0.94) 52%, rgba(244, 248, 251, 0) 72%);
}

/* На узком экране (<768px, тот же порог, что у сдвига object-position
   выше) object-fit:cover обрезает кадр по бокам так сильно, что опора
   занимает почти всю видимую ширину — горизонтальному градиенту слева
   направо просто некуда деться, текст справа от ~72% попадает прямо на
   решётку опоры без подложки. Сплошная светлая заливка почти на весь
   кадр держит текст читаемым; видео на мобильном и так декоративное. */
@media (max-width: 767px) {
  .hero--video .hero-media::after {
    background: rgba(244, 248, 251, 0.93);
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  /* Только top/bottom — .hero-content делит класс "container" в разметке,
     и полный shorthand padding здесь затирал бы .container'овские
     left/right:24px целиком (одинаковая специфичность, порядок каскада),
     из-за чего на экранах уже 1240px (там, где max-width уже не создаёт
     центрирующее поле) текст упирался прямо в край экрана */
  padding-top: 120px;
  padding-bottom: 72px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.hero-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* Текст лежит на светлой части хиро (слева), .hero-stats — правее,
   поверх видео (см. .hero--video .hero-media::after выше) — на узких
   экранах видео там уже не видно за счёт object-fit:cover, поэтому
   стек стата под текстом не портит контраст. */
@media (max-width: 900px) {
  .hero-content {
    flex-direction: column;
    align-items: stretch;
  }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--spark-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--spark);
}

.hero h1 {
  max-width: 620px;
  font-size: clamp(2.1rem, 3.8vw, 3.4rem);
  margin-bottom: 20px;
}

/* Второй смысловой блок заголовка ("для быстровозводимых зданий") —
   тот же размер/начертание (шрифт загружен только в Regular, жирности
   нет), приглушённый цвет вместо основного — по референсу мокапа. */
.hero-title-muted {
  color: var(--text-faint);
}

.hero-lead {
  max-width: 560px;
  font-size: 1.15rem;
  color: #d6dbe3;
}

/* .hero-lead делит имя класса с page-banner на остальных страницах
   (klienty/kontakty/raschet/sertifikaty/o-zavode) — те остаются тёмными,
   светлый #d6dbe3 там всё ещё нужен. Тёмный текст — только у видео-хиро
   на главной, где фон теперь светлый. */
.hero--video .hero-lead {
  color: var(--text-muted);
}

/* ---------- Hero stats (иконка + факт, поверх видео справа) ---------- */
.hero-stats {
  display: flex;
  flex-direction: column;
  gap: 22px;
  flex: 0 0 auto;
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 240px;
}

/* Подложка на весь пункт (не только иконку) — теперь опора на видео
   стоит близко к правому краю и крупная, текст без фона на решётке
   опоры/проводах читался плохо. */
.hero-stats li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(244, 248, 251, 0.88);
  border-radius: var(--radius-md);
  padding: 6px 14px 6px 6px;
}

.hero-stats-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--spark-text);
}

@media (max-width: 900px) {
  .hero-stats {
    flex-direction: row;
    flex-wrap: wrap;
    max-width: 100%;
    margin-top: 32px;
    gap: 16px 28px;
  }
}

.btn-play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid currentColor;
  margin-left: 2px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 36px;
}

.trust-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-raise);
}

.trust-strip ul {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  padding: 22px 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.trust-strip a {
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}

.trust-strip a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.trust-strip li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trust-strip strong {
  color: var(--text);
}

.trust-strip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--spark);
  flex-shrink: 0;
}

/* ---------- Cards: USP ---------- */
.usp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.usp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.usp-card:hover {
  border-color: var(--border-light);
  transform: translateY(-4px);
}

.usp-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.usp-card h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.usp-card p {
  font-size: 0.92rem;
  margin: 0;
}

@media (max-width: 960px) {
  .usp-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .usp-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Product category cards ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.product-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  display: block;
}

.product-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

/* Категории без готового фото — временная заглушка (позже фото заказчика
   заменит её целиком, поэтому не вкладываемся в кастомную иллюстрацию
   здесь — только лёгкий чертёжный паттерн вместо абстрактных полос). */
.product-card-blueprint {
  background-color: #14171c;
  background-image: url("/assets/img/blueprints/grid-pattern.svg");
  background-repeat: repeat;
}

.product-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 14, 18, 0) 35%, rgba(11, 14, 18, 0.95) 100%);
  transition: background 0.3s var(--ease);
}

.product-card:hover img {
  transform: scale(1.06);
}

.product-card:hover::after {
  background: linear-gradient(180deg, rgba(11, 14, 18, 0.1) 20%, rgba(11, 14, 18, 0.97) 100%),
    linear-gradient(0deg, var(--spark-soft) 0%, transparent 40%);
}

.product-card-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px;
  z-index: 1;
}

.product-card-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--spark-text);
  margin-bottom: 8px;
}

.product-card h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.product-card-arrow {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
  z-index: 1;
}

.product-card:hover .product-card-arrow {
  background: var(--spark);
  border-color: var(--spark);
}

@media (max-width: 960px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Counters ---------- */
.counters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: left;
}

.counter-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.counter-value .unit {
  font-size: 1.4rem;
  color: var(--spark-text);
}

.counter-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

@media (max-width: 780px) {
  .counters {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 20px;
  }
}

/* ---------- Certification badges ---------- */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cert-card.is-confirmed {
  border-color: rgba(46, 204, 113, 0.35);
}

.cert-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 100px;
}

.cert-status.confirmed {
  background: rgba(46, 204, 113, 0.14);
  color: var(--success);
}

.cert-status.pending {
  background: rgba(139, 149, 165, 0.14);
  color: var(--text-muted);
}

.cert-card h3 {
  font-size: 1.05rem;
  margin: 0;
}

.cert-card .cert-meta {
  font-size: 0.85rem;
  color: var(--text-faint);
}

.cert-thumb {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

@media (max-width: 860px) {
  .cert-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .cert-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Case / project cards ---------- */
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.case-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

/*
 * Подъём при наведении — только у интерактивных карточек (ссылка на
 * cases-list/*.html или <details>-аккордеон на /proekty/). Простые
 * <div class="case-card"> (блоки "Реализованные проекты" на страницах
 * продукции и на главной, без клика) hover не получают — иначе
 * выглядит кликабельно, а на самом деле никуда не ведёт.
 */
a.case-card:hover,
details.case-card:hover {
  border-color: var(--border-light);
  transform: translateY(-4px);
}

.case-card-media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #141920, #1c232d);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
}

.case-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-card-body {
  padding: 20px 22px 24px;
}

.case-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-hover);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  margin-top: 10px;
}

/*
 * proekty/index.html — карточки объектов теперь <details> (не ссылка на
 * отдельную страницу): клиент не даёт достаточно контента на 76 разных
 * страниц, поэтому "Подробнее" разворачивает общее описание прямо в
 * карточке. summary снимает дефолтный маркер браузера. Шеврон — отдельный
 * ::after, поворачиваем только его (не весь текст "Подробнее" — иначе
 * при rotate(180deg) текст читался бы вверх ногами).
 */
.case-card summary {
  cursor: pointer;
  list-style: none;
}

.case-card summary::-webkit-details-marker {
  display: none;
}

.case-arrow::after {
  content: "⌄";
  display: inline-block;
  transition: transform 0.2s var(--ease);
}

.case-card[open] .case-arrow::after {
  transform: rotate(180deg);
}

.case-card-desc {
  padding: 0 22px 22px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.case-card-desc p {
  margin: 0;
}

.case-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 8px;
  display: block;
}

@media (max-width: 960px) {
  .case-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .case-grid {
    grid-template-columns: 1fr;
  }
}

/*
 * /proekty/index.html (76 объектов) — отдельные классы, не .case-grid/
 * .case-card: там их используют ещё и превью на главной, и мини-секции
 * "Реализованные проекты" на страницах продукции (по 3 штуки, сеткой
 * карточек — это уместно). На 76 штук клиент фото не даёт (и вряд ли
 * даст на все сразу) — вместо сетки карточек с пустым фото-плейсхолдером
 * под каждой (.case-card-media) список строк-полосок: тег, заголовок,
 * "Подробнее" в одну линию, разворачивается по клику (details/summary,
 * как и раньше). data-reveal — тот же общий scroll-reveal (theme-steel.css
 * + initRevealOnScroll в main.js), никакого нового JS не потребовалось.
 */
.case-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.case-row {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.case-row:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.case-row summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
}

.case-row summary::-webkit-details-marker {
  display: none;
}

.case-row-tag {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-hover);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 100px;
  white-space: nowrap;
}

.case-row-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.case-row .case-arrow {
  flex-shrink: 0;
  margin-top: 0;
}

.case-row .case-card-desc {
  padding: 0 20px 18px 20px;
}

@media (max-width: 620px) {
  .case-row summary {
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 14px 16px;
  }

  .case-row-title {
    order: 3;
    flex: 1 1 100%;
  }

  .case-row .case-card-desc {
    padding: 0 16px 16px 16px;
  }
}

/* ---------- Article cards ---------- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.article-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
}

.article-card-media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #141920, #1c232d);
}

.article-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card-body {
  padding: 20px 22px 24px;
}

.article-card-date {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: 8px;
  display: block;
}

@media (max-width: 960px) {
  .article-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .article-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Client badges ----------
   Часть клиентов — текстовые плашки (нет официального логотипа под
   рукой, см. placeholders.json), часть — реальные логотипы
   (.client-badge--logo), найденные в открытых источниках (Wikimedia
   Commons/Wikipedia). */
.client-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.client-badge {
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 10px 18px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-card);
}

.client-badge--logo {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-md);
  padding: 10px 20px;
}

.client-badge--logo img {
  display: block;
  height: 28px;
  width: auto;
}

/* ---------- Geo map (#geografiya) ---------- */
.geo-map {
  position: relative;
  /* Карта Европейской части РФ вытянута по вертикали (виден весь
     контекст, не только юг) — на всю ширину .container (900px) секция
     становилась выше экрана. 560px держит высоту в разумных пределах. */
  max-width: 560px;
  margin: 0 auto;
}

.geo-map-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.geo-region {
  cursor: pointer;
}

/*
 * Реальные контуры регионов (Natural Earth / click_that_hood, см.
 * README-стиль комментарий в assets/img/map/russia-regions.svg) —
 * viewBox в градусах-с-масштабом, поэтому stroke-width на порядок
 * меньше, чем был бы у декоративной SVG-иконки.
 */
.geo-region path {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 0.5;
  transition: fill 0.18s ease, stroke 0.18s ease;
}

.geo-region:hover path,
.geo-region:focus path,
.geo-region.is-active path {
  fill: var(--accent);
  stroke: var(--accent-hover);
}

/*
 * Соседние регионы без поставок — просто контекст (карта Европейской
 * части РФ должна читаться как узнаваемая страна, а не 9 фигур в
 * пустоте), но тоже интерактивны: подсветка границы + тултип с одним
 * названием (js/main.js), без синей заливки — чтобы не путали с
 * "здесь работаем". --border/--border-light тут слишком бледные
 * (сливаются с фоном страницы) — берём --text-faint/--text-muted.
 */
.geo-region-context path {
  fill: var(--bg-card);
  stroke: var(--text-faint);
}

.geo-region-context:hover path,
.geo-region-context:focus path,
.geo-region-context.is-active path {
  fill: var(--bg-card-hover);
  stroke: var(--text-muted);
  stroke-width: 1;
}

/* Невидимая увеличенная hit-зона у мелких регионов (Севастополь,
   Ингушетия и т.п.) — реальный контур на карте такого масштаба может
   быть меньше 9px, наводиться/тапать по нему напрямую нереально. */
.geo-hit {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}

.geo-region:focus {
  outline: none;
}

.geo-region:focus-visible path {
  stroke: var(--spark);
  stroke-width: 0.9;
}

.geo-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.geo-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.geo-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.geo-legend-dot--objects {
  background: var(--accent);
}

.geo-legend-item--export {
  color: var(--text-faint);
}

.geo-tooltip {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, calc(-100% - 14px));
  min-width: 220px;
  max-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  padding: 14px 16px;
  pointer-events: none;
}

.geo-tooltip strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.geo-tooltip ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.geo-tooltip li {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.geo-tooltip-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.geo-tooltip-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
}

@media (max-width: 620px) {
  .geo-tooltip {
    min-width: 180px;
    max-width: 220px;
    font-size: 0.9em;
  }
}

/* ---------- Tables ---------- */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.spec-table th,
.spec-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.spec-table th {
  color: var(--text-faint);
  font-weight: 600;
  font-family: var(--font-display);
  width: 42%;
}

.spec-table td {
  font-variant-numeric: tabular-nums;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.table-scroll .spec-table {
  min-width: 480px;
}

.table-scroll .spec-table th,
.table-scroll .spec-table td {
  border-bottom: 1px solid var(--border);
}

.table-scroll tr:last-child th,
.table-scroll tr:last-child td {
  border-bottom: none;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-bottom: 18px;
}

.breadcrumbs a:hover {
  color: var(--text-muted);
}

.breadcrumbs .sep {
  color: var(--border-light);
}

/* ---------- Page banner (non full-bleed) ---------- */
.page-banner {
  position: relative;
  min-height: 46vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.page-banner .hero-media {
  position: absolute;
}

.page-banner-content {
  position: relative;
  z-index: 1;
  /* Только top/bottom — та же причина, что у .hero-content выше:
     не затирать .container'овские left/right:24px */
  padding-top: 64px;
  padding-bottom: 48px;
  width: 100%;
}

/* ---------- Forms ---------- */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.form-row {
  margin-bottom: 18px;
}

.form-row label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-row input[type="text"],
.form-row input[type="tel"],
.form-row input[type="email"],
.form-row select,
.form-row textarea {
  width: 100%;
  background: var(--bg-raise);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s var(--ease);
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--accent);
}

.form-row textarea {
  min-height: 110px;
  resize: vertical;
}

.form-row.has-error input[type="text"],
.form-row.has-error input[type="tel"],
.form-row.has-error input[type="email"],
.form-row.has-error select,
.form-row.has-error textarea {
  border-color: var(--error);
  background: color-mix(in srgb, var(--error) 6%, var(--bg-raise));
}

.form-row.has-error label {
  color: var(--error);
}

.form-consent.has-error {
  color: var(--error);
}

.form-consent.has-error input {
  outline: 2px solid var(--error);
  outline-offset: 2px;
}

.field-error {
  display: block;
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 4px;
}
.field-error:empty {
  display: none;
}

.form-file {
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}

.form-file {
  display: block;
  position: relative;
  overflow-wrap: anywhere;
}

/* Сам input скрыт визуально, но остаётся фокусируемым с клавиатуры
   (display:none выкидывал его из tab-порядка) */
.form-file input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.form-file:hover,
.form-file.is-dragover {
  border-color: var(--accent);
}

.form-file.is-dragover {
  border-style: solid;
}

.form-file:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.form-file.has-file {
  border-style: solid;
  border-color: var(--accent);
  color: var(--text);
}

.form-row.has-error .form-file {
  border-color: var(--error);
}

.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-bottom: 20px;
}

.form-consent input {
  margin-top: 3px;
}

.form-consent a {
  color: var(--text-muted);
  text-decoration: underline;
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  font-size: 0.85rem;
  margin-top: 14px;
  display: none;
}

.form-status.is-success {
  color: var(--success);
  display: block;
}

.form-status.is-error {
  color: var(--error);
  display: block;
}

.form-status.is-pending {
  color: var(--text-faint);
  display: block;
}

/* ---------- FAQ ---------- */
.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  cursor: pointer;
  padding: 20px 0;
  font-family: var(--font-display);
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--spark-text);
  font-size: 1.4rem;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  padding-bottom: 20px;
  margin: 0;
}

/* ---------- Timeline (production cycle) ---------- */
.timeline {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  counter-reset: step;
}

.timeline-step {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  background: var(--bg-card);
  position: relative;
}

.timeline-step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--spark-text);
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.timeline-step h3 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.timeline-step p {
  font-size: 0.82rem;
  margin: 0;
}

@media (max-width: 1080px) {
  .timeline {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 620px) {
  .timeline {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- CTA band ---------- */
.cta-band {
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--bg-card), var(--bg-raise));
  border: 1px solid var(--border);
  /* .cta-band делит класс "container" в разметке — её padding: 48px
     (карточке нужен отступ на всех сторонах) затирал .container'овские
     left/right:24px целиком (та же причина, что у hero-content/
     page-banner-content выше), поэтому ниже задаём padding отдельно
     (см. media query) и НЕ полагаемся на .container'овский padding
     для внешнего отступа от края экрана — вместо этого сама карточка
     сужена на 48px и центрируется через margin:auto, повторяя внешний
     зазор 24px, который .container даёт остальному контенту страницы.
     max-width:1240px (унаследован от .container) продолжает работать
     как и раньше — на широких экранах ничего не меняется. */
  width: calc(100% - 48px);
  margin-left: auto;
  margin-right: auto;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.cta-band h2 {
  margin-bottom: 8px;
}

.cta-band p {
  margin: 0;
  max-width: 440px;
}

.cta-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

@media (min-width: 640px) {
  .cta-band {
    padding: 48px;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-raise);
  border-top: 1px solid var(--border);
  padding: 64px 0 28px;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.footer-brand .brand {
  margin-bottom: 14px;
}

.footer-brand p {
  font-size: 0.88rem;
  max-width: 320px;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 16px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: var(--text-muted);
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  color: var(--text-faint);
  font-size: 0.82rem;
}

.footer-bottom a {
  color: var(--text-faint);
  text-decoration: underline;
}

.footer-bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* Подпись студии — акцентным (--spark), не приглушённым цветом
   остального футера, чтобы не терялась среди служебных ссылок.
   Цвет здесь — базовый (на случай темы без .theme-steel); реальный
   сайт использует body.theme-steel, там своё более специфичное
   правило .footer-bottom a переопределяет цвет обратно — фактический
   акцентный цвет на проде задаётся в theme-steel.css отдельным
   правилом той же специфичности, см. комментарий там. */
.footer-bottom a.sitomika-link {
  color: var(--spark-text);
  font-weight: 600;
}

.footer-bottom a.sitomika-link:hover {
  color: var(--spark-hover);
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Cookie banner ---------- */
/* Компактная плашка в углу, а не на всю ширину — раньше перекрывала
   основной CTA хиро на 1366x768 и мобильных при первом визите. */
.cookie-banner {
  position: fixed;
  left: auto;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  max-width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 14px 16px;
  transform: translateY(calc(100% + 32px));
  transition: transform 0.3s var(--ease);
}

.cookie-banner.is-visible {
  transform: translateY(0);
}

.cookie-banner .container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 0;
}

.cookie-banner p {
  margin: 0;
  font-size: 0.8rem;
}

.cookie-banner a {
  color: var(--text);
  text-decoration: underline;
}

/* ---------- Utility grids ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: start;
}

.two-col > * {
  /* Без этого 1fr-колонка растягивается по min-content вложенных
     .table-scroll (там min-width:480px у таблицы) и ломает раскладку
     на мобильных — известная особенность grid-треков. */
  min-width: 0;
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}

.tag-filter a {
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tag-filter a[aria-current="true"],
.tag-filter a:hover {
  border-color: var(--accent);
  color: var(--text);
}

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

.gallery-grid img {
  border-radius: var(--radius-md);
  aspect-ratio: 4/3;
  object-fit: cover;
  border: 1px solid var(--border);
}

.gallery-item {
  display: block;
  position: relative;
  cursor: zoom-in;
}

.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background: rgba(11, 14, 18, 0.25);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.gallery-item:hover::after,
.gallery-item:focus-visible::after {
  opacity: 1;
}

@media (max-width: 720px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Lightbox (галерея "Завод изнутри" и подобные) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 11, 0.94);
  padding: 24px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-img {
  max-width: min(88vw, 1280px);
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-close {
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 14px;
  border-radius: 100px;
}

@media (max-width: 640px) {
  .lightbox {
    padding: 12px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
  }

  .lightbox-prev {
    left: 6px;
  }

  .lightbox-next {
    right: 6px;
  }
}

body.lightbox-open {
  overflow: hidden;
}
