/* ==========================================================================
   Терапевтическая эвритмия в России — основной CSS
   Воспроизводит дизайн oldsite (палитра, шапка, навигация, sidebar,
   статьи, библиография, новостные карточки, slant-футер).
   ========================================================================== */

   :root {
    --primary-dark-blue: rgb(85, 85, 199);
    --logo-text: rgb(51, 51, 153);
    --secondary-beige: #f5f2e6;
    --accent-orange: #f89c31;
    --text-dark: #333;
    --text-light: #fff;
    --border-soft: rgba(0, 0, 0, 0.08);
    --border-search: rgb(166, 22, 118);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Плавный скролл + запрет iOS-автоувеличения шрифта при повороте экрана. */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background: #fff;
    font-weight: 400;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--logo-text); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent-orange); }

ul { list-style: none; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.cap { font-size: 1.3em; color: inherit; }

/* Первая буква заголовка страницы (.page-title-custom в home.php).
   Размер и остальные свойства — как в старом сайте
   (old_data/css/styles.css): буква не увеличивается, а слегка
   уменьшается относительно кегля заголовка. */
.cap-first {
    font-size: 0.90em;
    color: inherit;
    font-weight: inherit;
    line-height: 1;
    display: inline;
}

/* Утилита: запрет переноса строки */
.nowrap { white-space: nowrap; }

/* ==========================================================================
   Header
   ========================================================================== */
header { background: #fff; }

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px 0 0px;
    gap: 0px;
    flex-wrap: wrap;
}

.logo { display: flex; align-items: center; gap: 4px; }
.logo-link { 
    flex-shrink: 0; 
    display: block; 
    margin-bottom: 0px;
}
.logo img { max-height: 120px; width: auto; }
.logo .titles-wrapper { display: flex; flex-direction: column; }

/* Заголовок сайта — крупно, тёмно-синий, с увеличенной первой буквой через .cap. */
.logo h1 {    
    color: var(--logo-text);
    margin: 0;

    display: block;
    font-size: 22px;    
    line-height: 1;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;    
    font-weight: 400;
    text-transform: uppercase;
}
.logo h1 .cap { font-size: 1.2em; font-weight: 400; }

.logo .site-subtitle {
    margin-top: 4px;
    color: var(--logo-text);
    letter-spacing: 0px;


    /*top: calc(100% + 3px);*/
    left: 0;
    font-size: 11px;
    line-height: 1;
    padding: 0;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    text-transform: uppercase;
}
.logo .site-subtitle .cap { font-size: 1.15em; }

/* Верхняя правая зона: Новости/Контакты + поиск */
.top-nav {
    display: flex;
    gap: 20px;
}
.top-nav-links { display: flex; gap: 18px; align-items: center; }
.nav-right { display: flex; gap: 22px; }
.nav-right a {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--logo-text);
    font-weight: 400;
    letter-spacing: 0.5px;
}
.nav-right a:hover,
.nav-right a.active { color: var(--accent-orange); }

.search-container form {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-search);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}
.search-container input[type="text"] {
    border: none;
    padding: 6px 10px;
    width: 160px;
    font-size: 13px;
    outline: none;
    color: var(--text-dark);
}
.search-container input::placeholder { color: var(--border-search); }
.search-container button {
    background: transparent;
    border: none;
    color: var(--border-search);
    cursor: pointer;
    padding: 6px 10px;
    line-height: 0;
}

/* Баннер раздела: сам блок во всю ширину, размеры картинки — ниже,
   в секции Main / Banner / Layout (единственное объявление). */
.page-header-image {
    margin-bottom: 0;
    width: 100%;
}

.page-header-image img {
    width: 100%;
    height: 325px;
    object-fit: cover;
    border-radius: 0;
}

/* Универсальное смещение баннеров (под шапкой фото) для всех страниц до 499px - сделано чтобы центрировать объекты фото */
@media (max-width: 499px) {
    .page-header-image {
        margin-left: calc(-50vw + 50% - 60px) !important;
        width: calc(100vw + 60px) !important;
    }
    
    /* Исключение для некоторых баннеров страниц */
    .no-banner-shift .page-header-image {
        margin-left: calc(-50vw + 50%) !important;
        width: 100vw !important;
    }
}

/* ==========================================================================
   Main nav (3 dropdown + домик)
   ========================================================================== */
.main-nav { margin-top: 0px; }
.main-nav > ul {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    align-items: center;
}
.main-nav li { position: relative; }
.main-nav a {
    display: block;
    padding: 10px 0;
    font-weight: 400;
    font-size: 15px;
    color: var(--logo-text);
    text-transform: uppercase;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}
.main-nav a:hover { color: var(--accent-orange); }
.main-nav li.active > a { color: var(--accent-orange); }
.main-nav li.active > a .home-icon { fill: var(--accent-orange); }
.main-nav .home-icon {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    fill: var(--logo-text);
    transition: fill .2s ease;
}
.main-nav a:hover .home-icon { fill: var(--accent-orange); }

/* Увеличенная первая буква в пунктах меню */
.main-nav a .cap,
.nav-right a .cap { font-size: 1.25em; }

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 240px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    padding: 8px 0;
    z-index: 50;
}
.dropdown-content a {
    display: block;
    padding: 10px 20px;
    font-size: 12px;
    color: var(--logo-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dropdown-content a:hover { color: var(--accent-orange); }
.dropdown:hover > .dropdown-content,
.dropdown.is-open > .dropdown-content,
.dropdown:focus-within > .dropdown-content { display: block; }

.color-strip { height: 5px; background: var(--accent-orange); margin-top: 8px; margin-bottom: 20px; }

/* ==========================================================================
   Main / Banner / Layout
   ========================================================================== */
main { min-height: 500px; padding: 0 0 60px; }

.page-header {
    margin: 0 calc(50% - 50vw);
    width: 100vw;
}
/* Единая базовая высота баннера; мобильные значения (210px / 180px)
   переопределяются в блоке «Мобильная адаптация» в конце файла. */
.page-header-image img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 0;
    display: block;
}

.content-with-sidebar {
    display: flex;
    gap: 40px;
    margin-top: 35px;
    margin-bottom: 35px;
    align-items: flex-start;
}
.sidebar { 
    flex: 0 0 250px;
    background-color: var(--secondary-beige);
    border-radius: 6px;
    padding: 15px 0;
    align-self: flex-start;
    position: sticky;
    top: 20px;
}
.main-content { flex: 1; min-width: 0; }

.content-no-sidebar { margin-top: 35px; }

/* ==========================================================================
   Sidebar nav
   ========================================================================== */
   
/* --------------------------------------------------------------------------
   Боковое меню раздела (_sidebar.php). Единый каскад без !important.
   Три уровня вложенности (порядок 0 → 1 → 2). Подсветка «складывается»,
   т.к. PHP проставляет класс .active сразу всем предкам текущей страницы.
     • Порядок 0 — главные пункты раздела:        .sidebar-nav-link
     • Порядок 1 — заголовок подкатегории:        .sidebar-nav-category-header
     • Порядок 2 — статья внутри подкатегории:     .sidebar-nav-category-content a
   -------------------------------------------------------------------------- */

/* Контейнер меню */
.sidebar-nav { list-style: none; margin: 0; padding: 0; }
.sidebar-nav-item,
.sidebar-nav-category { margin-bottom: 5px; }
/* Все уровни выровнены по одной левой линии (без ступенчатого отступа) */
.sidebar-nav-item.sub-item,
.sidebar-nav-category.sub-item { margin-left: 20px; }

/* Порядок 0 — главные ссылки раздела: жирные, со стрелкой «›» */
.sidebar-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-left: 3px solid transparent;
    color: var(--primary-dark-blue);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    margin-right: 10px;
    text-decoration: none;
    position: relative;
    transition: all 0.2s ease;
}
/* Самый верхний пункт раздела крупнее */
.sidebar-nav-item.main-item .sidebar-nav-link { font-size: 16px; }

/* Порядок 1 — заголовок подкатегории: жирный, без стрелки */
.sidebar-nav-category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 15px;
    border-left: 3px solid transparent;
    color: var(--primary-dark-blue);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}
/* Длинные заголовки переносятся на несколько строк */
.sidebar-nav-category-header.multiline { flex-wrap: wrap; padding-right: 30px; }

/* Порядок 2 — статьи внутри подкатегории: обычные, со стрелкой «›» */
.sidebar-nav-category-content { display: block; padding-left: 0; }
.sidebar-nav-category-content a {
    display: block;
    padding: 10px 20px;
    border-left: 3px solid transparent;
    color: var(--primary-dark-blue);
    font-weight: 400;
    font-size: 14px;
    line-height: 1.4;
    text-decoration: none;
    position: relative;
    transition: all 0.2s ease;
}

/* Стрелка «›» у кликабельных пунктов (0 и 2 порядок); у заголовков её нет */
.sidebar-nav-link::after,
.sidebar-nav-category-content a::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-top: 2px solid var(--primary-dark-blue);
    border-right: 2px solid var(--primary-dark-blue);
    transform: rotate(45deg);
    transition: all 0.2s ease;
}

/* Ховер — лёгкая подложка и оранжевая полоса слева */
.sidebar-nav-link:hover,
.sidebar-nav-category-header:hover,
.sidebar-nav-category-content a:hover {
    background-color: rgba(0, 58, 93, 0.05);
    border-left-color: var(--accent-orange);
}
.sidebar-nav-link:hover::after,
.sidebar-nav-category-content a:hover::after { border-color: var(--accent-orange); }

/* === Активное состояние =================================================== */

/* Порядок 0 и 1 — сплошная оранжевая плашка, белый текст и белая стрелка */
.sidebar-nav-link.active,
.sidebar-nav-category-header.active {
    background-color: var(--accent-orange);
    color: #fff;
    border-left-color: var(--accent-orange);
}
.sidebar-nav-link.active::after { border-color: #fff; }

/* Порядок 2 — подсветка только цветом текста (без плашки) */
.sidebar-nav-category-content a.active {
    color: var(--accent-orange);
    background-color: transparent;
    border-left-color: transparent;
    font-weight: 600;
}
.sidebar-nav-category-content a.active::after { border-color: var(--accent-orange); }

/* ==========================================================================
   Article
   ========================================================================== */
.article-text-wrapper {
    line-height: 1.6;
}

.page-title-custom {
    color: var(--logo-text);
    margin-top: 0; 
    margin-left: 0; 
    margin-bottom: 20px; 
    border-bottom: none; 
    font-variant: small-caps; 
    font-size: 1.8rem;
    font-weight: normal;
    line-height: 1.2;
}
.article-title {
    color: var(--logo-text);
    margin-top: 0; 
    margin-left: 0; 
    margin-bottom: 20px; 
    border-bottom: none; 
    font-variant: small-caps; 
    font-size: 1.7rem;
    font-weight: normal;
    line-height: 1.2;
}
.article-text { 
    line-height: 1.75; 
    color: #2b2b2b; 
    font-size: 16px; }
.article-text h2 {
    color: var(--logo-text);
    margin-left: 0; 
    margin-bottom: 20px; 
    margin-top: 5px; 
   border-bottom: none; 
   font-variant: small-caps; 
   font-size: 1.5rem; 
   font-weight: 400; 
   line-height: 1.05;
}
.article-text h3 { font-size: 48px; }
.article-text p { margin-bottom: 14px; }
/* Классы выравнивания TinyMCE (align_right и т.д.) в body. */
.article-text .align_left,
.article-text .align-left { text-align: left; }
.article-text .align_right,
.article-text .align-right { text-align: right; }
.article-text .align_center,
.article-text .align-center { text-align: center; }
.article-text .align_full,
.article-text .align-full { text-align: justify; }
.article-text img.align_left,
.article-text figure.align_left,
.article-text img.align-left,
.article-text figure.align-left { float: left; margin: 4px 18px 12px 0; }
.article-text img.align_right,
.article-text figure.align_right,
.article-text img.align-right,
.article-text figure.align-right { float: right; margin: 4px 0 12px 18px; }
.article-text img.align_center,
.article-text figure.align_center,
.article-text img.align-center,
.article-text figure.align-center { display: block; margin-left: auto; margin-right: auto; }
.article-text em { color: var(--logo-text); font-style: italic; }
.article-text img { margin: 18px 0; border-radius: 4px; }
.article-text ul, .article-text ol { margin: 0 0 14px 26px; }
.article-text ul { list-style: square; }
.article-text ol { list-style: decimal; }
.article-text li { margin-bottom: 6px; }
.article-text li::marker {
    color: rgb(51, 51, 153);
  }
.article-text a { color: var(--logo-text); text-decoration: underline; }
.article-text a:hover { color: var(--accent-orange); }

.article-text hr {
    border: none;              /* убираем стандартную рамку браузера */
    height: 1px;               /* задаем толщину */
    background-color: var(--accent-orange);
    margin: 40px 0;
}

/* Селектор с тегом a нужен, чтобы перебить .article-text a { underline }. */
a.footnote-link,
.article-text a.footnote-link {
    color: var(--logo-text);
    font-weight: 400;        
    text-decoration: none;
}
/* Подчёркивание появляется только при наведении. */
a.footnote-link:hover,
.article-text a.footnote-link:hover { color: var(--accent-orange); text-decoration: underline; }

.article-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
}
.bottom-block { 
    text-align: right;
}
.bottom-block .author-names { 
    display: block;    
    text-align: right;
    font-style: normal;
    font-size: 0.9em;
    color: #000;
}
.bottom-block .copyright {  
    /* Блочный, иначе margin-top на inline-span не сработает. */
    display: block;
    margin-top: 20px;
    /* Гасим border-top / padding-top, приходящие от футерного .copyright. */
    border-top: none;
    padding-top: 0;
    text-align: left;
    font-style: normal;
    font-size: 0.9em;
    color: #000;
}

.article-card-image { margin: 0 0 20px; }
.article-gallery { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.article-gallery img { max-width: 240px; border-radius: 4px; }
.pdf-link a {
    display: inline-block;
    padding: 8px 14px;
    background: var(--accent-orange);
    color: var(--secondary-beige);
    border-radius: 4px;
    font-weight: 600;
}
.styletitleArticle {
    margin-top: 0; 
    margin-left: 0; 
    margin-bottom: 20px; 
    border-bottom: none; 
    font-variant: small-caps; 
    font-size: 1.8rem; 
    font-weight: normal; 
    line-height: 1.2;
}
/* ==========================================================================
   Bibliography
   ========================================================================== */
.bibliography-block {
    margin: 32px 0 24px;
    border-radius: 6px;
    overflow: hidden;
}
.bibliography-title {
    background: var(--accent-orange);
    color: #fff;
    font-weight: 400;
    font-size: 1.2rem;
    padding: 6px 22px;
    letter-spacing: 1px;
    text-transform: none;
}
.bibliography-list {
    background: #fff;
    color: #222;
    font-size: 0.92rem;
    padding: 16px 22px;    
    border: none;
}
.bibliography-list ol { margin: 0; padding-left: 22px; }
.bibliography-list li { line-height: 1.4; margin: 2px 0; }

/* ==========================================================================
   News grid
   ========================================================================== */
.section-title { 
    text-transform: uppercase;
    font-size: 1.3rem;
    font-weight: normal;
    color: var(--logo-text);
    margin: 7px 0 20px 0;
    letter-spacing: 1px;
    text-align: left;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--accent-orange);
}

.section-title-news {
    text-transform: uppercase;
    font-size: 1.3rem;
    color: var(--logo-text);
    letter-spacing: 1px;
    margin: 6px 0 24px;
    font-weight: 400;
}
/* Обёртка заголовка раздела и кнопки случайной новости */
.news-header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
/* Стили для кнопки «Случайная новость» */
.news-random-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-dark-blue);
    background: #fff;
    border: 1px solid var(--primary-dark-blue);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.25s ease;
}
.news-random-btn:hover {
    background: var(--primary-dark-blue);
    color: #fff;
}
/* Анимация акцентного выделения карточки при выборе случайной новости */
.news-card-highlight {
    outline: 3px solid var(--accent-orange) !important;
    transform: translateY(-5px) !important;
}
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}
/* Три колонки фиксированной доли: 1–2 карточки в ряду не растягиваются. */
.news-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
button.direction-item-link {
    border: 0;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
}
.direction-item-link.is-disabled,
.direction-item-link.is-disabled:hover {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
    background-color: var(--primary-dark-blue);
    color: #fff;
}
@media (max-width: 720px) {
    .news-grid-3 { grid-template-columns: minmax(0, 1fr); }
    /* Одна колонка: строка — это одна карточка, пустой summary схлопываем сразу. */
    .news-card.is-summary-empty {
        height: calc(430px - var(--news-summary-block));
    }
    .news-card.is-summary-empty .news-card-description {
        display: none;
    }
}
.news-card {
    /* Фиксированная карточка: картинка + год + 3 строки заголовка + 3 строки summary + кнопка */
    /* Слот summary: отступ 12px + 3 строки. Вычитается, когда строка вся без описания. */
    --news-summary-block: calc(12px + 0.85rem * 1.4 * 3);
    display: flex;
    flex-direction: column;
    height: 430px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
    color: inherit;
}
.news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
    color: inherit;
}
/* Вся строка без summary — скрываем описание и укорачиваем карточку на его слот. */
.news-card.is-row-no-summary {
    height: calc(430px - var(--news-summary-block));
}
.news-card.is-row-no-summary .news-card-description {
    display: none;
}
.news-card-image { width: 100%; height: 170px; flex: 0 0 170px; overflow: hidden; }
.news-card-image img { width: 100%; height: 100%; object-fit: cover; }
.news-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 16px 18px 22px;
}
.news-card-year {
    position: relative;
    padding: 8px 8px 8px 8px;
    background: var(--accent-orange);
    color: var(--secondary-beige);
    border-radius: 4px 4px 4px 4px;
    line-height: 1;
    display: inline-block;
    align-self: flex-start;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 10px;
}
.news-card-title {
    /* Заголовок — максимум 3 строки */
    color: var(--logo-text);
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
    height: calc(0.95rem * 1.4 * 3);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}
.news-card-description {
    /* Summary — максимум 3 строки */
    margin: 12px 0 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #444;
    height: calc(0.85rem * 1.4 * 3);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}
/* Абзацы из поля summary не должны раздувать слот: склеиваем их в один поток,
   чтобы line-clamp резал весь текст, а не каждый <p> отдельно. */
.news-card-description p {
    display: inline;
    margin: 0;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}
.news-card-description p + p::before { content: " "; }
.news-card-description a { color: var(--logo-text); }
.news-card-description a:hover { color: var(--accent-orange); }
.news-card .direction-item-link {
    /* Кнопка «Далее» всегда прижата к низу карточки */
    margin: auto 0 0;
}

/* ==========================================================================
   Search / Sitemap
   ========================================================================== */
 .page-search p {
    font-family: 'Segoe UI';
    font-weight: normal;
    font-size: 1.3rem;
    color: var(--border-search);
}
.search-query {
    color: var(--text-dark);
}
.search-results { padding-left: 0; }
.search-results li { margin-bottom: 0px; }
/* Гасим дефолтный margin: 1em 0 у h3, который при .article-text h3 { 48px }
   давал по 48px между результатами. Размер сбрасываем и на самом h3,
   иначе высоту строки задаёт его крупный strut. */
.search-results h3 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    line-height: 1.2;
}
.search-results h3 a { 
    color: var(--logo-text);    
    text-decoration: none; /* убираем подчёркивание у заголовков результатов */
    font-variant: small-caps;
    font-size: 1.2rem;
    font-weight: normal;
    line-height: 1.2;
}
/* Заголовки результатов — без подчёркивания в любом состоянии.
   Нужно перебить .article-text a { text-decoration: underline }. */
.search-results h3,
.search-results h3 a,
.search-results h3 a:hover { text-decoration: none; }
.search-results h3 a:hover { color: var(--accent-orange); }
.sitemap, .sitemap ul { padding-left: 20px; }
.sitemap a { text-decoration: underline; }

/* ==========================================================================
   Footer (slant)
   ========================================================================== */
   footer {
    margin-top: -75px; 
    background-color: var(--primary-dark-blue);
    color: var(--text-light);
    position: relative;
    z-index: 1;
}

.slant-color-insert {
    position: relative;
    padding: 30px 0 10px;
    background-color: var(--primary-dark-blue);
    clip-path: polygon(0 15%, 100% 0, 100% 100%, 0 100%);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.site-map {
    margin-bottom: -5px;
}

.site-map h3 {
    margin-bottom: 15px;
    color: var(--accent-orange);
    text-transform: none;
    font-size: 1.15rem;
    font-weight: 400;
    font-family: 'Segoe UI';
    position: relative; 
    z-index: 2;
    padding-top: 10px; 
}

.site-map ul li {
    margin-bottom: 8px;
    font-family: 'Segoe UI';
    font-size: 1rem;
    font-weight: 400;
}

.site-map a {
    color: var(--text-light);
}

.site-map a:hover {
    color: var(--accent-orange);
}

.footer-link-arrow { color: var(--accent-orange); margin-left: 4px; }
.copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0px;
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
}

/* ==========================================================================
   Mobile menu toggle (по умолчанию скрыт)
   ========================================================================== */
.mobile-menu-toggle { display: none; background: transparent; border: none; cursor: pointer; padding: 8px; }
.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--logo-text);
    margin: 5px 0;
    transition: all .3s ease;
}
.mobile-menu-sidebar-nav { display: none; }

/* Кнопка «Подробнее» в карточках. Раньше в этой группе был и
   .direction-item-link, но он полностью переопределялся ниже (см. плашку
   со срезанным углом), поэтому оставлен только .read-more-btn. */
.read-more-btn {
    display: inline-block;
    padding: 8px 15px;
    background-color: var(--primary-dark-blue);
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: background-color 0.3s ease;
    margin-left: 24px;
}

.read-more-btn:hover {
    background-color: var(--accent-orange);
    color: #fff;
}

.direction-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 30px;
    margin-bottom: 10px; 
}

.direction-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    background-color: var(--secondary-beige);
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.direction-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.direction-item-content {
    display: flex;
    flex-direction: row;
    /* Высоту ряда задаёт текстовая колонка; картинка растягивается под неё */
    align-items: stretch;
    gap: 10px;
    padding: 20px;
    position: relative;
}

/* Единое базовое правило картинки в карточке направления.
   height: auto + align-self: stretch — из позднего дубликата, который
   раньше стоял ниже и перебивал height: 150px. */
.direction-item-image {
    flex: 0 0 200px;
    height: auto;
    align-self: stretch;
    overflow: hidden;
    border-radius: 4px;
    position: relative;
}

.direction-item-image img {
    /* Абсолют: intrinsic-высота картинки не влияет на flex-ряд */
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.direction-item-separator {
    width: 4px;
    height: 150px;
    background-color: var(--accent-orange);
    position: relative;
    flex: 0 0 4px;
}

.direction-item-title {
    flex: 1;
}

.direction-item-title h2 {
    color: rgb(51,51,153); 
    margin-bottom: 15px;
    font-size: 24px; 
    font-weight: bold;
}

.direction-item-title p {
    margin-bottom: 15px;
}

/* Плашка-«стрелка» со срезанным правым углом. Свойства text-decoration /
   font-weight / font-size / transition раньше приезжали из группы
   .read-more-btn — теперь объявлены здесь, правило самодостаточное. */
.direction-item-link {
    position: relative;
    padding: 8px 30px 8px 18px;
    background-color: var(--primary-dark-blue);
    color: #fff;
    border-radius: 4px 0 0 4px;
    line-height: 1;
    display: inline-block;
    align-self: flex-start;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: background-color 0.3s ease;
    min-width: 80px;
    margin-left: 24px;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
}

.direction-item-link:hover {
    background-color: var(--accent-orange);
    color: #fff;
}

@media (max-width: 767px) {
    .direction-item-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* flex здесь не задаём: базовое flex: 0 0 200px всё равно оставалось
       в силе из-за дубликата ниже — сохраняем фактическое поведение. */
    .direction-item-image {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .direction-item-separator {
        width: 100%;
        height: 4px;
        margin: 5px 0 15px;
        flex: 0 0 4px;
    }
}

.info-block {
    background-color: var(--secondary-beige);
    padding: 30px;
    border-radius: 4px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.info-block h2 {
    color: var(--primary-dark-blue);
    margin-bottom: 20px;
    font-size: 24px;
    border-bottom: 2px solid var(--accent-orange);
    padding-bottom: 10px;
}

.coming-soon {
    background-color: #fff;
    padding: 25px;
    border-radius: 4px;
    border-left: 4px solid var(--accent-orange);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.coming-soon h3 {
    color: var(--primary-dark-blue);
    margin-bottom: 15px;
    font-size: 20px;
}

.coming-soon ul {
    list-style: disc;
    padding-left: 20px;
}

.coming-soon ul li {
    margin-bottom: 10px;
}

.direction-item-content-wrapper {
    display: flex;
    flex-direction: column;
    padding-left: 20px;
    border-left: 4px solid var(--accent-orange);
    margin-bottom: 15px;
}

 /* Стили для мобильной плашки "Статьи в разработке" */
 .mobile-only.coming-soon-section .direction-item {
    background-color: #f3efe6 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    margin-bottom: 0 !important;
}

.mobile-only.coming-soon-section .direction-item-content {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
    border: none !important;
    border-radius: 8px !important;
    background-color: #f3efe6 !important;
    position: relative !important;
    overflow: visible !important;
    display: flex !important;
}

.mobile-only.coming-soon-section .direction-item-image {
    width: 100% !important;
    height: 220px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: none !important;
    border-radius: 6px 6px 0 0 !important;
    overflow: hidden !important;
}

.mobile-only.coming-soon-section .direction-item-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 6px 6px 0 0 !important;
}

.mobile-only.coming-soon-section .direction-item-title {
    width: 100% !important;
    padding: 0 20px 20px !important;
    margin: 0 !important;
    flex: none !important;
}

.mobile-only.coming-soon-section .direction-item-content-wrapper {
    border-left: none !important;
    border-top: 4px solid var(--accent-orange) !important;
    padding-left: 0 !important;
    padding-top: 15px !important;
    margin: 0 !important;
    height: auto !important;
}

.mobile-only.coming-soon-section .direction-item-title h2 {
    margin-top: 0 !important;
    margin-bottom: 15px !important;
    color: rgb(51,51,153) !important;
    font-weight: normal !important;
    font-size: 1.26rem !important;
}

.direction-item-text {
    flex: 1;
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 0%;
    font-size: 0.90rem;
    font-weight: normal;
}

.mobile-only.coming-soon-section .direction-item-text ul {
    list-style-type: none !important;
    padding-left: 0 !important;
    margin-bottom: 20px !important;
}

.mobile-only.coming-soon-section .direction-item-text li {
    margin-bottom: 10px !important;
    position: relative !important;
    padding-left: 20px !important;
    font-size: 0.90rem !important;
    font-weight: normal !important;
    color: var(--text-dark) !important;
}

.mobile-only.coming-soon-section .direction-item-text li span {
    position: absolute !important;
    left: 0 !important;
    top: 6px !important;
    width: 6px !important;
    height: 6px !important;
    background-color: rgb(51,51,153) !important;
    display: inline-block !important;
}

@media (max-width: 767px) {
    .coming-soon-section .direction-item {
        background-color: #f3efe6 !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        margin-bottom: 0 !important;
    }
    
    .coming-soon-section .direction-item-content {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 0 !important;
        margin-bottom: 0 !important;
        border: none !important;
        border-radius: 8px !important;
        background-color: #f3efe6 !important;
        position: relative !important;
        overflow: visible !important;
        display: flex !important;
    }
    
    .coming-soon-section .direction-item-image {
        width: 100% !important;
        height: 220px !important;
        margin: 0 !important;
        padding: 0 !important;
        flex: none !important;
        border-radius: 6px 6px 0 0 !important;
        overflow: hidden !important;
    }
    
    .coming-soon-section .direction-item-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
        border-radius: 6px 6px 0 0 !important;
    }
    
    .coming-soon-section .direction-item-title {
        width: 100% !important;
        padding: 0 20px 20px !important;
        margin: 0 !important;
        flex: none !important;
    }
    
    .coming-soon-section .direction-item-content-wrapper {
        border-left: none !important;
        border-top: 4px solid var(--accent-orange) !important;
        padding-left: 0 !important;
        padding-top: 15px !important;
        margin: 0 !important;
        height: auto !important;
    }
}

@media (max-width: 375px) {
.mobile-only.coming-soon-section .direction-item-image {
    height: 250px !important;
    overflow: hidden;
}
}

@media (min-width: 376px) and (max-width: 480px) {
.mobile-only.coming-soon-section .direction-item-image {
    height: 300px !important;
    overflow: hidden;
}
}

@media (min-width: 481px) and (max-width: 991px) {
.mobile-only.coming-soon-section .direction-item-image {
    height: 350px !important;
    overflow: hidden;
}
}

@media (min-width: 376px) and (max-width: 480px) {
    /* Стили для "Скоро на сайте" на средних экранах */
    .coming-soon-section .direction-item-image {
        height: 300px !important;
    }   
    
    .direction-item-image {
        height: 220px !important;
        min-height: 220px !important;
        max-height: 220px !important;
    }
}

@media (min-width: 481px) and (max-width: 767px) {
    .coming-soon-section .direction-item-image {
        height: 360px !important;
    }
    
    .direction-item-image {
        height: 400px !important;
    }
}

.direction-item-image{
      flex: 0 0 200px;
      height: auto;
      align-self: stretch;
  }



  .books-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 0;
}

.book-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden; 
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    height: 320px; 
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.book-card-image {
    width: 100%;
    height: 100%;
    overflow: hidden; 
    position: absolute;
    top: 0;
    left: 0;
    background-color: rgb(208, 233, 236); /* Фон для всех карточек */
}

.book-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    transition: transform 0.3s ease;
}

.book-card:hover .book-card-image img {
    transform: scale(1.05);
}

.book-card-content {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.book-card-button {
    display: inline-block;
    background: var(--accent-orange);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.3s ease;
    margin-left: -10px;
}

.book-card-button:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

.article-content{margin-top:0}
/* Дубликаты активных состояний сайдбара с !important убраны:
   те же значения уже заданы в секции «Sidebar nav» без !important. */

/* Стиль для заголовков секций */
h3.section {
    font-size: 1.15rem;
    font-weight: normal;
    margin-top: 30px;
    margin-bottom: 10px;
    color: rgb(51,51,153);
}

/* Стили для ссылки "Контакты" */
.contacts-link {
    color: #000 !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contacts-link:hover {
    color: var(--accent-orange) !important;
}

/* Стили для таблицы специалистов */
.specialists-table-container {
    overflow-x: scroll;
    margin: 0px 0;
}

.specialists-table {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-collapse: collapse;
    font-family: 'Segoe UI', sans-serif;
    table-layout: fixed;
}

/* Задаем ширину для всех столбцов таблицы */
.specialists-table colgroup col:nth-child(1) { width: 56.5px; }
.specialists-table colgroup col:nth-child(2) { width: 56.5px; }
.specialists-table colgroup col:nth-child(3) { width: 249px; }
.specialists-table colgroup col:nth-child(4) { width: 208px; }
.specialists-table colgroup col:nth-child(5) { width: 120px; }

.specialists-table td {
    border: 1pt solid #ffffff;
    padding: 8px;
    vertical-align: top;
}

.specialists-table .header-cell {
    text-align: left;
    padding: 0px 0px 0px 0px;
}

/* Столбец «Город» (colspan=2): оформление и фиксированная ширина в одном месте */
.specialists-table .city-cell {
    text-align: left;
    font-weight: normal;
    width: 113px;
    max-width: 113px;
}

.specialists-table .name-cell p:first-child {
    margin: 0;
    font-size: 10pt;
    color: #1f3864;
}

.specialists-table .name-cell p:last-child {
    margin: 3px 0 0 0;
    font-size: 10pt;
    color: #1f3864;
}

.specialists-table .email-cell p {
    margin: 0;
    font-size: 10pt;
    color: #1f3864;
}

.specialists-table .phone-cell p {
    margin: 0;
    font-size: 10pt;
    color: #1f3864;
}

.specialists-table .note-cell {
    padding: 15px;
    background-color: #ffffcc;
}

.specialists-table .note-cell p {
    margin: 0;
    font-size: 11pt;
    font-style: italic;
    color: #333399;
}

/* Цвета фонов для городов */
.bg-ekaterinburg { background-color: #ffcccc; }
.bg-zelenograd { background-color: #ffff00; }
.bg-moscow { background-color: #9999ff; }
.bg-murom { background-color: #66ffcc; }
.bg-peresvetovo { background-color: #ffc000; }
.bg-rostov { background-color: #ff99cc; }
.bg-samara { background-color: #a8d08d; }
.bg-spb { background-color: #ffccff; }
.bg-almetyevsk { background-color: #ccecff; }
.bg-kazan { background-color: #99ff99; }
.bg-tolyatti { background-color: #66ccff; }

/* Цвета текста */
.text-city { color: #a50021; }
.text-name { color: #1f3864; }
.text-name-special { color: #333399; }

/* Правильные пропорции столбцов: ширина .city-cell задана выше, в его правиле */

/* Столбец ФИО - 3-й по счету */
.specialists-table td:nth-child(3) {
    width: 249px;
    min-width: 249px;
}

/* Столбец Email - 4-й по счету */
.specialists-table td:nth-child(4) {
    width: 208px;
    min-width: 208px;
}

.specialists-table td:nth-child(5) {
    width: 120px;
    max-width: 120px;
}

/* Мобильные правки для разрешений до 909px */
@media (max-width: 909px) {
    .specialists-table .header-cell p {
        margin-left: 0 !important;
        text-align: left !important;
    }
}

/* Правки для планшетов от 992px до 1196px */
@media (min-width: 992px) and (max-width: 1196px) {
    .specialists-table .header-cell p {
        margin-left: 0 !important;
        text-align: left !important;
    }
}

/* Горизонтальный скролл для мобильной версии до 709px */
@media (max-width: 709px) {
    .specialists-table-container {
        position: relative;
        /* Делаем основной скролл всегда видимым */
        overflow-x: scroll !important;
        /* Всегда резервируем место для скролла */
        scrollbar-gutter: stable;
    }
    
    /* Показываем верхний скролл на мобильных */
    .scroll-top-mobile {
        display: block !important;
        /* Всегда резервируем место для скролла */
        scrollbar-gutter: stable;
    }
}

/* ==========================================================================
   Contacts — страница контактов (contacts.php)
   ========================================================================== */

/* Контактная версия заголовка: с нижней оранжевой границей (порт инлайн-стиля) */
.page-contacts .page-title-custom {
    text-transform: none;
    font-size: 1.7rem;
    font-weight: normal;
    color: rgb(51, 51, 153);
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-orange);
    font-variant: small-caps;
    line-height: 1.2;
}

/* Двухколоночная раскладка: слева — информация, справа — форма */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 60px;
}

.contact-info p { line-height: 1.6; margin-bottom: 12px; }
.contact-redaction { margin-top: 10px; }
.contact-redaction-label,
.contact-address { color: #000; }

/* Блок контактных данных (email / адрес) */
.contact-details { margin-top: 25px; }
.contact-item { margin-bottom: 20px; }
.contact-item h3 {
    margin-bottom: 6px;
    font-weight: normal;
    color: rgb(51, 51, 153);
}
.contact-item p { margin: 0; }
.contact-item a {
    color: #000;
    text-decoration: none;
    transition: color 0.2s ease;
}
.contact-item a:hover { color: var(--accent-orange); }

/* Форма обратной связи */
.contact-form .form-group { margin-bottom: 18px; }
.contact-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: normal;
    color: #000;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d7dbe0;
    border-radius: 8px;
    font: inherit;
    font-size: 1rem;
    color: #333;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.contact-form textarea { min-height: 120px; resize: vertical; }
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px rgba(248, 156, 49, 0.15);
}

/* Кнопка отправки */
.contact-form .button {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    background: var(--primary-dark-blue);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    
}
.contact-form .button:hover {
    background: #e67e22;
    transform: translateY(-1px);
}

/* Адаптив: одна колонка на узких экранах */
@media (max-width: 768px) {
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

        /* Стили для слайдера фотографий */
        .photo-gallery-slider {
            margin-top: 15px;
            padding: 15px;
            background: white;
            border-radius: 10px;
            box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
            border: 1px solid #e9ecef;
        }

        .slider-container {
            position: relative;
            max-width: 600px;
            margin: 0 auto;
        }

        .slider-arrow {
            position: absolute;
            /* Центр 400px-превью, а не всего слайда (подпись теперь снизу) */
            top: 200px;
            transform: translateY(-50%);
            background: var(--primary-dark-blue);
            color: white;
            border: none;
            width: 35px;
            height: 35px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            transition: all 0.3s ease;
            z-index: 10;
        }

        .slider-arrow:hover {
            background: var(--accent-orange);
            transform: translateY(-50%) scale(1.1);
        }

        .slider-arrow.prev {
            left: -45px;
        }

        .slider-arrow.next {
            right: -45px;
        }

        .slider-content {
            background: white;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
        }

        .photo-slide {
            display: none;
        }
        
        .photo-slide.active {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 0;
            width: 100%;
            max-width: 100%;
            height: auto;
            animation: fadeIn 0.5s ease-in-out;
        }

        /* Нет подписи — слайд ровно по высоте фото */
        .photo-slide.active:not(:has(.photo-caption)) {
            height: 400px;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        /* Без подписи — картинка прямым потомком слайда, на всю ширину */
        .photo-slide > img {
            flex: 1;
            max-width: 100%;
            width: 100%;
            height: 400px;
            object-fit: cover;
            border-radius: 0;
            margin: 0;
            padding: 0;
            display: block;
        }

        /* С подписью — фото сверху на всю ширину, caption под ним */
        .photo-image-container {
            flex: none;
            width: 100%;
            max-width: 100%;
            height: 400px;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: #f8f8f8;
            border-radius: 8px 8px 0 0;
        }

        .photo-image-container img {
            width: auto;
            height: auto;
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            border-radius: 0;
            margin: 0 auto;
            padding: 0;
            display: block;
        }

        /* Высота блока = высота текста, без фиксированных 150/400px */
        .photo-caption,
        .video-caption {
            flex: 0 0 auto;
            width: 100%;
            max-width: 100%;
            height: auto;
            padding: 12px 16px;
            margin: 0;
            background: white;
            display: block;
            text-align: left;
            box-sizing: border-box;
            border-left: none;
            border-top: 3px solid var(--accent-orange);
            border-radius: 0 0 8px 8px;
            overflow: visible;
        }

        .photo-caption p,
        .video-caption p {
            margin: 0 0 10px 0;
            font-size: 16px;
            line-height: 1.5;
            color: var(--text-dark);
            overflow-wrap: anywhere;
        }

        .photo-caption p {
            font-family: 'Georgia', serif;
        }

        .photo-caption p:last-child {
            margin-bottom: 0;
        }

        .photo-caption .caption-segoe {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        .photo-caption .caption-article {
            font-family: inherit;
        }

        .slider-indicators {
            display: flex;
            justify-content: center;
            gap: 6px;
            margin-top: 15px;
            margin-bottom: 10px;
        }

        .indicator {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #dee2e6;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .indicator.active {
            background: var(--accent-orange);
            transform: scale(1.2);
        }

            .photo-counter {
                text-align: center;
                margin-top: -5px;
                font-size: 0.8rem;
                color: var(--text-muted);
                font-weight: 500;
                display: flex;
                justify-content: center;
                align-items: flex-start;
                gap: 25px;
            }

            .photo-counter .current-number {
                color: var(--accent-orange);
                font-weight: 600;
            }
            
            .photo-counter span {
                align-self: center;
            }
            
            /* Стрелки для мобильной версии рядом с нумерацией */
            .mobile-arrow {
                display: none;
                width: 28px;
                height: 28px;
                border-radius: 50%;
                background-color: rgb(85, 85, 199);
                color: white;
                border: none;
                align-items: center;
                justify-content: center;
                font-size: 16px;
                font-weight: bold;
                cursor: pointer;
                transition: all 0.3s ease;
                box-shadow: 0 2px 6px rgba(85, 85, 199, 0.3);
                transform: translateY(-10px);
            }
            
            .mobile-arrow:hover {
                background-color: var(--accent-orange);
                transform: translateY(-10px) scale(1.1);
            }
            
            .mobile-arrow:active {
                background-color: rgb(85, 85, 199);
                transform: translateY(-10px);
            }

        /* Отступ над заголовком «Видеоматериалы» */
        .video-materials-title {
            margin-top: 40px;
        }

        /* Стили для видеопленки */
        .video-gallery-slider {
            margin-top: 25px;
            padding: 15px;
            background: white;
            border-radius: 10px;
            box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
            border: 1px solid #e9ecef;
        }

        .video-slider-container {
            position: relative;
            max-width: 600px;
            margin: 0 auto;
        }

        .video-slide {
            display: none;
        }
        
        .video-slide.active {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 0;
            width: 100%;
            max-width: 100%;
            height: auto;
            animation: fadeIn 0.5s ease-in-out;
        }

        /* Нет подписи — слайд ровно по высоте превью */
        .video-slide.active:not(:has(.video-caption)) {
            height: 400px;
        }
        
        .video-preview {
            flex: none;
            min-width: 0;
            width: 100%;
            height: 400px;
            background-color: #2b2b2b;
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            border: none;
            border-radius: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: relative;
            transition: all 0.3s ease;
            cursor: pointer;
            overflow: hidden;
        }

        /* С подписью — превью contain, чтобы кадр не обрезался над текстом */
        .video-slide:has(.video-caption) .video-preview {
            border-radius: 8px 8px 0 0;
            background-size: contain !important;
            background-position: center !important;
            background-repeat: no-repeat !important;
        }

        .video-preview:hover {
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
        }

        .play-button {
            width: 52px;
            height: 52px;
            border-radius: 50%;
            background: rgba(0, 0, 0, 0.4);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.6rem;
            color: var(--accent-orange);
            margin-bottom: 10px;
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
            z-index: 2;
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(255, 255, 255, 0.1);
            padding-left: 3px;
        }

        .video-preview:hover .play-button {
            color: #ff8c00;
            transform: scale(1.05);
            background: rgba(0, 0, 0, 0.5);
            box-shadow: 0 4px 20px rgba(255, 140, 0, 0.3);
            border-color: rgba(255, 140, 0, 0.3);
        }

        .video-number {
            display: none;
        }

        .video-caption p {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            text-align: left;
        }

        .video-caption p:last-child {
            margin-bottom: 0;
        }

        .video-slider-indicators {
            display: flex;
            justify-content: center;
            gap: 6px;
            margin-top: 15px;
            margin-bottom: 10px;
        }

        .video-indicator {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #dee2e6;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .video-indicator.active {
            background: var(--accent-orange);
            transform: scale(1.2);
        }

        .video-counter {
            text-align: center;
            margin-top: -5px;
            font-size: 0.8rem;
            color: var(--text-muted);
            font-weight: 500;
            display: flex;
            justify-content: center;
            align-items: flex-start;
            gap: 25px;
        }

        .video-counter .current-number {
            color: var(--accent-orange);
            font-weight: 600;
        }
        
        .video-counter span {
            align-self: center;
        }
        
        /* Стрелки для мобильной версии рядом с нумерацией */
        .mobile-video-arrow {
            display: none;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background-color: rgb(85, 85, 199);
            color: white;
            border: none;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 2px 6px rgba(85, 85, 199, 0.3);
            transform: translateY(-10px);
        }
        
        .mobile-video-arrow:hover {
            background-color: var(--accent-orange);
            transform: translateY(-10px) scale(1.1);
        }
        
        .mobile-video-arrow:active {
            background-color: rgb(85, 85, 199);
            transform: translateY(-10px);
        }

        .video-modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(5px);
        }

        .video-modal-content {
            position: relative;
            background-color: #000;
            margin: 2% auto;
            padding: 0;
            width: 90%;
            max-width: 800px;
            height: 450px; 
            border-radius: 8px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
            animation: modalZoomIn 0.3s ease-out;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Переименовано из modalFadeIn: ниже в файле было второе @keyframes
           с тем же именем (translateY), и оно перебивало это — видео-модалка
           теряла зум. Теперь у каждой анимации своё имя. */
        @keyframes modalZoomIn {
            from { opacity: 0; transform: scale(0.9); }
            to { opacity: 1; transform: scale(1); }
        }

        .video-modal video {
            width: 100%;
            height: 100%;
            border-radius: 8px;
            display: block;
            object-fit: contain;
        }

        .video-close {
            position: absolute;
            top: 20px;
            right: 20px;
            color: white;
            font-size: 26px;
            font-weight: 600;
            cursor: pointer;
            background: linear-gradient(135deg, var(--accent-orange) 0%, #e67e22 100%);
            border: 2px solid rgba(255, 255, 255, 0.2);
            border-radius: 50%;
            width: 45px;
            height: 45px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            box-shadow: 0 4px 20px rgba(255, 152, 0, 0.3);
            z-index: 9999;
        }

        .video-close:hover {
            background: linear-gradient(135deg, #e67e22 0%, var(--accent-orange) 100%);
            color: white;
            transform: scale(1.1);
            box-shadow: 0 6px 25px rgba(255, 152, 0, 0.5);
            border-color: rgba(255, 255, 255, 0.4);
        }

        @media (max-width: 699px) {
            .video-gallery-slider {
                padding: 12px;
                margin-top: 18px;
                width: 100%;
            }
            
            .video-slider-container {
                flex-direction: column;
                gap: 10px;
                width: 100%;
                position: relative;
            }
            
            .slider-arrow {
                width: 32px;
                height: 32px;
                display: none;
            }
            
            .video-slide.active:not(:has(.video-caption)) {
                height: 350px;
            }

            .video-slide.active:has(.video-caption) {
                height: auto;
            }
            
            .video-preview {
                max-width: 100% !important;
                width: 100% !important;
                height: 350px !important; 
                border-radius: 6px 6px 0 0;
                display: flex !important;
                align-items: center;
                justify-content: center;
                background-position: center !important;
                background-size: contain !important;
                background-repeat: no-repeat !important;
                margin: 0 auto;
                min-width: 100% !important;
                flex: none !important;
            }
            
            /* Высота caption остаётся auto (как на десктопе) — только шрифт чуть плотнее */
            .video-caption p {
                font-size: 16px;
                line-height: 1.4;
                margin-bottom: 0;
            }

            /* Адаптивность модального окна для мобильных */
            .video-modal-content {
                width: 95%;
                max-width: none;
                height: 56vw; /* 16:9 соотношение для видео */
                margin: 40% auto;
            }

            .video-close {
                top: -45px;
                right: 0;
                width: 40px;
                height: 40px;
                font-size: 24px;
            }
            
            /* font-size: 0 скрывает текстовую иконку ► — вместо неё рисуется
               треугольник через .play-button::before (ниже в этом же файле).
               Размеры остаются здесь, до брейкпоинта 480px, который их
               уменьшает до 50x50. */
            .play-button {
                width: 60px;
                height: 60px;
                padding-left: 6px;
                position: relative;
                font-size: 0;
            }
        }
        
        @media (max-width: 480px) {
            /* .video-preview и .video-caption p для 480px заданы ниже,
               в общем блоке фото/видео-галереи. */
            .video-modal-content {
                margin: 60% auto;
                height: 50vw;
            }
            
            .play-button {
                width: 50px;
                height: 50px;
            }
        }

        @media (max-width: 699px) {
            .mobile-arrow, .mobile-video-arrow {
                display: flex;
            }
            
            .play-button::before {
                content: '';
                position: absolute;
                left: 50%;
                top: 50%;
                transform: translate(-50%, -50%);
                width: 0;
                height: 0;
                border-left: 12px solid var(--accent-orange);
                border-top: 8px solid transparent;
                border-bottom: 8px solid transparent;
                margin-left: 2px;
            }
            
            .photo-gallery-slider {
                padding: 12px;
                margin-top: 18px;
                width: 100%;
            }
            
            .slider-container {
                flex-direction: column;
                gap: 10px;
                width: 100%;
            }
            
            /* .slider-arrow для этого брейкпоинта задан выше (скрыт). */
            .slider-content {
                flex: 1;
                position: relative;
                overflow: hidden;
                border-radius: 6px;
                box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
                width: 100%;
                max-width: 100%;
                display: block;
                margin: 0 auto;
            }
            
            .photo-slide.active:has(.photo-caption) {
                height: auto;
            }

            /* Без подписи на мобилке — только картинка, без лишней высоты под caption */
            .photo-slide.active:not(:has(.photo-caption)) {
                height: 400px;
            }
            
            /* Контейнер для изображения с фиксированной высотой */
            .photo-image-container {
                width: 100%;
                height: 400px; 
                overflow: hidden;
                display: flex;
                align-items: center;
                justify-content: center;
                background-color: #f8f8f8;
                border-radius: 6px 6px 0 0;
            }
            
            .photo-image-container img {
                width: auto;
                height: auto;
                max-width: 100%;
                max-height: 100%;
                object-fit: contain; 
                margin: 0 auto;
            }

            .photo-slide > img {
                width: 100%;
                height: 100%;
                max-width: 100%;
                max-height: 100%;
                object-fit: cover;
                margin: 0;
            }
            
            .gallery-title {
                font-size: 1rem;
            }
            
            /* Caption уже снизу и по тексту — на мобилке не фиксируем 150px */
            .photo-caption p {
                font-size: 16px;
                line-height: 1.4;
                margin-bottom: 0;
            }
        }
        
        @media (max-width: 480px) {
            .photo-slide.active:not(:has(.photo-caption)) {
                height: 350px;
            }

            .photo-slide.active:has(.photo-caption) {
                height: auto;
            }
            
            .photo-image-container {
                height: 350px;
            }
            
            .video-slide.active:not(:has(.video-caption)) {
                height: 300px;
            }

            .video-slide.active:has(.video-caption) {
                height: auto;
            }
            
            .video-preview {
                height: 300px !important;
            }
            
            .photo-caption p, .video-caption p {
                font-size: 16px;
            }
        }
        
        @media (max-width: 389px) {
            .school-logo-container + span {
                text-align: right !important;
                display: block !important;
                width: 100% !important;
                margin-top: 10px !important;
            }
            
            .school-logo-container {
                width: 100% !important;
                margin-bottom: 10px !important;
            }
        }
        
        /* Стили для мобильной версии до 991px */
        @media (max-width: 991px) {
            .play-button {
                position: relative;
                font-size: 0;
            }
            
            .play-button::before {
                content: '';
                position: absolute;
                left: 50%;
                top: 50%;
                transform: translate(-50%, -50%);
                width: 0;
                height: 0;
                border-left: 14px solid var(--accent-orange);
                border-top: 10px solid transparent;
                border-bottom: 10px solid transparent;
                margin-left: 2px;
            }
        }

        /* Мобильная версия - уменьшение расстояния между строчками автора */
        @media (max-width: 389px) {
            div[style*="justify-content: space-between"]:nth-of-type(2) span {
                margin-top: -5px !important;
            }
        }

        @media (max-width: 409px) {
            .school-logo-container img {
                max-width: 170px !important;
            }
        }

        /* Мобильная версия - уменьшение расстояния между "лечащий" и "эвритмист" */
        @media (max-width: 371px) {
            div[style*="justify-content: space-between"]:nth-of-type(2) span {
                line-height: 1.2 !important;
            }
        }

/* ==========================================================================
   Перенесённые page-specific стили из старого проекта (old_data/*.html)
   Собраны из <style>-блоков HTML, дедуплицированы, сгруппированы по фичам.
   Пути к картинкам переведены на ../migrated-assets/images/.
   ========================================================================== */

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Направления: плашки, «Скоро на сайте», якорные секции ---------- */

#preschool.section-title {
    margin-top: 5px;
}

.coming-soon-title {
    text-transform: uppercase;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-orange);
    margin-bottom: 30px;
    letter-spacing: 1px;
}

#preschool + .direction-list .direction-item,
        #therapeutic + .direction-list .direction-item {
    display: flex;
}

#preschool + .direction-list .direction-item-content,
        #therapeutic + .direction-list .direction-item-content {
    align-items: stretch;
    display: flex;
}

#preschool + .direction-list .direction-item-image,
        #therapeutic + .direction-list .direction-item-image {
    flex: 0 0 200px;
    height: auto;
    align-self: stretch;
}

#preschool + .direction-list .direction-item-image img,
        #therapeutic + .direction-list .direction-item-image img {
    height: 100%;
    object-fit: cover;
}

#preschool + .direction-list .direction-item-title,
        #therapeutic + .direction-list .direction-item-title {
    display: flex;
    flex-direction: column;
    flex: 1;
}

#preschool + .direction-list .direction-item-content-wrapper,
        #therapeutic + .direction-list .direction-item-content-wrapper {
    min-height: 0;
}

.direction-item-text-wrapper {
    display: flex;
    flex-direction: row;
    gap: 0;
}

.in-development {
    display: inline-block;
    padding: 7px 20px;
    padding-top: 10px;
    padding-bottom: 10px;
    line-height: 16px;
    background-color: var(--primary-dark-blue);
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    opacity: 0.8;
    cursor: default;
    align-self: flex-start;
    text-align: center;
    min-width: 110px;
    width: auto;
    margin-left: 20px;
    margin-top: 10px;
    box-sizing: border-box;
}

/* Плашка «в разработке» внутри блока «Скоро на сайте». Единственное
   объявление: раньше выше был дубликат с display: inline-flex, который
   всё равно перебивался этим (а align-items/justify-content на
   inline-block ни на что не влияли). */
.coming-soon-section .in-development {
    margin-left: 24px;
    margin-bottom: 0;
    width: auto;
    display: inline-block;
}

@media (max-width: 991px) {
    .direction-item-text-wrapper {
        flex-direction: column;
        gap: 10px;
    }
    .direction-item-link, .in-development {
        margin-left: 0;
    }
    #coming-soon .direction-list .direction-item-content {
        padding: 20px !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }
    #coming-soon .direction-list .direction-item-image {
        flex: 0 0 auto !important;
        width: 100% !important;
        margin-bottom: 15px !important;
        overflow: hidden !important;
    }
    #coming-soon .direction-list .direction-item-image img {
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
    }
    #coming-soon .direction-list .direction-item-content-wrapper {
        border-left: none !important;
        border-top: 4px solid var(--accent-orange) !important;
        padding: 20px !important;
        width: 100% !important;
    }
}

@media (max-width: 375px) {
    #preschool + .direction-list .direction-item-image {
        height: 200px !important;
        overflow: hidden !important;
    }
    #preschool + .direction-list .direction-item-image img {
        object-position: center !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    #therapeutic + .direction-list .direction-item-image {
        height: 200px !important;
        overflow: hidden !important;
    }
    #therapeutic + .direction-list .direction-item-image img {
        object-position: center !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    #coming-soon .direction-list .direction-item-image {
        height: 200px !important;
        overflow: hidden !important;
    }
    #coming-soon .direction-list .direction-item-image img {
        object-position: center !important;
        height: 100% !important;
        object-fit: cover !important;
    }
}

@media (min-width: 376px) and (max-width: 480px) {
    #preschool + .direction-list .direction-item-image {
        height: 220px !important;
        overflow: hidden !important;
    }
    #preschool + .direction-list .direction-item-image img {
        object-position: center !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    #therapeutic + .direction-list .direction-item-image {
        height: 220px !important;
        overflow: hidden !important;
    }
    #therapeutic + .direction-list .direction-item-image img {
        object-position: center !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    #coming-soon .direction-list .direction-item-image {
        height: 300px !important;
        overflow: hidden !important;
    }
    #coming-soon .direction-list .direction-item-image img {
        object-position: center !important;
        height: 100% !important;
        object-fit: cover !important;
    }
}

@media (min-width: 481px) and (max-width: 991px) {
    #preschool + .direction-list .direction-item-image {
        height: 400px !important;
        overflow: hidden !important;
    }
    #preschool + .direction-list .direction-item-image img {
        object-position: center !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    #therapeutic + .direction-list .direction-item-image {
        height: 400px !important;
        overflow: hidden !important;
    }
    #therapeutic + .direction-list .direction-item-image img {
        object-position: center !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    #coming-soon .direction-list .direction-item-image {
        height: 360px !important;
        overflow: hidden !important;
    }
    #coming-soon .direction-list .direction-item-image img {
        object-position: center !important;
        height: 100% !important;
        object-fit: cover !important;
    }
}

@media (min-width: 992px) {
    .large-desktop-only.coming-soon-section .direction-item-content {
        display: flex !important;
        flex-direction: row !important;
        background-color: transparent !important;
        padding: 20px !important;
        margin-bottom: 0 !important;
        border: none !important;
        border-radius: 8px !important;
    }
    .large-desktop-only.coming-soon-section .direction-item-image {
        flex: 0 0 200px !important;
        width: 200px !important;
        height: 150px !important;
        margin-right: 0px !important;
        margin-bottom: 0 !important;
        border-radius: 4px !important;
        overflow: hidden !important;
        position: static !important;
    }
    .large-desktop-only.coming-soon-section .direction-item-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
        border-radius: 0 !important;
    }
    .large-desktop-only.coming-soon-section .direction-item-title {
        flex: 1 !important;
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .large-desktop-only.coming-soon-section .direction-item-content-wrapper {
        border-left: 4px solid var(--accent-orange) !important;
        border-top: none !important;
        padding-left: 20px !important;
        padding-top: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
        height: 150px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
    }
}

#international.section-title {
    margin-top: 5px;
}

#international + .direction-list .direction-item,
        #russia + .direction-list .direction-item,
        #bookshelf + .direction-list .direction-item,
        #specialists + .direction-list .direction-item,
        #institutions + .direction-list .direction-item,
        #who + .direction-list .direction-item {
    display: flex;
}

#international + .direction-list .direction-item-content,
        #russia + .direction-list .direction-item-content,
        #bookshelf + .direction-list .direction-item-content,
        #specialists + .direction-list .direction-item-content,
        #institutions + .direction-list .direction-item-content,
        #who + .direction-list .direction-item-content {
    align-items: stretch;
    display: flex;
}

#international + .direction-list .direction-item-image,
        #russia + .direction-list .direction-item-image,
        #bookshelf + .direction-list .direction-item-image,
        #specialists + .direction-list .direction-item-image,
        #institutions + .direction-list .direction-item-image,
        #who + .direction-list .direction-item-image {
    flex: 0 0 200px;
    height: auto;
    align-self: stretch;
}

#international + .direction-list .direction-item-image img,
        #russia + .direction-list .direction-item-image img,
        #bookshelf + .direction-list .direction-item-image img,
        #specialists + .direction-list .direction-item-image img,
        #institutions + .direction-list .direction-item-image img,
        #who + .direction-list .direction-item-image img {
    height: 100%;
    object-fit: cover;
}

#international + .direction-list .direction-item-content-wrapper,
        #russia + .direction-list .direction-item-content-wrapper,
        #bookshelf + .direction-list .direction-item-content-wrapper,
        #specialists + .direction-list .direction-item-content-wrapper,
        #institutions + .direction-list .direction-item-content-wrapper,
        #who + .direction-list .direction-item-content-wrapper {
    min-height: 0;
}

@media (max-width: 767px) {
    #international + .direction-list .direction-item-image img {
        content: url('../migrated-assets/images/articles/international_logo_mobile.jpg');
    }
    #bookshelf-anchor + .direction-list .direction-item-image img {
        content: url('../migrated-assets/images/articles/bookshelf_logo_mobile.jpg');
    }
    #institutions-anchor + .direction-list .direction-item-image img {
        content: url('../migrated-assets/images/articles/educational_institutions_logo_mobile.jpg');
    }
    #specialists + .direction-list .direction-item-image img {
        content: url('../migrated-assets/images/articles/specialists_logo_mobile.jpg');
    }
    #voz + .direction-list .direction-item-image img {
        content: url('../migrated-assets/images/articles/voz_logo_mobile.jpg');
    }
    .direction-item-text-wrapper {
        flex-direction: column;
        gap: 10px;
    }
    .direction-item-link, .in-development {
        margin-left: 0;
    }
}

/* ---------- Адаптивные хелперы (force-height/version toggles) ---------- */

.force-height-300 {
    height: 300px !important;
    min-height: 300px !important;
    max-height: 300px !important;
}

.force-img-full {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
}

.tablet-only {
    display: none;
}

.large-desktop-only {
    display: none;
}

@media (max-width: 991px) {
    .tablet-only {
        display: none;
    }
    .large-desktop-only {
        display: none;
    }
}

@media (min-width: 992px) {
    .tablet-only {
        display: none !important;
    }
    .large-desktop-only {
        display: block !important;
    }
}

@media (max-width: 528px) {
    .desktop-version {
        display: none !important;
    }
    .mobile-version {
        display: block !important;
    }
}

@media (min-width: 529px) {
    .desktop-version {
        display: flex !important;
    }
    .mobile-version {
        display: none !important;
    }
}

.force-height-200 {
    height: 200px !important;
    min-height: 200px !important;
    max-height: 200px !important;
}

.force-height-220 {
    height: 220px !important;
    min-height: 220px !important;
    max-height: 220px !important;
}

@media (max-width: 699px) {
    @media (min-width: 320px) and (max-width: 374px) {
        .animated-indicators {
            display: none;
        }
    }
    @media (min-width: 375px) {
        .animated-indicators {
            display: none;
        }
    }
}

/* ---------- Статьи: контейнер, изображения, даты, источник, стихи ---------- */

.breadcrumbs {
    margin-bottom: 30px;
}

.article-source {
    text-align: right;
    margin-top: 20px;
}

/* Дата статьи — все свойства из двух прежних дубликатов в одном правиле */
.article-date {
    text-align: left;
    margin-top: 30px;
    font-weight: normal;
    line-height: 1.5;
}

.site-link {
    display: block;
    margin-top: 30px;
    margin-bottom: 30px;
    text-align: left;
}

.poem-text p {
    font-size: 0.95rem;
    line-height: 1.4;
}

.article-image {
    text-align: left !important;
    margin-left: 10% !important;
}

/* Единственный отступ стихов: 8vw. Прежние варианты (10% и 10px внутри
   медиа-запросов) были мертвы — их перебивал этот же !important ниже. */
.poem-text {
    margin-left: 8vw !important;
}

.article-image p {
    line-height: 1.2 !important;
}

@media (max-width: 598px) {
    .poem-text {
        text-align: left;
    }
    .article-image img[alt="Перчатка для развития движений пальцев"] {
        max-width: 50% !important;
    }
}

@media (max-width: 398px) {
    .article-image img[alt="Перчатка для развития движений пальцев"] {
        max-width: 55% !important;
    }
}

@media (min-width: 598px) {
    div.article-image[style*="margin-left: 5rem"] > div:first-child {
        width: 23.5% !important;
    }
    div.article-image[style*="margin-left: 5rem"] > div:last-child {
        width: 21.75% !important;
    }
}

@media (min-width: 600px) and (max-width: 1199px) {
    .article-image img[alt="Перчатка для развития движений пальцев"] {
        max-width: 45% !important;
    }
}

@media (min-width: 768px) {
    .article-image img[alt="Перчатка для развития движений пальцев"] {
        max-width: 30% !important;
    }
}

@media (max-width: 398px) {
    .article-image {
        margin-left: 10px !important;
    }
    .article-image[style*="flex-wrap"] {
        margin-left: 10px !important;
    }
}

.article-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 30px;
}

/* ---------- Фазы (phases) ---------- */

@media (max-width: 398px) {
    .phases-container {
        flex-direction: column !important;
        align-items: flex-start !important;
        margin-left: 10px !important;
        gap: 15px !important;
    }
    .phases-container .phase-item {
        width: 40% !important;
        min-width: auto !important;
        text-align: center !important;
    }
}

@media (min-width: 599px) {
    .phases-container {
        margin-left: 5rem !important;
    }
    .phases-container .phase-item:first-child {
        width: 23.5% !important;
    }
    .phases-container .phase-item:last-child {
        width: 21.75% !important;
    }
}

@media (min-width: 400px) and (max-width: 598px) {
    .phases-container {
        flex-direction: column !important;
        align-items: flex-start !important;
        margin-left: 10% !important;
        gap: 15px !important;
    }
    .phases-container .phase-item {
        width: 40% !important;
        min-width: auto !important;
        text-align: left !important;
    }
}

/* ---------- Программы (списки с квадратными маркерами) ---------- */

.program-list {
    margin-top: 4px;
    margin-bottom: 15px;
    margin-left: 30px;
}

.program-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 4px;
}

.program-text {
    margin-left: 0px;
    line-height: 1.4;
}

.program-square {
    width: 8px;
    height: 8px;
    background-color: rgb(51,51,153);
    border-radius: 2px;
    flex-shrink: 0;
    margin-top: 6px;
}

/* ---------- Библиография (цветная таблица) ---------- */

.bibliography-table-container {
    overflow-x: auto;
    margin: 0px 0;
}

.bibliography-table {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-collapse: collapse;
    font-family: 'Segoe UI', sans-serif;
    background-color: #ffffff;
}

.bibliography-table td {
    border: 1pt solid #ffffff;
    padding: 5.03pt 4.28pt;
    vertical-align: top;
}

.bibliography-table .header-cell {
    text-align: center;
    padding: 15px;
}

.bibliography-table .main-title {
    border-top: 1pt solid #ffffff;
    border-right: 1pt solid #ffffff;
    border-left: 1pt solid #ffffff;
    border-bottom: 1pt solid #ffffff;
}

.bibliography-table .section-title {
    border-top: 1pt solid #ffffff;
    border-right: 1pt solid #ffffff;
    border-left: 1pt solid #ffffff;
    border-bottom: 1pt solid transparent;
}

.bibliography-table .subsection-title {
    border-top: 1pt solid #ffffff;
    border-right: 1pt solid #ffffff;
    border-left: 1pt solid #ffffff;
    border-bottom: 1pt solid transparent;
}

.bibliography-table .artistic-eurythmy td {
    background-color: #ffcccc;
    border-top: 1pt solid #ffffff;
    border-right: 1pt solid #ffffff;
    border-left: 1pt solid #ffffff;
    border-bottom: 1pt solid #ffffff;
}

.bibliography-table .artistic-eurythmy:first-child td {
    border-top: 1pt solid #ffffff;
}

.bibliography-table .artistic-eurythmy:last-child td {
    border-bottom: 1pt solid #ffffff;
}

.bibliography-table .therapeutic-eurythmy td {
    background-color: #ff99ff;
    border-top: 1pt solid #ffffff;
    border-right: 1pt solid #ffffff;
    border-left: 1pt solid #ffffff;
    border-bottom: 1pt solid #ffffff;
}

.bibliography-table .other-authors td {
    background-color: #ffe599;
    border: 1pt solid #ffffff;
}

.bibliography-table .other-authors:first-child td {
    border-top: 1pt solid #ffffff;
}

.bibliography-table .other-authors:last-child td {
    border-bottom: 1pt solid #ffffff;
}

.bibliography-table .additional-literature td {
    background-color: #ffccff;
    border: 1pt solid #ffffff;
}

.bibliography-table .additional-literature:first-child td {
    border-top: 1pt solid #ffffff;
}

.bibliography-table .additional-literature:last-child td {
    border-bottom: 1pt solid #ffffff;
}

.bibliography-table .other-authors-additional td {
    background-color: #ccffcc;
    border: 1pt solid #ffffff;
}

.bibliography-table .other-authors-additional:first-child td {
    border-top: 1pt solid #ffffff;
}

.bibliography-table .other-authors-additional:last-child td {
    border-bottom: 1pt solid #ffffff;
}

.bibliography-table p {
    margin: 0;
    line-height: 1.2;
}

.bibliography-table .main-title p {
    margin-bottom: 10px;
}

.bibliography-table .section-title p:first-child {
    margin-bottom: 0px;
}

@media (max-width: 909px) {
    .bibliography-table .section-title p,
            .bibliography-table .subsection-title p {
        margin-left: -15px !important;
        text-align: left !important;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .bibliography-table .section-title p,
            .bibliography-table .subsection-title p {
        margin-left: -15px !important;
        text-align: left !important;
    }
}

@media (max-width: 991px) {
    .bibliography-table .additional-literature p,
            .bibliography-table .other-authors-additional p {
        margin-left: 25.85pt !important;
        text-indent: -25.85pt !important;
    }
}

.bibliography-table tr:last-child td {
    border: none !important;
    padding: 0 !important;
}

/* ---------- Хронология ---------- */

.chronology-entry {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.chronology-year {
    color: rgb(51,51,153);
    font-weight: normal;
    min-width: 120px;
    flex-shrink: 0;
    margin-right: 20px;
}

.chronology-month {
    color: rgb(51,51,153);
    font-style: italic;
    margin-right: 8px;
}

.chronology-content {
    flex: 1;
}



/* ---------- Файлы / PDF-секция и кнопка открытия ---------- */

.pdf-file-section {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 20px 0;
}

.file-icon-container {
    flex-shrink: 0;
}

.file-icon {
    position: relative;
    width: 75px;
    height: 75px;
    color: var(--accent-orange);
}

.file-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.file-info {
    flex: 1;
}

.file-info h3 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: normal;
}

.file-info p {
    margin: 0 0 20px 0;
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.6;
}

.open-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--accent-orange) 0%, #e67e22 100%);
    color: white;
    border: none;
    border-radius: 7px;
    font-size: 0.95rem;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(230, 126, 34, 0.25);
}

.open-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.35);
}

.open-btn svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {
    .pdf-file-section {
        flex-direction: column;
        text-align: center;
        padding: 20px 15px;
    }
    .file-icon {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 769px) {
    .file-icon {
        width: 90px !important;
        height: 90px !important;
    }
}

@media (max-width: 369px) {
    #passwordInput {
        width: 150px !important;
        padding: 10px 12px !important;
        padding-right: 40px !important;
        font-size: 0.9rem !important;
    }
    .password-form-container {
        gap: 10px !important;
    }
}

/* ---------- Сайдбар: доп. навигация ---------- */

.sidebar-nav-section {
    margin-bottom: 20px;
}

.sidebar-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-dark-blue);
    padding: 0 15px 8px;
    margin: 0 0 10px;
    border-bottom: 1px solid #eee;
}

.sidebar-nav-text {
    display: block;
    padding: 10px 15px;
    color: var(--primary-dark-blue);
    text-decoration: none;
    font-weight: normal;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.sidebar-nav-text:hover {
    background-color: rgba(0, 58, 93, 0.05);
    border-left-color: var(--accent-orange);
}

.sidebar-nav-text.active {
    background-color: rgba(0, 58, 93, 0.08);
    border-left-color: var(--accent-orange);
}

/* ---------- Новости: дата карточки ---------- */

.news-card-date {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

/* ---------- Модальное окно / зум изображений ---------- */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
}
.modal.is-open { display: block; }

/* Модалка новости — почти на весь экран */
.news-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2vh 2vw;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.85);
}
.news-modal .modal-content {
    margin: 0;
    width: 96vw;
    max-width: none;
    height: 96vh;
    max-height: 96vh;
    background-color: #111;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.news-modal .modal-image-container {
    width: 100%;
    height: 100%;
    max-height: none;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}
.news-modal .modal-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 96vh;
    object-fit: contain;
    border-radius: 0;
    /* Плавное изменение размера при зуме */
    transition: max-width 0.2s ease, max-height 0.2s ease;
    cursor: zoom-in;
}
.news-modal .modal-image-container {
    /* При увеличении картинки появляется прокрутка */
    overflow: auto;
}
.news-modal .zoom-controls {
    left: 20px;
    top: 20px;
}
.news-modal .zoom-btn[data-zoom="reset"] {
    width: auto;
    min-width: 40px;
    border-radius: 20px;
    padding: 0 12px;
    font-size: 13px;
}
.news-modal .close {
    right: 20px;
    top: 20px;
    margin-top: 0;
    width: 44px;
    height: 44px;
}

.news-modal-body {
    padding: 48px 28px 28px;
    max-height: 80vh;
    overflow: auto;
}

.modal-content {
    position: relative;
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
    overflow: hidden;
}

.modal-image {
    width: 100%;
    height: auto;
    max-height: calc(80vh - 60px);
    object-fit: contain;
    border-radius: 8px 8px 0 0;
    display: block;
    transform-origin: center center;
}

.modal-image-container {
    overflow: auto;
    max-height: calc(80vh - 60px);
    border-radius: 8px 8px 0 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
    overflow-y: scroll;
    overflow-x: scroll;
}

.modal-image-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.modal-image-container::-webkit-scrollbar-track {
    background: transparent;
}

.modal-image-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.modal-image-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    line-height: 1;
    text-align: center;
    padding: 0;
    margin: 0;
    vertical-align: middle;
    margin-top: -5px;
    z-index: 20;
}

.close::before {
    content: "✕";
    display: block;
    line-height: 1;
    margin: 0;
    padding: 0;
    transform: translateY(-0.5px);
}

.close:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.zoom-controls {
    position: absolute;
    left: 15px;
    top: 15px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.zoom-btn {
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    line-height: 1;
}

.zoom-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.zoom-btn:active {
    background-color: var(--accent-orange);
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }
    .modal-image {
        max-height: calc(85vh - 50px);
    }
    /* Новости: почти весь экран и на мобильных */
    .news-modal .modal-content {
        width: 96vw;
        height: 96vh;
        max-height: 96vh;
        margin: 0;
    }
    .news-modal .modal-image {
        max-height: 96vh;
    }
    .close {
        right: 10px;
        top: 10px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
    .news-modal .close {
        width: 40px;
        height: 40px;
        right: 12px;
        top: 12px;
    }
    .zoom-controls {
        left: 10px;
        top: 10px;
        gap: 6px;
    }
    .zoom-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}

/* ==========================================================================
   Стили, вынесенные из inline style="" в шаблонах site/templates
   (big_section_list, articles_list, specialists). Инлайны заменены классами.
   ========================================================================== */

/* Заголовок статьи-карточки внутри обёртки контента направления. */
.direction-item-content-wrapper h2 {
    color: rgb(51,51,153);
    font-weight: normal;
    font-size: 1.26rem;
    line-height: 1.2;
}

/* ---------- Блок «Скоро на сайте» (big_section_list.php) ---------- */
.coming-soon-header {
    font-weight: normal;
    color: var(--accent-orange);
    border-bottom: 1px solid rgb(51,51,153);
}
.coming-soon-content {
    padding: 20px;
    background-color: transparent;
    display: flex;
    margin-bottom: 0;
    border: none;
    border-radius: 8px;
}
.coming-soon-title-col {
    padding: 0;
    flex: 1;
}
.coming-soon-wrapper {
    margin-bottom: 0;
    border-left: 4px solid var(--accent-orange);
    padding-left: 20px;
    height: auto;
}
/* У заголовка внутри блока «Скоро» убираем верхний отступ. */
.coming-soon-wrapper h2 { margin-top: 0; }
.coming-soon-dev-list {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 20px;
}
.coming-soon-dev-item {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
    font-size: 0.90rem;
    font-weight: normal;
    color: var(--text-dark);
}
/* Квадратный маркер-буллит перед пунктом списка «в разработке». */
.coming-soon-dev-marker {
    position: absolute;
    left: 0;
    top: 6px;
    width: 6px;
    height: 6px;
    background-color: rgb(51,51,153);
    display: inline-block;
}

/* ---------- Страница «Наши специалисты» (specialists.php) ---------- */
.spec-title {
    margin-top: 0;
    margin-left: 0;
    margin-bottom: 20px;
    border-bottom: none;
    font-variant: small-caps;
    font-size: 1.8rem;
    font-weight: normal;
    line-height: 1.2;
}
/* Карточка «парольных ворот» до ввода пароля. */
.spec-gate-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    text-align: center;
}
.spec-gate-title {
    margin: 0 0 20px 0;
    color: rgb(51,51,153);
    font-size: 1.3rem;
    font-weight: normal;
}
.spec-gate-desc {
    margin: 0 0 20px 0;
    color: #6c757d;
    font-size: 1rem;
}
.password-form-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}
.spec-input-wrap {
    position: relative;
    display: inline-block;
}
#passwordInput {
    padding: 12px 16px;
    padding-right: 45px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    width: 200px;
    transition: border-color 0.3s ease;
}
/* Кнопка-«глазик» показа пароля внутри поля. */
#togglePassword {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #6c757d;
    font-size: 16px;
}
/* Кнопка «Перейти»: hover перенесён из inline JS-обработчиков в :hover. */
.spec-submit-btn {
    padding: 12px 20px;
    background: var(--accent-orange);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(230, 126, 34, 0.3);
}
.spec-submit-btn:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.4);
}
/* Плашка ошибки неверного пароля (показывается JS-ом). */
#passwordError {
    color: #dc3545;
    font-size: 0.9rem;
    padding: 10px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    margin-top: 10px;
    display: none;
}
/* Контент специалистов скрыт до ввода верного пароля (JS ставит block). */
#specBody { display: none; }

/* ==========================================================================
   Мобильная адаптация (перенос из old_data/css/mobile-styles.css).
   Вся мобильная вёрстка держится здесь, в main.css. Бургер раскрывает
   .dropdown-menu под строкой поиска — как в старом проекте.
   ========================================================================== */
/* Мобильное меню скрыто по умолчанию (на десктопе), показывается только
   внутри @media (max-width: 991px) при классе .active. */
.dropdown-menu { display: none; }

@media (max-width: 991px) {
    /* --- Базовая типографика для мобильных --- */
    body { font-size: 16px; line-height: 1.5; }
    h1, h2, h3, h4, h5, h6 { margin-bottom: 15px; }
    .container { padding: 0 10px; }
    .page-title, .page-title-custom { font-size: 22px; margin: 20px 0; }
    .section-title { font-size: 20px; margin: 20px 0 15px; }
    p { font-size: 16px; line-height: 1.5; margin-bottom: 15px; }
    .article-title { font-size: 1.7rem; margin-bottom: 15px; }
    .article-text { font-size: 16px; line-height: 1.6; }
    .article-text p { margin-bottom: 18px; }

    /* --- Баннер раздела --- */
    .page-header-image img { height: 210px; }
    .page-header { margin-top: -30px; }

    /* --- Шапка: логотип и заголовок в колонку --- */
    header { position: relative; }
    .header-top { position: relative; padding: 15px 0 10px 0; flex-direction: column; align-items: stretch; }
    .logo { display: flex; align-items: center; width: 100%; text-align: left; margin-bottom: 0px; position: relative; }
    .logo img { max-height: 110px; margin-right: 5px; }
    .logo .titles-wrapper { display: flex; flex-direction: column; margin-top: 0; }
    .logo h1 { font-size: 18px; margin-top: 0; line-height: 1.2; }
    .logo .site-subtitle { font-size: 9px; position: relative; top: 0; margin-top: 6px; }

    /* Главное меню прячем — вместо него бургер + .dropdown-menu. */
    .main-nav { display: none !important; }

    /* Верхняя навигация (Новости/Контакты) и поиск — в колонку. */
    .top-nav { display: flex; flex-direction: column; width: 100%; position: relative; margin-top: 0px; gap: 0; }
    .top-nav a { color: rgb(51,51,153); text-decoration: none; }
    .top-nav-links { display: flex; justify-content: space-between; align-items: center; width: 100%; font-size: 14px; margin-bottom: 0; padding: 0 2px; }
    .top-nav-links .nav-right { display: flex; gap: 15px; }
    .nav-right a { font-size: 13px; font-weight: 400; color: rgb(51,51,153); text-transform: uppercase; }
    .nav-right a:hover { color: var(--accent-orange); }

    .search-container { width: 100%; padding: 0 2px; margin: 0; }
    .search-container form { width: 100%; display: flex; position: relative; border: none; background: transparent; overflow: visible; }
    .search-container input[type="text"] { 
        width: 100%; 
        padding: 6px 35px 6px 15px; 
        font-size: 16px; 
        border-radius: 10px; 
        border: 1px solid var(--border-search);
        color: #000; 
    }
    .search-container button { 
        width: 30px; 
        height: 30px; 
        position: absolute; 
        right: 5px; 
        top: 50%; 
        transform: translateY(-50%); 
        background: transparent; 
        border: none; 
        display: flex; 
        align-items: center; 
        justify-content: center; 
    }
    .search-container button svg { 
        fill: var(--border-search);
    }

    /* --- Бургер (оранжевый квадрат с белыми полосами) --- */
    .mobile-menu-toggle { display: flex; flex-direction: column; justify-content: space-around; width: 35px; height: 35px; background: var(--accent-orange); border: none; border-radius: 4px; cursor: pointer; padding: 8px; z-index: 1001; margin-bottom: 10px; }
    .mobile-menu-toggle span { display: block; width: 100%; height: 2px; margin: 0; background-color: #fff; border-radius: 2px; transition: all 0.3s ease; }
    .mobile-menu-toggle.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
    .mobile-menu-toggle.active span:nth-child(3) { transform: translateY(-4px) rotate(-45deg); }
    .mobile-menu-toggle.active span:nth-child(4) { opacity: 0; }

    /* --- Раскрывающееся меню под строкой поиска --- */
    .dropdown-menu { 
        display: none; 
        width: 100%;
        background-color: #f9f5f0; 
        margin-top: 10px; 
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 
        border-radius: 4px; 
        overflow: hidden; 
    }
    .dropdown-menu.active { display: block; }
    .dropdown-menu-nav { list-style: none; padding: 0; margin: 0; }
    .dropdown-menu-nav li { border-bottom: 1px solid #e8e0d5; }
    .dropdown-menu-nav li:last-child { border-bottom: none; }
    .dropdown-menu-nav li a { display: block; padding: 15px 20px; color: rgb(51,51,153); font-weight: 400; text-decoration: none; transition: color 0.3s; text-transform: uppercase; line-height: 1.2; }
    .dropdown-menu-nav li a:hover,
    .dropdown-menu-nav li.active a { color: var(--accent-orange); }
    .dropdown-menu-nav li.active .home-icon { fill: var(--accent-orange); }
    .dropdown-menu-nav li a .cap { font-size: 1.5em; display: inline-block; vertical-align: baseline; line-height: 0.8; position: relative; }
    .dropdown-menu-nav .home-icon { margin-right: 7px; position: relative; vertical-align: middle; }

    /* Подсветка активного раздела по классу <body> (Новости/Контакты — в .nav-right). */
    body.page-news .nav-right a[href*="news"] { color: var(--accent-orange) !important; }
    body.page-contacts .nav-right a[href*="contacts"] { color: var(--accent-orange) !important; }

    /* --- Контент со сайдбаром — в колонку --- */
    .content-with-sidebar { flex-direction: column; }
    /* Сбрасываем sticky, иначе сайдбар «прилипает» к верху и статья
       скроллится под ним. */
    /* flex: 0 0 250px на десктопе — это ширина. В колонке та же
       величина становится высотой и оставляет пустое место под меню. */
    .sidebar { width: 100%; margin-bottom: 20px; position: static; top: auto; flex: none; height: auto; }
    .main-content { width: 100%; }
}

/* --- Самые узкие экраны --- */
@media (max-width: 375px) {
    .logo img { max-height: 70px; }
    .logo h1 { font-size: 16px; line-height: 0.9 !important; }
    .logo .site-subtitle { font-size: 8px; }
    .page-header-image img { height: 180px; }
    .page-header { margin-top: -30px; }
}

/* --- Подвал на мобильных: карты сайта в колонку --- */
@media (max-width: 600px) {
    .footer-content { flex-direction: column; }
    .site-map { width: 100%; }
}
