/* =========================================
   0. ПОДКЛЮЧЕНИЕ ШРИФТОВ
   ========================================= */
@font-face {
    font-family: 'Gotham';
    src: url('/static/fonts/Gotham-Black.woff2') format('woff2'),
         url('/static/fonts/Gotham-Black.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* =========================================
   1. СБРОС И БАЗОВЫЕ НАСТРОЙКИ
   ========================================= */
body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    /* Сложный фон с едва заметным паттерном */
    background-color: #f4f7f6;
    background-image: 
        radial-gradient(at 10% 10%, rgba(0, 60, 130, 0.03) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(0, 160, 200, 0.03) 0px, transparent 50%);
    background-attachment: fixed;
    color: #333;
    line-height: 1.6;
    /* Большой отступ сверху для "воздуха" под хедером */
    padding-top: 160px;
}

*, *:before, *:after {
    box-sizing: border-box;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   2. ХЕДЕР (ФИКСИРОВАННЫЙ + GLASMORPHISM)
   ========================================= */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;

    /* Более прозрачный фон */
    background: linear-gradient(90deg, rgba(0, 60, 130, 0.7) 0%, rgba(0, 160, 200, 0.7) 100%);

    /* Сильное размытие фона */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

/* Логотип */
.logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;

    /* Увеличиваем размер контейнера */
    width: 130px;
    height: 130px;

    /* Делаем белый круг */
    background-color: #fff;
    border-radius: 50%;

    /* Сдвигаем вниз, чтобы он свисал с меню */
    margin-top: 60px;

    /* Добавляем красивую размытую тень (тот самый blur эффект краев) */
    box-shadow: 0 10px 30px rgba(0, 60, 130, 0.3);

    /* Чтобы логотип был выше остального контента */
    position: relative;
    z-index: 1100;

    /* Плавная анимация */
    transition: all 0.3s ease;
}

/* Эффект при наведении на лого */
.logo-link:hover {
    transform: scale(1.05); /* Чуть увеличивается */
    box-shadow: 0 15px 40px rgba(0, 60, 130, 0.4);
}

.logo-img {
    height: 90px; /* Увеличили саму картинку внутри круга */
    width: auto;
    object-fit: contain;
}


/* =========================================
   3. МЕНЮ (ДЕСКТОП И МОБИЛЬНОЕ)
   ========================================= */

/* --- Десктопное меню --- */
.desktop-menu {
    display: flex;
    gap: 15px;
    align-items: center;
}

.menu-item {
    font-family: 'Gotham', sans-serif;
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    border-radius: 20px;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    outline: none;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    background: rgba(0, 60, 130, 0.98);
    border-top: 1px solid rgba(255,255,255,0.1);
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    padding: 20px 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.mobile-menu.active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

.mobile-link {
    color: #fff;
    text-decoration: none;
    padding: 15px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 1.1rem;
    text-transform: uppercase;
    font-weight: 500;
    display: block;
    text-align: right;
}

.mobile-link:last-child {
    border-bottom: none;
}

.hero-block {
    display: flex;
    background-color: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 60, 130, 0.1); /* Глубокая тень */
    overflow: hidden;
    margin-bottom: 50px;
    min-height: 450px;
    position: relative;
    border: 1px solid rgba(0,0,0,0.02);
}

.hero-text {
    flex: 1;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.hero-text h1 {
    font-family: 'Gotham', sans-serif;
    font-size: 2.2rem;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: #003c82;
    line-height: 1.1;
    text-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.hero-video {
    flex: 1.5;
    position: relative;
    background-color: #000;
    min-height: 300px;
    padding: 0;
    border: none;
    display: flex;
}

.hero-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-video::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    background: linear-gradient(to right, #fff 10%, rgba(255,255,255,0) 100%);
    pointer-events: none;
    z-index: 5;
}

.hero-video::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to top, rgba(255,255,255,0.2), transparent);
    z-index: 6;
    pointer-events: none;
}

/* =========================================
   5. ПАНЕЛЬ УПРАВЛЕНИЯ
   ========================================= */
.controls-wrapper {
    margin-bottom: 50px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lang-row {
    display: flex;
    justify-content: flex-end;
    padding-right: 10px;
}

.lang-group {
    display: flex;
    gap: 15px;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    font-family: 'Gotham', sans-serif;
}

.lang-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1), 0 6px 6px rgba(0,0,0,0.1);
    color: #003c82;
}

.flag-icon {
    width: 28px;
    height: 20px;
    border-radius: 3px; /* Прямоугольный флаг */
    object-fit: cover;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.nav-row {
    display: flex;
    justify-content: center;
}

.nav-container {
    background: #fff;
    padding: 10px 15px;
    border-radius: 60px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.nav-pill {
    font-family: 'Gotham', sans-serif;
    text-decoration: none;
    color: #555;
    padding: 10px 25px;
    border-radius: 40px;
    transition: all 0.3s ease;
    background-color: transparent;
    border: 1px solid transparent;
    font-size: 0.9rem;
}

.nav-pill:hover {
    background-color: #003c82;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 60, 130, 0.3);
    transform: scale(1.05);
}

/* =========================================
   6. СЕКЦИИ КОНТЕНТА (MODERN CARDS)
   ========================================= */
.content-section {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    padding: 50px;
    margin-bottom: 80px; /* Увеличенный отступ между блоками */
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    border: 1px solid rgba(255,255,255,0.5);
    scroll-margin-top: 110px;
}

/* Эффект всплытия при наведении */
.content-section:hover {
    transform: translateY(-7px);
    box-shadow: 0 20px 40px rgba(0, 60, 130, 0.1);
}

/* Заголовки с градиентной линией */
.section-header {
    margin-bottom: 35px;
    position: relative;
    border-left: none;
    padding-left: 0;
}

.section-header h2 {
    font-family: 'Gotham', sans-serif;
    margin: 0;
    text-transform: uppercase;
    font-size: 2.2rem;
    color: #003c82;
    letter-spacing: 0.5px;
    position: relative;
    display: inline-block;
}

.section-header::after {
    content: '';
    display: block;
    width: 120px;
    height: 4px;
    background: linear-gradient(90deg, #003c82 0%, #00a0c8 100%);
    margin-top: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 60, 130, 0.2);
}

/* Тело секции */
.section-body {
    display: flex;
    gap: 60px; /* Много воздуха между колонками */
    align-items: center;
}

/* --- ZIG-ZAG LAYOUT (Чередование) --- */
.content-section:nth-child(even) .section-body {
    flex-direction: row-reverse;
}

/* Картинки */
.section-image-box {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
}

/* Декоративный фон за картинкой */
.section-image-box::before {
    content: '';
    position: absolute;
    width: 90%;
    height: 90%;
    background: linear-gradient(135deg, rgba(0,60,130,0.05), rgba(0,160,200,0.05));
    border-radius: 50%;
    z-index: 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.blurred-edge-img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    object-fit: cover;
    max-height: 350px;
    position: relative;
    z-index: 1;
    -webkit-mask-image: radial-gradient(circle, black 60%, transparent 100%);
    mask-image: radial-gradient(circle, black 60%, transparent 100%);
}

.section-text-box {
    flex: 1.2;
    font-size: 1.1rem;
    color: #4a5568;
    line-height: 1.8;
}

/* Стилизация списков */
.section-text-box ul {
    padding: 0;
    list-style: none;
}

.section-text-box li {
    position: relative;
    padding-left: 35px;
    margin-bottom: 15px;
    color: #333;
    font-weight: 500;
}

/* Галочки для списков */
.section-text-box li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300a0c8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* =========================================
   7. МЕДИА ЗАПРОСЫ (АДАПТИВ)
   ========================================= */

@media (max-width: 1170px) {
    .desktop-menu { display: none; }
    .hamburger { display: block; }

    /* Исправляем контейнер меню */
    .mobile-menu {
        display: none;
        flex-direction: column;
        background: rgba(0, 60, 130, 0.98);
        border-top: 1px solid rgba(255,255,255,0.1);
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        padding: 20px 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
        transform: translateY(-20px);
        opacity: 0;
        transition: all 0.3s ease;
        align-items: stretch;
    }

    /* Исправляем ссылки внутри мобильного меню */
    .mobile-menu .menu-item {
        display: block;        /* Блочный элемент на всю ширину */
        width: 100%;
        color: #fff;
        text-decoration: none;

        /* Отступы */
        padding: 15px 40px 15px 10px;

        border-bottom: 1px solid rgba(255,255,255,0.1);
        border-radius: 0; /* Убираем скругление кнопок */

        font-size: 1.1rem;
        text-transform: uppercase;
        font-weight: 500;

        /* ПРИНУДИТЕЛЬНОЕ выравнивание вправо */
        text-align: right !important;

        box-sizing: border-box;
    }

    /* Убираем эффект наведения (серый фон), делаем прозрачным */
    .mobile-menu .menu-item:hover {
        background-color: transparent;
        color: #00a0c8; /* Или просто меняем цвет текста */
    }
}

@media (max-width: 768px) {
    /* Хедер */
    .header-content { padding: 0 10px; }

    /* Hero */
    .hero-block { flex-direction: column; }
    .hero-text h1 { font-size: 1.8rem; }
    .hero-text { 
        padding: 30px; 
        text-align: center;
        border-left: none; /* Убираем всё лишнее */
    }
    .hero-video { min-height: 200px; }
    
    /* Меняем градиент на мобильных (сверху вниз) */
    .hero-video::after {
        width: 100%;
        height: 100px;
        top: 0;
        left: 0;
        background: linear-gradient(to bottom, #fff 0%, transparent 100%);
    }

    /* Controls */
    .lang-row { justify-content: center; }
    .lang-btn span { display: none; }
    .lang-btn { padding: 10px; }
    .nav-container { flex-direction: column; width: 100%; text-align: center; border-radius: 20px; }

    /* Content Sections */
    .section-body,
    .content-section:nth-child(even) .section-body {
        flex-direction: column; /* Всегда колонка на телефоне */
    }
    .section-image-box { margin-bottom: 20px; }
    .content-section { padding: 25px; margin-bottom: 40px; }
    .section-body { gap: 30px; }

    .logo-link {
        width: auto;
        height: auto;
        background-color: transparent;
        border-radius: 0;
        margin-top: 0;
        box-shadow: none;
    }

    .logo-img {
        height: 50px; /* Стандартный размер для мобильных */
    }

     /* Центрируем весь текст в футере */
    .footer-content {
        text-align: center;
    }

    /* Увеличиваем отступ между колонками футера */
    .footer-col {
        margin-bottom: 40px;
        display: flex;
        flex-direction: column;
        align-items: center; /* Центрируем содержимое (например, соцсети) */
    }

    /* Настройки для ЛОГОТИПА */
    .footer-logo-link {
        display: block;
        margin: 0 auto 20px auto; /* Центрируем сам блок ссылки */
    }

    .footer-logo-img {
        max-width: 260px; /* Увеличиваем размер (на десктопе было 180px) */
        width: 100%;      /* Адаптивность */
    }

    /* Центрируем иконки соцсетей */
    .social-links {
        justify-content: center;
    }
}

/* =========================================
   8. МОДЕРН ФУТЕР
   ========================================= */
.footer {
    position: relative;
    background: #003c82;
    color: #fff;
    margin-top: 150px;
}

.waves-container {
    position: absolute;
    top: -100px;
    left: 0;
    width: 100%;
    height: 100px;
    overflow: hidden;
    line-height: 0;
}

.waves-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    padding: 20px 20px 40px 20px;
    position: relative;
    z-index: 2;
}

.footer-col {
    flex: 1;
    min-width: 200px;
}

.footer-col h3, .footer-col h4 {
    font-family: 'Gotham', sans-serif;
    margin-top: 0;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li { margin-bottom: 10px; }

.footer-col a {
    color: #b0c4de;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: #fff;
    text-decoration: none;
}

.footer-col p { color: #b0c4de; margin-bottom: 10px; }

.social-links { display: flex; gap: 15px; }

.social-links a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.3s, transform 0.3s;
}

.social-links a:hover {
    background: #00a0c8;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
    color: #889bb4;
    position: relative;
    z-index: 1001;
}

.footer-logo-link {
    display: inline-block;
    margin-bottom: 20px;
    text-decoration: none;
}

.footer-logo-img {
    max-width: 280px;
    height: auto;
    display: block;
    filter: brightness(0) invert(1);
}

.svg-placeholder {
    width: 100%;
    max-width: 350px;
    height: auto;
    filter: drop-shadow(0 10px 15px rgba(0, 60, 130, 0.1)); /* Красивая тень под вектором */
}

.lang-btn.active {
    background-color: #003c82; /* Синий фон */
    color: #fff;               /* Белый текст */
    border-color: #003c82;     /* Синяя рамка */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2); /* Эффект нажатия */
    pointer-events: none;      /* Отключаем клик по активной кнопке */
}

/* Меняем цвет обводки иконки внутри активной кнопки, если она SVG */
.lang-btn.active svg {
    stroke: #fff;
}


/* --- АДАПТИВ ДЛЯ ОЧЕНЬ МАЛЕНЬКИХ ЭКРАНОВ (<420px) --- */
@media (max-width: 420px) {

    /* Уменьшаем главный заголовок */
    .hero-text h1 {
        font-size: 1.3rem; /* Было 2.8rem */
        word-wrap: break-word; /* Перенос длинных слов */
    }

    /* Уменьшаем заголовки разделов (Миссия, Цели...) */
    .section-header h2 {
        font-size: 1.5rem; /* Было 2.2rem */
    }

    /* Уменьшаем размер иконки логотипа, чтобы не перекрывала */
    .logo-img {
        height: 40px;
    }

    .hero-text {
        padding: 20px 15px; /* Еще меньше отступы */
    }

    .content-section {
        padding: 20px 15px;
    }
}

/* =========================================
   КНОПКА "НАВЕРХ" (Контрастная)
   ========================================= */
#backToTop {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 50px;
    height: 50px;

    /* ИЗМЕНЕНО: Белый фон, синяя иконка */
    background: #ffffff;
    color: #003c82;

    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;

    z-index: 9000;
    /* Усиленная тень, чтобы кнопку было видно на белом фоне страницы */
    box-shadow: 0 5px 15px rgba(0, 60, 130, 0.25);
}

#backToTop.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Ховер: Инвертируем цвета (Синий фон, белая иконка) */
#backToTop:hover {
    background: #003c82;
    color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 60, 130, 0.4);
}

/* Адаптив */
@media (max-width: 768px) {
    #backToTop {
        bottom: 20px;
        right: 20px;
        width: 45px; /* Чуть покрупнее для пальца */
        height: 45px;
    }
}


/* =========================================
   АНИМАЦИЯ ЛОГОТИПА (СВЕЧЕНИЕ)
   ========================================= */

/* 1. Определяем вращение */
@keyframes spin-glow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 2. Создаем светящееся кольцо под логотипом */
.logo-link::before {
    content: '';
    position: absolute;

    /* Делаем кольцо чуть больше самого логотипа */
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;

    border-radius: 50%;

    /* Градиент "хвост кометы": прозрачный -> голубой -> синий -> прозрачный */
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        transparent 40%,
        #00a0c8 60%,   /* Голубой */
        #003c82 80%,   /* Синий */
        transparent 100%
    );

    /* Размытие для эффекта неона/свечения */
    filter: blur(8px);

    /* Кладем ПОД белый круг логотипа */
    z-index: -1;

    /* Бесконечное плавное вращение */
    animation: spin-glow 4s linear infinite;

    /* Немного прозрачности, чтобы не было слишком резко */
    opacity: 0.8;
}

/* 3. При наведении ускоряем или усиливаем эффект */
.logo-link:hover::before {
    filter: blur(16px); /* Сильнее светится */
    opacity: 1;
    animation-duration: 2s; /* Быстрее крутится */
}

/* 4. На мобильных отключаем, чтобы не нагружать и не мешать */
@media (max-width: 768px) {
    .logo-link::before {
        display: none;
    }

}

body {
    background-image: url("/static/bgimg/pattern.png") ;
}

@media (max-width: 900px) {
    /* Отключаем блюр в хедере */
    header {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        /* Делаем фон чуть плотнее, так как размытия нет */
        background: rgba(0, 60, 130, 0.95);
    }

    /* Отключаем блюр на плашках дат в новостях */
    .news-date-badge {
        backdrop-filter: none !important;
        background: rgba(255, 255, 255, 0.9); /* Почти белый фон */
        color: #003c82;
    }

    /* Отключаем блюр в слайдере */
    .slide-caption, .slider-btn {
        backdrop-filter: none !important;
        background: rgba(0, 60, 130, 0.9);
    }
}