@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap");

/*
 * ГКП «Алматы Су» — дизайн «civic utility»: доверие, читаемость, контраст.
 * Палитра: глубокий синевато-бирюзовый + акцент «вода», шрифт Montserrat.
 */

:root {
  color-scheme: light;
  --bg-page: #eef2f5;
  --bg-soft-gray: #eef2f5;
  --bg-surface: #ffffff;
  --bg-surface-glass: #ffffff;
  --bg-warm-gray: #f7f8fa;
  --primary: #124559;
  --primary-hover: #0e3949;
  --accent: #0d7c7a;
  --accent-hover: #0a6563;
  --accent-soft: #e6f4f3;
  --accent-mint: #d1f0ee;
  --accent-glow: rgba(13, 124, 122, 0.18);
  --text: #0f1a20;
  --text-muted: #4a5f6d;
  --border: #cdd8de;
  --border-strong: #a8b9c2;
  --border-light: #e8eef1;
  --shadow: 0 10px 40px -12px rgba(15, 26, 32, 0.1), 0 4px 14px -6px rgba(15, 26, 32, 0.06);
  --shadow-sm: 0 2px 8px rgba(15, 26, 32, 0.06);
  --shadow-nav: 0 2px 0 rgba(0, 0, 0, 0.06), 0 8px 24px -8px rgba(10, 30, 40, 0.18);
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --header-top: #f5f8fa;
  --nav-bg: #124559;
  --nav-gradient: var(--nav-bg);
  --focus-ring: 2px solid var(--accent);
  --max-width: 1180px;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rhythm: 1.5rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.25, 0.64, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg-page);
  background-image: none;
  overflow-x: clip;
}

::selection {
  background: var(--accent-soft);
  color: var(--primary);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.75rem 1rem;
  background: var(--primary);
  color: #fff;
  z-index: 10000;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ——— Верхняя полоса ——— */
.top-bar {
  background: var(--header-top);
  color: var(--text);
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 220;
  box-shadow: 0 1px 0 var(--border-light);
}

.top-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.35), transparent);
  pointer-events: none;
}

.top-bar__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.5rem max(0.1rem, env(safe-area-inset-left, 0px)) 0.5rem max(1.25rem, env(safe-area-inset-right, 0px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.5rem;
}

.top-bar__phones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
  flex-shrink: 0;
}

.top-bar__phones-icon {
  flex-shrink: 0;
  width: 0.9375rem;
  height: 0.9375rem;
  color: var(--primary);
  opacity: 0.9;
}

.top-bar__phones span {
  color: var(--text-muted);
}

.top-bar__phones strong {
  font-weight: 600;
  color: var(--primary);
}

.top-bar__phones strong,
.top-bar__phones span {
  white-space: nowrap;
}

/* Телефоны в отдельной «рельсе» с overflow-x — иначе выпадающие «Контакты» обрезаются по вертикали */
.top-bar__phones-rail {
  flex: 1 1 0;
  min-width: 0;
  overflow: visible;
  padding-right: 0.15rem;
}

/* Телефоны + блок контактов в ряд; прокрутка только у телефонов */
.top-bar__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 0.85rem;
  row-gap: 0.35rem;
  min-width: 0;
  overflow: visible;
}

.top-bar__corner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.5rem;
  flex-shrink: 0;
  justify-self: end;
}

.top-bar__extras {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem 1rem;
  flex-shrink: 0;
  min-width: 0;
  overflow: visible;
  justify-content: flex-end;
}

.top-bar__link {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}

.top-bar__link:hover {
  text-decoration: underline;
}

@media (max-width: 560px) {
  .top-bar__inner {
    grid-template-columns: 1fr;
  }

  .top-bar__corner {
    width: 100%;
  }
}

@media (max-width: 1240px) {
  .top-bar {
    font-size: 0.78rem;
  }

  .top-bar__main {
    grid-template-columns: 1fr;
    row-gap: 0.25rem;
  }

  .top-bar__phones {
    gap: 0.3rem 0.55rem;
  }

  .top-bar__extras {
    gap: 0.55rem 0.7rem;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* Контакты — выпадающий блок */
.has-dropdown {
  position: relative;
}

/* Верхняя полоса: список открывается вверх — не перекрывает «Районные…», «Сообщите…» справа; выше по z-order соседних ссылок */
.top-bar .has-dropdown.is-open {
  z-index: 450;
}

.top-bar .has-dropdown__panel {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 0.35rem;
  z-index: 460;
}

.has-dropdown > button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0;
}

.has-dropdown > button::after {
  content: "";
  width: 0.4em;
  height: 0.4em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -0.2em;
}

.has-dropdown__panel {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.35rem;
  min-width: 240px;
  padding: 0.5rem 0;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-strong);
  list-style: none;
  margin: 0.35rem 0 0;
  z-index: 200;
}

.has-dropdown__panel a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text);
  text-decoration: none;
}

.has-dropdown__panel a:hover {
  background: var(--accent-soft);
  color: var(--primary);
}

.has-dropdown.is-open .has-dropdown__panel,
.has-dropdown:hover .has-dropdown__panel,
.has-dropdown:focus-within .has-dropdown__panel {
  display: block;
}

/* ——— Шапка: логотип и поиск ——— */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border-light);
  position: relative;
  z-index: 140;
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem max(1.25rem, env(safe-area-inset-left, 0px)) 1rem max(1.25rem, env(safe-area-inset-right, 0px));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
  color: var(--primary);
}

.logo__mark {
  flex-shrink: 0;
}

.logo__mark img,
.logo__mark svg {
  width: 48px;
  height: 48px;
  display: block;
  object-fit: contain;
}

.logo__title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.logo__subtitle {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Поиск в полосе навигации; языки и a11y — в top-bar */
.nav-extras {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  flex: 0 1 auto;
  min-width: 0;
  margin-left: 0;
}

/* Слот под поиск: на десктопе фиксированная ширина — раскрытие не двигает меню */
.nav-search-slot {
  flex: 1 1 130px;
  min-width: 0;
  max-width: 200px;
  display: flex;
  align-items: center;
  min-height: 2.1rem;
}

.nav-extras .search-form--nav {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.nav-extras .search-form--nav input {
  padding: 0.4rem 0.65rem;
  font-size: 0.8125rem;
}

.nav-extras .search-form--nav button {
  padding: 0.32rem 0.45rem;
  min-width: 2.1rem;
  min-height: 2.1rem;
}

.nav-extras .search-form--nav button svg {
  width: 16px;
  height: 16px;
}

.search-form {
  display: flex;
  width: 100%;
  max-width: 100%;
  border: none;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: none;
  transition: background-color 0.25s var(--ease-out);
}

.search-form:focus-within {
  outline: none;
  box-shadow: none;
}

.search-form input {
  flex: 1;
  border: none;
  padding: 0.55rem 1rem;
  font: inherit;
  background: transparent;
  min-width: 0;
}

.search-form input:focus {
  outline: none;
}

.search-form input::placeholder {
  color: var(--text-muted);
}

.search-form button {
  border: none;
  background: transparent;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.65rem;
  min-width: 2.65rem;
  min-height: 2.45rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s var(--ease-out), transform 0.2s var(--ease-out), background 0.2s var(--ease-out);
}

.search-form button:hover {
  color: var(--accent-hover);
  background: transparent;
  transform: scale(1.06);
}

.search-form button svg {
  display: block;
  flex-shrink: 0;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.lang-switch a {
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}

.lang-switch a[aria-current="true"],
.lang-switch a:hover {
  color: var(--primary);
}

.lang-switch .sep {
  color: var(--border);
  user-select: none;
}

.lang-switch--top {
  font-size: inherit;
  gap: 0.45rem 0.6rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.a11y-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--primary);
  text-decoration: none;
  font-size: 1rem;
}

button.a11y-link {
  cursor: pointer;
  padding: 0;
  margin: 0;
  font: inherit;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}

.a11y-link:hover {
  background: var(--accent-soft);
  border-color: rgba(14, 165, 233, 0.35);
  color: var(--accent-hover);
}

.a11y-link--top {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .nav-extras {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 100%;
  }

  .nav-search-slot {
    flex: 1 1 130px;
    max-width: none;
  }
}

@media (max-width: 520px) {
  .nav-search-slot {
    flex: 1 1 100px;
    max-width: 180px;
  }

  .nav-extras .search-form--nav input {
    padding: 0.35rem 0.5rem;
    padding-left: 0.55rem;
    padding-right: 0.4rem;
  }

  .nav-extras .search-form--nav button {
    padding: 0.3rem 0.4rem;
    min-width: 2rem;
    min-height: 1.95rem;
  }

  .nav-extras .search-form--nav button svg {
    width: 15px;
    height: 15px;
  }
}

/* ——— Главное меню ——— */
.nav-wrap {
  margin: 0;
  background: rgba(10, 25, 47, 0.82);
  position: sticky;
  top: 0;
  z-index: 150;
  box-shadow: 0 8px 24px -16px rgba(8, 20, 36, 0.7);
  backdrop-filter: blur(8px) saturate(1.08);
  -webkit-backdrop-filter: blur(8px) saturate(1.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

/* Главная: навигатор поверх карусели + центрирование меню */
body[data-active-nav="home"] .nav-wrap {
  position: sticky;
  top: 0;
  margin-bottom: -3.35rem;
  z-index: 220;
  background: rgba(10, 25, 47, 0.52);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
}

@media (min-width: 1025px) {
  body[data-active-nav="home"] .nav-wrap__inner {
    justify-content: center;
    position: relative;
  }

  body[data-active-nav="home"] .nav-brand {
    position: absolute;
    left: max(0.6rem, env(safe-area-inset-left, 0px));
    top: 50%;
    transform: translateY(-50%);
    margin-right: 0;
    padding-right: 0;
  }

  body[data-active-nav="home"] .nav-wrap__inner > .main-nav {
    margin: 0 auto;
  }

  body[data-active-nav="home"] .nav-wrap__inner > .nav-extras {
    position: absolute;
    right: max(0.6rem, env(safe-area-inset-right, 0px));
    top: 50%;
    transform: translateY(-50%);
  }
}

/* В одну линию с логотипом (site-header__inner) и контентом main */
.nav-wrap__inner {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 0 max(0.6rem, env(safe-area-inset-left, 0px)) 0 max(0.6rem, env(safe-area-inset-right, 0px));
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: center;
  gap: 0.5rem 1rem;
  position: relative;
  min-height: 3.35rem;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #fff;
  flex: 0 0 auto;
  min-width: 0;
  padding-right: 0.5rem;
  margin-right: 0.25rem;
}

.nav-brand__mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.nav-brand__mark img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.nav-brand__text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.1;
}

.nav-brand__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.nav-brand__subtitle {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.78);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-wrap__inner > .main-nav {
  flex: 1 1 auto;
  min-width: 0;
  align-self: stretch;
  display: flex;
  justify-content: center;
  margin: 0;
  padding-right: 2.6rem;
  padding-left: 5cm;
}

/* Одна строка; узкий слот поиска в потоке + компактные отступы — без полос прокрутки */
@media (min-width: 1025px) {
  .main-nav > ul {
    flex-wrap: nowrap;
  }

  .nav-wrap__inner > .main-nav {
    min-width: 0;
    flex-shrink: 1;
    margin-left: 0;
  }

  .main-nav > ul > li > a {
    padding: 0 0.72rem;
    font-size: 0.875rem;
  }
}

.nav-wrap__inner > .nav-extras {
  align-self: center;
  position: absolute;
  right: max(0.6rem, env(safe-area-inset-right, 0px));
  top: 50%;
  transform: translateY(-50%);
}

.nav-wrap__inner > .menu-toggle {
  align-self: center;
}

/* Спейсеры: пункты меню слева вровень с логотипом; свободное место — между меню и поиском */
.nav-wrap__spacer {
  min-width: 0;
}

.nav-wrap__spacer--before {
  flex: 0 0 0;
  width: 0;
  min-width: 0;
  overflow: hidden;
}

.nav-wrap__spacer--after {
  flex: 1 1 0;
}

@media (min-width: 1025px) {
  /* В потоке только ширина иконки; раскрытие формы — влево поверх меню, без «резерва» 200px */
  .nav-search-slot {
    flex: 0 0 2.35rem;
    width: 2.35rem;
    min-width: 2.35rem;
    max-width: 2.35rem;
    position: relative;
    justify-content: flex-end;
    overflow: visible;
  }

  .nav-extras .search-form--nav {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    flex: none;
    width: 2.35rem;
    max-width: 2.35rem;
    justify-content: flex-end;
    overflow: hidden;
    transition: width 0.4s var(--ease-out), max-width 0.4s var(--ease-out);
  }

  .nav-extras .search-form--nav:hover,
  .nav-extras .search-form--nav:focus-within {
    width: 200px;
    max-width: 200px;
    justify-content: flex-start;
    z-index: 8;
  }

  .nav-extras .search-form--nav input {
    flex: 1 1 0%;
    min-width: 0;
    max-width: 0;
    opacity: 0;
    padding-left: 0;
    padding-right: 0;
    transition: max-width 0.38s var(--ease-out), opacity 0.2s var(--ease-out), padding 0.3s var(--ease-out);
  }

  .nav-extras .search-form--nav:hover input,
  .nav-extras .search-form--nav:focus-within input {
    max-width: 11rem;
    opacity: 1;
    padding-left: 0.65rem;
    padding-right: 0.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  @media (min-width: 1025px) {
    .nav-extras .search-form--nav,
    .nav-extras .search-form--nav input {
      transition-duration: 0.01ms;
    }
  }
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  border-radius: var(--radius);
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

.menu-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
}

.main-nav {
  flex: 0 1 auto;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  flex: 0 1 auto;
  align-content: stretch;
  gap: 0;
  min-height: 100%;
  justify-content: center;
}

.main-nav > ul > li {
  position: relative;
  display: flex;
  align-items: stretch;
}

.main-nav > ul > li > a {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  min-height: 3.35rem;
  box-sizing: border-box;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.main-nav > ul > li > a:hover,
.main-nav > ul > li > a:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.main-nav > ul > li > a[aria-current="page"] {
  border-bottom-color: #7dd3fc;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* Подменю */
.main-nav .submenu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 280px;
  max-height: 70vh;
  overflow-y: auto;
  margin: 0;
  padding: 0.5rem 0;
  background: var(--bg-surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-strong);
  border-top: none;
  z-index: 160;
}

.main-nav .submenu a {
  display: block;
  padding: 0.45rem 1rem;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.main-nav .submenu a:hover {
  background: var(--accent-soft);
  color: var(--primary);
}

.main-nav > ul > li:hover .submenu,
.main-nav > ul > li:focus-within .submenu {
  display: block;
}

/* ——— Контент ——— */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--rhythm) * 2) max(1.25rem, env(safe-area-inset-left, 0px)) calc(var(--rhythm) * 3)
    max(1.25rem, env(safe-area-inset-right, 0px));
}

body[data-active-nav="home"] main {
  padding-top: 0;
}

/* Референдум / информационный баннер */
.gov-banner {
  margin-bottom: 2rem;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--primary);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.gov-banner::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #c9a227 0%, #e8d48b 40%, #c9a227 100%);
  opacity: 0.95;
}

.gov-banner__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.35rem 1.65rem;
  position: relative;
  z-index: 1;
}

.gov-banner__text h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.gov-banner__text p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.95;
}

.gov-banner__text a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.gov-banner__media {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: 0.75rem;
  align-items: center;
  flex: 1 1 17rem;
  min-width: 0;
  max-width: min(100%, 26rem);
}

.gov-banner__media-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  object-fit: contain;
}

/* Сетка: новости + объявления */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 840px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

.section-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: 1.35rem 1.45rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: box-shadow 0.25s var(--ease-out), border-color 0.25s;
}

.section-card:hover {
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--accent-soft);
  border-color: var(--border-strong);
}

.section-card__head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.1rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.section-card__head svg,
.section-card__icon {
  flex-shrink: 0;
  opacity: 0.9;
  color: var(--accent-hover);
}

.section-card__icon {
  width: 1.6rem;
  height: 1.6rem;
}

/* Спрайт: задавайте размер через width/height на <svg class="as-icon"> */
.as-icon {
  flex-shrink: 0;
}

.news-list,
.announce-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.content-card {
  padding: 1.05rem 1.1rem;
  border-radius: var(--radius-lg);
  background: var(--bg-page);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 100%;
  transition: box-shadow 0.2s var(--ease-out), border-color 0.2s;
}

.content-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}

.content-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.content-card h3 a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.content-card h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.content-card__meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.content-card__meta-icon {
  flex-shrink: 0;
  opacity: 0.9;
  color: inherit;
}

.content-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
  max-width: 65ch;
}

.content-card .read-more {
  font-weight: 600;
  font-size: 0.875rem;
  align-self: flex-start;
  color: var(--accent);
  text-decoration: none;
}

.content-card .read-more:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.home-heading {
  margin: 0 0 1.35rem;
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
  position: relative;
  padding-bottom: 0.65rem;
}

.home-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 3.25rem;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

/* Плитки услуг */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.6rem;
}

@media (max-width: 900px) {
  .tile-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .tile-grid {
    grid-template-columns: 1fr;
  }
}

.tile {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), border-color 0.2s;
}

.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.tile:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

.tile__media {
  aspect-ratio: 4 / 3;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  padding: 1rem;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-light);
}

.tile__media svg {
  width: min(100%, 140px);
  height: auto;
  position: relative;
  z-index: 1;
}

.tile__icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: translateY(-30px) scale(1.22);
  transform-origin: center top;
  transition: transform 0.25s var(--ease-out);
}

.tile:hover .tile__icon {
  transform: translateY(-18px) scale(1.28);
}

.tile__icon--lift {
  transform: translateY(-53px) scale(1.22);
}

.tile:hover .tile__icon--lift {
  transform: translateY(-40px) scale(1.28);
}

.tile__icon--meter {
  transform: translateY(-56px) scale(1.34);
}

.tile:hover .tile__icon--meter {
  transform: translateY(-50px) scale(1.4);
}

.tile__icon--service-center {
  transform: translateY(-5Л4px) scale(1.36);
}

.tile:hover .tile__icon--service-center {
  transform: translateY(-28px) scale(1.42);
}

.tile__label {
  padding: 1.05rem 1rem 1.2rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
  line-height: 1.35;
  letter-spacing: -0.01em;
  background: var(--bg-surface);
}

@media (prefers-reduced-motion: reduce) {
  .tile,
  .content-card:hover,
  .section-card:hover {
    transition: none;
  }

  .tile:hover {
    transform: none;
  }

  .content-card:hover {
    transform: none;
  }
}

/* Футер */
.site-footer {
  background: var(--nav-bg);
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  padding: 1.35rem 1rem;
  font-size: 0.875rem;
  position: relative;
}

.site-footer p {
  margin: 0;
  position: relative;
  z-index: 1;
}

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 3rem;
  height: 3rem;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent) 0%, #06b6d4 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(255, 255, 255, 0.25) inset, 0 8px 32px rgba(14, 165, 233, 0.45);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-out), visibility 0.3s, transform 0.3s var(--ease-spring);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-4px) scale(1.06);
  filter: brightness(1.05);
}

/* Мобильное меню */
@media (max-width: 1024px) {
  .menu-toggle {
    display: flex;
    flex-shrink: 0;
  }

  .nav-brand {
    order: 0;
    margin-right: auto;
  }

  .nav-brand__subtitle {
    display: none;
  }

  .nav-wrap__inner {
    align-items: center;
    flex-wrap: wrap;
  }

  .nav-wrap__spacer {
    display: none;
  }

  .nav-extras {
    flex: 1 1 0;
    min-width: 0;
    order: 2;
    align-items: center;
    margin-left: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 0.45rem;
  }

  .nav-search-slot {
    max-width: none;
    flex: 1 1 120px;
    position: static;
    width: auto;
    min-width: 0;
    justify-content: flex-start;
  }

  .nav-extras .search-form--nav {
    position: static;
    transform: none;
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
  }

  .menu-toggle {
    order: 1;
  }

  /* Специфичнее .nav-wrap__inner > .main-nav { display: flex } с десктопа — иначе меню не скрывается */
  .nav-wrap__inner > .main-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--nav-gradient);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    max-height: min(70vh, 480px);
    overflow-y: auto;
    flex: none;
    align-self: stretch;
    width: 100%;
    box-sizing: border-box;
  }

  .nav-wrap__inner > .main-nav.is-open {
    display: block;
  }

  .main-nav > ul {
    flex-direction: column;
  }

  .main-nav > ul > li > a {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .main-nav > ul > li > a[aria-current="page"] {
    border-left: 3px solid #7dd3fc;
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  .main-nav .submenu {
    position: static;
    display: none;
    max-height: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.15);
    padding: 0.25rem 0;
  }

  .main-nav > ul > li.submenu-open .submenu {
    display: block;
  }

  .main-nav .submenu a {
    padding-left: 1.5rem;
    color: rgba(255, 255, 255, 0.92);
  }

  .main-nav .submenu a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }

  .main-nav > ul > li:hover .submenu {
    display: none;
  }

  .main-nav > ul > li.submenu-open:hover .submenu {
    display: block;
  }

  .main-nav > ul > li > a {
    white-space: normal;
    padding: 0.75rem 1rem;
    min-height: 2.85rem;
  }
}

/* Узкие экраны и телефоны */
@media (max-width: 640px) {
  body {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  .top-bar__inner {
    padding-top: max(0.5rem, env(safe-area-inset-top, 0px));
  }

  .top-bar {
    font-size: 0.78rem;
  }

  .top-bar__phones {
    flex-wrap: wrap;
    row-gap: 0.2rem;
    column-gap: 0.5rem;
  }

  .site-header__inner {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    gap: 0.85rem;
  }

  .logo__title {
    font-size: 1.2rem;
  }

  .logo__subtitle {
    font-size: 0.68rem;
    letter-spacing: 0.04em;
  }

  .logo__mark img,
  .logo__mark svg {
    width: 42px;
    height: 42px;
  }

  main {
    padding: 1.35rem max(0.85rem, env(safe-area-inset-left, 0px)) 2.5rem max(0.85rem, env(safe-area-inset-right, 0px));
  }

  .gov-banner {
    margin-bottom: 1.5rem;
    border-radius: var(--radius-lg);
  }

  .gov-banner__inner {
    padding: 1rem 1.1rem;
    gap: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .gov-banner__text h2 {
    font-size: clamp(1rem, 4.5vw, 1.2rem);
    line-height: 1.25;
    letter-spacing: 0.01em;
  }

  .gov-banner__text p {
    font-size: 0.875rem;
    line-height: 1.45;
  }

  .gov-banner__media {
    flex: 1 1 auto;
    max-width: 100%;
    align-self: stretch;
  }

  .nav-wrap__inner {
    min-height: 3rem;
  }

  .two-col {
    gap: 1.2rem;
    margin-bottom: 1.85rem;
  }

  .section-card {
    padding: 1.05rem 1rem;
    border-radius: var(--radius-lg);
  }

  .section-card__head {
    font-size: 1.05rem;
  }

  .content-card {
    padding: 0.95rem 1rem;
  }

  .content-card h3 {
    font-size: 0.95rem;
  }

  .home-heading {
    margin-bottom: 1.1rem;
    padding-bottom: 0.55rem;
  }

  .tile-grid {
    gap: 1rem;
    margin-bottom: 1.25rem;
  }

  .tile__label {
    padding: 0.95rem 0.85rem 1.05rem;
    font-size: 0.9rem;
  }

  .tile__icon {
    width: 100%;
    height: 100%;
  }

  .back-to-top {
    right: max(0.75rem, env(safe-area-inset-right, 0px));
    bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
    width: 2.7rem;
    height: 2.7rem;
  }

  .site-footer {
    padding: 1.15rem max(1rem, env(safe-area-inset-left, 0px)) 1.15rem max(1rem, env(safe-area-inset-right, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-wrap {
    animation: none !important;
  }

  .back-to-top:hover {
    transform: none;
  }
}

/* ——— Единые поверхности (как на прежней главной) ——— */
body {
  background: #f6f8fb;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border-light);
}

.nav-wrap {
  background: #0f3d66;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 20px -12px rgba(15, 61, 102, 0.55);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body[data-active-nav="home"] .nav-wrap {
  background: rgba(10, 25, 47, 0.52);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
}

.section-card,
.content-card,
.tile {
  background: #fff;
  border: 1px solid var(--border-light);
}

.gov-banner {
  color: #fff;
  background: var(--primary);
}

.gov-banner .gov-banner__text a {
  color: #fff;
}

/* Подъём при наведении только у плиток «Сервисы»; новости/объявления — без сдвига */
.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -18px rgba(15, 61, 102, 0.35);
}

/* Hero-first layout */
.modern-hero {
  margin-bottom: 1.8rem;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid var(--border-light);
  color: var(--text);
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.95fr);
  gap: 1.5rem;
  align-items: stretch;
  box-shadow: var(--shadow-sm);
}

.modern-hero__eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
}

.modern-hero h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.45rem, 2.75vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  max-width: 26ch;
}

.modern-hero__lead {
  margin: 0;
  max-width: 58ch;
  color: var(--text-muted);
}

.modern-hero__actions {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.modern-hero__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.2s var(--ease-out), background-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.modern-hero__btn--primary {
  background: #0f3d66;
  color: #fff;
}

.modern-hero__btn--ghost {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary);
}

.modern-hero__btn:hover {
  transform: translateY(-2px);
}

.modern-hero__stats {
  display: grid;
  gap: 0.7rem;
}

.hero-showcase {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: 0;
  margin-bottom: 1.7rem;
}

.hero-carousel--full {
  position: relative;
  width: 100%;
  height: 95vh;
  height: 95dvh;
  overflow: hidden;
  background: #0f3d66;
}

.hero-carousel__track {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-carousel__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(100%) scale(1.02);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
  pointer-events: none;
}

.hero-carousel__slide.is-before {
  transform: translateX(-100%) scale(1.02);
}

.hero-carousel__slide.is-after {
  transform: translateX(100%) scale(1.02);
}

.hero-carousel__slide.is-active {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.hero-carousel__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-carousel__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.68) 0%, rgba(0, 0, 0, 0.26) 45%, rgba(0, 0, 0, 0.12) 100%);
}

.hero-carousel__content {
  position: absolute;
  left: clamp(1rem, 6vw, 6rem);
  right: 1rem;
  /* выше от низа кадра — заголовок и текст читаются выше точки интереса видео */
  bottom: clamp(4.5rem, 18vh, 9rem);
  max-width: min(780px, 84vw);
  color: #fff;
}

.hero-carousel__content h2 {
  margin: 0 0 0.45rem;
  font-size: clamp(2.25rem, 5.5vw, 4rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  font-weight: 500;
  max-width: 18ch;
}

.hero-carousel__content p {
  margin: 0 0 1.25rem;
  font-size: clamp(1rem, 1.75vw, 1.125rem);
  line-height: 1.58;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 400;
  max-width: 42ch;
}

.hero-carousel__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0.55rem 1.2rem;
  border-radius: 10px;
  background: #1b66d1;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.15s ease;
}

.hero-carousel__cta:hover {
  background: #1759b7;
  transform: scale(1.03);
}

.hero-carousel__cta:active {
  background: #154a9a;
  transform: scale(0.98);
}

.hero-carousel__cta:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.9);
  outline-offset: 3px;
}

.hero-carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.92);
  color: #0f3d66;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  z-index: 2;
}

.hero-carousel__btn--prev {
  left: clamp(0.5rem, 2vw, 2rem);
}

.hero-carousel__btn--next {
  right: clamp(0.5rem, 2vw, 2rem);
}

.hero-carousel__dots {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  display: flex;
  gap: 0.45rem;
  z-index: 2;
}

.hero-carousel__dot {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.54);
  cursor: pointer;
  transition: width 0.2s var(--ease-out), background-color 0.2s var(--ease-out);
}

.hero-carousel__dot.is-active {
  width: 1.65rem;
  background: #fff;
}

.modern-stat {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  align-items: center;
  column-gap: 0.6rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-lg);
  background: #f8fbff;
  border: 1px solid #dbe8f5;
}

.modern-stat__icon {
  color: #0f3d66;
}

.modern-stat__text {
  min-width: 0;
}

.modern-stat strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.2;
}

.modern-stat span {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.reveal-up {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.reveal-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .hero-carousel__btn {
    width: 2rem;
    height: 2rem;
    font-size: 1.2rem;
  }
}

@media (max-width: 640px) {
  .modern-hero {
    margin-bottom: 1.35rem;
    padding: 1.2rem 1rem;
    border-radius: var(--radius-lg);
  }

  .modern-hero__actions {
    width: 100%;
  }

  .modern-hero__btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 1024px) {
  .modern-hero {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-up,
  .modern-hero__btn,
  .hero-carousel__slide {
    transition: none !important;
  }

  .hero-carousel__cta:hover,
  .hero-carousel__cta:active {
    transform: none;
  }
}
