/* ===== ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКОВ (В ШАПКЕ) ===== */
.header-lang {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 24px; /* Отступ от кнопок входа/регистрации */
    padding-left: 24px;
    border-left: 1px solid #a89888; /* Разделительная линия */
}

.header-lang .lang-btn {
    background: transparent;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    line-height: 0;
}

.header-lang .lang-btn img {
    width: 26px;
    height: auto;
    display: block;
    border-radius: 4px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.header-lang .lang-btn:hover img {
    opacity: 1;
    transform: scale(1.05);
}

.header-lang .lang-btn.active {
    border-color: #1a1a2e;
    background-color: rgba(26, 26, 46, 0.05);
}

.header-lang .lang-btn.active img {
    opacity: 1;
    box-shadow: 0 0 0 1px rgba(26, 26, 46, 0.2);
}

/* Скрываем или адаптируем на мобильных, чтобы не ломать шапку */
@media (max-width: 900px) {
    .header-lang {
         /* Можно скрыть на мобильных, если используете фиксированный вариант, или перенести в мобильное меню */
    }
}

/* ===== ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКОВ (ФИКСИРОВАННЫЙ) ===== */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999; /* Гарантирует, что переключатель будет поверх всех элементов */
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px); /* Эффект размытия фона (современный вид) */
}

.lang-btn {
    background: transparent;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0; /* Убирает лишние отступы под изображением */
}

.lang-btn img {
    width: 28px;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

/* Эффект при наведении */
.lang-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.lang-btn:hover img {
    transform: scale(1.05);
}

/* Активный (выбранный) язык */
.lang-btn.active {
    border-color: #2a3a6b; /* Цвет в тон дизайну сайта */
    background-color: rgba(42, 58, 107, 0.08);
}

.lang-btn.active img {
    box-shadow: 0 0 0 1px rgba(42, 58, 107, 0.3);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .language-switcher {
        top: 12px;
        right: 12px;
        padding: 4px;
        gap: 6px;
        background: rgba(255, 255, 255, 0.98); /* Менее прозрачный на мобильных для читаемости */
    }
    
    .lang-btn img {
        width: 24px !important;
    }
	.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}
}

@media (max-width: 480px) {
	.container {
    max-width: 1280px;
    margin: 0 auto !important;
    padding: 0 24px;
}
}
.container {
    max-width: 1280px;
    margin: 80px auto;
    padding: 0 24px;
}

/* ===== STICKY FOOTER / МИНИМАЛЬНАЯ ВЫСОТА ===== */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Контент между header и footer растягивается */
.site-main,
.main-content,
main,
.page-content,
.archive-page {
    flex: 1 0 auto;
}

/* Footer прижимается к низу */
.site-footer {
    flex-shrink: 0;
}

/* ===== ОБЩИЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background-color: #f5f0eb;
    color: #2a2a3a;
    line-height: 1.6;
}



a {
    text-decoration: none;
    color: inherit;
}

/* ===== HEADER ===== */
.site-header {
    background-color: #bfb0a3;
    border-bottom: 1px solid #a89888;
    padding: 0;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
	margin: 0 0 40px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 72px;
}

/* --- Брендинг --- */
.site-branding {
    flex-shrink: 0;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #1a1a2e;
}

.site-logo-img {
    height: 48px;
    width: auto;
    display: block;
    object-fit: contain;
}

.brand-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #1a1a2e;
    line-height: 1.2;
}

/* --- Навигация --- */
.main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 28px;
    align-items: center;
}

.main-navigation ul li a {
    text-decoration: none;
    color: #3a3a4a;
    font-family: 'Georgia', serif;
    font-size: 16px;
    padding: 5px 0;
    display: block;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.main-navigation ul li a:hover {
    color: #1a1a2e;
}

.main-navigation ul li.current-menu-item a,
.main-navigation ul li.current_page_item a {
    border-bottom: 2px solid #3a3a4a;
    color: #1a1a2e;
}

/* --- Вход / Регистрация --- */
.header-auth {
    flex-shrink: 0;
    font-family: 'Georgia', serif;
    font-size: 14px;
    color: #3a3a4a;
}

.header-auth a {
    color: #3a3a4a;
    text-decoration: none;
    transition: color 0.2s;
}

.header-auth a:hover {
    color: #1a1a2e;
    text-decoration: underline;
}

.auth-sep {
    margin: 0 4px;
    color: #6a6a7a;
}

/* --- Переключатель языка --- */
.language-switcher {
    display: flex;
    gap: 8px;
    align-items: center;
}

.lang-item {
    display: inline-block;
}

.lang-item img {
    width: 24px;
    height: auto;
    border-radius: 2px;
    transition: opacity 0.2s;
}

.lang-item img:hover {
    opacity: 0.8;
}

.lang-item.active img {
    box-shadow: 0 0 0 2px #1a1a2e;
}

/* ===== МОБИЛЬНОЕ МЕНЮ ===== */

/* По умолчанию на десктопе кнопка скрыта */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
    z-index: 1002; /* Кнопка должна быть выше открытого меню */
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #1a1a2e;
    transition: all 0.3s ease;
}

/* Анимация крестика при открытии (опционально, но красиво) */
.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Стили для экранов меньше 900px --- */
@media (max-width: 900px) {
    /* Показываем кнопку бургера */
    .menu-toggle {
        display: flex !important;
    }

    /* Скрываем десктопное меню и готовим его к выпаду */
    .main-navigation {
        display: none; /* Скрыто по умолчанию */
        position: absolute;
        top: 100%; /* Сразу под шапкой */
        left: 0;
        right: 0;
        background-color: #bfb0a3;
        border-top: 1px solid #a89888;
        z-index: 1001;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        padding: 0 24px;
    }

    /* КЛЮЧЕВОЕ ПРАВИЛО: Показываем меню, когда JS добавляет класс .toggled */
    .main-navigation.toggled {
        display: block !important;
    }

    /* Превращаем горизонтальное меню в вертикальное */
    .main-navigation ul {
        flex-direction: column;
        gap: 0;
        padding: 10px 0;
    }

    .main-navigation ul li {
        width: 100%;
        border-bottom: 1px solid #a89888;
    }

    .main-navigation ul li:last-child {
        border-bottom: none;
    }

    .main-navigation ul li a {
        padding: 16px 0;
        display: block;
        border-bottom: none !important; /* Убираем подчеркивание активного пункта */
    }

    /* Скрываем "Вход/Регистрация" на мобильных, чтобы не мешали (или можно перенести их в меню) */
    .header-auth {
        display: none;
    }
}

/* ===== ARCHIVE PAGE ===== */
.archive-page {
    padding: 32px 0;
    background-color: #f5f0eb;
    min-height: calc(100vh - 400px);
}

.archive-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Годовые секции --- */
.year-section {
    margin-bottom: 32px;
}

.year-header {
    background-color: #d4c4b8;
    padding: 12px 24px;
    text-align: center;
    margin-bottom: 24px;
    border-radius: 2px;
}

.year-header h2 {
    font-family: 'Georgia', serif;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

/* --- Элементы выпуска --- */
.issue-item {
    display: grid;
    grid-template-columns: 280px 180px 1fr;
    gap: 24px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #e0d5cc;
}

.issue-item:last-child {
    border-bottom: none;
}

.issue-info {
    font-family: 'Georgia', serif;
    font-size: 15px;
    font-weight: 600;
    color: #2a2a3a;
}

.issue-number {
    font-weight: 700;
}

.issue-date {
    color: #4a4a5a;
}

/* --- Кнопка Аннотация --- */
.annotation-btn {
    display: inline-block;
    background-color: #b8a89c;
    color: #1a1a2e;
    padding: 10px 24px;
    text-align: center;
    font-family: 'Georgia', serif;
    font-size: 13px;
    font-weight: 600;
    border-radius: 2px;
    transition: background-color 0.2s, transform 0.2s;
    cursor: pointer;
    border: none;
}

.annotation-btn:hover {
    background-color: #a89888;
    transform: translateY(-1px);
}

.annotation-btn:active {
    transform: translateY(0);
}

/* --- Текст подписки --- */
.subscription-text {
    font-size: 14px;
    color: #4a4a5a;
    line-height: 1.5;
}

/* ===== FOOTER ===== */
.site-footer {
    background-color: #bfb0a3;
    border-top: 1px solid #a89888;
    color: #2a2a3a;
    font-family: 'Georgia', serif;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 48px;
    padding: 48px 24px 32px;
    max-width: 1280px;
    margin: 0 auto;
}

/* --- Колонки --- */
.footer-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* --- Левая колонка: Брендинг и меню --- */
.footer-branding {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.footer-logo {
    height: 40px;
    width: auto;
    display: block;
}

.footer-title {
    font-family: 'Georgia', serif;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: 0.3px;
}

.footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-menu li a {
    color: #3a3a4a;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    transition: color 0.2s;
    display: inline-block;
}

.footer-menu li a:hover {
    color: #1a1a2e;
    text-decoration: underline;
}

/* --- Заголовки секций --- */
.footer-heading {
    font-family: 'Georgia', serif;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Текст и адрес --- */
.footer-text {
    font-size: 14px;
    line-height: 1.6;
    color: #3a3a4a;
    margin: 0;
}

.footer-address {
    font-size: 14px;
    line-height: 1.6;
    color: #3a3a4a;
    margin: 0;
    font-style: normal;
}

/* --- Контакты --- */
.footer-contact-item {
    font-size: 14px;
    line-height: 1.8;
    color: #3a3a4a;
    margin: 0;
}

.footer-contact-item strong {
    color: #2a2a3a;
    font-weight: 600;
}

.footer-contact-item a {
    color: #3a3a4a;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-contact-item a:hover {
    color: #1a1a2e;
    text-decoration: underline;
}

/* --- Нижняя полоса с копирайтом --- */
.footer-bottom {
    border-top: 1px solid #a89888;
    padding: 20px 24px;
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    font-size: 13px;
    color: #4a4a5a;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 900px) {
    .menu-toggle {
        display: flex;
    }

    .main-navigation {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: #bfb0a3;
        border-top: 1px solid #a89888;
        z-index: 100;
    }

    .main-navigation.toggled {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0;
        padding: 12px 24px;
    }

    .main-navigation ul li a {
        padding: 14px 0;
        border-bottom: 1px solid #a89888;
    }

    .header-auth {
        display: none;
    }

    /* Archive responsive */
    .issue-item {
        grid-template-columns: 1fr;
        gap: 12px;
        text-align: center;
    }

    .annotation-btn {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }

    /* Footer responsive */
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 32px 24px 24px;
    }
    
    .footer-column {
        gap: 20px;
    }
    
    .footer-branding {
        justify-content: center;
    }
    
    .footer-menu {
        align-items: center;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-contacts {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding: 0 16px;
        height: 64px;
    }

    .brand-title {
        font-size: 16px;
    }

    .site-logo-img {
        height: 40px;
    }

    .archive-content {
        padding: 0 16px;
    }

    .year-header {
        padding: 10px 16px;
    }

    .year-header h2 {
        font-size: 16px;
    }

    .issue-item {
        padding: 12px 0;
    }

    .issue-info {
        font-size: 14px;
    }

    .annotation-btn {
        padding: 8px 16px;
        font-size: 12px;
    }

    .subscription-text {
        font-size: 13px;
    }

    .footer-inner {
        padding: 24px 16px 16px;
    }
    
    .footer-branding {
        flex-direction: column;
        gap: 8px;
    }
    
    .footer-logo {
        height: 36px;
    }
}

/* ===== УТИЛИТЫ ===== */
.text-center {
    text-align: center;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }