/* =========================================================================
   SZRCE Theme v2 — main.css
   Премиальная институция: тёмно-синий + золото, mobile-first, без зависимостей.
   ========================================================================= */

/* --- Tokens --- */
:root {
  --ink-900: #0E1B33;
  --ink-700: #1F2D52;
  --ink-500: #3A4A78;
  --gold-500: #B79354;
  --gold-200: #EDDFC2;
  --paper: #FFFFFF;
  --mist-50: #F6F4EE;
  --rule: #D6CFC0;
  --muted: #5C6479;

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

  --shadow-1: 0 1px 2px rgba(14, 27, 51, 0.06), 0 4px 16px rgba(14, 27, 51, 0.05);
  --shadow-2: 0 8px 32px rgba(14, 27, 51, 0.10);

  --container: 1240px;
  --container-narrow: 820px;
  --gutter: clamp(16px, 4vw, 32px);

  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 1100px;

  --font-heading: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --transition: 200ms ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 4; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-900);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video, canvas { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color var(--transition); }
a:hover, a:focus-visible { color: var(--ink-700); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; color: var(--ink-900); }

/* --- A11y --- */
.skip-link {
  position: absolute; left: -9999px;
  padding: 12px 16px;
  background: var(--ink-900); color: #fff;
  z-index: 9999;
}
.skip-link:focus { left: 8px; top: 8px; }

:where(:focus-visible) {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

/* --- Layout primitives --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: clamp(48px, 8vw, 96px); }
.section--dark { background: var(--ink-900); color: var(--paper); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--paper); }
.section--mist { background: var(--mist-50); }

.section__header { margin-bottom: clamp(24px, 4vw, 48px); }
.section__header--center { text-align: center; }
.section__header--with-link { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section__title {
  font-size: clamp(1.625rem, 1.2rem + 1.5vw, 2.5rem);
  letter-spacing: -0.01em;
}
.section__eyebrow {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-500);
  margin-bottom: 8px;
}
.section__lead { color: var(--muted); max-width: 720px; font-size: 1.125rem; }
.section--dark .section__lead { color: rgba(255, 255, 255, 0.78); }
.section__more {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--ink-700);
  border-bottom: 1px solid var(--rule);
}
.section__more:hover { color: var(--gold-500); border-color: var(--gold-500); }

.layout--two-col { display: grid; grid-template-columns: 1fr; gap: 32px; padding-block: clamp(32px, 5vw, 64px); }
@media (min-width: 1100px) {
  .layout--two-col { grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; }
}
.layout__sidebar { display: flex; flex-direction: column; gap: 24px; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn--primary {
  background: var(--gold-500);
  color: var(--ink-900);
}
.btn--primary:hover { background: var(--gold-200); color: var(--ink-900); }
.btn--ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.section--dark .btn--ghost,
.hero .btn--ghost { color: var(--paper); border-color: rgba(255, 255, 255, 0.5); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.08); color: var(--paper); border-color: var(--paper); }
:not(.section--dark, .hero) > .btn--ghost,
.layout__content .btn--ghost { color: var(--ink-900); border-color: var(--rule); }
:not(.section--dark, .hero) > .btn--ghost:hover,
.layout__content .btn--ghost:hover { background: var(--mist-50); border-color: var(--ink-900); }

/* --- Header (двухполковый: brand+contact, потом nav-bar) --- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.header__top { background: var(--paper); }
.header__top-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink-900);
  flex: 1 1 auto; min-width: 0;
}
.brand__mark { width: 48px; height: 48px; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__line--full {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
  display: none;
}
.brand__line--short {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
}
@media (min-width: 768px) {
  .brand__line--full { display: block; max-width: 40ch; }
  .brand__line--short { display: none; }
  .brand__mark { width: 56px; height: 56px; }
}

.header__contact {
  display: inline-flex; align-items: center; gap: 12px;
  flex: 0 0 auto;
}
.header__phone {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--ink-900);
  white-space: nowrap;
}
.header__phone .icon { width: 18px; height: 18px; color: var(--gold-500); }
@media (max-width: 600px) {
  .header__phone span { display: none; }
  .header__contact .btn { padding: 10px 14px; font-size: 0.9rem; }
}

.header__nav-bar {
  background: var(--ink-900);
  color: var(--paper);
}
.header__nav-inner {
  display: flex; align-items: center; gap: 16px;
  min-height: 48px;
}

.header__burger {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px;
  padding: 0 12px;
  color: var(--paper);
  border-radius: var(--radius-sm);
}
.header__burger span:not(.header__burger-text) {
  display: block; width: 22px; height: 2px;
  background: var(--paper); border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
  margin-top: 0;
}
.header__burger {
  position: relative;
}
.header__burger > span:not(.header__burger-text) {
  position: absolute;
  left: 12px;
}
.header__burger > span:nth-child(1) { top: 14px; }
.header__burger > span:nth-child(2) { top: 21px; }
.header__burger > span:nth-child(3) { top: 28px; }
.header__burger-text {
  font-family: var(--font-heading);
  font-weight: 600; font-size: 0.95rem;
  margin-left: 30px;
}
.header__burger[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.header__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.header__burger[aria-expanded="true"] span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

.primary-nav {
  flex: 1;
  max-height: 0; overflow: hidden;
  transition: max-height var(--transition);
}
.primary-nav.is-open {
  max-height: 600px;
  position: absolute;
  left: 0; right: 0; top: 100%;
  background: var(--ink-900);
  border-top: 1px solid rgba(255,255,255,0.1);
  z-index: 51;
}
.header__nav-bar { position: relative; }
.primary-nav.is-open .primary-nav__list { padding-inline: var(--gutter); padding-block: 8px; max-width: var(--container); margin-inline: auto; }
.primary-nav__list { display: flex; flex-direction: column; gap: 0; }
.primary-nav__list li a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--paper);
}
.primary-nav__list li:last-child a { border-bottom: 0; }
.primary-nav__list li a:hover { color: var(--gold-500); }
.primary-nav__list .sub-menu { display: none; padding-left: 16px; }

@media (min-width: 1100px) {
  .header__burger { display: none; }
  .primary-nav {
    max-height: none; overflow: visible;
    position: static !important; background: transparent !important; border: 0;
  }
  .primary-nav__list { flex-direction: row; gap: 28px; padding: 0; }
  .primary-nav__list li a { padding: 0; border: 0; }
  .primary-nav__list li { position: relative; padding: 12px 0; }
  .primary-nav__list .sub-menu {
    display: none;
    position: absolute; top: 100%; left: 0;
    background: var(--paper);
    box-shadow: var(--shadow-2);
    min-width: 240px;
    border-radius: var(--radius-md);
    padding: 8px;
  }
  .primary-nav__list .sub-menu li { padding: 0; }
  .primary-nav__list .sub-menu li a { color: var(--ink-900); padding: 8px 12px; }
  .primary-nav__list li:hover > .sub-menu,
  .primary-nav__list li:focus-within > .sub-menu { display: block; }
}

/* --- Hero --- */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--ink-900) 0%, var(--ink-700) 60%, var(--ink-500) 100%);
  color: var(--paper);
  overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; pointer-events: none; }
.hero__watermark {
  position: absolute;
  right: -120px; top: 50%;
  transform: translateY(-50%);
  width: clamp(360px, 50vw, 640px);
  height: auto;
  opacity: 0.10;
  filter: drop-shadow(0 0 40px rgba(183, 147, 84, 0.3));
}
@media (min-width: 1100px) {
  .hero__watermark { right: -80px; opacity: 0.14; }
}
.hero__inner {
  position: relative;
  padding-block: clamp(64px, 10vw, 128px);
  max-width: min(720px, 100%);
}
.hero__eyebrow {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-500);
  margin-bottom: 16px;
}
.hero__title {
  font-size: clamp(2rem, 1.4rem + 3vw, 3.5rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--paper);
}
.hero__title-accent { color: var(--gold-200); font-weight: 600; }
.hero__lead {
  margin-top: 20px;
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 560px;
}
.hero__services {
  margin-top: 32px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 480px) { .hero__services { grid-template-columns: 1fr 1fr; } }
.hero__services li {
  position: relative;
  padding-left: 24px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.92);
}
.hero__services li::before {
  content: "";
  position: absolute; left: 0; top: 0.55em;
  width: 12px; height: 1px;
  background: var(--gold-500);
}
.hero__cta {
  margin-top: 40px;
  display: flex; flex-wrap: wrap; gap: 12px;
}

/* --- Cards / grids --- */
.grid { display: grid; gap: 24px; }
.grid--two { grid-template-columns: 1fr; }
.grid--three { grid-template-columns: 1fr; }
.grid--cards { grid-template-columns: 1fr; }
.grid--services { grid-template-columns: 1fr; }
.grid--credentials { grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 768px) {
  .grid--two { grid-template-columns: 1fr 1fr; }
  .grid--three { grid-template-columns: repeat(3, 1fr); }
  .grid--cards { grid-template-columns: repeat(2, 1fr); }
  .grid--services { grid-template-columns: repeat(2, 1fr); }
  .grid--credentials { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1100px) {
  .grid--cards { grid-template-columns: repeat(3, 1fr); }
  .grid--services { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-1); border-color: var(--ink-500); transform: translateY(-2px); }
.card__icon { width: 40px; height: 40px; color: var(--gold-500); margin-bottom: 16px; }
.card__icon .icon { width: 100%; height: 100%; }
.card__title { font-size: 1.25rem; margin-bottom: 12px; }
.card__title a { color: var(--ink-900); }
.card__title a:hover { color: var(--ink-700); }
.card__list { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.card__list li a {
  font-size: 0.95rem;
  color: var(--muted);
  padding: 4px 0;
  display: inline-flex; align-items: center; gap: 6px;
}
.card__list li a::before { content: "→"; color: var(--gold-500); font-size: 0.85em; }
.card__list li a:hover { color: var(--ink-900); }
.card__more {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--ink-700);
  font-size: 0.9rem;
}
.card__more:hover { color: var(--gold-500); }

.card--post { padding: 0; overflow: hidden; }
.card--post .card__media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card--post .card__body { padding: 20px; }
.card__date { font-size: 0.85rem; color: var(--muted); display: block; margin-bottom: 8px; }
.card__excerpt { color: var(--muted); font-size: 0.95rem; margin: 0; }
.card__excerpt-link {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.card__excerpt-link:hover .card__excerpt,
.card__excerpt-link:focus-visible .card__excerpt { color: var(--ink-900); }
.card__link:hover, .card__link:focus-visible { color: var(--gold-500); }

/* --- Features (Why Us) --- */
.feature { text-align: center; padding: 16px; }
.feature__icon { width: 56px; height: 56px; margin: 0 auto 16px; color: var(--gold-500); }
.feature__icon .icon { width: 100%; height: 100%; }
.feature__title { font-size: 1.25rem; margin-bottom: 8px; }
.feature__body { color: var(--muted); }

/* --- Principles --- */
.principle {
  position: relative;
  padding: 24px;
  border-left: 2px solid var(--gold-500);
}
.principle__num {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 2rem;
  color: var(--gold-500);
  margin-bottom: 12px;
}
.principle__title { color: var(--paper); margin-bottom: 8px; font-size: 1.25rem; }
.principle__body { color: rgba(255, 255, 255, 0.78); }

/* --- Credentials --- */
.credential {
  display: flex; flex-direction: column; gap: 12px;
  text-align: center;
}
.credential__media {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 24px;
  aspect-ratio: 3 / 4;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-500);
}
.credential__placeholder .icon { width: 56px; height: 56px; }
.credential__caption { font-size: 0.9rem; color: var(--muted); }

/* --- Breadcrumbs --- */
.breadcrumbs { margin-bottom: 16px; font-size: 0.9rem; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--rule); }
.breadcrumbs a { color: var(--ink-700); }
.breadcrumbs a:hover { color: var(--gold-500); }

/* --- Post / Page --- */
.post__header, .page__header { margin-bottom: 24px; }
.post__title, .page__title {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  letter-spacing: -0.015em;
  margin-bottom: 12px;
}
.post__meta { display: flex; gap: 8px; color: var(--muted); font-size: 0.9rem; }
.post__cover, .page__cover { margin: 24px 0; border-radius: var(--radius-lg); overflow: hidden; }
.post__cover img, .page__cover img { width: 100%; height: auto; }
.post__body p, .page__body p { margin-bottom: 1em; }
.post__body h2, .page__body h2 { font-size: 1.75rem; margin: 1.5em 0 0.5em; }
.post__body h3, .page__body h3 { font-size: 1.375rem; margin: 1.25em 0 0.5em; }
.post__body ul, .page__body ul,
.post__body ol, .page__body ol { margin: 0 0 1em 1.5em; }
.post__body ul, .page__body ul { list-style: disc; }
.post__body ol, .page__body ol { list-style: decimal; }
.post__body a, .page__body a { color: var(--ink-700); text-decoration: underline; text-decoration-color: var(--gold-500); text-underline-offset: 2px; }
.post__body img, .page__body img { border-radius: var(--radius-md); margin: 1em 0; }
.post__body blockquote, .page__body blockquote {
  border-left: 3px solid var(--gold-500);
  padding-left: 16px;
  font-style: italic;
  color: var(--muted);
  margin: 1em 0;
}

.post__cta, .page__cta {
  margin-top: 48px;
  padding: 32px;
  background: var(--mist-50);
  border-radius: var(--radius-lg);
  text-align: center;
}
.post__cta h3, .page__cta h3 { font-size: 1.5rem; margin-bottom: 16px; }

.page__children { margin-top: 32px; }
.link-list { display: flex; flex-direction: column; gap: 8px; padding: 16px 0; }
.link-list li a {
  display: block;
  padding: 10px 16px;
  background: var(--mist-50);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
}
.link-list li a:hover { background: var(--gold-200); }

/* --- Widgets / sidebar --- */
.widget {
  background: var(--mist-50);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.widget--contact a { color: var(--ink-700); font-weight: 600; }
.widget__title { font-size: 1.125rem; margin-bottom: 12px; }

/* --- Pagination --- */
.pagination, .nav-links {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 32px; justify-content: center;
}
.pagination .page-numbers, .nav-links .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  text-decoration: none;
}
.pagination .page-numbers.current,
.nav-links .page-numbers.current {
  background: var(--ink-900); color: var(--paper); border-color: var(--ink-900);
}
.pagination .page-numbers:hover,
.nav-links .page-numbers:hover { border-color: var(--ink-900); }

/* --- Forms — единый стиль для CF7 на всём сайте + поиск --- */
.search-form__row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Универсальные input для всех контекстов CF7 (внутри секций главной, страниц, диалога) */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 input[type="number"],
.wpcf7 input[type="search"],
.wpcf7 textarea,
.wpcf7 select,
.search-form__input {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-900);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.wpcf7 textarea {
  border-radius: 20px;
  min-height: 120px;
  resize: vertical;
}
.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder { color: var(--muted); opacity: 0.85; }

.wpcf7 input:focus,
.wpcf7 textarea:focus,
.wpcf7 select:focus,
.search-form__input:focus {
  border-color: var(--ink-700);
  box-shadow: 0 0 0 4px rgba(31, 45, 82, 0.12);
  outline: 0;
}

.wpcf7 .wpcf7-not-valid {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}
.wpcf7-not-valid-tip { font-size: 0.85rem; color: #c0392b; margin-top: 4px; }

.wpcf7 .wpcf7-submit,
.wpcf7 input[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold-500); color: var(--ink-900);
  font-family: var(--font-heading); font-weight: 700;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background var(--transition), transform var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.wpcf7 .wpcf7-submit:hover,
.wpcf7 input[type="submit"]:hover { background: var(--gold-200); }
.wpcf7 .wpcf7-submit:active { transform: translateY(1px); }

.wpcf7 form > p {
  display: grid; gap: 6px; margin-bottom: 14px;
}
.wpcf7 form label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
}

.wpcf7 .wpcf7-response-output {
  border-radius: var(--radius-md);
  padding: 12px 16px !important;
  margin: 16px 0 0 !important;
  font-size: 0.95rem;
}

/* Тёмные секции (footer-форма, hero) — инвертированные input'ы */
.section--dark .wpcf7 input[type="text"],
.section--dark .wpcf7 input[type="email"],
.section--dark .wpcf7 input[type="tel"],
.section--dark .wpcf7 input[type="url"],
.section--dark .wpcf7 textarea,
.section--dark .wpcf7 select {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--paper);
}
.section--dark .wpcf7 input::placeholder,
.section--dark .wpcf7 textarea::placeholder { color: rgba(255, 255, 255, 0.55); }
.section--dark .wpcf7 input:focus,
.section--dark .wpcf7 textarea:focus {
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--gold-500);
  box-shadow: 0 0 0 4px rgba(183, 147, 84, 0.18);
}

/* Поиск — оставляем согласованный вид */
.search-form__input { border-radius: 999px; }

/* --- Dialog (модалка callback) --- */
.dialog {
  border: 0;
  padding: 0;
  border-radius: 24px;
  max-width: 480px;
  width: calc(100% - 32px);
  background: var(--paper);
  box-shadow: 0 24px 64px rgba(14, 27, 51, 0.35), 0 4px 12px rgba(14, 27, 51, 0.2);
  color: var(--ink-900);
  /* Центрирование модалки — нативный <dialog> по умолчанию центрируется
     в большинстве браузеров, но добавим явное правило для Safari/старых WebKit */
  margin: auto;
  inset: 0;
  position: fixed;
  overflow: visible;
}
.dialog::backdrop {
  background: rgba(14, 27, 51, 0.78);
  backdrop-filter: blur(4px);
}
.dialog[open] {
  animation: szrcev2-dialog-in 220ms ease-out;
}
@keyframes szrcev2-dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.dialog__close-form {
  position: absolute; top: 12px; right: 12px;
  margin: 0; padding: 0;
  z-index: 1;
}
.dialog__close {
  width: 36px; height: 36px;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--mist-50);
  color: var(--ink-700);
  border: 1px solid var(--rule);
  transition: background var(--transition), color var(--transition);
}
.dialog__close:hover { background: var(--ink-900); color: var(--paper); border-color: var(--ink-900); }

.dialog__body {
  padding: 32px clamp(20px, 5vw, 36px) clamp(24px, 5vw, 36px);
  text-align: center;
}
.dialog__body::before {
  content: "";
  display: block;
  width: 56px; height: 4px;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-200));
  border-radius: 999px;
  margin: 0 auto 18px;
}
.dialog__body h3 {
  font-size: 1.5rem;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.dialog__body::after {
  content: attr(data-subtitle);
}
.dialog__subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}
.dialog__body .wpcf7 form > p { text-align: left; }
.dialog__body .wpcf7 .wpcf7-submit { width: 100%; margin-top: 4px; }

@media (max-width: 480px) {
  .dialog { width: calc(100% - 24px); border-radius: 20px; }
  .dialog__body { padding: 28px 20px 24px; }
}

/* --- Footer --- */
.footer {
  background: var(--ink-900);
  color: rgba(255, 255, 255, 0.78);
  padding-top: 64px;
}
.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding-bottom: 48px;
}
@media (min-width: 768px) { .footer__inner { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; } }
.footer__brand .brand { color: var(--paper); }
.footer__brand .brand__line--full,
.footer__brand .brand__line--short { color: var(--paper); display: block; }
.footer__brand .brand__line--full { font-size: 1rem; }
.footer__brand .brand__line--short { display: none; }
.footer__tagline { margin-top: 12px; max-width: 32ch; font-size: 0.95rem; }
.footer__heading {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--paper);
  margin-bottom: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.footer__list { display: flex; flex-direction: column; gap: 8px; }
.footer__list li a, .footer__list li { color: rgba(255, 255, 255, 0.78); }
.footer__list li a:hover { color: var(--gold-500); }
.footer__legal { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.footer__legal-inner { padding-block: 20px; font-size: 0.85rem; color: rgba(255, 255, 255, 0.5); }

/* --- Icons --- */
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon--inline { width: 1em; height: 1em; }

/* --- Layout sidebar enhancements --- */
.layout--two-col .layout__sidebar {
  position: sticky; top: 96px;
  align-self: start;
}
@media (max-width: 1099px) {
  .layout--two-col .layout__sidebar { position: static; }
}

/* --- Price tables (на странице /tarify/) --- */
.page__body table.price,
.page__body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.page__body table.price th,
.page__body table th {
  background: var(--ink-900);
  color: var(--paper);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: left;
  padding: 14px 16px;
  border: 0;
}
.page__body table.price td,
.page__body table td {
  padding: 12px 16px;
  border-top: 1px solid var(--rule);
  vertical-align: top;
  height: auto !important;
  width: auto !important;
}
.page__body table.price tr:nth-child(even) td:not(.tableColspan) {
  background: var(--mist-50);
}
.page__body table.price tr td:last-child:not(.tableColspan) {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--ink-900);
  white-space: nowrap;
  text-align: right;
  width: 1%;
}
.page__body table.price td.tableColspan {
  background: var(--gold-200);
  color: var(--ink-900);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  padding: 12px 16px;
  border-top: 2px solid var(--gold-500);
}
.page__body table.price[style] { height: auto !important; }
.page__body table.price tr[style] { height: auto !important; }

/* Inline CF7 form on tariffs/services pages — обёртка-плашка */
.page__body .wpcf7 {
  background: var(--mist-50);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 32px);
  margin: 2em 0;
  border: 1px solid var(--rule);
}

.page__body .centerCap {
  text-align: center;
  margin-top: 1.8em;
  font-size: 1.5rem;
}

/* На мобильных таблицы — горизонтальная прокрутка */
@media (max-width: 600px) {
  .page__body table.price,
  .page__body table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .page__body table.price td,
  .page__body table td { white-space: normal; }
}

/* --- Contacts page --- */
.contacts { margin: 32px 0; }
.contacts__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 32px;
}
@media (min-width: 600px) { .contacts__grid { grid-template-columns: repeat(2, 1fr); } }
.contacts__cell {
  background: var(--mist-50);
  border-radius: var(--radius-md);
  padding: 20px;
}
.contacts__heading {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-500);
  margin-bottom: 8px;
  font-family: var(--font-heading);
}
.contacts__text {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink-900);
}
.contacts__text a { color: var(--ink-700); border-bottom: 1px solid var(--gold-500); }
.contacts__text a:hover { color: var(--gold-500); }
.contacts__map {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--rule);
  aspect-ratio: 16 / 9;
  margin-bottom: 16px;
}
.contacts__map iframe {
  width: 100%; height: 100%; border: 0; display: block;
}
.contacts__route { text-align: center; }

/* --- Footer credit --- */
.footer__legal-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px;
}
.footer__credit a { color: var(--gold-500); border-bottom: 1px dotted var(--gold-500); }
.footer__credit a:hover { color: var(--gold-200); border-bottom-color: var(--gold-200); }
.footer__metrika { display: inline-flex; align-items: center; opacity: 0.85; }
.footer__metrika img { display: block; }
.footer__metrika:hover { opacity: 1; }

/* --- Floating contactus widget (vendor: contactus-js) — фирменный стиль --- */
#szrce-contactus.szrce-contactus .ctu_btn,
#szrce-contactus.szrce-contactus .ctu_btn_inner,
#szrce-contactus.szrce-contactus .arcontactus-button { background: var(--gold-500) !important; }
#szrce-contactus .arcontactus-message-text-typing { background: var(--ink-900) !important; color: var(--paper) !important; }
#szrce-contactus .arcontactus-prompt { color: var(--paper) !important; }

/* --- Anti-spam honeypot — off-screen для пользователя, в DOM для бота --- */
.szrcev2-hp {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0;
  pointer-events: none;
}
.szrcev2-hp input { width: 1px; height: 1px; }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0ms !important;
    transition-duration: 0ms !important;
    scroll-behavior: auto !important;
  }
}
