/*
Theme Name: Петергоф ДДЮТ
Description: Современная тема для государственного бюджетного учреждения дополнительного образования Дворец детского (юношеского) творчества Петродворцового района Санкт-Петербурга "ПЕТЕРГОФ"
Author: Косарев Андрей
Version: 1.5.2
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
*/

/* Manrope — самохостинг (без Google Fonts CDN). Файлы: assets/fonts/ */

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/manrope-cyrillic-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/manrope-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/manrope-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/manrope-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/manrope-cyrillic-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/manrope-cyrillic-500-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/manrope-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/manrope-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/manrope-cyrillic-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/manrope-cyrillic-600-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/manrope-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/manrope-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/manrope-cyrillic-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/manrope-cyrillic-700-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/manrope-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/manrope-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('assets/fonts/manrope-cyrillic-ext-800-normal.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('assets/fonts/manrope-cyrillic-800-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('assets/fonts/manrope-latin-ext-800-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('assets/fonts/manrope-latin-800-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


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

:root {
  /* ─────────────────────────────────────────────────────────
     ПАЛИТРА САЙТА (перекраска под фирменные цвета ДДЮТ «Петергоф»)
     Семантические переменные — задают тон всему сайту.
     ───────────────────────────────────────────────────────── */

  /* Основные 5 цветов (заданы заказчиком) */
  --color-primary:        #005f92; /* основной тёмный — шапка, футер, крупные акценты, заголовки */
  --color-accent:         #4da3ff; /* основной яркий — кнопки, ссылки, активные пункты меню */
  --color-accent-light:   #9fd3ff; /* светлый акцент — фоны секций, подсветка, полоски заголовков */
  --color-page-bg:        #f6f7fb; /* фон страницы */
  --color-text:           #2f4050; /* основной текст */

  /* Дополнительные (служебные) оттенки */
  --color-primary-hover:  #004a70; /* основной тёмный — hover/нажатие */
  --color-accent-hover:   #3b8ee0; /* основной яркий — hover/нажатие */
  --color-card-bg:        #ffffff; /* фон карточек и блоков */
  --color-text-secondary: #6b7c8a; /* вторичный текст — подписи, даты, мета */
  --color-border:         #dbe4ec; /* границы и разделители */
  --color-success:        #2e9e5b; /* состояние: успех */
  --color-error:          #d64550; /* состояние: ошибка */
  --color-warning:        #e0a020; /* состояние: предупреждение */

  /* Производные оттенки акцента (для тонких фонов/подсветок) */
  --color-accent-darkest: #003a58; /* самый тёмный синий — активное нажатие крупных блоков */
  --color-accent-soft-bg: #eaf4ff; /* очень светлый фон-подсветка на базе акцента */

  /* ─────────────────────────────────────────────────────────
     СЛУЖЕБНЫЙ РЕМАП: прежние Tailwind-подобные имена переменных
     переопределены на новую палитру, чтобы не переписывать
     весь файл. Все var(--color-slate-*) и var(--color-blue-*)
     ниже по коду автоматически берут новые значения.
     ───────────────────────────────────────────────────────── */

  /* Тёмная линейка (бывший slate → сине-стальная шкала бренда) */
  --color-slate-900: var(--color-primary);        /* шапка, футер, hero-фон, заголовки */
  --color-slate-800: var(--color-primary-hover);  /* границы на тёмном, футер-разделители */
  --color-slate-700: #33566b;                      /* тёмный текст на светлом (кнопки a11y) */
  --color-slate-600: #4a6172;                      /* приглушённый тёмный текст */
  --color-slate-500: var(--color-text-secondary); /* вторичный текст, подписи, мета */
  --color-slate-400: #90a4b3;                      /* блёклый текст (пункты меню на тёмном) */
  --color-slate-300: #c3d1dc;                      /* блёклый текст/иконки, свайп-индикатор */
  --color-slate-200: var(--color-border);          /* границы, разделители */
  --color-slate-100: #eef2f6;                      /* очень светлый фон/разделитель */
  --color-slate-50:  var(--color-page-bg);         /* фон страницы, светлые панели */

  /* Акцентная линейка (бывший blue → яркий бренд-синий) */
  --color-blue-700: var(--color-accent-darkest);  /* активное нажатие */
  --color-blue-600: var(--color-accent-hover);    /* hover ссылок/кнопок, активный пункт меню */
  --color-blue-500: var(--color-accent);          /* базовый акцент — кнопки, ссылки */
  --color-blue-400: var(--color-accent-light);    /* светлый акцент — подсветка, highlight в hero */
  --color-blue-50:  var(--color-accent-soft-bg);  /* светлый фон-подсветка */

  /* Состояния (бывшие amber/emerald/rose → палитра состояний бренда) */
  --color-amber-50:    #fdf6e7;
  --color-amber-500:   var(--color-warning);
  --color-amber-600:   #c78a15;
  --color-emerald-50:  #e9f6ef;
  --color-emerald-600: var(--color-success);
  --color-rose-50:     #fbecee;
  --color-rose-600:    var(--color-error);
}

* {
  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-text);
  background-color: var(--color-page-bg);
}

/* 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;
}

@media (hover: hover) and (pointer: fine) {
  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;
  }
}

@media (hover: hover) and (pointer: fine) {
  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, var(--color-accent), var(--color-primary));
  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, var(--color-accent-hover), var(--color-primary-hover));
  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;
}

@media (hover: hover) and (pointer: fine) {
  .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: var(--color-primary-hover);
  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;
}

@media (hover: hover) and (pointer: fine) {
  .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;
}

@media (hover: hover) and (pointer: fine) {
  .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;
}

@media (hover: hover) and (pointer: fine) {
  .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(0, 58, 88, 0.85), rgba(0, 58, 88, 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(77, 163, 255, 0.2);
  color: var(--color-accent-light);
  border: 1px solid rgba(159, 211, 255, 0.4);
  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: background-color 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out, transform 0.15s ease-out;
  border: none;
  text-decoration: none;
}

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

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background: var(--color-blue-600);
    color: #fff;
    transform: translateY(-1px);
  }
}

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

@media (hover: hover) and (pointer: fine) {
  .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;
}

@media (hover: hover) and (pointer: fine) {
  .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;
}

@media (hover: hover) and (pointer: fine) {
  .mobile-sidebar-toggle:hover {
    background: var(--color-accent-hover);
    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: none !important;
  }
  
  .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);
}

@media (hover: hover) and (pointer: fine) {
  .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: 2rem 0 6rem; }
}

.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: var(--color-card-bg);
  border: 1px solid var(--color-slate-200);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
  height: 100%;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
  }
}

.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;
}

/* Масштабирование картинки при hover убрано: анимируем только подъём карточки */

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

.hero-slider-container {
  max-width: 75%;
  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: var(--color-card-bg);
  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;
}

@media (hover: hover) and (pointer: fine) {
  .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;
}

@media (hover: hover) and (pointer: fine) {
  .a11y-main-toggle:hover {
    background: var(--color-slate-200);
  }
}

.a11y-main-toggle.active {
  background: var(--color-warning);
  color: white;
  border-color: var(--color-amber-600);
}

.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;
}

@media (hover: hover) and (pointer: fine) {
  .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; }

@media (hover: hover) and (pointer: fine) {
  .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;
}

@media (hover: hover) and (pointer: fine) {
  .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;
}

@media (hover: hover) and (pointer: fine) {
  .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;
}

@media (hover: hover) and (pointer: fine) {
  .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: var(--color-warning) !important;
  color: white !important;
  border-color: var(--color-amber-600) !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 {
    display: none !important;
  }
  
  .mobile-menu-open .mobile-nav-close {
    display: none !important;
  }
  
  .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));
    }
  }
}

/* ═══════════════════════════════════════════════════════
   ФИКС ПЕРЕПОЛНЕНИЯ КОНТЕНТА (info-страницы, таблицы, списки)
   Добавлено: устраняет выезд списков/ссылок и съезд меню
   из-за широких таблиц и длинных неразрывных строк.
   ═══════════════════════════════════════════════════════ */

/* 1. Перенос длинных строк и URL внутри контента */
.content-area,
.content-area p,
.content-area li,
.content-area td,
.content-area th,
.content-area a {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* 2. Списки: маркеры внутри колонки, не за её границей */
.content-area ul,
.content-area ol {
  padding-left: 1.5rem;
  margin-left: 0;
  box-sizing: border-box;
  max-width: 100%;
}

/* 3. Обычные HTML-таблицы в контенте вписываются в колонку.
      table-layout: fixed не даёт длинной ячейке распирать таблицу. */
.content-area table,
article table {
  max-width: 100%;
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.content-area td,
.content-area th,
article td,
article th {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* 4. Картинки в контенте не выходят за колонку */
.content-area img {
  max-width: 100%;
  height: auto;
}

/* 5. Мобильный режим: широкие таблицы — горизонтальный скролл
      ВНУТРИ контент-области, без распирания всего макета.
      Переопределяем прежний min-width:600px, который ломал верстку
      у таблиц без обёртки-скроллера. */
@media (max-width: 768px) {
  .content-area {
    overflow-x: hidden;
  }
  .content-area table,
  article table {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;            /* снимаем распирающий 600px для таблиц без обёртки */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    table-layout: auto;      /* внутри скролла авто-ширина ок */
  }
  /* TablePress со своей обёрткой оставляем как было (min-width работает в .tablepress-scroll-wrapper) */
  .tablepress-scroll-wrapper .tablepress {
    display: table;
  }
}

/* ═══════════════════════════════════════════════════════
   ФИКС СЪЕЗДА МЕНЮ: не даём вложенным контейнерам и таблицам
   распирать колонку контента (и через неё — боковое меню).
   ═══════════════════════════════════════════════════════ */

/* Вся цепочка контейнеров внутри контент-области не должна
   растягиваться шире доступной ширины флекс-колонки. */
.page-template-page-info .main-layout > .content-area,
.page-template-page-info .content-area .section,
.page-template-page-info .content-area .container,
.page-template-page-info .content-area article {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
}

/* Сайдбар держим жёстко: не сжимается и не растёт. */
.page-template-page-info .main-layout > .info-sidebar {
  width: 280px;
  min-width: 280px;
  flex: 0 0 280px;
}

/* Таблицы контента: перебиваем возможные инлайновые width из
   вставленного HTML. fixed + 100% гарантируют вписывание в колонку. */
.page-template-page-info .content-area table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}
.page-template-page-info .content-area table td,
.page-template-page-info .content-area table th {
  width: auto !important;
  max-width: 100% !important;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal !important;   /* на случай nowrap из инлайна */
}

/* ═══════════════════════════════════════════════════════
   ФИКС ВЕРТИКАЛЬНОГО ВЫРАВНИВАНИЯ info-страниц:
   боковое меню и контент начинаются от одной верхней линии
   независимо от содержимого (пустые заголовки и т.п.).
   ═══════════════════════════════════════════════════════ */
.page-template-page-info .main-layout {
  align-items: flex-start;
}

/* Пустые заголовки в начале контента не создают лишний отступ сверху */
.page-template-page-info .content-area h1:empty,
.page-template-page-info .content-area h2:empty,
.page-template-page-info .content-area h3:empty {
  display: none;
}

/* ═══════════════════════════════════════════════════════
   УМЕНЬШЕНИЕ ВЕРТИКАЛЬНЫХ ОТСТУПОВ МЕЖДУ СЕКЦИЯМИ (главная)
   Было: 4rem сверху/снизу (на стыке ≈8rem пустоты);
         на десктопе 2rem/6rem. Стало компактнее.
   ═══════════════════════════════════════════════════════ */
.section {
  padding: 2.5rem 0;
}

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

/* ═══════════════════════════════════════════════════════
   ФИКС: кнопка вызова сайдбара становилась прозрачной на Android.
   Причина: :hover ссылался на переменную, которая могла быть
   не объявлена → var() возвращает transparent → фон обнуляется.
   На Android :hover залипает после свайпа, поэтому фон застревал
   прозрачным.
   Решение: (1) все нужные переменные объявлены в :root выше,
   (2) hover-эффект только для устройств с реальным курсором,
   (3) явный фон-страховка во всех состояниях.
   ═══════════════════════════════════════════════════════ */

/* Явный фон кнопки во всех состояниях (страховка) */
.mobile-sidebar-toggle,
.mobile-sidebar-toggle:hover,
.mobile-sidebar-toggle:active,
.mobile-sidebar-toggle:focus {
  background: var(--color-accent);
}

/* Hover-подсветку применяем ТОЛЬКО там, где есть мышь —
   на тач-экранах hover залипает и ломает фон. */
@media (hover: hover) and (pointer: fine) {
  .mobile-sidebar-toggle:hover {
    background: var(--color-accent-hover);
    transform: scale(1.05);
  }
}
/* ═══════════════════════════════════════════════════════════════
   ТИПОГРАФИКА КОНТЕНТА СТРАНИЦ (page.php, page-info.php и др.)
   Задаёт аккуратный, читаемый вид тексту из редактора WordPress:
   абзацы, заголовки, списки, таблицы, ссылки, цитаты, файлы.
   Все цвета — через переменные палитры (см. :root).
   ═══════════════════════════════════════════════════════════════ */

/* Обёртка читаемого контента (добавляется в шаблонах) */
.entry-content {
  color: var(--color-text);
  font-size: 1.0625rem;
  line-height: 1.8;
  /* Ограничение длины строки для читаемости на широких экранах */
  max-width: 100%;
}

/* На info-страницах колонка уже, ограничение не нужно */
.page-template-page-info .entry-content {
  max-width: 100%;
}

/* Абзацы — воздух между ними */
.entry-content p {
  margin: 0 0 1.15rem 0;
}
.entry-content > *:last-child {
  margin-bottom: 0;
}

/* Заголовки внутри контента */
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  color: var(--color-primary);
  line-height: 1.3;
  margin: 2rem 0 0.75rem;
}
.entry-content h2 { font-size: 1.5rem; }
.entry-content h3 { font-size: 1.25rem; }
.entry-content h4 { font-size: 1.0625rem; }
.entry-content > h2:first-child,
.entry-content > h3:first-child {
  margin-top: 0;
}

/* Списки — маркеры и интервалы */
.entry-content ul,
.entry-content ol {
  margin: 0 0 1.15rem 0;
  padding-left: 1.5rem;
}
.entry-content li {
  margin-bottom: 0.5rem;
}
.entry-content li::marker {
  color: var(--color-accent);
}
.entry-content ul ul,
.entry-content ol ol,
.entry-content ul ol,
.entry-content ol ul {
  margin: 0.5rem 0 0.5rem 0;
}

/* Ссылки в тексте — заметные, с подчёркиванием */
.entry-content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
@media (hover: hover) and (pointer: fine) {
  .entry-content a:hover {
    color: var(--color-accent-hover);
    text-decoration-thickness: 2px;
  }
}

/* Цитаты */
.entry-content blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid var(--color-accent);
  border-radius: 0;
  background: var(--color-accent-soft-bg);
  color: var(--color-text);
  font-style: italic;
}
.entry-content blockquote p:last-child {
  margin-bottom: 0;
}

/* Горизонтальный разделитель вместо строк «=====» */
.entry-content hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: 2rem 0;
}

/* Таблицы контента — зебра, аккуратные границы, синяя шапка */
.entry-content table {
  margin: 1.5rem 0;
  border: 1px solid var(--color-border);
}
.entry-content thead th,
.entry-content table th {
  background: var(--color-primary);
  color: #fff;
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
}
.entry-content td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--color-border);
}
.entry-content tbody tr:nth-child(even) {
  background: var(--color-page-bg);
}

/* Изображения в контенте — скруглённые */
.entry-content img {
  border-radius: 8px;
  margin: 0.5rem 0;
}

/* ─────────────────────────────────────────────────────────
   ССЫЛКИ НА ФАЙЛЫ (.docx, .pdf, .xlsx …) — с иконкой формата.
   Работает автоматически по расширению в href.
   ───────────────────────────────────────────────────────── */
.entry-content a[href$=".pdf"],
.entry-content a[href$=".doc"],
.entry-content a[href$=".docx"],
.entry-content a[href$=".xls"],
.entry-content a[href$=".xlsx"],
.entry-content a[href$=".ppt"],
.entry-content a[href$=".pptx"],
.entry-content a[href$=".zip"],
.entry-content a[href$=".rar"] {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-decoration: none;
  background: var(--color-accent-soft-bg);
  border: 1px solid var(--color-border);
}
.entry-content a[href$=".pdf"]::before,
.entry-content a[href$=".doc"]::before,
.entry-content a[href$=".docx"]::before,
.entry-content a[href$=".xls"]::before,
.entry-content a[href$=".xlsx"]::before,
.entry-content a[href$=".ppt"]::before,
.entry-content a[href$=".pptx"]::before,
.entry-content a[href$=".zip"]::before,
.entry-content a[href$=".rar"]::before {
  content: "📄";
  font-style: normal;
}
.entry-content a[href$=".xls"]::before,
.entry-content a[href$=".xlsx"]::before { content: "📊"; }
.entry-content a[href$=".zip"]::before,
.entry-content a[href$=".rar"]::before { content: "🗜"; }
@media (hover: hover) and (pointer: fine) {
  .entry-content a[href$=".pdf"]:hover,
  .entry-content a[href$=".docx"]:hover,
  .entry-content a[href$=".doc"]:hover,
  .entry-content a[href$=".xlsx"]:hover,
  .entry-content a[href$=".xls"]:hover {
    background: var(--color-accent-light);
    text-decoration: none;
  }
}

/* ─────────────────────────────────────────────────────────
   ХЛЕБНЫЕ КРОШКИ (Главная → Раздел → Страница)
   ───────────────────────────────────────────────────────── */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.25rem;
}
.breadcrumbs a {
  color: var(--color-accent);
  text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
  .breadcrumbs a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
  }
}
.breadcrumbs .sep {
  color: var(--color-text-secondary);
  opacity: 0.6;
}
.breadcrumbs .current {
  color: var(--color-text-secondary);
}

/* ─────────────────────────────────────────────────────────
   БОКОВОЕ МЕНЮ INFO-СТРАНИЦ (вынесено из инлайна page-info.php)
   ───────────────────────────────────────────────────────── */
.info-nav-link {
  display: block;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-text);
  border-left: 3px solid transparent;
  margin-bottom: 0.25rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
@media (hover: hover) and (pointer: fine) {
  .info-nav-link:hover {
    background: var(--color-accent-soft-bg);
    color: var(--color-primary);
  }
}
.info-nav-link.active {
  background: var(--color-accent-soft-bg);
  color: var(--color-primary);
  border-left-color: var(--color-accent);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ТИПОГРАФИКА КОНТЕНТА СТРАНИЦ (page.php и page-info.php)
   Единое оформление текста, списков, заголовков, таблиц, ссылок и файлов
   для «сырого» HTML из редактора. Цвета — через переменные палитры.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Обёртка контента: на обычных страницах — во всю ширину колонки.
   (Колонка сама ограничена макетом, поэтому строки не станут бесконечными.) */
.entry-content {
  max-width: 100%;
  color: var(--color-text);
  font-size: 1.0625rem;
  line-height: 1.8;
}

/* На info-страницах контент на всю ширину колонки (без белого шума справа) */
.page-template-page-info .entry-content {
  max-width: 100%;
}

/* Абзацы */
.entry-content p {
  margin: 0 0 1rem 0;
}
.entry-content p:last-child {
  margin-bottom: 0;
}

/* Заголовки внутри контента */
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  color: var(--color-primary);
  line-height: 1.3;
  margin: 2rem 0 0.75rem 0;
  font-weight: 700;
}
.entry-content h2 { font-size: 1.5rem; }
.entry-content h3 { font-size: 1.25rem; }
.entry-content h4 { font-size: 1.0625rem; }
.entry-content > :first-child { margin-top: 0; }

/* Списки: видимые маркеры и нормальные интервалы */
.entry-content ul,
.entry-content ol {
  margin: 0 0 1rem 0;
  padding-left: 1.5rem;
}
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li {
  margin-bottom: 0.4rem;
}
.entry-content li::marker {
  color: var(--color-accent);
}
.entry-content li > ul,
.entry-content li > ol {
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
}

/* Ссылки в контенте */
.entry-content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  overflow-wrap: break-word;
}
@media (hover: hover) and (pointer: fine) {
  .entry-content a:hover {
    color: var(--color-accent-hover);
  }
}

/* Разделители: аккуратная линия вместо «=====» */
.entry-content hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: 2rem 0;
}

/* Цитаты */
.entry-content blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid var(--color-accent);
  background: var(--color-accent-soft-bg);
  color: var(--color-text);
  border-radius: 0 6px 6px 0;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

/* Таблицы контента */
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}
.entry-content th,
.entry-content td {
  border: 1px solid var(--color-border);
  padding: 0.625rem 0.875rem;
  text-align: left;
  vertical-align: top;
}
.entry-content thead th,
.entry-content table th {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}
.entry-content tbody tr:nth-child(even) td {
  background: var(--color-page-bg);
}

/* Изображения в контенте */
.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}

/* Ссылки на файлы: иконка формата + подсветка.
   Работает для ссылок, ведущих на .pdf/.doc/.docx/.xls/.xlsx (через href$=). */
.entry-content a[href$=".pdf"],
.entry-content a[href$=".doc"],
.entry-content a[href$=".docx"],
.entry-content a[href$=".xls"],
.entry-content a[href$=".xlsx"],
.entry-content a[href$=".zip"],
.entry-content a[href$=".rtf"] {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-card-bg);
  text-decoration: none;
  font-weight: 500;
  line-height: 1.4;
}
@media (hover: hover) and (pointer: fine) {
  .entry-content a[href$=".pdf"]:hover,
  .entry-content a[href$=".doc"]:hover,
  .entry-content a[href$=".docx"]:hover,
  .entry-content a[href$=".xls"]:hover,
  .entry-content a[href$=".xlsx"]:hover,
  .entry-content a[href$=".zip"]:hover,
  .entry-content a[href$=".rtf"]:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-soft-bg);
  }
}
.entry-content a[href$=".pdf"]::before,
.entry-content a[href$=".doc"]::before,
.entry-content a[href$=".docx"]::before,
.entry-content a[href$=".xls"]::before,
.entry-content a[href$=".xlsx"]::before,
.entry-content a[href$=".zip"]::before,
.entry-content a[href$=".rtf"]::before {
  content: "📄";
  font-size: 0.95em;
  line-height: 1;
}
.entry-content a[href$=".xls"]::before,
.entry-content a[href$=".xlsx"]::before { content: "📊"; }
.entry-content a[href$=".zip"]::before { content: "🗜"; }

/* ═══════════════════════════════════════════════════════════════════════════
   ХЛЕБНЫЕ КРОШКИ
   ═══════════════════════════════════════════════════════════════════════════ */
.breadcrumbs {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.breadcrumbs a {
  color: var(--color-accent);
  text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
  .breadcrumbs a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
  }
}
.breadcrumbs .sep {
  color: var(--color-text-secondary);
  opacity: 0.6;
}
.breadcrumbs .current {
  color: var(--color-text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   БОКОВОЕ МЕНЮ INFO-СТРАНИЦ (перенос инлайн-стилей в CSS + акценты)
   ═══════════════════════════════════════════════════════════════════════════ */
.info-nav-link {
  display: block;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-text);
  margin-bottom: 0.25rem;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
@media (hover: hover) and (pointer: fine) {
  .info-nav-link:hover {
    background: var(--color-accent-soft-bg);
    color: var(--color-primary);
  }
}
.info-nav-link.active {
  background: var(--color-accent-soft-bg);
  color: var(--color-primary);
  border-left-color: var(--color-accent);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ВНУТРЕННИЕ ОТСТУПЫ ЗОНЫ КОНТЕНТА (все шаблоны страниц)
   На десктопе .container обнуляет боковой padding, из-за чего текст липнет
   к краям колонки. Возвращаем умеренное «поле» изнутри — единообразно.
   ═══════════════════════════════════════════════════════════════════════════ */
.content-area .section .container {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ВНУТРЕННИЙ ОТСТУП ЗОНЫ КОНТЕНТА (все шаблоны страниц)
   На десктопе .container внутри секции обнуляет боковой padding, из-за чего
   текст прилипал к краям колонки. Возвращаем умеренный отступ прицельно —
   только для контентной колонки страниц, не трогая секции главной.
   ═══════════════════════════════════════════════════════════════════════════ */
.content-area .section .container {
  padding-left: 1.75rem;
  padding-right: 1.75rem;
}

/* На узких экранах отступ чуть меньше — и так есть внешние поля */
@media (max-width: 768px) {
  .content-area .section .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* page-info: контент на всю ширину колонки (убираем белый шум справа),
   как на обычных страницах */
.page-template-page-info .entry-content {
  max-width: 100%;
}

/* Строки-разделы внутри таблиц контента (объединённая ячейка на всю ширину) */
.entry-content .table-section {
  background: var(--color-accent-soft-bg);
  color: var(--color-primary);
  font-weight: 700;
  text-align: center;
  font-size: 1.0625rem;
  padding: 0.75rem;
}

/* Таблица без чередования строк (галочка «зебра» снята в редакторе) */
.entry-content table.no-zebra tbody tr:nth-child(even) td { background: transparent; }

/* Ширина столбцов, заданная в редакторе (инлайн width на ячейках),
   должна соблюдаться на фронте. table-layout:fixed ставится редактором. */
.entry-content table[style*="table-layout"] { table-layout: fixed; }
.entry-content table th[style*="width"],
.entry-content table td[style*="width"] { /* инлайн width уважается */ }

/* ═══════════════════════════════════════════════════════════════════════════
   МИКРОАНИМАЦИИ (сдержанные, только transform/opacity)
   Класс .peterhof-anim ставится на <html> инлайн-скриптом в <head> ТОЛЬКО
   если JS работает и нет prefers-reduced-motion. Без JS контент виден сразу.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Плавный переход цвета у ссылок (150 мс) */
a {
  transition: color 0.15s ease-out;
}

/* Карточки слайдера мероприятий: тот же подъём, что у .card */
.hero-slide {
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
}
@media (hover: hover) and (pointer: fine) {
  .hero-slide:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.18);
  }
}

/* Появление секций при скролле: fade-in + сдвиг снизу 14px, один раз.
   Начальное скрытие ТОЛЬКО при активных анимациях (html.peterhof-anim). */
html.peterhof-anim [data-animate] {
  opacity: 0;
  transform: translateY(14px);
}
html.peterhof-anim [data-animate].is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* Доступность: при reduced-motion отключаем ВСЕ анимации и переходы,
   контент — сразу в конечном состоянии. Приоритет над всем выше. */
@media (prefers-reduced-motion: reduce) {
  html.peterhof-anim [data-animate] {
    opacity: 1 !important;
    transform: none !important;
  }
  .card, .hero-slide, .btn, a,
  .card:hover, .hero-slide:hover, .btn-primary:hover {
    transition: none !important;
    transform: none !important;
  }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ДОСТУПНОСТЬ: skip-link и видимый клавиатурный фокус
   ═══════════════════════════════════════════════════════════════════════════ */

/* «Перейти к содержимому»: скрыт визуально, появляется при фокусе с клавиатуры */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100000;
  padding: 0.75rem 1.25rem;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.15s ease-out;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid var(--color-accent-light);
  outline-offset: 2px;
}

/* Видимый фокус для клавиатурной навигации (не мешает кликам мышью) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}
/* На тёмных фонах (шапка, футер) — светлая обводка для контраста */
.site-header a:focus-visible,
.site-footer a:focus-visible,
.site-nav a:focus-visible {
  outline-color: var(--color-accent-light);
}

/* ═══════════════════════════════════════════════════════════════════════════
   МОБИЛЬНАЯ АДАПТАЦИЯ: ТАБЛИЦЫ И ХЛЕБНЫЕ КРОШКИ (v1.4.1)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Хлебные крошки: обычный строчный поток вместо flex — переносится
   естественно, без «разорванных» строк на узких экранах. */
.breadcrumbs {
  display: block;
  line-height: 1.6;
}
.breadcrumbs a,
.breadcrumbs .sep,
.breadcrumbs .current {
  display: inline;
  white-space: normal;
}
.breadcrumbs .sep {
  margin: 0 0.3rem;
}
@media (max-width: 768px) {
  .breadcrumbs {
    font-size: 0.8125rem;
    margin-bottom: 1rem;
  }
}

/* Таблицы контента на узких экранах: НЕ сжимаем в ширину экрана
   (это ломало текст по буквам), а даём горизонтальную прокрутку.
   Колонки сохраняют читаемую ширину, таблица листается пальцем. */
@media (max-width: 900px) {
  .entry-content table,
  .content-area table {
    display: block;              /* контейнер таблицы становится скролл-зоной */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
  }
  .entry-content table th,
  .entry-content table td,
  .content-area table th,
  .content-area table td {
    min-width: 9rem;             /* колонки не схлопываются в столбик букв */
    width: auto !important;
    overflow-wrap: normal;
    word-break: normal !important;
  }
  /* Узкие служебные колонки («—», даты) можно не растягивать сверх нужного,
     но минимум оставляем, чтобы заголовки читались. Строки-разделы — на всю
     видимую ширину прокрутки. */
  .entry-content .table-section,
  .content-area .table-section {
    min-width: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   БЫСТРЫЕ ССЫЛКИ: сетка 3-в-ряд, карточка с фото или эмодзи
   ═══════════════════════════════════════════════════════════════════════════ */
.quicklink-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  height: 100%;
}
.quicklink-text { flex: 1; min-width: 0; }
.quicklink-photo {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-slate-100);
}
.quicklink-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.quicklink-emoji { flex-shrink: 0; }
