/* ============================================
   style.css — Администрация Заларинского округа
   Версия с поисковой панелью (как на sludlib.ru)
   ============================================ */

/* ---------- ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ ---------- */
:root {
    --bs-primary: #1a4f8e;
    --bs-primary-rgb: 26, 79, 142;
    --bs-secondary: #6c757d;
    --bs-accent: #f7b731;
    --bs-accent-rgb: 247, 183, 49;
    --bs-body-bg: #f8f9fa;
    --bs-body-color: #212529;
    --bs-heading-color: #1a2b4a;

    --card-bg: #ffffff;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --card-hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    --border-light: rgba(0, 0, 0, 0.08);

    --font-family-base: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --transition-speed: 0.3s;

    --mega-bg: #ffffff;
    --mega-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);

    --card-radius: 16px;
    --card-padding: 1.5rem;
    --post-thumb-ratio: 4/3;
    --post-thumb-bg: #e9ecef;

}

[data-bs-theme="dark"] {
    --bs-body-bg: #121212;
    --bs-body-color: #dee2e6;
    --bs-heading-color: #f0f4ff;
    --bs-primary: #4a8bc2;
    --bs-primary-rgb: 74, 139, 194;
    --bs-accent: #f7b731;
    --card-bg: #1e1e1e;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    --card-hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    --border-light: rgba(255, 255, 255, 0.08);
    --bs-secondary: #adb5bd;

    --mega-bg: #1e1e1e;
    --mega-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* ---------- БАЗОВЫЕ СТИЛИ ---------- */
body {
    font-family: var(--font-family-base);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--bs-primary);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--bs-accent);
}

/* ---------- ВЕРХНЯЯ ПЛАНКА ---------- */
.top-bar {
    background-color: var(--bs-primary);
    padding: 10px 0;
    color: #fff;
    border-bottom: 3px solid var(--bs-accent);
    transition: background-color var(--transition-speed);
}

.top-bar .site-title {
    color: #fff;
    line-height: 1.2;
}

.top-bar .site-title small {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.75rem;
}

.top-logo-link {
    display: flex;
    column-gap: 5px;
}

.top-logo {
    height: 65px;
}

.top-contacts {
    font-size: 0.75rem;
}

.top-contacts span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.9);
}

.top-contacts a {
    color: rgba(255, 255, 255, 0.9);
}

.top-contacts a:hover {
    color: var(--bs-accent);
}

.top-bar .btn-outline-primary {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
}

.top-bar .btn-outline-primary:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: #fff;
}

.top-bar .btn-outline-secondary {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
}

.top-bar .btn-outline-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: #fff;
}

.visually-impaired-btn.active {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: #fff;
}

/* ============================================
   МЕГА-МЕНЮ (общее для всех страниц)
   ============================================ */
.main-nav {
    background-color: var(--card-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-nav .navbar-nav {
    align-items: center;
    width: 100%;
}

.main-nav .navbar-nav .nav-item {
    margin-right: 4px;
}

@media (max-width: 1199.98px) {
    .main-nav .navbar-nav .nav-item {
        margin-right: 0;
    }
}

.main-nav .navbar-nav .nav-link {
    color: var(--bs-body-color);
    font-weight: 500;
    padding: 0.75rem 1.1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.main-nav .navbar-nav .nav-link i {
    font-size: 1.1rem;
}

/* Стили для активного пункта */
.main-nav .navbar-nav .nav-link.active {
    color: var(--bs-primary);
    background-color: transparent;
}

.main-nav .navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30%;
    height: 3px;
    background: var(--bs-accent);
    border-radius: 10px 10px 0 0;
}

.main-nav .navbar-nav .nav-link.active:hover {
    background-color: transparent;
}

/* Особые кнопки "Все разделы" и "Поиск" */
.all-sections-link,
.search-trigger {
    border: 1px solid var(--bs-primary);
    border-radius: 30px;
    padding: 0.4rem 1.2rem !important;
    background-color: rgba(var(--bs-primary-rgb), 0.04);
    transition: all 0.3s ease;
}

.all-sections-link:hover,
.search-trigger:hover {
    background-color: var(--bs-primary);
    color: #fff !important;
}

.all-sections-link i,
.search-trigger i {
    margin-right: 4px;
}

/* Убираем стрелку у "Все разделы" */
.all-sections-link .bi-chevron-down {
    display: none !important;
}

/* Для тёмной темы */
[data-bs-theme="dark"] .all-sections-link,
[data-bs-theme="dark"] .search-trigger {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

[data-bs-theme="dark"] .all-sections-link:hover,
[data-bs-theme="dark"] .search-trigger:hover {
    background-color: var(--bs-primary);
    color: #fff !important;
}

/* ---------- МЕГА-МЕНЮ (контейнер) ---------- */
.mega-menu-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1001;
    background: var(--mega-bg);
    box-shadow: var(--mega-shadow);
    border-bottom: 3px solid var(--bs-accent);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s 0.4s;
}

.mega-menu-container.active {
    max-height: 70vh;
    visibility: visible;
    overflow-y: auto;
    padding: 2rem 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s 0s;
}

.mega-menu-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    max-height: 100vh;
    visibility: hidden;
    padding: 2rem 0;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s 0.4s;
}

.mega-menu-container.fullscreen.active {
    transform: translateX(0);
    visibility: visible;
    max-height: 100vh;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s 0s;
}

.mega-menu-container .container {
    max-width: 1320px;
    padding: 0 15px;
    position: relative;
}

.mega-close-btn {
    position: absolute;
    top: 0;
    right: 15px;
    font-size: 1.8rem;
    color: var(--bs-body-color);
    cursor: pointer;
    z-index: 10;
    transition: all var(--transition-speed);
    opacity: 0.6;
    display: none;
}

.mega-close-btn:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.mega-menu-container.fullscreen .mega-close-btn {
    display: block;
}

.mega-menu-content {
    position: relative;
    min-height: 200px;
}

/* Оверлей для fullscreen */
.mega-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed);
}

.mega-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Уровни мега-меню */
.mega-level {
    display: none;
    animation: slideIn 0.3s ease;
}

.mega-level.active {
    display: block !important;
}

.mega-level.slide-out {
    animation: slideOut 0.2s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

.mega-breadcrumb {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--border-light);
}

.mega-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--bs-primary);
    cursor: pointer;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    transition: all var(--transition-speed);
}

.mega-back:hover {
    background: rgba(var(--bs-primary-rgb), 0.08);
}

.mega-back i {
    font-size: 1rem;
}

.mega-current {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--bs-heading-color);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mega-current i {
    color: var(--bs-primary);
}

.mega-current:hover {
    color: var(--bs-accent);
}

.mega-section {
    margin-bottom: 1.5rem;
}

.mega-section-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--bs-primary);
    display: block;
    padding: 6px 0;
    border-bottom: 2px solid var(--bs-accent);
    margin-bottom: 0.75rem;
    transition: all var(--transition-speed);
}

.mega-section-title:hover {
    color: var(--bs-accent);
}

.mega-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-links li {
    margin-bottom: 0.4rem;
}

.mega-links a {
    color: var(--bs-body-color);
    font-size: 0.95rem;
    padding: 4px 8px;
    display: block;
    border-radius: 4px;
    transition: all var(--transition-speed);
}

.mega-links a:hover {
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.06);
    padding-left: 16px;
}

@media (max-width: 1199.98px) {
    .mega-menu-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 100vh;
        max-height: 100vh;
        padding: 1.5rem 0;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        visibility: visible;
        overflow-y: auto;
    }

    .mega-menu-container.active {
        transform: translateX(0);
        max-height: 100vh;
        padding: 1.5rem 0;
        visibility: visible;
    }

    .mega-menu-container .mega-close-btn {
        display: block;
    }

    .mega-current {
        font-size: 1.1rem;
    }

    .main-nav .navbar-nav .nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.95rem;
    }

    .all-sections-link,
    .search-trigger {
        border: none;
        border-radius: 0;
        padding: 0.5rem 0.8rem !important;
        background: transparent;
    }

    .all-sections-link:hover,
    .search-trigger:hover {
        background: rgba(var(--bs-primary-rgb), 0.08);
        color: var(--bs-primary) !important;
    }
}

@media (max-width: 767.98px) {
    .mega-menu-container {
        padding: 1rem 0;
    }

    .mega-menu-container.active {
        padding: 1rem 0;
    }

    .mega-breadcrumb {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .mega-current {
        font-size: 1rem;
    }

    .mega-section {
        margin-bottom: 1rem;
    }
}

/* ============================================
   ПОИСК (панель под навбаром, как на sludlib.ru)
   ============================================ */
.search-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-bottom: 3px solid var(--bs-accent);
    box-shadow: var(--mega-shadow);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s 0.4s;
    z-index: 1001;
}

.search-panel.active {
    max-height: 200px;
    visibility: visible;
    padding: 1.2rem 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s 0s;
}

.search-panel__inner {
    max-width: 720px;
    margin: 0 auto;
}

.search-panel__form {
    display: flex;
    align-items: center;
    background: var(--bs-body-bg);
    border-radius: 50px;
    padding: 0.25rem 0.25rem 0.25rem 1.2rem;
    border: 2px solid var(--border-light);
    transition: border-color 0.3s ease;
}

.search-panel__form:focus-within {
    border-color: var(--bs-primary);
}

.search-panel__icon {
    font-size: 1.2rem;
    color: var(--bs-secondary);
    margin-right: 0.5rem;
}

.search-panel__input {
    border: none;
    background: transparent;
    padding: 0.7rem 0;
    flex: 1;
    outline: none;
    color: var(--bs-body-color);
    font-size: 1rem;
}

.search-panel__input::placeholder {
    color: var(--bs-secondary);
}

.search-panel__submit {
    border-radius: 50px;
    padding: 0.5rem 1.2rem;
    font-weight: 600;
    background: var(--bs-primary);
    border: none;
    color: #fff;
    transition: background 0.3s ease;
    margin-right: 0.5rem;
}

.search-panel__submit:hover {
    background: #0d3a6e;
}

.search-panel__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--bs-body-color);
    cursor: pointer;
    padding: 0 0.5rem;
    transition: transform 0.3s ease;
}

.search-panel__close:hover {
    transform: rotate(90deg);
}

/* Адаптив для поиска */
@media (max-width: 1199.98px) {
    .search-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        max-height: 0;
        border-bottom: none;
        border-top: 3px solid var(--bs-accent);
        background: var(--card-bg);
        z-index: 1050;
    }

    .search-panel.active {
        max-height: 300px;
        padding: 1.5rem;
    }

    .search-panel__inner {
        max-width: 100%;
    }

    .search-panel__form {
        border-radius: 16px;
        flex-wrap: wrap;
        padding: 0.5rem;
    }

    .search-panel__input {
        width: 100%;
        padding: 0.5rem;
    }

    .search-panel__submit {
        width: 100%;
        margin-top: 0.5rem;
        margin-right: 0;
    }

    .search-panel__close {
        position: absolute;
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 575.98px) {
    .search-panel.active {
        max-height: 350px;
        padding: 1rem;
    }
}

/* ============================================
   ГЛАВНАЯ СТРАНИЦА
   ============================================ */

/* Герой */
.hero-section {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #0d2b4a 100%);
    color: #fff;
    padding: 4rem 0 5rem;
    position: relative;
    overflow: hidden;
    transition: background var(--transition-speed);
}

[data-bs-theme="dark"] .hero-section {
    background: linear-gradient(135deg, #1a2b4a 0%, #0a1426 100%);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(247, 183, 49, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-weight: 700;
    font-size: 2.8rem;
    line-height: 1.2;
    margin-bottom: 1.2rem;
    color: #fff;
}

.hero-text {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 600px;
    color: rgba(255, 255, 255, 0.9);
}

.badge.bg-accent {
    background-color: var(--bs-accent) !important;
    color: #1a2b4a !important;
    font-weight: 600;
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
}

.btn-hero-primary {
    background-color: var(--bs-accent);
    color: #1a2b4a;
    border: none;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    transition: all var(--transition-speed);
}

.btn-hero-primary:hover {
    background-color: #e0a020;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(247, 183, 49, 0.4);
    color: #1a2b4a;
}

.btn-hero-secondary {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    font-weight: 500;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    transition: all var(--transition-speed);
}

.btn-hero-secondary:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    color: #fff;
}

.hero-banners .banner-card {
    display: block;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 1.5rem 1rem;
    text-align: center;
    color: #fff;
    transition: all var(--transition-speed);
    height: 100%;
}

.hero-banners .banner-card:hover {
    background: rgba(255, 255, 255, 0.20);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.banner-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--bs-accent);
}

.banner-card h5 {
    font-weight: 600;
    font-size: 1.1rem;
    color: #fff;
}

.banner-card p {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.banner-arrow {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    transition: all var(--transition-speed);
}

.banner-card:hover .banner-arrow {
    background: var(--bs-accent);
    color: #1a2b4a;
    transform: translateX(4px);
}

.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    overflow: hidden;
    pointer-events: none;
}

.hero-wave svg {
    width: 100%;
    height: 100%;
    display: block;
}

.hero-wave path {
    fill: var(--bs-body-bg);
    transition: fill var(--transition-speed);
}

/* Слайдеры на главной */
.sliders-section {
    background-color: var(--bs-body-bg);
    transition: background-color var(--transition-speed);
}

.main-slider {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    height: 100%;
}

.main-slider .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.main-slider .swiper-pagination {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.main-slider .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.main-slider .swiper-pagination-bullet-active {
    background: #fff;
}

.small-slider {
    border-radius: 20px;
    overflow: hidden;
    height: 100%;
}

.small-slider .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 20px;
}

.small-slider .swiper-pagination {
    position: relative;
    margin-top: 1rem;
}

.small-slider .swiper-pagination-bullet {
    background: var(--bs-secondary);
    opacity: 0.5;
}

.small-slider .swiper-pagination-bullet-active {
    background: var(--bs-primary);
    opacity: 1;
}

/* Новости на главной */
.news-section {
    background-color: var(--bs-body-bg);
    transition: background-color var(--transition-speed);
}

.section-title {
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--bs-heading-color);
}

.section-title i {
    margin-right: 8px;
}

.section-title-lg {
    font-weight: 700;
    font-size: 2.2rem;
    color: var(--bs-heading-color);
}

.news-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
    border: 1px solid var(--border-light);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-hover-shadow);
}

.news-card.featured {
    border: none;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.news-card.featured:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-hover-shadow);
}

.news-card-bg {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    overflow: hidden;
}

.news-card-bg .news-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 50%, transparent 100%);
    color: #fff;
}

.news-card-bg .news-card-overlay .news-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--bs-accent);
    color: #1a2b4a;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.news-card-bg .news-card-overlay .news-date {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.news-card-bg .news-card-overlay h4 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
}

.news-card-bg .news-card-overlay h4 a {
    color: #fff;
}

.news-card-bg .news-card-overlay h4 a:hover {
    text-decoration: underline;
}

.news-card-bg .news-card-overlay p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 1rem;
    max-width: 80%;
}

.news-card-bg .news-card-overlay .news-link {
    color: var(--bs-accent);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.news-card-bg .news-card-overlay .news-link i {
    transition: transform var(--transition-speed);
}

.news-card-bg .news-card-overlay .news-link:hover i {
    transform: translateX(4px);
}

.news-card-img {
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

.news-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed);
}

.news-card:hover .news-card-img img {
    transform: scale(1.05);
}

.news-card-body {
    padding: 1.25rem 1.5rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card-body .news-date {
    font-size: 0.85rem;
    color: var(--bs-secondary);
    display: inline-block;
    margin-bottom: 0.5rem;
}

.news-card-body h4 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--bs-heading-color);
    line-height: 1.3;
}

.news-card-body h4 a {
    color: inherit;
}

.news-card-body h4 a:hover {
    color: var(--bs-primary);
}

.news-card-body p {
    font-size: 0.95rem;
    color: var(--bs-body-color);
    opacity: 0.85;
    margin-bottom: 1rem;
    flex: 1;
}

.news-card-body .news-link {
    font-weight: 600;
    color: var(--bs-primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.news-card-body .news-link i {
    transition: transform var(--transition-speed);
}

.news-card-body .news-link:hover i {
    transform: translateX(4px);
}

.news-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 991.98px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}

/* Быстрый доступ */
.quick-links-section {
    background-color: var(--bs-body-bg);
    transition: background-color var(--transition-speed);
}

.quick-link-card {
    display: block;
    background: var(--card-bg);
    padding: 1.8rem 1rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-light);
    transition: all var(--transition-speed);
    color: var(--bs-body-color);
    height: 100%;
}

.quick-link-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-hover-shadow);
    border-color: var(--bs-primary);
    color: var(--bs-body-color);
}

.ql-icon {
    font-size: 2.5rem;
    color: var(--bs-primary);
    margin-bottom: 0.5rem;
}

.quick-link-card h6 {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--bs-heading-color);
}

.quick-link-card .ql-desc {
    font-size: 0.8rem;
    opacity: 0.7;
    display: block;
}

/* ============================================
   ПОДВАЛ (общий)
   ============================================ */
.site-footer {
    background-color: var(--bs-primary);
    color: rgba(255, 255, 255, 0.85);
    padding: 3rem 0 1.5rem;
    transition: background-color var(--transition-speed);
}

[data-bs-theme="dark"] .site-footer {
    background-color: #0d1b2a;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-brand h5 {
    color: #fff;
    margin-bottom: 0;
}

.footer-brand small {
    opacity: 0.75;
}

.footer-logo {
    height: 100px;
}

.footer-about {
    font-size: 0.95rem;
    opacity: 0.85;
    max-width: 350px;
}

.footer-socials .social-link {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: rgba(255, 255, 255, 0.10);
    border-radius: 50%;
    color: #fff;
    margin-right: 8px;
    transition: all var(--transition-speed);
    font-size: 1.2rem;
}

.footer-socials .social-link:hover {
    background: var(--bs-accent);
    color: #1a2b4a;
    transform: scale(1.05);
}

.site-footer h6 {
    color: #fff;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links,
.footer-contacts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li,
.footer-contacts li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.75);
    transition: color var(--transition-speed);
}

.footer-links a:hover {
    color: #fff;
    padding-left: 4px;
}

.footer-contacts li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.footer-contacts i {
    color: var(--bs-accent);
    width: 20px;
    text-align: center;
}

.footer-divider {
    border-color: rgba(255, 255, 255, 0.15);
    margin: 2rem 0 1.5rem;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer-links-horizontal a {
    color: rgba(255, 255, 255, 0.75);
    margin-left: 1.5rem;
    transition: color var(--transition-speed);
}

.footer-links-horizontal a:hover {
    color: #fff;
}

/* ============================================
   АНИМАЦИИ (общие)
   ============================================ */
.anim-ready {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.anim-ready.animated {
    opacity: 1;
    transform: translateY(0);
}

.news-card:nth-child(1) {
    transition-delay: 0.05s;
}

.news-card:nth-child(2) {
    transition-delay: 0.1s;
}

.news-card:nth-child(3) {
    transition-delay: 0.15s;
}

.news-card:nth-child(4) {
    transition-delay: 0.2s;
}

.quick-link-card:nth-child(1) {
    transition-delay: 0.02s;
}

.quick-link-card:nth-child(2) {
    transition-delay: 0.04s;
}

.quick-link-card:nth-child(3) {
    transition-delay: 0.06s;
}

.quick-link-card:nth-child(4) {
    transition-delay: 0.08s;
}

.quick-link-card:nth-child(5) {
    transition-delay: 0.1s;
}

.quick-link-card:nth-child(6) {
    transition-delay: 0.12s;
}

.quick-link-card:nth-child(7) {
    transition-delay: 0.14s;
}

.quick-link-card:nth-child(8) {
    transition-delay: 0.16s;
}

.banner-card:nth-child(1) {
    transition-delay: 0.05s;
}

.banner-card:nth-child(2) {
    transition-delay: 0.1s;
}

.banner-card:nth-child(3) {
    transition-delay: 0.15s;
}

.banner-card:nth-child(4) {
    transition-delay: 0.2s;
}

/* ============================================
   ВЕРСИЯ ДЛЯ СЛАБОВИДЯЩИХ
   ============================================ */
body.visually-impaired {
    font-size: 1.2rem;
    line-height: 1.8;
}

body.visually-impaired .top-bar .site-title small {
    font-size: 1rem;
}

body.visually-impaired .main-nav .navbar-nav .nav-link {
    font-size: 1.2rem;
    padding: 0.8rem 1.5rem;
}

body.visually-impaired .hero-title {
    font-size: 3.5rem;
}

body.visually-impaired .hero-text {
    font-size: 1.4rem;
}

body.visually-impaired .btn {
    font-size: 1.2rem;
    padding: 0.8rem 2.2rem;
}

body.visually-impaired .news-card h4 {
    font-size: 1.5rem;
}

body.visually-impaired .quick-link-card h6 {
    font-size: 1.3rem;
}

body.visually-impaired .footer-about {
    font-size: 1.1rem;
}

body.visually-impaired .mega-links a {
    font-size: 1.1rem;
}

body.visually-impaired .mega-current {
    font-size: 1.6rem;
}

body.visually-impaired .mega-section-title {
    font-size: 1.2rem;
}

body.visually-impaired .news-card-bg .news-card-overlay h4 {
    font-size: 2.5rem;
}

/* ============================================
   АДАПТИВНОСТЬ (общая)
   ============================================ */
@media (max-width: 1199.98px) {
    .hero-title {
        font-size: 2.4rem;
    }

    .hero-section {
        padding: 3rem 0 4rem;
    }

    .top-contacts {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-section {
        padding: 2.5rem 0 3.5rem;
    }

    .hero-banners .banner-card {
        padding: 1rem 0.8rem;
    }

    .banner-icon {
        font-size: 2rem;
    }

    .news-card-bg {
        min-height: 300px;
    }

    .news-card-bg .news-card-overlay h4 {
        font-size: 1.4rem;
    }

    .news-card-bg .news-card-overlay p {
        max-width: 100%;
        font-size: 0.9rem;
    }
}

@media (max-width: 767.98px) {
    .top-bar .site-title {
        font-size: 0.9rem;
    }

    .top-bar .site-title small {
        font-size: 0.65rem;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-text {
        font-size: 1rem;
    }

    .btn-hero-primary,
    .btn-hero-secondary {
        padding: 0.6rem 1.5rem;
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .section-title-lg {
        font-size: 1.8rem;
    }

    .news-card-img {
        height: 180px;
    }

    .news-card-body {
        padding: 1rem 1.25rem 1.25rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
    }

    .footer-links-horizontal a {
        margin: 0 0.8rem;
    }

    .footer-socials .social-link {
        width: 36px;
        height: 36px;
        line-height: 36px;
        font-size: 1rem;
    }

    .news-card-bg {
        min-height: 250px;
    }

    .news-card-bg .news-card-overlay {
        padding: 1.5rem;
    }

    .news-card-bg .news-card-overlay h4 {
        font-size: 1.2rem;
    }

    .news-card-bg .news-card-overlay p {
        font-size: 0.85rem;
    }
}

@media (max-width: 575.98px) {
    .hero-banners .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .quick-link-card {
        padding: 1.2rem 0.5rem;
    }

    .ql-icon {
        font-size: 2rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .main-slider .swiper-pagination {
        bottom: 10px;
    }
}

/* ---------- ОБЩИЕ УЛУЧШЕНИЯ ---------- */
img, svg {
    max-width: 100%;
    height: auto;
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

* {
    transition: background-color var(--transition-speed) ease,
    color var(--transition-speed) ease,
    border-color var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease,
    fill var(--transition-speed) ease,
    transform var(--transition-speed) ease;
}