/*
Theme Name: OKB ITR
Theme URI: https://okb-itr.ru/
Author: OKB ITR
Author URI: https://okb-itr.ru/
Description: Промышленная B2B-тема для ОКБ ИТР : поставка станков ЧПУ «под ключ», роботизация, метрология, НИОКР. Классическая тема на Montserrat и бренд-палитре okb-itr.ru, паттерн Trust & Authority.
Version: 1.5.17
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: okb-itr
Tags: business, industrial, custom-menu, custom-logo, featured-images, translation-ready
*/

/* ============================================================
   Fonts : Montserrat раздаётся локально, правила @font-face вынесены в
   assets/fonts/fonts.css и подключаются отдельным файлом (см. functions.php).
   Отдельный файл нужен, чтобы браузер получил объявления шрифтов сразу и не
   ждал разбора всех стилей темы, а адреса в src считались от каталога со
   шрифтами, а не от корня темы.
   ============================================================ */

/* ============================================================
   Tokens (см. DESIGN.md : exact + token)
   ============================================================ */
:root {
  /*
   * Palette tuned for WCAG AAA (text 7:1, UI/focus 3:1).
   * Brand blue #3a8bdc kept as --c-brand for decoration only (fails AAA as text/btn).
   */
  --c-brand: #3a8bdc;
  --c-primary: #245689;
  --c-primary-deep: #214895;
  --c-primary-light: #74b7fb;
  --c-primary-alt: #2456a8;
  --c-primary-soft: #d4e6f5;
  --c-ink: #1b1a1a;
  --c-heading: #353535;
  --c-muted: #525252;
  --c-border: #8a8a8a;
  --c-surface: #ffffff;
  --c-surface-alt: #f5f8f4;
  --c-footer-bg: #1b1a1a;
  --c-footer-muted: #b0b0b0;
  --c-accent: #b00000;
  --c-accent-hover: #8b0000;
  --c-accent-soft: #ffe6e6;
  --c-on-primary: #ffffff;
  --c-icon-tint: #eaf3fc;

  /* typography : enlarged for 50+ readers (~+12–20%) */
  --font-base: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --fs-hero-title: clamp(1.75rem, 1.2rem + 2vw, 3.1rem);
  --fs-hero-sub: clamp(2.4rem, 1.5rem + 3.6vw, 4.4rem);
  --fs-lead: clamp(1.05rem, 0.95rem + 0.5vw, 1.25rem);
  --fs-section: clamp(2rem, 1.5rem + 1.8vw, 2.85rem);
  --fs-nav: 1rem; /* 16px */
  --fs-btn: 1.125rem;
  --fs-body: 1.125rem;
  --fs-foot-label: 0.95rem;
  --logo-h: 53px; /* 44px × 1.2 */
  /* Логотип широкий (606×185), поэтому на телефоне высота решает и ширину: 46px
     дают 151 пиксель, и вместе с кнопкой и меню ряд перестаёт помещаться в 320
     доступных пикселей. Растим высоту от ширины окна: 34px на 360px и прежние
     46px к 480px. */
  --logo-h-sm: clamp(34px, 9.5vw, 46px);
  --logo-h-footer: 58px;

  /* layout */
  --container: 1200px;
  --gutter: 20px;
  --section-y: clamp(48px, 6vw, 100px);
  --radius: 4px;
  --radius-lg: 8px;

  /* effects */
  --shadow-card: 0 2px 12px rgba(27, 26, 26, 0.06);
  --shadow-hover: 0 8px 28px rgba(33, 72, 149, 0.14);
  --transition: 0.25s ease;
}

/* ============================================================
   Reset / base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-base);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--c-ink);
  background: var(--c-surface);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--c-primary-deep); }
h1, h2, h3, h4 { margin: 0 0 0.5em; color: var(--c-heading); line-height: 1.3; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--c-primary-deep); outline-offset: 2px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section { padding: var(--section-y) 0; }
.section--alt { background: var(--c-surface-alt); }
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--c-primary); color: var(--c-on-primary); padding: 12px 18px;
  font-size: var(--fs-btn); font-weight: 700;
}
.skip-link:focus { left: 8px; top: 8px; color: var(--c-on-primary); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-block;
  padding: 14px 36px;
  font-size: var(--fs-btn);
  font-weight: 700;
  line-height: 1.35;
  color: var(--c-on-primary);
  text-align: center;
  border: 2px solid var(--c-primary);
  border-radius: var(--radius);
  background: var(--c-primary);
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}
.btn:hover { background: var(--c-primary-deep); border-color: var(--c-primary-deep); color: var(--c-on-primary); transform: translateY(-1px); }
.btn--ghost { background: transparent; border-color: #fff; color: #fff; }
.btn--ghost:hover { background: #fff; color: var(--c-primary-deep); }
.btn--accent { background: var(--c-accent); border-color: var(--c-accent); }
.btn--accent:hover { background: var(--c-accent-hover); border-color: var(--c-accent-hover); }

/* ============================================================
   Section title
   ============================================================ */
.section-title {
  font-size: var(--fs-section);
  font-weight: 700;
  line-height: 1.25;
  color: var(--c-heading);
  text-transform: uppercase;
  margin-bottom: 0.6em;
}
.section-title::after {
  content: "";
  display: block;
  width: 56px; height: 3px;
  margin-top: 16px;
  background: var(--c-brand);
}
.section-title--center { text-align: center; }
.section-title--center::after { margin-left: auto; margin-right: auto; }
.section-lead { max-width: 720px; color: var(--c-muted); font-size: var(--fs-lead); }
.section-title--center + .section-lead { margin-left: auto; margin-right: auto; text-align: center; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky; top: var(--admin-bar-h, 0px); z-index: 100;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--c-border);
  transition: box-shadow var(--transition), padding var(--transition);
}
/* Смещение под панель администратора WordPress: она висит поверх страницы и без
   отступа закрывает прилипшую шапку. Высоту меряет assets/js/main.js — она зависит
   от ширины окна и числа кнопок в панели, ядро при этом резервирует фиксированные
   46px и на двухрядной панели их не хватает. Посетителям переменная не приходит и
   отступ равен нулю. */
.site-header.is-scrolled { box-shadow: 0 4px 18px rgba(27, 26, 26, 0.08); }
.header-row {
  display: flex; align-items: center; gap: 24px;
  min-height: 88px;
}
.site-header.is-scrolled .header-row { min-height: 76px; }
.header__logo { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; }
/* flex: 0 0 auto обязательно. Логотип — элемент flex-ряда, и на узком экране ряд
   сжимал именно его: высота оставалась заданной, а ширина уезжала до остатка места.
   На экране 360px картинка 606×185 отрисовывалась как 32×46, то есть сплющивалась
   вчетверо. object-fit: contain — страховка на случай, если высоту когда-нибудь
   зададут вместе с шириной: пропорции сохранятся вместо растягивания. */
.header__logo img, .header__logo svg,
.header__logo .custom-logo {
  height: var(--logo-h); width: auto; max-height: var(--logo-h);
  flex: 0 0 auto; object-fit: contain;
}
.header__nav { flex: 0 1 auto; }
/* Шесть пунктов в контейнере 1200px не влезают и наезжают на логотип и телефон.
   Шапка 1440px: боковые зазоры около 26px, между пунктами 22px.
   Ниже 1440px — выпадающая панель. */
@media (min-width: 1440px) {
  .site-header .container { max-width: 1440px; }
  .header-row { gap: 20px; }
  .header__logo { flex: 0 0 auto; min-width: auto; }
  .header__nav {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: safe center;
  }
  .header__actions { flex: 0 0 auto; margin-left: 0; }
}
.header__links { display: flex; align-items: center; gap: 22px; list-style: none; }
/* Пункты не сжимаются: при нехватке места короткое название вроде «О нас»
   ломалось на две строки и вытягивало шапку по высоте. Лучше уйти в выпадающую
   панель на пороге ниже, чем ломать надписи. */
.header__links > li { flex: 0 0 auto; }
.header__links a {
  display: inline-block;
  white-space: nowrap;
  font-size: var(--fs-nav);
  font-weight: 500;
  color: var(--c-ink);
  padding: 8px 0;
  position: relative;
}
.header__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px; background: var(--c-brand);
  transition: width var(--transition);
}
.header__links a:hover, .header__links .current-menu-item > a { color: var(--c-primary); }
.header__links a:hover::after, .header__links .current-menu-item > a::after { width: 100%; }
.header__actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex: 0 0 auto; }
.header__phone { font-weight: 700; font-size: var(--fs-nav); color: var(--c-ink); white-space: nowrap; }
.header__phone:hover { color: var(--c-primary); }
/* nowrap: без него на узком окне кнопке не хватало места и надпись ломалась на две
   строки, вытягивая шапку по высоте. */
.header__actions .btn { padding: 12px 24px; font-size: 1.05rem; white-space: nowrap; }
/* flex: 0 0 auto по той же причине, что у логотипа: в тесном ряду кнопка меню
   сжималась с 48px до 38px и переставала попадать под палец. */
.nav-toggle {
  display: none; width: 48px; height: 48px; border: none; background: transparent;
  flex-direction: column; justify-content: center; gap: 5px; margin-left: auto;
  flex: 0 0 auto;
}
.nav-toggle span { display: block; height: 2px; width: 26px; background: var(--c-ink); transition: var(--transition); }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Dropdown submenu */
.header__links .menu-item-has-children { position: relative; }
.header__links .menu-item-has-children > a { padding-right: 18px; }
.header__links .menu-item-has-children > a::before {
  content: ""; position: absolute; right: 0; top: 50%;
  width: 6px; height: 6px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-75%) rotate(45deg);
  transition: transform var(--transition);
}
.header__links .menu-item-has-children:hover > a::before,
.header__links .menu-item-has-children:focus-within > a::before {
  transform: translateY(-25%) rotate(-135deg);
}
.header__links .sub-menu {
  position: absolute; top: calc(100% + 10px); left: 0;
  min-width: 250px; margin: 0; padding: 8px; list-style: none;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-hover);
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 100;
}
.header__links .menu-item-has-children:hover > .sub-menu,
.header__links .menu-item-has-children:focus-within > .sub-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.header__links .sub-menu a { display: block; width: 100%; padding: 10px 14px; border-radius: var(--radius); white-space: nowrap; }
.header__links .sub-menu a::after { display: none; }
.header__links .sub-menu a:hover { background: var(--c-surface-alt); color: var(--c-primary); }

/* ============================================================
   Hero / descriptor
   ============================================================ */
.descriptor {
  position: relative; overflow: hidden;
  padding: clamp(64px, 8vw, 100px) 0 clamp(72px, 9vw, 125px);
  min-height: 550px;
  display: flex; align-items: center;
  background: #c9ced4 var(--hero-image, none) center / cover no-repeat;
  color: #fff;
}
/* Subtle left scrim so the white text stays legible over the photo */
.descriptor .overlay {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(20, 35, 59, 0.72) 0%, rgba(20, 35, 59, 0.34) 38%, rgba(20, 35, 59, 0) 68%);
}
/* Blue "engineering" diagonal : replicates okb-itr.ru (SVG + overlay blend) */
.descriptor::after {
  content: ""; position: absolute; top: 0; right: 100px; z-index: 0;
  width: 100%; height: 100%; pointer-events: none;
  background: url("assets/img/descriptor-line.svg") right center / auto 100% no-repeat;
  mix-blend-mode: overlay;
}
.descriptor .container { position: relative; z-index: 1; }
.descriptor__inner { max-width: 720px; }
.descriptor__title { color: var(--c-primary-light); font-size: var(--fs-hero-title); font-weight: 500; text-transform: none; line-height: 1.2; margin-bottom: 6px; }
.descriptor__subtitle { color: #fff; font-size: var(--fs-hero-sub); font-weight: 700; line-height: 1.14; text-transform: uppercase; max-width: 628px; margin-bottom: 24px; }
.descriptor__text { color: #fff; font-size: var(--fs-lead); font-weight: 500; line-height: 1.6; max-width: 641px; margin-bottom: 28px; }
.descriptor__cta { display: flex; flex-wrap: wrap; gap: 16px; }

/* ============================================================
   Services : two panels (2×2) + compact cards
   ============================================================ */
.grid { display: grid; gap: 24px; }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.services-intro { margin-bottom: 36px; }
.services-intro .section-lead { margin-left: auto; margin-right: auto; text-align: center; }

.services-panel {
  position: relative;
  background:
    linear-gradient(180deg, rgba(36, 86, 137, 0.04) 0%, rgba(255, 255, 255, 0) 48%),
    var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.services-panel::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--c-primary), var(--c-brand));
}
.services-panel:last-child { margin-bottom: 0; }
.services-panel__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--c-border);
}
.services-panel__num {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--c-primary);
  line-height: 1;
}
.services-panel__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-heading);
  text-transform: none;
  line-height: 1.3;
}
.services-panel__grid { gap: 14px; }

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--c-primary); }
.card__icon {
  width: 60px; height: 60px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  background: var(--c-icon-tint); color: var(--c-primary);
  margin-bottom: 18px;
}
.card__icon svg { width: 32px; height: 32px; }
.card__title { font-size: 1.3rem; font-weight: 700; color: var(--c-heading); text-transform: none; margin-bottom: 10px; }
.card__text { color: var(--c-muted); font-size: 1.0625rem; margin: 0 0 16px; line-height: 1.65; }
.card__link { margin-top: auto; font-weight: 700; font-size: 1.05rem; display: inline-flex; align-items: center; gap: 6px; }
.card__link svg { width: 18px; height: 18px; }

/* Compact cards inside service panels */
.card--compact {
  padding: 16px 18px;
  box-shadow: none;
  background: var(--c-surface-alt);
  border-color: transparent;
  min-height: 0;
}
.card--compact:hover {
  background: var(--c-surface);
  border-color: var(--c-primary);
  transform: translateY(-2px);
}
.card--compact .card__icon {
  width: 40px; height: 40px;
  margin-bottom: 10px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
}
.card--compact .card__icon svg { width: 22px; height: 22px; }
.card--compact .card__title {
  font-size: 1rem;
  margin-bottom: 6px;
  line-height: 1.35;
}
.card--compact .card__text {
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0 0 10px;
}
.card--compact .card__link { font-size: 0.875rem; }

/* ============================================================
   About: картинка и краткий текст в две колонки
   ============================================================ */
.about-intro { margin-bottom: 28px; }

/* Картинка слева уже текста: она поясняет, а читают всё-таки текст. */
.about-split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: stretch;
}
.about-split__media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  /* Картинка держит свою пропорцию и прижата к верху, а не растягивается на всю
     высоту текста. Растянутая по высоте она превращалась в узкую вертикальную
     полосу: снимок панорамный (1200×499), и при ширине колонки 414 пикселя от кадра
     оставалась четверть — цех в нём уже не читался. */
  align-self: start;
  aspect-ratio: 4 / 3;
}
.about-split__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Точка кадра левее центра: там рабочий у станка, справа пустой проход. */
  object-position: 38% center;
}
.about-split__lead {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.65;
}
.about-split__facts {
  list-style: none;
  display: grid;
  gap: 14px;
  margin: 24px 0 0;
  padding: 0;
}
.about-split__facts li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.55;
}
.about-split__facts svg {
  color: var(--c-primary);
  flex-shrink: 0;
  /* Галочка стоит по первой строке текста, а не по центру пункта. */
  margin-top: 3px;
}
.about-split__more { margin: 28px 0 0; }

/* Узкий экран: колонки складываются, картинка уходит наверх и показывается
   горизонтальной полосой, ближе к своей исходной пропорции.
   Граница та же, что у меню в шапке (1199px): ниже неё колонка текста становится
   настолько узкой, что текст оказывается вдвое выше картинки и рядом с ней
   образуется пустое поле. */
@media (max-width: 1199px) {
  .about-split {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .about-split__media {
    /* Во всю ширину экрана кадр показывается полосой, ближе к своей пропорции. */
    aspect-ratio: 16 / 9;
  }
  .about-split__media img { object-position: center; }
}
.feature-list { list-style: none; display: grid; gap: 16px; margin-top: 20px; }
.feature-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 1.125rem; line-height: 1.6; }
.feature-list svg { width: 24px; height: 24px; color: var(--c-primary); flex-shrink: 0; margin-top: 2px; }

/* ============================================================
   Industries
   ============================================================ */
.industries { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.industry {
  border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 20px; text-align: center; background: var(--c-surface);
  transition: border-color var(--transition), color var(--transition);
}
.industry:hover { border-color: var(--c-primary); color: var(--c-primary); }
.industry svg { width: 36px; height: 36px; margin: 0 auto 12px; color: var(--c-primary); }
.industry span { font-weight: 600; font-size: 1.1rem; }

/* ============================================================
   CTA band : solid deep navy so white copy stays AAA
   ============================================================ */
.cta-band { background: var(--c-primary-deep); color: #fff; }
.cta-band .section-title, .cta-band h2 { color: #fff; }
.cta-band .section-title::after { background: #fff; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-inner p { color: #ffffff; max-width: 560px; margin: 8px 0 0; font-size: var(--fs-lead); }

/* ============================================================
   Contacts
   ============================================================ */
.contacts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.contact-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-card); }
.contact-card .card__icon { margin-bottom: 14px; }
.contact-card h3 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .02em; }
.contact-card a { font-weight: 600; font-size: 1.125rem; }

/* ============================================================
   Content (pages / posts)
   ============================================================ */
.page-hero { background: var(--c-surface-alt); padding: clamp(40px, 6vw, 72px) 0; border-bottom: 1px solid var(--c-border); }
.breadcrumbs { color: var(--c-muted); font-size: 1rem; margin-bottom: 10px; }
.breadcrumbs a { color: var(--c-muted); }
.breadcrumbs a:hover { color: var(--c-primary); }
.entry-content { max-width: 820px; font-size: 1.125rem; line-height: 1.75; }
/* Абзацы по ширине: левый и правый край ровные. Последняя строка остаётся
   короткой. Переносы по слогам, иначе браузер растягивает пробелы. */
.entry-content p {
  text-align: justify;
  text-justify: inter-word;
  text-indent: 2.5em;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
}
.entry-content p:has(> img:only-child) { text-indent: 0; }
.entry-content h2 { text-transform: none; font-size: 1.85rem; margin-top: 1.4em; }
.entry-content h3 { text-transform: none; font-size: 1.4rem; }
.entry-content ul,
.entry-content ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: 0.5em; padding-left: 4px; }
.entry-content li::marker { color: var(--c-primary); }
.entry-content strong { color: var(--c-heading); }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content img { border-radius: var(--radius-lg); margin: 1.2em 0; }
.entry-content blockquote { border-left: 4px solid var(--c-brand); margin: 1.2em 0; padding: 6px 20px; color: var(--c-muted); }

/* Таблицы юридических страниц: в политике четыре колонки, и на телефоне они
   уезжают за край экрана. display: block с прокруткой оставляет таблицу внутри
   колонки текста, а не растягивает страницу по горизонтали. */
.entry-content table { display: block; width: 100%; overflow-x: auto; margin: 1.2em 0; border-collapse: collapse; font-size: 0.95rem; line-height: 1.6; }
.entry-content th { border-bottom: 2px solid var(--c-border); padding: 8px 12px; text-align: left; vertical-align: top; font-weight: 600; color: var(--c-primary); }
.entry-content td { border-bottom: 1px solid var(--c-border); padding: 8px 12px; vertical-align: top; }
.post-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* ============================================================
   Заявка под страницей услуги
   ============================================================ */
.request { background: var(--c-surface-alt); scroll-margin-top: 100px; }
.request__panel {
  max-width: 940px; margin: 0 auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-top: 4px solid var(--c-primary);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3.5vw, 44px);
  box-shadow: var(--shadow-card);
}
.request__tag {
  display: inline-block; margin-bottom: 12px;
  font-size: 0.85rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--c-primary);
  padding: 4px 12px; border: 1px solid var(--c-primary-soft); border-radius: 999px;
  background: var(--c-icon-tint);
}
.request__title { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem); margin-bottom: 10px; }
.request__lead { color: var(--c-muted); margin: 0 0 20px; max-width: 62ch; }
.request__chips {
  display: flex; flex-wrap: wrap; gap: 10px 12px;
  list-style: none; margin: 0 0 28px; padding: 0;
}
.request__chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 1rem; color: var(--c-heading);
  background: var(--c-surface-alt);
  border: 1px solid var(--c-primary-soft);
  border-radius: var(--radius); padding: 7px 14px;
}
.request__chip svg { color: var(--c-primary); flex: none; }
.request__chip a { color: var(--c-heading); font-weight: 600; }
.request__chip a:hover { color: var(--c-primary); }
.request__form { border-top: 1px dashed var(--c-primary-soft); padding-top: 26px; }

/* Поля Contact Form 7 внутри блока */
.request .rf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.request .rf-field { display: block; }
.request .rf-field--wide { grid-column: 1 / -1; }
.request .rf-label {
  display: block; margin-bottom: 6px;
  font-size: 0.85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--c-heading);
}
.request .rf-label em { color: var(--c-accent); font-style: normal; }
.request input[type="text"],
.request input[type="tel"],
.request input[type="email"],
.request textarea {
  width: 100%; font-family: inherit; font-size: 1.0625rem; color: var(--c-ink);
  background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 12px 14px; transition: border-color var(--transition), box-shadow var(--transition);
}
.request textarea { min-height: 132px; resize: vertical; }
.request input::placeholder,
.request textarea::placeholder { color: #6f6f6f; }
.request input:focus,
.request textarea:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(36, 86, 137, 0.18);
}
.request .rf-consent { margin: 20px 0 0; font-size: 1rem; color: var(--c-muted); }
.request .rf-consent .wpcf7-list-item { margin: 0; }
.request .rf-consent label { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.request .rf-consent input[type="checkbox"] { width: 20px; height: 20px; flex: none; margin-top: 4px; accent-color: var(--c-primary); }
.request .rf-consent a { text-decoration: underline; text-underline-offset: 3px; }

/* Яндекс SmartCaptcha. Плагин задаёт контейнеру min-height 102px под виджет,
   нам остаётся отбить его от галочки согласия и от кнопки отправки. */
.request .smart-captcha { margin-top: 20px; }
/* Виджет ровно 300 пикселей в ширину и не сжимается — это минимальный размер
   чекбокса у Яндекса. Внутри карточки на экране 360px остаётся 272 пикселя,
   поэтому виджет вылезал за карточку вправо. Уменьшаем его целиком: рамка и
   подпись «Yandex SmartCaptcha» масштабируются вместе с чекбоксом, кликается он
   при этом нормально. Отрицательный отступ снизу убирает пустоту, которая
   остаётся от неотмасштабированной высоты в потоке.
   Порог 430px, а не 480px: на 480px виджет помещается и уменьшать его незачем. */
@media (max-width: 430px) {
  .request .smart-captcha {
    transform: scale(0.86);
    transform-origin: left top;
    margin-bottom: -17px;
  }
}
/* Ниже 345px даже уменьшенный виджет упирается в край: карточке остаётся около
   232 пикселей. Коэффициенты взяты с запасом в десяток пикселей, чтобы виджет не
   касался рамки карточки. */
@media (max-width: 345px) {
  .request .smart-captcha {
    transform: scale(0.74);
    margin-bottom: -31px;
  }
}
/* Плагин помечает контейнер этим классом, когда посетитель жмёт «Отправить»,
   не пройдя проверку, и рисует рамку цветом браузера. Приводим к цвету ошибок темы. */
.request .smart-captcha.wpcf7-not-valid { border-color: var(--c-accent); }

.request .rf-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px;
  margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--c-primary-soft);
}
.request .rf-note { color: var(--c-muted); font-size: 0.95rem; }
/* Ссылка на политику под кнопкой: доступ к ней рядом с формой сбора данных
   требует ч. 2 ст. 18.1 152-ФЗ, поэтому она видима, а не спрятана в подвал. */
.request .rf-policy { margin: 14px 0 0; color: var(--c-muted); font-size: 0.95rem; }
.request .rf-policy a { text-decoration: underline; text-underline-offset: 3px; }
.request input[type="submit"] {
  font-family: inherit; font-size: var(--fs-btn); font-weight: 700;
  color: var(--c-on-primary); background: var(--c-primary);
  border: 1px solid var(--c-primary); border-radius: var(--radius);
  padding: 14px 30px; cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.request input[type="submit"]:hover { background: var(--c-primary-deep); transform: translateY(-1px); }
.request input[type="submit"]:focus-visible { outline: 3px solid var(--c-primary-light); outline-offset: 2px; }
.request .wpcf7-not-valid-tip { color: var(--c-accent); font-size: 0.95rem; margin-top: 6px; }
.request .wpcf7-not-valid { border-color: var(--c-accent); }
.request .wpcf7-response-output {
  margin: 22px 0 0 !important; padding: 12px 16px !important;
  border-radius: var(--radius); border-width: 1px !important;
  font-size: 1rem;
}
.request .wpcf7-spinner { vertical-align: middle; }

@media (max-width: 640px) {
  .request .rf-grid { grid-template-columns: 1fr; }
  .request .rf-actions { flex-direction: column; align-items: stretch; }
  .request input[type="submit"] { width: 100%; }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--c-footer-bg);
  color: #fff; padding: clamp(40px, 5vw, 72px) 0 28px;
}
.footer-inner { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 32px; }
.footer__logo svg, .footer__logo img { height: var(--logo-h-footer); width: auto; margin-bottom: 16px; }
.footer__logo p { color: var(--c-footer-muted); font-size: 1.05rem; line-height: 1.65; }
.footer__title { text-transform: uppercase; color: var(--c-footer-muted); font-size: var(--fs-foot-label); font-weight: 600; opacity: 1; margin-bottom: 12px; letter-spacing: .04em; }
.footer__text { color: #fff; font-size: 1.05rem; margin: 0 0 8px; display: block; }
a.footer__text:hover { color: var(--c-primary-light); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid #6b6b6b; }
.footer-bottom p, .footer-bottom a { color: var(--c-footer-muted); font-size: 1rem; margin: 0; }
.footer-bottom a:hover { color: #fff; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1200px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .grid--4, .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .industries { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; gap: 28px; }
  .contacts-grid { grid-template-columns: 1fr; }
  .post-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1439px) {
  .nav-toggle { display: flex; }
  /* Панель меню привязана к низу шапки, а не к точке «88 пикселей от верха окна».
     Фиксированный отступ разъезжался с шапкой в трёх случаях: при прокрутке шапка
     сжимается до 76px и оставалась щель, у администратора её опускает панель
     WordPress, а на узком экране логотип меньше и шапка ниже. Позиционирование от
     самой шапки убирает все три случая сразу.
     Скрытую панель убираем через visibility, иначе ссылки в ней остаются
     доступными с клавиатуры, хотя их не видно. */
  .header__nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--c-border);
    padding: 16px var(--gutter); margin: 0;
    transform: translateY(-120%); visibility: hidden;
    transition: transform var(--transition), visibility 0s linear 0.25s;
    box-shadow: 0 12px 24px rgba(27,26,26,.12);
    overflow-y: auto; overscroll-behavior: contain;
    /* dvh считает высоту без адресной строки браузера, vh оставлен для старых
       версий, где длинное меню иначе упиралось бы в край экрана. */
    max-height: 78vh;
    max-height: 78dvh;
  }
  .nav-open .header__nav {
    transform: translateY(0); visibility: visible;
    transition: transform var(--transition), visibility 0s;
  }
  /* align-items: stretch и ширина пункта по панели. С flex-start пункт занимал
     ширину своего текста, а текст в шапке идёт с white-space: nowrap — из-за этого
     «Автоматизация и производительность труда» растягивала список до 396px внутри
     панели шириной 372px, и панель приходилось прокручивать боком.
     Здесь надписи переносим: в столбце вертикального места достаточно, а лишняя
     строка честнее горизонтальной прокрутки. Свойство переопределяем именно тут,
     на широком экране nowrap по-прежнему нужен, иначе ряд ломается по высоте. */
  .header__links { flex-direction: column; align-items: stretch; gap: 4px; }
  .header__links > li { width: 100%; }
  .header__links a { padding: 12px 0; width: 100%; white-space: normal; }
  .header__actions .header__phone { display: none; }
  /* Кнопке разрешаем перенос надписи. На экране 360px «Заказать звонок» в одну
     строку занимала 202px из 320 доступных, забирая место у логотипа и кнопки
     меню. В две строки она укладывается примерно в 100px и остаётся ниже
     минимальной высоты шапки, поэтому шапка от переноса не растёт. Размеры
     плавные, без ступеней: на планшете надпись остаётся в одну строку. */
  .header-row { gap: 14px; }
  /* Обёртку логотипа тоже нельзя сжимать. Она была flex: 1 1 auto, чтобы прижать
     правую группу к краю, и в тесном ряду сама сжималась до 88 пикселей, а
     глобальное правило img { max-width: 100% } обрезало по ней картинку — от
     flex: 0 0 auto у самой картинки толку не было. Правую группу прижимаем
     отступом, а не растяжением логотипа. */
  .header__logo { flex: 0 0 auto; }
  .header__actions { gap: 12px; margin-left: auto; }
  .header__actions .btn {
    white-space: normal; text-align: center;
    font-size: clamp(0.9rem, 2.4vw, 1.05rem);
    padding: 10px clamp(12px, 3vw, 24px);
  }
  /* Submenu expands inline on mobile */
  .header__links .sub-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; border-left: 2px solid var(--c-border);
    border-radius: 0; min-width: 0; padding: 0 0 0 14px; margin: 0 0 6px;
  }
  /* У пунктов подменю свой nowrap с более высокой специфичностью, поэтому
     переопределяем отдельно: именно они длиннее всего («Автоматизация и
     производительность труда») и растягивали панель на 96 пикселей в сторону. */
  .header__links .sub-menu a { padding: 8px 0; white-space: normal; }
  .header__links .menu-item-has-children > a::before { display: none; }
}
/* Телефон убран из шапки только там, где он действительно не влезает. На планшете
   и узком ноутбуке рядом с кнопкой места хватает, а это основной способ связи. */
@media (min-width: 700px) and (max-width: 1439px) {
  .header__actions .header__phone { display: inline; }
}
@media (max-width: 992px) {
  .descriptor::after { right: 10px; }
}
@media (max-width: 768px) {
  .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .services-panel { padding: 20px 16px 16px; }
  .services-panel__grid { gap: 10px; }
  .post-list { grid-template-columns: 1fr; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .descriptor { min-height: 440px; }
  .descriptor::after {
    right: 0;
    background-image: url("assets/img/descriptor-line-mob.svg");
  }
  .descriptor .overlay {
    background: linear-gradient(90deg, rgba(20, 35, 59, 0.78) 0%, rgba(20, 35, 59, 0.45) 55%, rgba(20, 35, 59, 0.2) 100%);
  }
}
@media (max-width: 480px) {
  .industries { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .header__logo img, .header__logo svg,
  .header__logo .custom-logo { height: var(--logo-h-sm); max-height: var(--logo-h-sm); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
