/* ========== ВЕРХНЯЯ ЧАСТЬ САЙТА ========== */

/* Большая шапка — НЕ ДВИГАЕТСЯ, всегда на месте */
.site-header-large {
    position: relative;
    top: 0;
    width: 100%;
    background: transparent;
    z-index: 999;
}

/* Маленькая шапка — скрыта, появляется при скролле */
.site-header-small {
    position: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    background: rgba(31, 78, 80, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backface-visibility: hidden;
    will-change: transform;
}



/* Маленькая шапка — видна */
.site-header-small {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.site-header-small.header-visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Светлая тема для маленькой шапки */
body.light-theme .site-header-small {
    background: rgba(255, 255, 255, 0.95);
}

/* Внутренний контейнер для ограничения ширины */
.header-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 50px;
    box-sizing: border-box;
}

.header-row {
    display: flex;
    justify-content: center;
    /* 🔑 Центрирует все элементы по горизонтали */
    align-items: center;
    flex-wrap: wrap;
    /* Разрешает перенос, если не влезают */
    gap: 16px;
    /* Равные отступы между логотипом, меню, поиском и т.д. */
    width: 100%;
    box-sizing: border-box;
}

.header-left {
    flex-shrink: 0;
}

.social-network {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    height: 30px;
}


.site-title {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 0;
    /* Скрываем любой остаточный текст */
    line-height: 1;
}

/* Стили самого логотипа */
.site-logo {
    max-height: 33px;
    /* 🔧 Подбери под высоту своей шапки (обычно 35-50px) */
    width: auto;
    object-fit: contain;
    display: block;
}

.site-logo-m {
    max-height: 20px;
}

.site-title:hover {
    text-decoration: none;
    opacity: 0.95;
}

.site-subtitle {
    font-size: 11px;
    color: #9ca3af;
    display: block;
}

.theme-toggle {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 0;
}

.theme-toggle:hover {
    background: rgba(56, 189, 248, 0.4);
    transform: scale(1.05);
}

/* Меню в большой шапке */
.header-nav-wrapper {
    max-width: 1400px;
    margin: 10px auto 0;
}

/* Меню в маленькой шапке */
.header-nav-wrapper-scrolled {
    flex: 1;
    text-align: left;
}

.header-nav {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.header-nav a {
    color: #e5e7eb;
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    white-space: nowrap;
}

.header-nav a:hover {
    color: #30D5C8;
    text-decoration: none;
}

/* ========== СТИЛИ ДЛЯ МАЛЕНЬКОЙ ШАПКИ ========== */
.site-header-small .header-inner {
    padding: 5px 20px 15px;
}

.site-header-small .header-row {
    flex-wrap: nowrap;
}

.site-header-small .site-title {
    font-size: 18px;
    margin-bottom: 0;
}

.site-header-small .site-title img {
    height: 20px;
}

.site-header-small .header-nav {
    justify-content: flex-start;
    padding-left: 20px;
    gap: 20px;
}

.site-header-small .header-nav a {
    font-size: 16px;
}

.site-header-small .theme-toggle {
    width: 28px;
    height: 28px;
    font-size: 16px;
}

/* ========== ПОИСК В БОЛЬШОЙ ШАПКЕ ========== */
.search-form {
    margin-top: 6px;
}

.search-block {
    width: 100%;
    max-width: 100%;
    min-width: 230px;
    margin: 10px auto 0;
}


.search-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 150px;
    max-width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(27, 92, 129, 0.55);
    color: var(--text);
    outline: none;
}

.search-input:focus {
    border-color: rgba(56, 189, 248, 0.7);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.search-button {
    background: transparent;
    cursor: pointer;
    border: none;
}

.search-button img {
    width: 22px;
}


.search-clear {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
}

.search-clear:hover {
    color: var(--text);
    text-decoration: underline;
}

.search-results {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.45);
    width: 100%;
    box-sizing: border-box;
}

.search-results-title {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.search-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin: 8px 0 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.term-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.term {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.35);
    color: var(--text);
    font-size: 12px;
}

.term-ok {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.12);
}

.term-miss {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.12);
}

/* ========== ПОИСК В МАЛЕНЬКОЙ ШАПКЕ ========== */
.search-small {
    max-width: 400px;
    margin: 5px auto 0;
    padding: 0 20px;
}

.search-form-small {
    display: flex;
    gap: 5px;
    align-items: center;
}

.search-input-small {
    flex: 1;
    padding: 6px 10px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.8);
    color: var(--text);
    font-size: 13px;
    outline: none;
}

.search-input-small:focus {
    border-color: rgba(56, 189, 248, 0.7);
}

.search-button-small {

    margin-left: 0;
    margin-top: 5px;
}

.search-clear-small {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
}

.search-clear-small:hover {
    color: var(--text);
}

/* Светлая тема для поиска в маленькой шапке */
body.light-theme .search-input-small {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.2);
}

/* ========== СВЕТЛАЯ ТЕМА ДЛЯ ШАПКИ ========== */
body.light-theme .site-title {
    color: #0891b2;
}

body.light-theme .site-subtitle {
    color: #475569;
}

body.light-theme .header-nav a {
    color: #1e293b;
}

body.light-theme .header-nav a:hover {
    color: #0891b2;
}

/* public_html/static/css/header.css */

.header-nav a.active-link {
    color: #30D5C8;
    /* Твой акцентный цвет */
}

/* 🔥 ФИКС ГОРИЗОНТАЛЬНОГО СКРОЛЛА (ГАРАНТИРОВАННЫЙ) 🔥 */


/* 1. Шапка: padding включается в ширину, убираем отрицательные margin */
.header-inner {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
}

/* 2. Строка шапки: убираем дублирующие отступы */
.header-row {
    box-sizing: border-box !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 10px !important;
    /* Компактнее на мобильных */
}