/* ===========================================================
   ПМК «Крепкий Остров» — Colors & Type
   ===========================================================
   Подключение: <link rel="stylesheet" href="/colors_and_type.css">
   Шрифт: Manrope (Google Fonts substitution для GrtskPeta — см. README)
   =========================================================== */

@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap");

:root {
  /* ---------- COLOR — BRAND ---------- */
  --navy-900: lab(16.25 10.8 -41.8);           /* основной navy для H2 / тёмных секций */
  --navy-800: lab(16.25 10.8 -41.8);           /* body на светлом (семантич. дубль) */
  --navy-700: #002C6E;
  --navy-600: #0041A0;                          /* secondary CTA, акцент */
  --navy-500: #1E5DC2;
  --navy-100: #E6EEFA;                          /* очень светлый navy для фонов-акцентов */

  --brand-red: #C8102E;                         /* индустриальный красный — primary CTA. Не #FF0000 (Bootstrap-красный, читается как авария/распродажа) */
  --brand-red-hover: #A50D26;
  --brand-red-active: #8A0B20;

  /* ---------- COLOR — NEUTRAL ---------- */
  --white: #FFFFFF;
  --grey-50: #F5F6F7;                           /* чередующаяся секция */
  --grey-100: #EFF1F3;
  --grey-200: #E5E7EB;                          /* hair-border */
  --grey-300: #D1D5DB;                          /* strong border */
  --grey-500: #5C6470;                          /* secondary text — AA contrast (≥4.5:1 on #FFF and #F5F6F7) */
  --grey-700: #374151;
  --grey-900: #111827;

  /* ---------- COLOR — SEMANTIC (backgrounds) ---------- */
  --bg-white:   var(--white);
  --bg-grey:    var(--grey-50);
  --bg-navy:    var(--navy-900);

  /* ---------- COLOR — SEMANTIC (foreground) ---------- */
  --fg-1:             var(--navy-900);          /* заголовки на светлом */
  --fg-1-on-dark:     var(--white);             /* заголовки на navy */
  --fg-body:          #1B1F2B;                  /* основной текст на светлом */
  --fg-body-on-dark:  rgba(255,255,255,0.88);   /* текст на navy */
  --fg-muted:         var(--grey-500);          /* secondary на светлом */
  --fg-muted-on-dark: rgba(255,255,255,0.64);   /* secondary на navy */
  --fg-link:          var(--navy-600);

  /* ---------- BORDERS ---------- */
  --border-hair:    1px solid var(--grey-200);
  --border-strong:  1px solid var(--grey-300);
  --border-navy:    1px solid rgba(255,255,255,0.14);

  /* ---------- RADII ---------- */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 999px;

  /* ---------- SHADOWS ---------- */
  --shadow-card:  0 1px 3px rgba(0, 44, 110, 0.08);
  --shadow-hover: 0 12px 32px rgba(0, 44, 110, 0.16);
  --shadow-menu:  0 12px 32px rgba(10,20,40,0.10);

  /* ---------- SPACING ---------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-30: 120px;

  /* ---------- CONTAINER ---------- */
  --container-max: 1440px;
  --container-px-desktop: 40px;
  --container-px-tablet:  24px;
  --container-px-mobile:  16px;

  /* ---------- TYPOGRAPHY ---------- */
  --font-sans: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", monospace;

  /* H1 hero (desktop by default; медиа снижают) */
  --h1-size: 88px;
  --h1-weight: 500;
  --h1-lh: 1.1;
  --h1-ls: -0.02em;

  /* H2 */
  --h2-size: 40px;
  --h2-weight: 500;
  --h2-lh: 46px;
  --h2-ls: -0.01em;

  /* H3 */
  --h3-size: 28px;
  --h3-weight: 500;
  --h3-lh: 1.25;
  --h3-ls: 0;

  /* H4 */
  --h4-size: 20px;
  --h4-weight: 500;
  --h4-lh: 1.3;
  --h4-ls: 0;

  /* Body */
  --body-l-size: 18px;
  --body-l-lh: 1.5;
  --body-m-size: 16px;
  --body-m-lh: 1.5;
  --body-s-size: 14px;
  --body-s-lh: 1.4;

  /* Caption / menu */
  --caption-size: 14px;
  --caption-weight: 500;

  /* Eyebrow — uppercase надпись над H2 */
  --eyebrow-size: 13px;
  --eyebrow-weight: 500;
  --eyebrow-tracking: 0.08em;

  /* CTA */
  --cta-size: 16px;
  --cta-size-lg: 18px;
  --cta-weight: 500;
  --cta-pad-y: 8px;
  --cta-pad-x: 22px;
  --cta-h-hero: 64px;
}

/* ===========================================================
   RESET + BASE
   =========================================================== */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--body-m-size);
  line-height: var(--body-m-lh);
  color: var(--fg-body);
  background: var(--bg-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Защита от случайного горизонтального overflow на мобиле. Используем
     overflow-x: clip (а не hidden!) — он визуально обрезает overflow, но
     НЕ создаёт scroll-контейнер на body. Это важно: hidden ломает CSS
     position:sticky внутри (ProcessJourney и любые другие sticky ancestors). */
  overflow-x: clip;
}

/* Длинные русские слова в заголовках должны переноситься, а не уезжать
   за край экрана. Особенно критично для «Металлоконструкции» в Hero на
   iPhone SE (375px). */
h1, h2, h3 {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

h1, h2, h3, h4, h5, h6, p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ===========================================================
   SEMANTIC TYPE
   =========================================================== */

.h1, h1 {
  font: var(--h1-weight) var(--h1-size) / var(--h1-lh) var(--font-sans);
  letter-spacing: var(--h1-ls);
  color: var(--fg-1);
}
@media (max-width: 1024px) { .h1, h1 { font-size: 74px; } }
@media (max-width: 640px)  { .h1, h1 { font-size: 62px; } }

.h2, h2 {
  font: var(--h2-weight) var(--h2-size) / var(--h2-lh) var(--font-sans);
  letter-spacing: var(--h2-ls);
  color: var(--fg-1);
}
@media (max-width: 640px) { .h2, h2 { font-size: 30px; line-height: 36px; } }

.h3, h3 {
  font: var(--h3-weight) var(--h3-size) / var(--h3-lh) var(--font-sans);
  color: var(--fg-1);
}
.h4, h4 {
  font: var(--h4-weight) var(--h4-size) / var(--h4-lh) var(--font-sans);
  color: var(--fg-1);
}

.body-l { font-size: var(--body-l-size); line-height: var(--body-l-lh); }
.body-m { font-size: var(--body-m-size); line-height: var(--body-m-lh); }
.body-s { font-size: var(--body-s-size); line-height: var(--body-s-lh); }

.caption {
  font-size: var(--caption-size);
  font-weight: var(--caption-weight);
  line-height: 1.4;
}

.eyebrow {
  font-size: var(--eyebrow-size);
  font-weight: var(--eyebrow-weight);
  letter-spacing: var(--eyebrow-tracking);
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* Inverted (на navy-фоне) */
.on-dark .h1, .on-dark h1,
.on-dark .h2, .on-dark h2,
.on-dark .h3, .on-dark h3,
.on-dark .h4, .on-dark h4 { color: var(--fg-1-on-dark); }
.on-dark { color: var(--fg-body-on-dark); }
.on-dark .fg-muted,
.on-dark .eyebrow { color: var(--fg-muted-on-dark); }

/* ===========================================================
   CTA BUTTONS
   =========================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--cta-size);
  font-weight: var(--cta-weight);
  line-height: 1;
  padding: var(--cta-pad-y) var(--cta-pad-x);
  min-height: 40px;
  border-radius: var(--r-pill);
  transition:
    background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
    color 150ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  text-decoration: none;
}

.btn--primary {
  background: var(--brand-red);
  color: var(--white);
}
.btn--primary:hover  { background: var(--brand-red-hover); transform: translateY(-1px); }
.btn--primary:active { background: var(--brand-red-active); transform: translateY(0); }

.btn--secondary {
  background: var(--navy-600);
  color: var(--white);
}
.btn--secondary:hover  { background: var(--navy-700); }
.btn--secondary:active { background: #002860; }

.btn--ghost {
  background: transparent;
  color: var(--fg-1);
  border: var(--border-strong);
  padding: calc(var(--cta-pad-y) - 1px) calc(var(--cta-pad-x) - 1px);
}
.btn--ghost:hover { background: var(--navy-100); }

.btn--on-dark-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.3);
}
.btn--on-dark-ghost:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.5); }

.btn--hero {
  min-height: var(--cta-h-hero);
  padding: 0 32px;
  font-size: var(--cta-size-lg);
}

/* ===========================================================
   LAYOUT — CONTAINER / SECTION
   =========================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--container-px-desktop);
}
@media (max-width: 1024px) { .container { padding-inline: var(--container-px-tablet); } }
@media (max-width: 640px)  { .container { padding-inline: var(--container-px-mobile); } }

.section      { padding-block: var(--space-24); background: var(--bg-white); }
.section--alt { padding-block: var(--space-24); background: var(--bg-grey); }
.section--dark{ padding-block: var(--space-24); background: var(--bg-navy); color: var(--fg-body-on-dark); }

@media (max-width: 1024px) {
  .section, .section--alt, .section--dark { padding-block: var(--space-16); }
}

/* ===========================================================
   CARDS
   =========================================================== */

.card {
  background: var(--white);
  border: var(--border-hair);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: transparent; }
.card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--grey-100); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 320ms cubic-bezier(0.4,0,0.2,1); }
.card:hover .card__media img { transform: scale(1.03); }
.card__body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card__title { font-size: 20px; font-weight: 500; color: var(--fg-1); line-height: 1.25; }
.card__desc { font-size: 14px; color: var(--fg-muted); line-height: 1.5; }
.card__arrow {
  margin-top: auto;
  align-self: flex-end;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  color: var(--fg-1);
  transition: transform 180ms;
}
.card:hover .card__arrow { transform: translateX(4px); }

/* ===========================================================
   TILE (направления — тёмное фото + белый текст)
   =========================================================== */

.tile {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  color: var(--white);
  display: block;
  isolation: isolate;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-card);
}
.tile__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 400ms cubic-bezier(0.4,0,0.2,1); }
.tile::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,18,35,0) 40%, rgba(11,18,35,0.78) 100%);
}
.tile__content {
  position: absolute; inset: 0;
  padding: 20px;
  display: flex; flex-direction: column; justify-content: flex-end;
  z-index: 1;
}
.tile__title { font-size: 18px; font-weight: 500; line-height: 1.25; }
.tile__arrow { position: absolute; right: 20px; bottom: 20px; z-index: 1; transition: transform 180ms; }
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.tile:hover .tile__img   { transform: scale(1.04); }
.tile:hover .tile__arrow { transform: translateX(4px); }

/* ===========================================================
   FORM FIELDS
   =========================================================== */

.field {
  display: flex; flex-direction: column; gap: 6px;
}
.field__label { font-size: 13px; font-weight: 500; color: var(--fg-muted); }
.field__input {
  font-family: var(--font-sans);
  font-size: 16px;
  padding: 14px 16px;
  border: var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--fg-body);
  transition: border-color 150ms;
}
.field__input:focus { outline: none; border-color: var(--navy-600); border-width: 2px; padding: 13px 15px; }
.field__input:focus-visible { outline: 3px solid var(--navy-600); outline-offset: 1px; }
.field__input::placeholder { color: #9CA3AF; }

/* ===========================================================
   UTILITIES
   =========================================================== */
.fg-muted { color: var(--fg-muted); }
.text-red { color: var(--brand-red); }

.text-link {
  position: relative;
  color: var(--navy-600);
  text-decoration: none;
  transition: color 200ms cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}
.text-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background-color: currentColor;
  transition: height 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.text-link:hover {
  color: var(--navy-700);
}
.text-link:hover::after {
  height: 2px;
}

.footer-icon-link {
  color: var(--grey-500);
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
}
.footer-icon-link:hover {
  color: var(--navy-600);
  transform: scale(1.1);
}

/* ===========================================================
   ANIMATIONS BOOT
   =========================================================== */
[data-animate="fade-up"] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--stagger-index, 0) * 100ms);
}
[data-animate="fade-up"].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================================================
   SCROLL — anchor offset for sticky nav
   =========================================================== */
html { scroll-behavior: smooth; scroll-padding-top: 70px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===========================================================
   HEADER SPACER — высота меняется через class, не inline-style.
   На десктопе 200px (главная) / 180px (под-страницы), на мобиле 60px.
   data-visible="0" — шапка скрыта при scroll, спейсер схлопывается.
   =========================================================== */
.header-spacer {
  height: 200px;
  flex-shrink: 0;
}
.header-spacer--inner { height: 180px; }
/* НЕ схлопываем спейсер при скрытии шапки — иначе scroll-up даёт прыжок контента
   на 200px (header возвращается через transform поверх spacer-а). */
@media (max-width: 1023px) {
  /* На iPad portrait (820px) — mobile-header 60px + видимый TopBar 38px = 98px;
     на phone (≤768) TopBar скрыт, остаётся только mobile-header 60px. */
  .header-spacer,
  .header-spacer--inner { height: 98px; }
}
@media (max-width: 768px) {
  .header-spacer,
  .header-spacer--inner { height: 60px; }
}

/* TopBar — на десктопе и iPad portrait visible с email/phone/часы/соцсети.
   На phone (≤768) скрыт — слишком тесно для 4-х групп. */
@media (max-width: 1023px) {
  /* Уплотняем gap на iPad portrait чтобы все элементы помещались */
  .topbar__inner { gap: 16px !important; height: 38px; }
}
@media (max-width: 768px) {
  .topbar { display: none; }
}

/* ===========================================================
   TABLET PORTRAIT (769–1023px) — iPad Air 5 portrait и т.п.
   Mobile-style header уже включился, но layout-секции ещё
   страдают от desktop-ширины. Точечные правки только для них.
   =========================================================== */
/* Превращаем <br> внутри hero h1 в обычный пробел на tablet/mobile —
   на десктопе они создают красивые ритмические разрывы строк, на узком
   viewport — лишние разрывы посреди слова. Простой display:none склеивал
   соседние слова ("Металло-конструкциина Сахалине"); ::before с whitespace
   восстанавливает пробел между ними. */
@media (max-width: 1023px) {
  .page-hero h1 br,
  .hero-h1 br,
  .ce-hero__title br,
  .be-hero__title br {
    display: inline;
    font-size: 0;
    line-height: 0;
  }
  .page-hero h1 br::before,
  .hero-h1 br::before,
  .ce-hero__title br::before,
  .be-hero__title br::before {
    content: ' ';
    font-size: 1rem;
  }
}

@media (min-width: 769px) and (max-width: 1023px) {
  /* PageHero stat-card на узком viewport — складывается под H1 (full width)
     вместо `1.4fr 1fr` (там карточка лезет за viewport). H1 ~52-58px стек. */
  .page-hero .container[style*="grid-template-columns: 1.4fr"],
  .page-hero .container[style*="grid-template-columns: 1.4fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  /* Hero h1 на под-страницах (PageHero) уменьшаем с 68 до 52 */
  .page-hero__h1 { font-size: 52px !important; line-height: 1.08 !important; }

  /* Footer верхний ряд — 5 col → 2 col */
  footer .container > div[style*="grid-template-columns: 1.2fr"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 32px !important;
  }
  /* Footer нижний ряд (контакты) — 4 col → 2 col */
  footer .container > div[style*="grid-template-columns: 1fr 1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 28px !important;
  }
  /* Мелкие шрифты в footer'е чтобы названия услуг не переносились на 3 строки */
  footer h3 { font-size: 13px !important; }
  footer a { font-size: 13px !important; }
  /* IconStrip — числа без неразрывного pre-text; "от 30-45" не должно
     разрезаться на 3 строки */
  .icon-strip > .container > div span[style*="font-size: 44px"],
  .icon-strip > .container > div span[style*="font-size: 32px"] {
    font-size: 32px !important;
    white-space: nowrap;
  }
  /* Универсальный fallback для прочих 2-колоночных секций которые ещё на
     inline-grid (CMIInvestor, MapSection, PriceAdvantage и т.п.) — на
     tablet portrait сворачиваются в 1 колонку */
  section .container[style*="grid-template-columns: 1fr 1fr"]:not(.split-2col),
  section .container > div[style*="grid-template-columns: 1fr 1fr"]:not(.split-2col) {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
}

/* ===========================================================
   RESPONSIVE — мобильная адаптивность
   =========================================================== */

/* Планшет ≤1024px */
@media (max-width: 1024px) {
  /* Hero — двухколоночная сетка → одна колонка */
  .hero-content {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
    padding-block: 32px 56px !important;
  }
  /* Hero h1 уменьшаем (74→52) */
  .hero-content h1 { font-size: 52px !important; }
  /* Hero stat-card — занимает всю ширину */
  .hero-content > div:last-child { max-width: 100%; }
}

/* Мобильный ≤768px */
@media (max-width: 768px) {
  /* Hero h1 ещё меньше (52→40) */
  .hero-content h1 { font-size: 40px !important; line-height: 1.12 !important; }
  .hero-content .eyebrow { font-size: 12px; }
  .hero-content > div:first-child p { font-size: 17px !important; }

  /* Все многоколоночные сетки .container и его потомков — в одну колонку.
     ВАЖНО: атрибут style в HTML рендерится с kebab-case (grid-template-columns),
     а не camelCase (gridTemplateColumns). Раньше селектор был с camelCase
     и не работал; плюс ограничен прямыми потомками — не цеплял внутренние
     сетки в TenderDocs/FAQ. И не цеплял .container с гридом внутри
     (CMIInvestor, CTABanner). Теперь два селектора: сам .container и потомки. */
  .container[style*="grid-template-columns"],
  .container [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* H2 на мобильном */
  h2 { font-size: 28px !important; line-height: 1.2 !important; }

  /* Контент-колонка под-страниц */
  .container > div[style*="grid-template-columns: 1.4fr"],
  .container > div[style*="grid-template-columns: 1fr 1.3fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Footer — 5 колонок → 2 */
  footer .container > div[style*="grid-template-columns: 1.2fr"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 32px !important;
  }
  footer .container > div[style*="grid-template-columns: 1fr 1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 28px !important;
  }

  /* Шапка на мобиле теперь рендерится через MobileNav.jsx (компакт-ряд 60px
     + off-canvas drawer). Десктопный блок шапки скрыт через .header-desktop
     {display:none}. Спейсер управляется через .header-spacer выше. */

  /* Sections отступы */
  .section, .section--alt, .section--dark { padding-block: 56px !important; }

  /* Калькулятор — две колонки → одна */
  .container > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Видео в VideoShowcase — 3 колонки → 1 */
  section[id="videos"] .container > div > div[style*="repeat(3"] {
    grid-template-columns: 1fr !important;
  }

  /* Projects 4-карточный карусель. Карточки в JSX — <a>, не <div>,
     поэтому НЕ ограничиваем тип тега в селекторе. Ловим элемент с
     calc(25% - 12px) внутри flex-ряда c gap:16. */
  .container > div > div[style*="display: flex"][style*="gap: 16px"] > [style*="calc(25% - 12px)"] {
    flex: 0 0 calc(85% - 12px) !important;
  }

  /* WhyUs / DirectionsGrid — 3 колонки → 1 */
  .container > div[style*="repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* Calculator поля */
  .field__input { font-size: 16px !important; /* iOS не зумит при focus, если ≥16 */ }

  /* PriceAdvantage — 2 колонки → 1 */
  section.section--alt .container > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* CMIInvestor — внутренние fact-карточки на мобиле идут в 1 колонку
     (через .container [style*="grid-template-columns"]), но inline-стили
     paddingLeft:32 / borderLeft / borderBottom:i<2 раскладывали 2x2-сетку
     на чётных/нечётных. На моноколонке это даёт сдвинутые карточки
     и пропавшие разделители. Сбрасываем и нормализуем по :not(:last-child). */
  .cmi-fact {
    padding-left: 0 !important;
    border-left: 0 !important;
  }
  .cmi-fact:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
  }
  .cmi-fact:last-child {
    border-bottom: 0 !important;
  }

  /* Шрифты в padding на мобиле */
  .article { padding: 32px 16px !important; font-size: 17px !important; }
  .article h1 { font-size: 32px !important; }
  .article h2 { font-size: 24px !important; }
  .article .lead { font-size: 18px !important; }
  .article table { font-size: 14px !important; }
  .article .blog-grid { grid-template-columns: 1fr !important; }
}

/* Узкий мобильный ≤480px */
@media (max-width: 480px) {
  .hero-content h1 { font-size: 28px !important; }
  h2 { font-size: 24px !important; }
  .hero-content .eyebrow,
  .eyebrow { font-size: 11px !important; }

  /* Footer — 1 колонка для контактных секций */
  footer .container > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Кнопки CTA — full-width */
  .btn--hero { width: 100%; justify-content: center; }
  .container > div[style*="display: flex"][style*="gap: 14px"],
  .container > div[style*="display: flex"][style*="gap: 12px"] {
    flex-direction: column;
    align-items: stretch;
  }
}

/* PriceAdvantage — тёмный блок «Цепочка закупки» липнет к viewport,
   пока пользователь читает длинный текст слева. На мобиле обычный flow. */
@media (min-width: 1024px) {
  .price-advantage__chain {
    position: sticky;
    top: 100px;
    align-self: start;
  }
}

/* FAQList — стили живут в src/components/FAQList.astro (Astro версия).
   Старое правило `.faq-row { display: grid }` удалено, оно конфликтовало с
   новой <details>-разметкой (расталкивало <summary> и .faq-row__answer
   в 2 grid-колонки вместо stacked block layout). */

/* ===========================================================
   Phase 4 — таргетные мобильные правила для новых/изменённых
   компонентов после редизайна главной (Hero, ClientStrip,
   IconStrip). Используют классы, добавленные в JSX.
   =========================================================== */

/* Hero — карточка-оффер под H1 (новая структура: «от 160 000 ₽/т» крупно +
   мета-строка «30–45 дней · С НДС и КМД»). Заменяет старую одностроку .hero-offer. */
.hero-offer-card {
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 24px;
  margin-bottom: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero-offer-card__price {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: #fff;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hero-offer-card__price-prefix { font-size: 16px; opacity: 0.7; font-weight: 500; }
.hero-offer-card__price-value { font-size: 38px; font-variant-numeric: tabular-nums; line-height: 1; }
.hero-offer-card__price-unit { font-size: 18px; font-weight: 500; opacity: 0.85; }
.hero-offer-card__meta {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
}
.hero-offer-card__meta b { color: #fff; font-weight: 600; }
.hero-offer-card__dot { color: rgba(255, 255, 255, 0.4); }

@media (max-width: 768px) {
  /* Hero на мобиле — H1 крупнее (38 вместо 28 после старого !important),
     карточка-оффер становится full-width, параграф скрыт (шум на мобиле),
     CTA-кнопки full-width. */
  .hero-h1, .hero-content h1 {
    font-size: 38px !important;
    line-height: 1.08 !important;
    margin-bottom: 18px !important;
  }
  .hero-content > div:first-child {
    max-width: 100%;
  }
  .hero-paragraph { display: none !important; }
  .hero-offer-card {
    display: flex;
    width: 100%;
    padding: 16px 18px;
    margin-bottom: 24px;
  }
  .hero-offer-card__price-value { font-size: 34px; }
  .hero-offer-card__meta { flex-wrap: wrap; }
  /* Видео-фон на мобиле выключен JS-логикой Hero.jsx (≥768px),
     но оставшийся poster тоже хочется ослабить — добавим больше тёмного. */
  .hero-section .hero-overlay {
    background: linear-gradient(180deg, rgba(5,10,23,0.55) 0%, rgba(5,10,23,0.85) 100%) !important;
  }
}
@media (max-width: 480px) {
  .hero-h1, .hero-content h1 { font-size: 34px !important; }
  .hero-section { min-height: 540px !important; }
  .hero-content { padding-block: 40px 48px !important; }
  .hero-offer-card__price-value { font-size: 30px; }
}

/* PageHero (под-страницы) — H1 на мобиле ужимается с 62 до 38px,
   уменьшаем верт. отступы секции, stat-card складывается в 2 колонки. */
@media (max-width: 768px) {
  .page-hero { padding-block: 48px !important; }
  .page-hero__h1 {
    font-size: 38px !important;
    line-height: 1.1 !important;
    margin-bottom: 18px !important;
    letter-spacing: -0.015em !important;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }
  .page-hero p {
    font-size: 16px !important;
    line-height: 1.5 !important;
  }
}
@media (max-width: 480px) {
  .page-hero__h1 { font-size: 32px !important; }
  .page-hero { padding-block: 40px !important; }
}

/* ===========================================================
   Calculator на мобиле — padding 56×48 съедает половину экрана.
   Уменьшаем до 28×18, h2 ужимаем, цифру результата чуть мельче.
   =========================================================== */
@media (max-width: 768px) {
  .calc-form, .calc-result {
    padding: 32px 20px !important;
  }
  .calc-form__h2 {
    font-size: 26px !important;
    line-height: 1.2 !important;
  }
  .calc-result > div:nth-child(2) > div:nth-child(2) > span:nth-child(2) {
    /* Большая цифра «от X.X» — уменьшаем с 56 до 44 */
    font-size: 44px !important;
  }
  .calc-savings {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .calc-savings__amount { font-size: 24px !important; }
  .calc-savings__percent { font-size: 38px !important; }
  /* Range + number input в Тоннаж — на iPhone число съедало флекс.
     Делаем range full-width, число под ним. */
  .calc-form .field input[type="number"] {
    width: 100% !important;
    text-align: left !important;
  }
}
@media (max-width: 480px) {
  .calc-form, .calc-result { padding: 24px 16px !important; }
  .calc-form__h2 { font-size: 24px !important; }
  .calc-result > div:nth-child(2) > div:nth-child(2) > span:nth-child(2) {
    font-size: 38px !important;
  }
}

/* ===========================================================
   IconStrip — 4 цифры. На мобиле сейчас row-stack с горизонтальными
   разделителями (см. Phase 4 ниже). Делаем плотнее: padding меньше,
   цифра чуть мельче, иконка слева не такая «массивная».
   =========================================================== */
@media (max-width: 768px) {
  .icon-strip > .container > div {
    padding: 20px 0 !important;
    gap: 16px !important;
  }
  /* Уменьшаем «коробочку» иконки */
  .icon-strip > .container > div > div:first-child {
    width: 36px !important;
    height: 36px !important;
  }
  /* Цифра — была 32, ставим 28 для плотности на iPhone SE 375px */
  .icon-strip > .container > div span[style*="font-size: 44px"] {
    font-size: 28px !important;
  }
  .icon-strip > .container > div .stat-label,
  .icon-strip > .container > div > div > div > div:last-child {
    font-size: 13px !important;
  }
}

/* ===========================================================
   Footer на мобиле — accordion-стиль для длинных колонок.
   Сейчас 4 колонки (Производство/Услуги/Регионы/Компания) на мобиле
   складываются в 2×2 (768) и 1×N (480). 7 ссылок × 4 = 28 ссылок
   подряд = очень длинно. Делаем складные секции через <details>.
   Это требует JSX-правок Footer.jsx — пока ужимаем шрифт и spacing.
   =========================================================== */
@media (max-width: 768px) {
  /* Заголовки колонок крупнее, ссылки чуть плотнее */
  footer h3 { font-size: 13px !important; margin-bottom: 12px !important; }
  footer a { font-size: 13.5px !important; }
  footer ul li { margin-bottom: 8px !important; }
  /* Логотип-колонка с реквизитами — уменьшаем text */
  footer p { font-size: 12.5px !important; line-height: 1.5 !important; }
}

/* ClientStrip — на десктопе flex space-between (label слева,
   имена справа). На мобиле space-between с переносом даёт
   странную центровку — переходим на column-stack. */
@media (max-width: 768px) {
  .client-strip > .container {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .client-strip > .container > div {
    gap: 22px !important;
    font-size: 14px !important;
  }
}

/* IconStrip — на десктопе 4 колонки в одну строку. На планшете
   4 колонки слишком тесные — даём 2×2. На мобиле — 1 колонка
   с горизонтальными разделителями вместо вертикальных. */
@media (max-width: 1024px) and (min-width: 769px) {
  .icon-strip > .container > div {
    padding: 36px 22px !important;
  }
}
@media (max-width: 768px) {
  .icon-strip > .container {
    grid-template-columns: 1fr !important;
  }
  .icon-strip > .container > div {
    border-left: 0 !important;
    border-top: 1px solid var(--grey-200);
    padding: 28px 0 !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 20px !important;
  }
  .icon-strip > .container > div:first-child {
    border-top: 0 !important;
    padding-top: 12px !important;
  }
  /* Большая цифра помельче, чтобы помещалась в строку с иконкой */
  .icon-strip > .container > div span[style*="font-size: 44px"] {
    font-size: 32px !important;
  }
}

/* ===========================================================
   A11Y SUPPORT — skip-link, global focus-visible, sr-only
   Standard WCAG 2.1 keyboard navigation patterns. Mouse users
   never see :focus-visible (browser heuristic), so visible focus
   ring appears only when navigating via Tab.
   =========================================================== */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100000;
  background: var(--navy-900);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.005em;
  transform: translateY(-150%);
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 3px solid var(--brand-red);
  outline-offset: 2px;
}

/* Globally visible focus ring on Tab navigation. We don't override
   :focus (mouse click) — only the keyboard-driven :focus-visible. */
:focus-visible {
  outline: 2px solid var(--navy-600);
  outline-offset: 3px;
  border-radius: 2px;
}
.btn:focus-visible {
  outline: 3px solid var(--navy-600);
  outline-offset: 4px;
}
.btn--primary:focus-visible,
.btn--hero:focus-visible {
  outline-color: var(--brand-red);
}
a:focus-visible {
  outline: 2px solid var(--navy-600);
  outline-offset: 3px;
  border-radius: 2px;
}
/* Inside dark surfaces (navy-900 / red footer / cookie banner) — light ring */
.cookie-banner :focus-visible,
[data-on-dark="1"] :focus-visible,
.calc-savings :focus-visible {
  outline-color: #fff;
}
/* Hide focus ring when user clicks (mouse) — browser handles via :focus-visible heuristic */

/* Screen-reader-only utility for visually hidden text */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Make :target (skip-link landing) accept programmatic focus without showing it. */
[id="main-content"]:focus { outline: none; }

/* ===========================================================
   2-col sticky-aside sections (TenderDocs, FAQ)
   На мобиле — 1 column + static aside. Inline JSX style блокировал
   @media для grid-template-columns + position:sticky → переехало в CSS class.
   =========================================================== */
.split-2col {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 64px;
  align-items: start;
}
.split-2col--wide {
  grid-template-columns: 1fr 2fr;
  gap: 80px;
}
.split-2col__aside {
  position: sticky;
  top: 210px;
}
@media (max-width: 1023px) {
  .split-2col,
  .split-2col--wide {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .split-2col__aside {
    position: static;
    top: auto;
  }
}

