/*
Theme Name: Строймашприбор
Theme URI: https://stroimashpribor.ru/
Author: СП Строймашприбор
Description: Тема сайта-визитки для компании, устанавливающей и обслуживающей приборы безопасности подъёмных сооружений.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: smp
*/

/* ==========================================================================
   Переменные
   ========================================================================== */
:root {
  --ink:        #0F1620;
  --ink-2:      #1B2532;
  --steel:      #2A3646;
  --muted:      #5C6B7F;
  --muted-2:    #8B98A9;
  --line:       #E2E7EE;
  --line-dark:  #2C3747;
  --bg:         #F5F7FA;
  --surface:    #FFFFFF;

  --accent:      #FFB020;   /* сигнальный жёлтый — цвет техники безопасности */
  --accent-dark: #E09400;
  --accent-tint: #FFF6E4;

  --font-display: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body:    "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;

  --shadow-sm: 0 1px 2px rgba(15, 22, 32, .05), 0 2px 8px rgba(15, 22, 32, .05);
  --shadow-md: 0 4px 14px rgba(15, 22, 32, .07), 0 14px 36px rgba(15, 22, 32, .08);
  --shadow-lg: 0 10px 30px rgba(15, 22, 32, .12), 0 30px 70px rgba(15, 22, 32, .14);

  --wrap: 1200px;
}

/* ==========================================================================
   База
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--ink); text-decoration-color: rgba(15, 22, 32, .25); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -.02em; }
h1 { font-size: clamp(30px, 5vw, 54px); font-weight: 800; }
h2 { font-size: clamp(25px, 3.4vw, 38px); font-weight: 800; }
h3 { font-size: clamp(19px, 2vw, 23px); font-weight: 700; }

p { margin: 0 0 1.1em; }

.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 820px; }

.section { padding: 84px 0; }
.section--tight { padding: 56px 0; }
.section--grey { background: var(--bg); }
.section--dark { background: var(--ink); color: #fff; }
.section--dark h2, .section--dark h3 { color: #fff; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 0 0 14px;
  font-family: var(--font-display); font-size: 12.5px; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent-dark);
}
.eyebrow::before { content: ""; width: 26px; height: 3px; border-radius: 2px; background: var(--accent); }
.section--dark .eyebrow { color: var(--accent); }

.section__head { max-width: 760px; margin-bottom: 44px; }
.section__lead { margin: 16px 0 0; font-size: 18px; color: var(--muted); }
.section--dark .section__lead { color: #A9B6C6; }

/* ==========================================================================
   Кнопки
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 30px; border: 0; border-radius: 100px; cursor: pointer;
  font-family: var(--font-display); font-size: 15.5px; font-weight: 700;
  text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--accent { background: var(--accent); color: var(--ink); box-shadow: 0 6px 18px rgba(255, 176, 32, .35); }
.btn--accent:hover { background: var(--accent-dark); color: var(--ink); }
.btn--ghost { background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .35); backdrop-filter: blur(6px); }
.btn--ghost:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: var(--ink-2); color: #fff; }
.btn--sm { padding: 11px 22px; font-size: 14px; }

/* ==========================================================================
   Шапка
   ========================================================================== */
.header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.header.is-stuck { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.header__inner { display: flex; align-items: center; gap: 28px; min-height: 78px; }

.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.logo__mark { width: 42px; height: 42px; flex-shrink: 0; display: block; }
.logo__crane { display: block; width: 100%; height: 100%; }
.logo__text { display: flex; flex-direction: column; line-height: 1.15; }
.logo__name { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.logo__sub { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }

.nav { margin-left: auto; }
.nav__list { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav__list a { font-size: 15.5px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.nav__list a:hover { color: var(--accent-dark); }
.nav__list .current-menu-item > a,
.nav__list .current_page_item > a,
.nav__list .current-menu-ancestor > a,
.nav__list .current_page_ancestor > a { color: var(--accent-dark); }

/* Выпадающий список услуг */
.nav__list > li { position: relative; }
.nav__list .sub-menu {
  position: absolute; top: 100%; left: -16px; z-index: 70;
  min-width: 268px; margin: 0; padding: 8px; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.nav__list > li:hover > .sub-menu,
.nav__list > li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.nav__list .sub-menu a { display: block; padding: 10px 12px; border-radius: var(--r-sm); font-size: 15px; font-weight: 500; }
.nav__list .sub-menu a:hover { background: var(--bg); }

.header__phone { display: inline-flex; flex-direction: column; line-height: 1.2; text-decoration: none; }
.header__phone b { font-family: var(--font-display); font-size: 17px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.header__phone span { font-size: 11.5px; color: var(--muted); }

.burger {
  display: none; width: 46px; height: 46px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; cursor: pointer; padding: 0;
  align-items: center; justify-content: center; flex-direction: column; gap: 5px;
}
.burger span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   Первый экран
   ========================================================================== */
.hero { position: relative; color: #fff; overflow: hidden; }
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
/* Слайдер: кадры лежат стопкой, видимый — с классом is-active. */
.hero__slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s ease; }
.hero__slide.is-active { opacity: 1; }
.no-js .hero__slide:first-child, .hero__slide:only-child { opacity: 1; }
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 22, 32, .82) 0%, rgba(15, 22, 32, .55) 45%, rgba(15, 22, 32, .88) 100%),
    linear-gradient(95deg, rgba(15, 22, 32, .78) 20%, rgba(15, 22, 32, .18) 75%);
}
.hero__inner { position: relative; padding: 64px 0 0; }
.hero__content { max-width: 720px; }
.hero h1 { color: #fff; }
.hero__lead { margin: 22px 0 0; font-size: clamp(17px, 1.6vw, 20px); color: #D3DCE6; max-width: 620px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

.hero__facts {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin-top: 76px; background: rgba(255, 255, 255, .16);
  border-radius: var(--r-md) var(--r-md) 0 0; overflow: hidden;
}
.hero__fact { background: rgba(15, 22, 32, .72); backdrop-filter: blur(8px); padding: 24px 26px; }
.hero__fact b { display: block; font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 30px); font-weight: 800; color: var(--accent); }
.hero__fact span { display: block; margin-top: 5px; font-size: 14px; color: #BCC7D4; line-height: 1.4; }

/* ==========================================================================
   Карточки услуг
   ========================================================================== */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.cards--2 { grid-template-columns: repeat(2, 1fr); }
.cards--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 30px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
  text-decoration: none; color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #C9D3E0; color: inherit; }
.card__icon {
  width: 50px; height: 50px; border-radius: 13px; flex-shrink: 0;
  background: var(--accent-tint); color: var(--accent-dark);
  display: grid; place-items: center; margin-bottom: 4px;
}
.card__icon svg { width: 26px; height: 26px; }
.card h3 { font-size: 20px; }
.card p { margin: 0; font-size: 15.5px; color: var(--muted); line-height: 1.6; }
.card__more { margin-top: auto; padding-top: 12px; font-family: var(--font-display); font-size: 14.5px; font-weight: 700; color: var(--accent-dark); }
.card__more::after { content: " →"; }

/* ==========================================================================
   Шаги
   ========================================================================== */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: step; }
.step { position: relative; padding: 28px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.step::before {
  counter-increment: step; content: "0" counter(step);
  display: block; margin-bottom: 14px;
  font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--accent);
  letter-spacing: -.04em;
}
.step h3 { font-size: 18px; margin-bottom: 8px; }
.step p { margin: 0; font-size: 15px; color: var(--muted); }

/* ==========================================================================
   Двухколоночный блок с фото
   ========================================================================== */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split--rev .split__media { order: 2; }
.split__media img { border-radius: var(--r-md); box-shadow: var(--shadow-md); }
.split__body h2 { margin-bottom: 18px; }
.split__body p { color: var(--muted); }
.split__body p strong { color: var(--ink); font-weight: 700; }

/* ==========================================================================
   Список с галочками
   ========================================================================== */
.ticks { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 13px; }
.ticks li { position: relative; padding-left: 34px; font-size: 16px; color: var(--ink-2); }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 4px;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--accent-tint) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E09400' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 13px no-repeat;
}
.section--dark .ticks li { color: #D3DCE6; }

/* ==========================================================================
   Теги оборудования
   ========================================================================== */
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.tag {
  padding: 9px 17px; border-radius: 100px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .2);
  font-size: 14.5px; font-weight: 600; color: #E4EAF1;
}
.section:not(.section--dark) .tag { background: var(--surface); border-color: var(--line); color: var(--ink-2); }

/* ==========================================================================
   Техника
   ========================================================================== */
.machines { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.machine {
  padding: 24px 26px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
}
.machine b { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.machine span { font-size: 15px; color: var(--muted); }

/* ==========================================================================
   Призыв к действию
   ========================================================================== */
.cta { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 56px; position: relative; overflow: hidden; }
.cta::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 176, 32, .22), transparent 65%);
}
.cta__inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.cta h2 { color: #fff; max-width: 560px; }
.cta p { margin: 14px 0 0; color: #A9B6C6; max-width: 520px; }
.cta__actions { display: flex; flex-direction: column; gap: 12px; }

/* ==========================================================================
   Контакты
   ========================================================================== */
.contacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.contact-card { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.contact-card b { display: block; font-family: var(--font-display); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.contact-card a, .contact-card p { font-size: 17px; margin: 0 0 6px; display: block; text-decoration: none; font-weight: 600; }
.contact-card p { font-weight: 400; color: var(--ink-2); }
.contact-card .small { font-size: 14px; color: var(--muted); font-weight: 400; }

.map { margin-top: 34px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); line-height: 0; }
.map iframe { width: 100%; height: 420px; border: 0; }

.requisites { margin-top: 34px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.requisites table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.requisites td { padding: 13px 20px; border-bottom: 1px solid var(--line); }
.requisites tr:last-child td { border-bottom: 0; }
.requisites td:first-child { color: var(--muted); width: 45%; }
.requisites td:last-child { font-weight: 600; }

/* ==========================================================================
   Внутренние страницы
   ========================================================================== */
.pagehead { background: var(--bg); border-bottom: 1px solid var(--line); padding: 44px 0 40px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-dark); }
.crumbs span[aria-hidden] { opacity: .45; }

.entry { padding: 60px 0 84px; }
.entry-content { font-size: 17px; }
.entry-content > * { margin: 0 0 22px; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content h2 { margin: 44px 0 16px; }
.entry-content h3 { margin: 32px 0 12px; }
.entry-content ul, .entry-content ol { padding-left: 22px; }
.entry-content li { margin-bottom: 9px; }
.entry-content a { color: var(--accent-dark); font-weight: 600; }
.entry-content .lead { font-size: 19px; color: var(--muted); }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 16px; }
.entry-content th, .entry-content td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.entry-content thead th { background: var(--bg); font-weight: 700; }
.entry-content blockquote {
  margin: 0; padding: 22px 26px; background: var(--accent-tint);
  border-left: 4px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Подвал
   ========================================================================== */
.footer { background: var(--ink); color: #A9B6C6; padding: 62px 0 30px; font-size: 15px; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1.3fr; gap: 44px; }
.footer .logo__name { color: #fff; }
.footer .logo__sub { color: var(--muted-2); }
.footer__desc { margin: 20px 0 0; max-width: 380px; color: #94A2B3; font-size: 15px; }
.footer__heading { margin: 0 0 16px; font-family: var(--font-display); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff; }
.footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.footer__list a, .footer a { color: #A9B6C6; text-decoration: none; }
.footer__list a:hover, .footer a:hover { color: var(--accent); }
.footer__bottom { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line-dark); display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; font-size: 13.5px; color: #7C8B9D; }

/* ==========================================================================
   Появление при прокрутке
   ========================================================================== */
.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 1024px) {
  .cards, .cards--4, .machines { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 34px; }
  .split--rev .split__media { order: 0; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 34px; }
  .contacts { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav {
    position: fixed; inset: 78px 0 auto; margin: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md); padding: 18px 24px 24px;
    display: none;
  }
  .nav.is-open { display: block; }
  .nav { max-height: calc(100vh - 78px); overflow-y: auto; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav__list a { display: block; padding: 13px 4px; font-size: 17px; border-bottom: 1px solid var(--line); }
  /* На узких экранах подпункты просто раскрыты списком */
  .nav__list .sub-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    min-width: 0; margin: 0 0 6px; padding: 0 0 0 14px;
    background: none; border: 0; box-shadow: none;
  }
  .nav__list .sub-menu a { padding: 11px 4px; font-size: 15.5px; color: var(--muted); border-bottom: 0; }
  .burger { display: flex; margin-left: auto; }
  .header__phone { display: none; }
  .hero__facts { grid-template-columns: repeat(2, 1fr); margin-top: 52px; }
  .hero__inner { padding-top: 46px; }
  .section { padding: 60px 0; }
  .cta { padding: 36px 28px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .container { padding: 0 18px; }
  .cards, .cards--2, .cards--4, .machines, .steps, .contacts, .footer__grid { grid-template-columns: 1fr; }
  .card { padding: 24px; }
  .hero__actions .btn { width: 100%; }
  .cta__actions { width: 100%; }
  .cta__actions .btn { width: 100%; }
  .hero__fact { padding: 18px 20px; }
  .hero__fact b { font-size: 21px; }
  .hero__fact span { font-size: 13px; }
  .map iframe { height: 320px; }
  .requisites td { padding: 11px 14px; font-size: 14.5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hero__slide { transition: none; }
  .btn:hover, a.card:hover { transform: none; }
}
