/* ========================================
   GLOBAL STYLES & CSS VARIABLES
   ======================================== */
:root {
    --primary-color: #1C3C84;
    --secondary-color: #0075BE;
    --accent-color: #CC0000;
    --link-color: #D1D1E9;
    --text-color: #000000;
    --bg-light-gray: #eeeeee;
    --bg-white: #FFFFFF;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-white);
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ========================================
   HEADER
   ======================================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-color);
    padding: 10px 20px;
    height: 70px;
    box-sizing: border-box;
}

.header__logo img {
    border: 0;
}

/* Обертка для флага и бургера */
.header__controls {
    display: flex;
    align-items: center;
    gap: 20px; /* Расстояние между флагом и бургером */
}

/* ========================================
   TOP BAR (BREADCRUMBS)
   ======================================== */
.top-bar {
    background-color: var(--primary-color);
    border-top: 1px solid #3355A3;
    border-bottom: 1px solid #CCCCCC;
    padding: 5px 20px;
}

.breadcrumbs {
    padding: 5px;
    font-size: 14px;
}

.breadcrumbs__link {
    color: var(--link-color);
}

.breadcrumbs__current {
    color: var(--bg-white);
    font-weight: bold;
}

/* ========================================
   MAIN LAYOUT (GRID)
   ======================================== */
.main-container {
    display: grid;
    grid-template-columns: 184px 1fr; /* Sidebar | Main Content */
    gap: 20px;
    padding: 20px;
}

/* ========================================
   SIDEBAR (LEFT)
   ======================================== */
.sidebar-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-menu {
    border-top: 1px solid #3355A3;
    border-bottom: 1px solid #3355A3;
}

.main-menu__item {
    display: block;
    padding: 5px 10px;
    background-color: var(--secondary-color);
    color: var(--bg-white);
    font-size: 14px;
    margin-bottom: 1px;
    transition: background-color 0.2s ease-in-out;
}

.main-menu__item:hover {
    background-color: #0788D8;
    text-decoration: none;
    cursor: pointer;
}

.main-menu__item--active {
    background-color: var(--accent-color);
}

.sidebar-widget {
    font-size: 12px;
}

.sidebar-widget__title {
    font-weight: bold;
    margin-bottom: 10px;
}

.banners img {
    border: 0;
    margin-bottom: 10px;
    max-width: 100%;
    height: auto;
}

/* ========================================
   CONTENT (RIGHT)
   ======================================== */
.content-right {
    width: 100%;
}

.sub-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    padding: 10px;
    border: 1px solid #DDDDDD;
    margin-bottom: 20px;
}

.sub-menu__item {
    font-size: 12px;
    color: var(--secondary-color);
}

.article-content h1 {
    font-size: 24px;
    margin-bottom: 20px;
}

.article-content__image {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
}

.article-meta {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid var(--bg-light-gray);
    font-size: 12px;
    color: #666;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-color);
    color: var(--bg-white);
    padding: 20px;
    font-size: 12px;
}

.footer__link {
    color: var(--bg-white);
}

.footer__social {
    display: flex;
    align-items: center;
    gap: 15px;
}


/* ========================================
   MOBILE NAVIGATION STYLES
   ======================================== */

/* --- Кнопка "Бургер" --- */
.mobile-menu-toggle {
    display: none; 
    width: 30px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--bg-white);
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

/* Анимация бургера в крестик */
.mobile-menu-toggle.is-active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.mobile-menu-toggle.is-active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.is-active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* --- Контейнер мобильного меню --- */
.mobile-nav {
    display: none; 
    position: fixed;
    top: 0;
    right: 0;
    width: 280px; 
    height: 100%;
    background-color: var(--primary-color);
    padding: 80px 20px 20px;
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    transform: translateX(100%); 
    transition: transform 0.3s ease-in-out;
    z-index: 100;
    overflow-y: auto; 
}

.mobile-nav--open {
    transform: translateX(0); 
}

.mobile-nav__item {
    display: block;
    padding: 12px 15px;
    color: var(--bg-white);
    font-size: 16px;
    border-bottom: 1px solid #3355A3;
}

.mobile-nav__item:hover {
    background-color: #0788D8;
    text-decoration: none;
}

.mobile-nav__item--active {
    background-color: var(--accent-color);
    font-weight: bold;
}


/* ========================================
   ADAPTIVE STYLES (MEDIA QUERIES)
   ======================================== */
@media (max-width: 768px) {
    /* === КЛЮЧЕВЫЕ ИЗМЕНЕНИЯ === */

    /* 1. Делаем шапку "липкой" */
    .header {
        position: -webkit-sticky; /* Для Safari */
        position: sticky;
        top: 0;
        width: 100%;
        z-index: 102; /* Выше чем у всех остальных элементов */
        box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Тень для эффекта "отрыва" */
    }

    /* 2. Сдвигаем контент вниз, чтобы он не залезал под шапку */
    body {
        padding-top: 60px; /* Высота шапки (мы задали ей height: 60px ниже) */
    }

    /* === ОСТАЛЬНЫЕ АДАПТИВНЫЕ СТИЛИ === */
    
    .sidebar-left {
        display: none;
    }

    .main-container {
        grid-template-columns: 1fr;
    }
    
    .mobile-menu-toggle {
        display: block;
    }

    .mobile-nav {
        display: block;
    }
    
    .header {
        height: 60px; /* Устанавливаем фиксированную высоту для мобильной шапки */
    }

    .header__logo img {
        width: 150px;
        height: auto;
    }
    
    .header__flag img {
        width: 45px;
        height: auto;
    }
    
    .footer {
        flex-direction: column;
        height: auto;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .sub-menu {
        grid-template-columns: 1fr;
    }
}
