/*
Theme Name: Петергоф ДДЮТ
Description: Современная тема для государственного бюджетного учреждения дополнительного образования Дворец детского (юношеского) творчества Петродворцового района Санкт-Петербурга "ПЕТЕРГОФ"
Author: Косарев Андрей
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: peterhof
*/

/* ══════════════════════════════════════════════════════════
   Основные стили темы
   ══════════════════════════════════════════════════════════ */

:root {
  --color-blue-50: #eff6ff;
  --color-blue-400: #60a5fa;
  --color-blue-500: #3b82f6;
  --color-blue-600: #2563eb;
  --color-slate-50: #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-300: #cbd5e1;
  --color-slate-400: #94a3b8;
  --color-slate-500: #64748b;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --color-slate-800: #1e293b;
  --color-slate-900: #0f172a;
  --color-amber-50: #fffbeb;
  --color-amber-500: #f59e0b;
  --color-amber-600: #d97706;
  --color-emerald-50: #ecfdf5;
  --color-emerald-600: #059669;
  --color-rose-50: #fff1f2;
  --color-rose-600: #e11d48;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-slate-900);
  background-color: #fff;
}

/* Main content wrapper - растягивается */
.site-header ~ *:not(.site-footer):not(.widget-sidebar),
.main-layout,
main {
  flex: 1 0 auto;
}

/* Footer всегда внизу */
.site-footer {
  flex-shrink: 0;
  margin-top: auto;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: var(--color-blue-600);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-blue-700);
}

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

/* Container */
.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container { padding: 0 1.5rem; }
}

@media (min-width: 1024px) {
  .container { padding: 0; }
}

/* Header */
.site-header {
  background: var(--color-slate-900);
  border-bottom: 1px solid var(--color-slate-800);
  position: sticky;
  top: 0;
  z-index: 1100;
}

.header-container {
  max-width: 75%;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Manrope', sans-serif;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: transparent;
}

.logo-text-group {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
}

.logo-title {
  font-size: 1rem;
  font-weight: 700;
  color: inherit;
}

.logo-subtitle {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--color-slate-400);
  opacity: 0.9;
}

@media (max-width: 768px) {
  .logo-subtitle {
    display: none;
  }
  .logo-title {
    font-size: 0.875rem;
  }
}

a.site-logo:hover,
a.site-logo:focus {
  background: rgba(255,255,255,0.1);
  color: #fff;
  transform: translateY(-1px);
  text-decoration: none;
}

.site-logo span,
.site-logo .logo-title,
.site-logo .logo-subtitle {
  color: inherit;
}

a.site-logo:hover span,
a.site-logo:focus span,
a.site-logo:hover .logo-title,
a.site-logo:focus .logo-title {
  color: #fff;
}

a.site-logo:hover .logo-subtitle,
a.site-logo:focus .logo-subtitle {
  color: var(--color-slate-300);
}

.logo-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 18px;
  aspect-ratio: 1 / 1;
}

/* Кастомный логотип */
.custom-logo-img {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .custom-logo-img {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    max-width: 32px;
    max-height: 32px;
  }
}

a.site-logo:hover .logo-icon,
a.site-logo:focus .logo-icon {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: rotate(-5deg) scale(1.05);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.site-nav {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 1024px) {
  .site-nav {
    display: flex;
    gap: 0.25rem;
    list-style: none;
  }
}

/* Убираем маркеры списка из всех элементов меню */
.site-nav,
.site-nav ul,
.site-nav li,
.site-nav .menu-item,
.site-nav .sub-menu {
  list-style: none;
  list-style-type: none;
}

/* Dropdown меню */
.menu-item {
  position: relative;
  list-style: none;
  list-style-type: none;
}

.menu-item > a {
  padding: 0.5rem 1rem;
  color: var(--color-slate-300);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.menu-item > a:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.menu-item.current-menu-item > a,
.menu-item.current-page-ancestor > a {
  color: #fff;
  background: var(--color-blue-600);
}

/* Стрелка для пунктов с подменю - только на десктопе */
@media (min-width: 1024px) {
  .menu-item-has-children > a::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 4px;
    transition: transform 0.2s;
  }

  .menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
  }
}

/* Подменю (dropdown) */
.sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #1e293b;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  padding: 0.5rem 0;
  z-index: 1000;
  margin-top: 0;
}

/* Невидимая область для плавного перехода курсора к подменю */
.sub-menu::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.menu-item-has-children:hover > .sub-menu {
  display: block;
}

.sub-menu .menu-item > a {
  padding: 0.625rem 1rem;
  color: var(--color-slate-300);
  font-size: 0.8125rem;
  border-radius: 0;
  display: block;
}

.sub-menu .menu-item > a:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.sub-menu .menu-item.current-menu-item > a {
  color: #fff;
  background: var(--color-blue-600);
}

/* Вложенные подменю */
.sub-menu .sub-menu {
  top: 0;
  left: 100%;
  margin-top: 0;
  margin-left: 0.25rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  color: var(--color-slate-300);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.nav-link.active {
  color: #fff;
  background: var(--color-blue-600);
}

/* Hero */
.hero-section {
  position: relative;
  height: 520px;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero-section { height: 600px; }
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.3));
}

.hero-content {
  position: relative;
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 4rem;
}

@media (min-width: 768px) {
  .hero-content { padding-bottom: 5rem; }
}

.hero-badge {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  width: fit-content;
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  max-width: 48rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .hero-title { font-size: 3rem; }
}

@media (min-width: 1024px) {
  .hero-title { font-size: 3.75rem; }
}

.hero-title .highlight {
  color: var(--color-blue-400);
}

.hero-description {
  font-size: 1rem;
  color: var(--color-slate-300);
  max-width: 42rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .hero-description { font-size: 1.125rem; }
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-blue-500);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-blue-600);
  color: #fff;
}

.btn-outline {
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  background: transparent;
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* Вариант для светлого фона */
.btn-outline-light {
  border: 1px solid var(--color-blue-500);
  color: var(--color-blue-500);
  background: transparent;
}

.btn-outline-light:hover {
  background: var(--color-blue-50);
  color: var(--color-blue-600);
}

/* Stats Bar */
.stats-section {
  background: var(--color-slate-900);
  border-top: 1px solid var(--color-slate-800);
}

.stats-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .stats-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  font-family: 'Manrope', sans-serif;
}

@media (min-width: 768px) {
  .stat-value { font-size: 2rem; }
}

.stat-label {
  font-size: 0.875rem;
  color: var(--color-slate-400);
  margin-top: 0.25rem;
}

/* Layout with Sidebar */
.main-layout {
  max-width: 75%;
  margin: 0 auto;
  padding: 0 2rem;
}

.content-area {
  width: 100%;
}

/* Fixed Widget Sidebar */
.widget-sidebar {
  display: none;
}

/* ═══════════════════════════════════════════════════════
   МОБИЛЬНЫЙ САЙДБАР - КНОПКА-ТОГГЛ
   ═══════════════════════════════════════════════════════ */
.mobile-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 56px;
  height: 56px;
  background: var(--color-blue-600);
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  z-index: 998;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}

.mobile-sidebar-toggle:hover {
  background: var(--color-blue-700);
  transform: scale(1.05);
}

.mobile-sidebar-toggle svg {
  width: 24px;
  height: 24px;
}

/* Мобильный сайдбар-панель */
.mobile-sidebar-panel {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 75vh;
  background: white;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  overflow: hidden;
  touch-action: pan-y;
}

.mobile-sidebar-panel.open {
  transform: translateY(0);
}

/* Индикатор свайпа */
.mobile-sidebar-header::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: var(--color-slate-300);
  border-radius: 2px;
}

.mobile-sidebar-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--color-slate-200);
  background: var(--color-slate-50);
}

.mobile-sidebar-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-slate-900);
  margin: 0;
}

/* Кнопка закрытия виджетов - скрыта */
.mobile-sidebar-close {
  display: none !important;
}

.mobile-sidebar-content {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: calc(75vh - 60px);
}

.mobile-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-sidebar-overlay.open {
  opacity: 1;
}

/* Показываем мобильный сайдбар-тоггл на планшетах и телефонах */
@media (max-width: 1199px) {
  .mobile-sidebar-toggle {
    display: flex;
  }
  
  .mobile-sidebar-panel {
    display: block;
  }
  
  .mobile-sidebar-close {
    display: flex;
  }
  
  .mobile-sidebar-overlay {
    display: block;
    pointer-events: none;
  }
  
  .mobile-sidebar-overlay.open {
    pointer-events: auto;
  }
}

/* ═══════════════════════════════════════════════════════
   КНОПКА "ВЕРНУТЬСЯ НАВЕРХ"
   ═══════════════════════════════════════════════════════ */
.scroll-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: var(--color-slate-800);
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 997;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.2s;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: var(--color-slate-700);
  transform: translateY(-2px);
}

.scroll-to-top svg {
  width: 20px;
  height: 20px;
}

@media (min-width: 1200px) {
  /* Показываем виджеты на всех страницах */
  .widget-sidebar {
    display: block !important;
    position: fixed;
    top: 100px;
    right: 12.5%;
    width: 260px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    z-index: 100;
  }
  
  /* Обычные страницы - контент центрирован, виджеты справа */
  body:not(.home):not(.page-template-page-info) .main-layout {
    max-width: calc(75% - 300px);
    margin: 0 auto;
    margin-right: calc(12.5% + 300px);
    margin-left: 12.5%;
    padding: 0;
  }
  
  /* Главная страница - flex layout */
  body.home .main-layout {
    display: flex;
    gap: 2rem;
    max-width: 75%;
    margin: 0 auto;
    padding: 0;
  }
  
  body.home .main-layout > .content-area {
    flex: 1;
    min-width: 0;
  }
  
  /* Виджеты на главной - sticky внутри flex */
  body.home .widget-sidebar {
    position: sticky !important;
    top: 100px !important;
    width: 280px !important;
    flex-shrink: 0;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    right: auto !important;
    padding-top: 1.5rem;
  }
  
  .widget-sidebar::-webkit-scrollbar {
    width: 3px;
  }
  .widget-sidebar::-webkit-scrollbar-track {
    background: transparent;
  }
  .widget-sidebar::-webkit-scrollbar-thumb {
    background: var(--color-slate-200);
    border-radius: 2px;
  }
}

@media (min-width: 1400px) {
  body:not(.home):not(.page-template-page-info) .main-layout {
    max-width: calc(75% - 320px);
    margin-right: calc(12.5% + 320px);
  }
  
  body:not(.home) .widget-sidebar {
    width: 280px;
  }
}

.sidebar-inner {
  /* пусто */
}

/* ═══════════════════════════════════════════════════════
   PAGE-INFO Layout (со своим боковым меню слева)
   ═══════════════════════════════════════════════════════ */
.page-template-page-info .main-layout {
  display: flex !important;
  max-width: 75%;
  margin: 0 auto;
  padding: 0 !important;
  gap: 0;
  overflow-x: hidden;
}

.page-template-page-info .main-layout > .info-sidebar {
  width: 280px;
  flex-shrink: 0;
}

.page-template-page-info .main-layout > .content-area {
  flex: 1;
  min-width: 0;
}

@media (min-width: 1200px) {
  .page-template-page-info .main-layout {
    max-width: calc(75% - 300px);
    margin-right: calc(12.5% + 300px) !important;
    margin-left: 12.5% !important;
  }
}

@media (min-width: 1400px) {
  .page-template-page-info .main-layout {
    max-width: calc(75% - 320px);
    margin-right: calc(12.5% + 320px) !important;
  }
}

/* Widgets */
.widget {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 0 1.25rem 0;
  margin-bottom: 1.25rem;
  box-shadow: none;
  border-bottom: 1px solid var(--color-slate-100);
}

.widget:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.widget-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-slate-500);
  margin-bottom: 0.75rem;
}

/* Section */
.section {
  padding: 4rem 0;
}

@media (min-width: 768px) {
  .section { padding: 6rem 0; }
}

.section-header {
  margin-bottom: 2.5rem;
  border-left: 3px solid var(--color-blue-500);
  padding-left: 1rem;
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--color-blue-600);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-slate-900);
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .section-title { font-size: 1.875rem; }
}

.section-description {
  font-size: 1rem;
  color: var(--color-slate-500);
  max-width: 42rem;
}

/* Card Grid */
.card-grid {
  display: grid;
  gap: 1.25rem;
}

.card-grid-2 { grid-template-columns: repeat(1, 1fr); }
.card-grid-3 { grid-template-columns: repeat(1, 1fr); }
.card-grid-4 { grid-template-columns: repeat(1, 1fr); }

@media (min-width: 640px) {
  .card-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .card-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .card-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .card-grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Card */
.card {
  background: #fff;
  border: 1px solid var(--color-slate-200);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s;
  height: 100%;
}

.card:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.card-content {
  padding: 1.5rem;
}

.card-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-slate-900);
  margin-bottom: 0.5rem;
}

.card-description {
  font-size: 0.875rem;
  color: var(--color-slate-500);
  line-height: 1.6;
}

.card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.3s;
}

.card:hover .card-image {
  transform: scale(1.05);
}

/* Hero Slider */
.hero-slider {
  position: relative;
  background: var(--color-slate-900);
  overflow: hidden;
}

.hero-slider-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

.hero-slider-track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.hero-slider-track::-webkit-scrollbar {
  display: none;
}

.hero-slide {
  flex: 0 0 300px;
  scroll-snap-align: start;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-slate-200);
}

@media (min-width: 768px) {
  .hero-slide { flex: 0 0 350px; }
}

.hero-slide-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.hero-slide-content {
  padding: 1.25rem;
}

.hero-slide-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-slate-900);
  margin-bottom: 0.5rem;
}

.hero-slide-caption {
  font-size: 0.875rem;
  color: var(--color-slate-600);
  line-height: 1.5;
}

/* Footer */
.site-footer {
  background: var(--color-slate-900);
  color: var(--color-slate-300);
  padding: 3rem 0 1.5rem;
  border-top: 1px solid var(--color-slate-800);
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

.footer-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--color-slate-400);
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid var(--color-slate-800);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-slate-500);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ПАНЕЛЬ ДОСТУПНОСТИ - ГОСТ СТАНДАРТ ДЛЯ ГОССАЙТОВ
   ═══════════════════════════════════════════════════════════════════════════ */

/* Основная панель */
.a11y-panel {
  font-family: 'Manrope', Arial, sans-serif;
}

/* Главная кнопка включения */
.a11y-main-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 1rem;
  background: var(--color-slate-100);
  color: var(--color-slate-700);
  border: 1px solid var(--color-slate-200);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.a11y-main-toggle:hover {
  background: var(--color-slate-200);
}

.a11y-main-toggle.active {
  background: #f59e0b;
  color: white;
  border-color: #d97706;
}

.a11y-main-toggle .a11y-icon {
  flex-shrink: 0;
}

/* Панель настроек */
.a11y-settings {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--color-slate-50);
  border: 1px solid var(--color-slate-200);
  border-radius: 6px;
}

/* Группа настроек */
.a11y-group {
  margin-bottom: 0.625rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--color-slate-200);
}

.a11y-group:last-of-type {
  margin-bottom: 0.75rem;
}

.a11y-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-slate-500);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.375rem;
}

/* Кнопки цветовых схем */
.a11y-colors {
  display: flex;
  gap: 0.375rem;
}

.a11y-color-btn {
  flex: 1;
  padding: 0;
  border: 2px solid var(--color-slate-300);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  overflow: hidden;
}

.a11y-color-btn span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  font-size: 0.8125rem;
  font-weight: 700;
}

.a11y-color-btn:hover {
  border-color: var(--color-blue-400);
}

.a11y-color-btn.active {
  border-color: var(--color-blue-500);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* Кнопки размера шрифта */
.a11y-font-sizes {
  display: flex;
  gap: 0.375rem;
}

.a11y-font-btn {
  flex: 1;
  padding: 0.375rem 0;
  border: 1px solid var(--color-slate-300);
  border-radius: 4px;
  background: white;
  color: var(--color-slate-700);
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 600;
}

.a11y-font-btn[data-size="normal"] { font-size: 0.75rem; }
.a11y-font-btn[data-size="large"] { font-size: 0.9375rem; }
.a11y-font-btn[data-size="xlarge"] { font-size: 1.125rem; }

.a11y-font-btn:hover {
  border-color: var(--color-blue-400);
  background: var(--color-blue-50);
}

.a11y-font-btn.active {
  background: var(--color-blue-500);
  color: white;
  border-color: var(--color-blue-500);
}

/* Кнопки интервала */
.a11y-spacing {
  display: flex;
  gap: 0.375rem;
}

.a11y-spacing-btn {
  flex: 1;
  padding: 0.375rem 0;
  border: 1px solid var(--color-slate-300);
  border-radius: 4px;
  background: white;
  color: var(--color-slate-700);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.a11y-spacing-btn:hover {
  border-color: var(--color-blue-400);
  background: var(--color-blue-50);
}

.a11y-spacing-btn.active {
  background: var(--color-blue-500);
  color: white;
  border-color: var(--color-blue-500);
}

/* Кнопки изображений */
.a11y-images {
  display: flex;
  gap: 0.375rem;
}

.a11y-images-btn {
  flex: 1;
  padding: 0.375rem 0;
  border: 1px solid var(--color-slate-300);
  border-radius: 4px;
  background: white;
  color: var(--color-slate-700);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.a11y-images-btn:hover {
  border-color: var(--color-blue-400);
  background: var(--color-blue-50);
}

.a11y-images-btn.active {
  background: var(--color-blue-500);
  color: white;
  border-color: var(--color-blue-500);
}

/* Кнопка сброса */
.a11y-reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  border: 1px dashed var(--color-slate-300);
  border-radius: 4px;
  color: var(--color-slate-500);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.a11y-reset-btn:hover {
  background: var(--color-slate-100);
  border-color: var(--color-slate-400);
  color: var(--color-slate-600);
}

/* ═══════════════════════════════════════════════════════════════════════════
   РЕЖИМЫ ДОСТУПНОСТИ - ЦВЕТОВЫЕ СХЕМЫ (ГОСТ для госсайтов)
   ИСПРАВЛЕНО: Полное покрытие всех элементов, высокий контраст
   ═══════════════════════════════════════════════════════════════════════════ */

/* Общие стили при включённом режиме */
body.a11y-enabled {
  transition: background-color 0.3s, color 0.3s;
}

/* ═══════════════════════════════════════════════════════════════════════════
   БЕЛАЯ СХЕМА (чёрный текст на белом фоне)
   ═══════════════════════════════════════════════════════════════════════════ */
body.a11y-scheme-white {
  background-color: #ffffff !important;
  color: #000000 !important;
}

/* Все блочные элементы - белый фон */
body.a11y-scheme-white *:not(.a11y-panel):not(.a11y-panel *):not(.a11y-color-btn span) {
  background-color: #ffffff !important;
  background-image: none !important;
  background: #ffffff !important;
  border-color: #000000 !important;
}

/* Весь текст - чёрный */
body.a11y-scheme-white *:not(.a11y-panel):not(.a11y-panel *):not(.a11y-color-btn span) {
  color: #000000 !important;
}

/* Ссылки - синий с подчёркиванием */
body.a11y-scheme-white a:not(.a11y-panel a):not(.a11y-panel *) {
  color: #0000cc !important;
  text-decoration: underline !important;
}

body.a11y-scheme-white a:hover:not(.a11y-panel a):not(.a11y-panel *) {
  color: #000099 !important;
}

/* Кнопки */
body.a11y-scheme-white .btn:not(.a11y-panel .btn),
body.a11y-scheme-white button:not(.a11y-panel button):not(.a11y-panel *) {
  background-color: #ffffff !important;
  background: #ffffff !important;
  color: #000000 !important;
  border: 2px solid #000000 !important;
}

/* Формы */
body.a11y-scheme-white input:not(.a11y-panel input),
body.a11y-scheme-white textarea:not(.a11y-panel textarea),
body.a11y-scheme-white select:not(.a11y-panel select) {
  background-color: #ffffff !important;
  background: #ffffff !important;
  color: #000000 !important;
  border: 2px solid #000000 !important;
}

body.a11y-scheme-white input::placeholder,
body.a11y-scheme-white textarea::placeholder {
  color: #555555 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ЧЁРНАЯ СХЕМА (белый/жёлтый текст на чёрном фоне)
   ═══════════════════════════════════════════════════════════════════════════ */
body.a11y-scheme-black {
  background-color: #000000 !important;
  color: #ffffff !important;
}

/* Все блочные элементы - чёрный фон */
body.a11y-scheme-black *:not(.a11y-panel):not(.a11y-panel *):not(.a11y-color-btn span) {
  background-color: #000000 !important;
  background-image: none !important;
  background: #000000 !important;
  border-color: #ffffff !important;
}

/* Весь текст - белый */
body.a11y-scheme-black *:not(.a11y-panel):not(.a11y-panel *):not(.a11y-color-btn span) {
  color: #ffffff !important;
}

/* Ссылки - жёлтый с подчёркиванием (высокий контраст) */
body.a11y-scheme-black a:not(.a11y-panel a):not(.a11y-panel *) {
  color: #ffff00 !important;
  text-decoration: underline !important;
}

body.a11y-scheme-black a:hover:not(.a11y-panel a):not(.a11y-panel *) {
  color: #ffcc00 !important;
}

/* Кнопки */
body.a11y-scheme-black .btn:not(.a11y-panel .btn),
body.a11y-scheme-black button:not(.a11y-panel button):not(.a11y-panel *) {
  background-color: #000000 !important;
  background: #000000 !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
}

/* Формы */
body.a11y-scheme-black input:not(.a11y-panel input),
body.a11y-scheme-black textarea:not(.a11y-panel textarea),
body.a11y-scheme-black select:not(.a11y-panel select) {
  background-color: #000000 !important;
  background: #000000 !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
}

body.a11y-scheme-black input::placeholder,
body.a11y-scheme-black textarea::placeholder {
  color: #aaaaaa !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   СИНЯЯ СХЕМА (белый текст на тёмно-синем фоне)
   ═══════════════════════════════════════════════════════════════════════════ */
body.a11y-scheme-blue {
  background-color: #063462 !important;
  color: #ffffff !important;
}

/* Все блочные элементы - тёмно-синий фон */
body.a11y-scheme-blue *:not(.a11y-panel):not(.a11y-panel *):not(.a11y-color-btn span) {
  background-color: #063462 !important;
  background-image: none !important;
  background: #063462 !important;
  border-color: #ffffff !important;
}

/* Весь текст - белый */
body.a11y-scheme-blue *:not(.a11y-panel):not(.a11y-panel *):not(.a11y-color-btn span) {
  color: #ffffff !important;
}

/* Ссылки - жёлтый с подчёркиванием (высокий контраст) */
body.a11y-scheme-blue a:not(.a11y-panel a):not(.a11y-panel *) {
  color: #ffff00 !important;
  text-decoration: underline !important;
}

body.a11y-scheme-blue a:hover:not(.a11y-panel a):not(.a11y-panel *) {
  color: #ffcc00 !important;
}

/* Кнопки */
body.a11y-scheme-blue .btn:not(.a11y-panel .btn),
body.a11y-scheme-blue button:not(.a11y-panel button):not(.a11y-panel *) {
  background-color: #063462 !important;
  background: #063462 !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
}

/* Формы */
body.a11y-scheme-blue input:not(.a11y-panel input),
body.a11y-scheme-blue textarea:not(.a11y-panel textarea),
body.a11y-scheme-blue select:not(.a11y-panel select) {
  background-color: #063462 !important;
  background: #063462 !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
}

body.a11y-scheme-blue input::placeholder,
body.a11y-scheme-blue textarea::placeholder {
  color: #aaaaaa !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   БЕЖЕВАЯ СХЕМА (коричневый текст на бежевом фоне)
   ═══════════════════════════════════════════════════════════════════════════ */
body.a11y-scheme-beige {
  background-color: #f5f1e5 !important;
  color: #4a3c2a !important;
}

/* Все блочные элементы - бежевый фон */
body.a11y-scheme-beige *:not(.a11y-panel):not(.a11y-panel *):not(.a11y-color-btn span) {
  background-color: #f5f1e5 !important;
  background-image: none !important;
  background: #f5f1e5 !important;
  border-color: #4a3c2a !important;
}

/* Весь текст - тёмно-коричневый */
body.a11y-scheme-beige *:not(.a11y-panel):not(.a11y-panel *):not(.a11y-color-btn span) {
  color: #4a3c2a !important;
}

/* Ссылки - тёмно-коричневый с подчёркиванием */
body.a11y-scheme-beige a:not(.a11y-panel a):not(.a11y-panel *) {
  color: #6b4423 !important;
  text-decoration: underline !important;
}

body.a11y-scheme-beige a:hover:not(.a11y-panel a):not(.a11y-panel *) {
  color: #8b5a2b !important;
}

/* Кнопки */
body.a11y-scheme-beige .btn:not(.a11y-panel .btn),
body.a11y-scheme-beige button:not(.a11y-panel button):not(.a11y-panel *) {
  background-color: #f5f1e5 !important;
  background: #f5f1e5 !important;
  color: #4a3c2a !important;
  border: 2px solid #4a3c2a !important;
}

/* Формы */
body.a11y-scheme-beige input:not(.a11y-panel input),
body.a11y-scheme-beige textarea:not(.a11y-panel textarea),
body.a11y-scheme-beige select:not(.a11y-panel select) {
  background-color: #f5f1e5 !important;
  background: #f5f1e5 !important;
  color: #4a3c2a !important;
  border: 2px solid #4a3c2a !important;
}

body.a11y-scheme-beige input::placeholder,
body.a11y-scheme-beige textarea::placeholder {
  color: #7a6b5a !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   РЕЖИМЫ ДОСТУПНОСТИ - РАЗМЕР ШРИФТА
   ═══════════════════════════════════════════════════════════════════════════ */

body.a11y-font-normal {
  font-size: 16px !important;
}

body.a11y-font-large {
  font-size: 20px !important;
}

body.a11y-font-large h1 { font-size: 2.5rem !important; }
body.a11y-font-large h2 { font-size: 2rem !important; }
body.a11y-font-large h3 { font-size: 1.5rem !important; }
body.a11y-font-large p, body.a11y-font-large li, body.a11y-font-large td { font-size: 1.25rem !important; }

body.a11y-font-xlarge {
  font-size: 24px !important;
}

body.a11y-font-xlarge h1 { font-size: 3rem !important; }
body.a11y-font-xlarge h2 { font-size: 2.5rem !important; }
body.a11y-font-xlarge h3 { font-size: 2rem !important; }
body.a11y-font-xlarge p, body.a11y-font-xlarge li, body.a11y-font-xlarge td { font-size: 1.5rem !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   РЕЖИМЫ ДОСТУПНОСТИ - МЕЖБУКВЕННЫЙ ИНТЕРВАЛ
   ═══════════════════════════════════════════════════════════════════════════ */

body.a11y-spacing-normal *:not(.a11y-panel *) {
  letter-spacing: normal !important;
  word-spacing: normal !important;
}

body.a11y-spacing-wide *:not(.a11y-panel *) {
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
  line-height: 1.8 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   РЕЖИМЫ ДОСТУПНОСТИ - ИЗОБРАЖЕНИЯ
   ═══════════════════════════════════════════════════════════════════════════ */

body.a11y-images-hide img:not(.a11y-panel img),
body.a11y-images-hide picture:not(.a11y-panel picture),
body.a11y-images-hide svg:not(.a11y-panel svg):not(.a11y-icon),
body.a11y-images-hide [style*="background-image"]:not(.a11y-panel *) {
  visibility: hidden !important;
  opacity: 0 !important;
}

body.a11y-images-hide .hero-section,
body.a11y-images-hide .hero-image {
  background-image: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ПАНЕЛЬ ДОСТУПНОСТИ - СОХРАНЕНИЕ СТИЛЕЙ
   ═══════════════════════════════════════════════════════════════════════════ */

/* Панель всегда сохраняет свои стили независимо от режима */
body.a11y-enabled .a11y-panel,
body.a11y-enabled .a11y-panel * {
  background-color: initial !important;
  color: initial !important;
  border-color: initial !important;
  font-size: initial !important;
  letter-spacing: initial !important;
  word-spacing: initial !important;
  line-height: initial !important;
}

body.a11y-enabled .a11y-panel {
  background: white !important;
  padding: 0.75rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

body.a11y-enabled .a11y-main-toggle {
  background: #f59e0b !important;
  color: white !important;
  border-color: #d97706 !important;
}

body.a11y-enabled .a11y-settings {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

body.a11y-enabled .a11y-label {
  color: #64748b !important;
}

body.a11y-enabled .a11y-color-btn {
  border-color: #cbd5e1 !important;
}

body.a11y-enabled .a11y-color-btn.active {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3) !important;
}

body.a11y-enabled .a11y-font-btn,
body.a11y-enabled .a11y-spacing-btn,
body.a11y-enabled .a11y-images-btn {
  background: white !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}

body.a11y-enabled .a11y-font-btn.active,
body.a11y-enabled .a11y-spacing-btn.active,
body.a11y-enabled .a11y-images-btn.active {
  background: #3b82f6 !important;
  color: white !important;
  border-color: #3b82f6 !important;
}

body.a11y-enabled .a11y-reset-btn {
  background: transparent !important;
  color: #64748b !important;
  border-color: #cbd5e1 !important;
}

body.a11y-enabled .a11y-group {
  border-color: #e2e8f0 !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════
   БУРГЕР-МЕНЮ (кнопка)
   ═══════════════════════════════════════════════════════ */
.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1101;
  position: relative;
}

.burger-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Анимация бургера в крестик */
.mobile-menu-open .mobile-menu-toggle .burger-line:nth-child(1) {
  transform: none;
}

.mobile-menu-open .mobile-menu-toggle .burger-line:nth-child(2) {
  opacity: 1;
}

.mobile-menu-open .mobile-menu-toggle .burger-line:nth-child(3) {
  transform: none;
}

/* Бургер остаётся видимым когда меню открыто */
.mobile-menu-open .mobile-menu-toggle {
  opacity: 1;
  pointer-events: auto;
}

/* Скрыть бургер на десктопе */
@media (min-width: 1024px) {
  .mobile-menu-toggle {
    display: none;
  }
  
  .mobile-nav-header {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════
   ОВЕРЛЕЙ МОБИЛЬНОГО МЕНЮ
   ═══════════════════════════════════════════════════════ */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1040;
}

.mobile-menu-open .mobile-menu-overlay {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 1024px) {
  .mobile-menu-overlay {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════
   МОБИЛЬНОЕ МЕНЮ (навигация)
   ═══════════════════════════════════════════════════════ */

/* Кнопка закрытия - скрыта по умолчанию */
.mobile-nav-close {
  display: none;
}

@media (max-width: 1023px) {
  /* Скрыть бургер при открытом меню */
  .mobile-menu-open .mobile-menu-toggle {
    opacity: 0;
    pointer-events: none;
  }
  
  /* Шапка мобильного меню с логотипом */
  .mobile-nav-header {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 60px;
    background: var(--color-slate-900);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: right 0.3s ease;
    z-index: 1051;
    box-sizing: border-box;
  }
  
  .mobile-menu-open .mobile-nav-header {
    right: 0;
  }
  
  .mobile-nav-logo {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    font-family: 'Manrope', sans-serif;
  }
  
  /* Навигация как боковая панель */
  nav.site-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: var(--color-slate-900);
    padding: 80px 1.5rem 2rem;
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 1050;
    display: block !important;
  }
  
  .mobile-menu-open nav.site-nav {
    right: 0;
  }
  
  /* Кнопка закрытия - слева от панели, напротив первого пункта меню */
  .mobile-nav-close {
    position: fixed;
    top: 100px;
    right: 90%;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: var(--color-slate-700);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1060;
    display: none;
  }
  
  .mobile-menu-open .mobile-nav-close {
    display: flex;
  }
  
  .mobile-nav-close:hover {
    background: white;
  }
  
  /* UL внутри nav (WordPress генерирует ul.site-nav внутри nav.site-nav) */
  nav.site-nav ul.site-nav,
  nav.site-nav > ul {
    display: block !important;
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  nav.site-nav .menu-item,
  nav.site-nav > ul > .menu-item {
    display: block;
    margin: 0;
    list-style: none;
  }
  
  nav.site-nav .menu-item > a,
  nav.site-nav > ul > .menu-item > a {
    display: block;
    padding: 1rem 0;
    font-size: 1.125rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-decoration: none;
    border-radius: 0;
  }
  
  /* Активный пункт в мобильном меню - аккуратное выделение */
  nav.site-nav .menu-item.current-menu-item > a,
  nav.site-nav .menu-item.current-page-ancestor > a,
  nav.site-nav .menu-item.current_page_item > a,
  nav.site-nav > ul > .menu-item.current-menu-item > a,
  nav.site-nav > ul > .menu-item.current-page-ancestor > a {
    border-radius: 8px;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: -1rem;
    margin-right: -1rem;
    border-bottom-color: transparent;
  }
  
  /* Подменю мобильное */
  nav.site-nav .sub-menu {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 0 0 1rem;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    display: block !important;
  }
  
  nav.site-nav .menu-item-has-children.submenu-open > .sub-menu {
    max-height: 2000px;
    overflow: visible;
  }
  
  nav.site-nav .sub-menu .menu-item {
    display: block !important;
    list-style: none;
  }
  
  nav.site-nav .sub-menu .menu-item > a {
    padding: 0.75rem 0;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: block;
    border-radius: 0;
  }
  
  /* Активный пункт в подменю */
  nav.site-nav .sub-menu .menu-item.current-menu-item > a {
    border-radius: 6px;
    padding-left: 0.75rem;
    margin-left: -0.75rem;
  }
  
  /* Вложенные подменю (третий уровень) */
  nav.site-nav .sub-menu .sub-menu {
    padding-left: 1rem;
    max-height: 0;
    overflow: hidden;
  }
  
  nav.site-nav .sub-menu .menu-item-has-children.submenu-open > .sub-menu {
    max-height: 2000px;
  }
  
  /* Кнопка раскрытия подменю */
  .submenu-toggle {
    position: absolute;
    right: 0;
    top: 0.75rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.3s ease;
  }
  
  .menu-item-has-children {
    position: relative;
  }
  
  .menu-item-has-children.submenu-open > .submenu-toggle {
    transform: rotate(180deg);
  }
}

@media (min-width: 1024px) {
  .submenu-toggle {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════
   HERO СЕКЦИЯ - МОБИЛЬНАЯ
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .hero-section {
    min-height: 70vh;
    padding: 2rem 1rem;
  }
  
  .hero-content {
    padding: 1rem;
  }
  
  .hero-badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }
  
  .hero-title {
    font-size: 1.75rem !important;
    line-height: 1.2;
    margin-bottom: 1rem;
  }
  
  .hero-title .highlight {
    display: block;
    margin-top: 0.25rem;
  }
  
  .hero-description {
    font-size: 0.9375rem !important;
    line-height: 1.6;
    margin-bottom: 1.5rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
    padding: 0.875rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-section {
    min-height: 60vh;
  }
  
  .hero-title {
    font-size: 1.5rem !important;
  }
  
  .hero-description {
    font-size: 0.875rem !important;
  }
}

/* ═══════════════════════════════════════════════════════
   СТАТИСТИКА - МОБИЛЬНАЯ
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .stats-section {
    padding: 1.5rem 1rem;
  }
  
  .stats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .stat-item {
    text-align: center;
    padding: 0;
  }
  
  .stat-value {
    font-size: 1.5rem !important;
  }
  
  .stat-label {
    font-size: 0.75rem !important;
  }
}

@media (max-width: 480px) {
  .stat-value {
    font-size: 1.25rem !important;
  }
}

/* ═══════════════════════════════════════════════════════
   СЛАЙДЕР - МОБИЛЬНЫЙ
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .hero-slider {
    padding: 2rem 0;
  }
  
  .hero-slider-container {
    padding: 0 1rem;
  }
  
  .hero-slider .section-header {
    margin-bottom: 1.5rem;
  }
  
  .hero-slider .section-title {
    font-size: 1.5rem !important;
  }
  
  .hero-slide {
    flex: 0 0 280px;
    min-width: 280px;
  }
  
  .hero-slide-title {
    font-size: 0.9375rem;
  }
  
  .hero-slide-caption {
    font-size: 0.8125rem;
  }
}

/* ═══════════════════════════════════════════════════════
   СЕКЦИИ КОНТЕНТА - МОБИЛЬНЫЕ
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .section {
    padding: 2rem 0 !important;
  }
  
  .section .container {
    padding: 0 1rem;
  }
  
  .section-header {
    margin-bottom: 1.5rem;
  }
  
  .section-subtitle {
    font-size: 0.75rem;
  }
  
  .section-title {
    font-size: 1.5rem !important;
  }
  
  .section-description {
    font-size: 0.9375rem;
  }
  
  .section-link {
    margin-top: 0.75rem !important;
  }
}

/* ═══════════════════════════════════════════════════════
   СЕТКА КАРТОЧЕК - МОБИЛЬНАЯ
   ═══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .card-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .card-grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .card-grid-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ═══════════════════════════════════════════════════════
   КАРТОЧКИ - МОБИЛЬНЫЕ
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .card {
    border-radius: 12px;
  }
  
  .card-content {
    padding: 1rem;
  }
  
  .card-title {
    font-size: 1rem;
  }
  
  .card-description {
    font-size: 0.875rem;
  }
  
  .card-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
  
  /* Быстрые ссылки - вертикально на мобильных */
  .section-quicklinks .card {
    flex-direction: row;
    align-items: center;
    padding: 1rem !important;
  }
  
  .section-quicklinks .card-icon {
    margin: 0 !important;
    flex-shrink: 0;
  }
}

/* ═══════════════════════════════════════════════════════
   LAYOUT С САЙДБАРОМ - МОБИЛЬНЫЙ
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1199px) {
  .main-layout {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 1rem !important;
    flex-direction: column;
  }
  
  .content-area {
    width: 100%;
    max-width: 100%;
  }
  
  /* Десктопный сайдбар полностью скрыт на мобильных */
  .widget-sidebar {
    display: none !important;
  }
  
  .sidebar-inner {
    max-width: 600px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .main-layout {
    padding: 0 1rem !important;
  }
}

/* ═══════════════════════════════════════════════════════
   САЙДБАР ВИДЖЕТЫ - МОБИЛЬНЫЕ
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .widget {
    padding: 1rem;
  }
  
  .widget-title {
    font-size: 0.8125rem;
  }
}

/* ═══════════════════════════════════════════════════════
   ФУТЕР - МОБИЛЬНЫЙ
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .site-footer {
    padding: 2rem 1rem 1rem;
  }
  
  .footer-container {
    flex-direction: column;
    gap: 2rem;
  }
  
  .footer-section {
    width: 100%;
    text-align: center;
  }
  
  .footer-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
  
  .footer-links {
    justify-content: center;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding-top: 1.5rem;
  }
  
  .footer-bottom p {
    font-size: 0.75rem;
  }
}

/* ═══════════════════════════════════════════════════════
   СТРАНИЦЫ АРХИВОВ - МОБИЛЬНЫЕ
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .archive-header {
    padding: 2rem 1rem;
  }
  
  .archive-header h1 {
    font-size: 1.5rem;
  }
  
  .archive-header p {
    font-size: 0.9375rem;
  }
  
  /* Фильтры рубрик - горизонтальный скролл */
  .category-filters {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
  }
  
  .category-filters::-webkit-scrollbar {
    height: 4px;
  }
  
  .category-filters::-webkit-scrollbar-thumb {
    background: var(--color-slate-300);
    border-radius: 2px;
  }
}

/* ═══════════════════════════════════════════════════════
   СТРАНИЦА "СВЕДЕНИЯ" - МОБИЛЬНАЯ
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
  .info-layout {
    flex-direction: column;
  }
  
  .info-sidebar {
    width: 100%;
    order: 2;
    margin-top: 2rem;
    padding: 1.5rem;
    border-left: none;
    border-top: 1px solid var(--color-slate-200);
  }
  
  .info-content {
    width: 100%;
    padding: 1.5rem;
  }
}

/* ═══════════════════════════════════════════════════════
   КНОПКИ - МОБИЛЬНЫЕ
   ═══════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
  }
  
  .btn-primary,
  .btn-outline {
    width: 100%;
    justify-content: center;
  }
}

/* ═══════════════════════════════════════════════════════
   ТАБЛИЦЫ - МОБИЛЬНЫЕ (горизонтальный скролл)
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .tablepress-scroll-wrapper,
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .tablepress,
  article table {
    min-width: 600px;
  }
  
  .tablepress thead th,
  article table thead th {
    padding: 0.75rem;
    font-size: 0.8125rem;
  }
  
  .tablepress tbody td,
  article table tbody td {
    padding: 0.75rem;
    font-size: 0.8125rem;
  }
}

/* ═══════════════════════════════════════════════════════
   ХЛЕБНЫЕ КРОШКИ - МОБИЛЬНЫЕ
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .breadcrumbs {
    font-size: 0.75rem;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* ═══════════════════════════════════════════════════════
   УЛУЧШЕНИЯ ТАПОВ (touch targets)
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
  /* Минимальный размер для тап-целей - 44x44px */
  a, button, input[type="submit"], .btn {
    min-height: 44px;
  }
  
  nav.site-nav a {
    min-height: 48px;
    display: flex;
    align-items: center;
  }
}

/* ═══════════════════════════════════════════════════════
   SAFE AREA (для iPhone с вырезом)
   ═══════════════════════════════════════════════════════ */
@supports (padding: max(0px)) {
  .site-header {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  
  .site-footer {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }
  
  @media (max-width: 1023px) {
    nav.site-nav {
      padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
  }
}
