/* 1. ФУНДАМЕНТ ТА ЗМІННІ */
:root {
    --bg-page: #ffffff;
    --text-main: #1a1a1b;
    --text-muted: #5f6368;
    --accent: #e31e24; /* Твій червоний */
    --border: #edf0f2;
    --header-bg: rgba(255, 255, 255, 0.98);
    --font-main: 'Inter', -apple-system, sans-serif;
}

/* Автоматична темна тема (якщо в тебе є клас dark-mode на body) */
body.dark-mode {
    --bg-page: #0f1112;
    --text-main: #e8eaed;
    --text-muted: #9aa0a6;
    --border: #2c2e33;
    --header-bg: rgba(15, 17, 18, 0.98);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* 2. ПРЕМІУМ ШАПКА - ОНОВЛЕНО */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--header-bg) !important; /* Примусово використовуємо нашу змінну */
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    transition: background-color 0.3s ease;
}

/* Додаткова перевірка для темної теми */
body.dark-mode .site-header {
    background-color: #0f1112 !important; /* Колір фону для темної теми */
    border-bottom: 1px solid #2c2e33;
}

/* Колір тексту в меню при темній темі */
body.dark-mode .main-tv-menu a, 
body.dark-mode .header-logo .logo-link {
    color: #e8eaed !important;
}

/* Таглайн теж має стати світлим */
body.dark-mode .site-tagline {
    color: #9aa0a6;
}
/* 3. ЛОГОТИП PRO VSE */
.header-logo .logo-link {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-decoration: none;
    color: var(--text-main);
    text-transform: uppercase;
}

.header-logo .logo-link span {
    color: var(--accent);
    font-weight: 500;
    margin-left: 2px;
}

.site-tagline {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: -4px;
}

/* 4. МЕНЮ (Чисте і солідне) */
.main-tv-menu {
    display: flex;
    list-style: none;
    gap: 24px;
    margin: 0;
    padding: 0;
    /* Якщо у хедера є border-bottom, цей від'ємний margin дозволить лінії його перекрити */
    margin-bottom: -1px; 
}

.main-tv-menu li {
    position: relative;
}

.main-tv-menu a {
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    transition: color 0.2s;
    display: block;
    padding: 10px 0 15px 0; /* Додав відступ знизу (15px), щоб лінія була на відстані від тексту */
    position: relative; /* КРИТИЧНО для роботи ліній ::after */
}

.main-tv-menu a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* --- АКТИВНИЙ ЕЛЕМЕНТ --- */
.main-tv-menu .current-menu-item > a,
.main-tv-menu .current-post-ancestor > a,
.main-tv-menu .current-category-ancestor > a {
    color: var(--accent) !important;
}

/* Лінія під активним пунктом та при наведенні */
.main-tv-menu a::after {
    content: '';
    position: absolute;
    bottom: 0; /* Лінія притиснута до самого низу посилання */
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--accent);
    border-radius: 2px 2px 0 0;
    transition: all 0.3s ease;
    z-index: 2; /* Щоб була ПОВЕРХ бордера шапки */
}

/* Стан для активного пункту (лінія на всю ширину) */
.main-tv-menu .current-menu-item > a::after,
.main-tv-menu .current-post-ancestor > a::after,
.main-tv-menu .current-category-ancestor > a::after {
    width: 100%;
}

/* Ефект появи лінії при наведенні для НЕактивних пунктів */
.main-tv-menu li:not(.current-menu-item) a:hover::after {
    width: 100%;
}
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.icon-btn:hover { transform: scale(1.1); }

/* Приховуємо зайві іконки тем */
body:not(.dark-mode) .sun-icon { display: none; }
body.dark-mode .moon-icon { display: none; }

/* 6. ПОШУКОВА ПАНЕЛЬ */
.search-bar {
    background: var(--bg-page);
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    display: none; /* Показуємо через JS */
}

.search-bar.is-active { display: block; }

.search-bar input {
    width: 100%;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 18px;
    outline: none;
}

/* --- СТИЛІ ДЛЯ СЕКЦІЇ НОВИН (PRO VSE STYLE) --- */
.section-title {
    border-left: 5px solid var(--accent);
    padding-left: 15px;
    font-weight: 800;
}

/* Велика картка (Hero) */
.hero-article {
    border-radius: 12px;
    height: 420px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.hero-overlay {
    background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, transparent 100%);
    width: 100%;
    padding: 30px;
}

/* Малі картки */
.news-card {
    background: var(--bg-card) !important;
    border-radius: 10px;
    border: 1px solid var(--border) !important;
    transition: transform 0.3s ease;
}

.news-card:hover { transform: translateY(-5px); }

.news-card .thumb {
    height: 190px;
    background-size: cover;
    background-position: center;
}

.news-card .card-body {
    padding: 1.25rem;
    color: var(--text-main);
}

.news-card a { color: var(--text-main); }

.news-meta {
    border-top: 1px solid var(--border);
    padding-top: 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.post-date strong {
    color: var(--text-main);
}
.post-date span {
    border-left: 1px solid var(--border);
    padding-left: 8px;
    margin-left: 5px;
}

/* --- СЕКЦІЯ СТАТЕЙ (PRO VSE PREMIUM ARTICLES) --- */
.articles-section {
    background-color: var(--bg-card); /* Легкий фон для виділення секції */
    padding: 60px 0;
    margin: 40px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.article-item {
    display: flex;
    gap: 25px;
    margin-bottom: 35px;
    align-items: center;
}

.article-item .article-thumb {
    flex: 0 0 240px;
    height: 160px;
    border-radius: 8px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.article-item .article-info {
    flex: 1;
}

.article-category {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.article-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.article-title a {
    color: var(--text-main);
    text-decoration: none;
}

.article-excerpt {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Мобільна адаптація для статей */
@media (max-width: 768px) {
    .article-item {
        flex-direction: column;
        gap: 15px;
    }
    .article-item .article-thumb {
        flex: 0 0 200px;
        width: 100%;
    }
}
.article-premium-card:hover img {
    transform: scale(1.05);
}
.article-premium-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
}

.article-meta-left .article-date {
    border-right: 1px solid var(--border);
    padding-right: 12px;
}


/* --- ВІДЕО БЛОК (PRO VSE CINEMATIC) --- */
.video-section {
    background-color: #0f1112 !important; /* Завжди темний для контрасту з відео */
    border-radius: 16px;
    padding: 30px;
    border: 1px solid #222529;
}

.video-section h2 {
    color: #ffffff;
    border-left: 5px solid var(--accent);
    padding-left: 15px;
}

.video-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.video-card:hover {
    transform: scale(1.02);
}

.video-overlay {
    background: rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease;
}

.video-card:hover .video-overlay {
    background: rgba(0, 0, 0, 0.5);
}

/* Стильна кнопка Play */
.play-icon {
    font-size: 60px;
    color: #ffffff;
    opacity: 0.8;
    transition: all 0.3s ease;
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.video-card:hover .play-icon {
    opacity: 1;
    transform: scale(1.1);
    color: var(--accent);
}

.video-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #f8f9fa !important;
    text-align: center;
    margin-top: 15px;
    transition: color 0.2s;
}

.video-card-link:hover + .video-title,
.video-title:hover {
    color: var(--accent) !important;
}

/* --- ГАЛЕРЕЯ PRO VSE --- */
.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.gallery-img-wrapper {
    height: 180px;
    position: relative;
    overflow: hidden;
}

.gallery-img-wrapper img {
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-img-wrapper img {
    transform: scale(1.1);
}

.gallery-icon-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.gallery-body {
    padding: 12px;
}

.gallery-title {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-main);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.gallery-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 8px;
}

/* --- БЛОК ВІРШІВ PRO VSE --- */
.poems-section {
    position: relative;
    overflow: hidden;
    padding: 30px;
    border-radius: 16px;
    background: #fdfcf0; /* Теплий папір для світлої теми */
    border: 1px solid #e8e4c8;
    transition: all 0.3s ease;
}

/* Адаптація під ТЕМНУ ТЕМУ */
body.dark-mode .poems-section {
    background: #1a1512; /* Глибокий коричнево-чорний */
    border-color: #332a24;
}

.poem-bg-icon {
    position: absolute;
    right: -20px;
    top: -20px;
    font-size: 10rem;
    color: rgba(0,0,0,0.03);
    transform: rotate(45deg);
    pointer-events: none;
}

body.dark-mode .poem-bg-icon {
    color: rgba(255,255,255,0.02);
}

.poem-header {
    border-color: rgba(0,0,0,0.1) !important;
}

body.dark-mode .poem-header {
    border-color: rgba(255,255,255,0.05) !important;
}

.poem-title {
    font-weight: 800;
    color: #4e342e;
    letter-spacing: 1px;
}

body.dark-mode .poem-title {
    color: #d7ccc8;
}

.poem-title i { color: var(--accent); }

.poem-link {
    color: #795548;
    transition: color 0.2s;
}

body.dark-mode .poem-link { color: #a1887f; }

/* Картка вірша */
.poem-card {
    padding: 20px;
    background: #ffffff;
    border-radius: 10px;
    border-left: 4px solid #bcaaa4 !important;
    height: 100%;
    transition: transform 0.3s ease;
}

body.dark-mode .poem-card {
    background: #251e1a;
    border-left-color: var(--accent) !important;
}

.poem-card:hover {
    transform: translateX(5px);
}

.poem-text-title {
    font-family: 'Georgia', serif;
    font-style: italic;
    line-height: 1.5;
}

.poem-text-title a {
    color: #3e2723;
}

body.dark-mode .poem-text-title a {
    color: #efebe9;
}

.poem-meta {
    font-size: 0.75rem;
    color: #8d6e63;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 10px;
}

body.dark-mode .poem-meta {
    color: #8d6e63;
    border-top-color: rgba(255,255,255,0.05);
}

.poem-card-icon {
    color: #bcaaa4;
    margin-right: 12px;
    margin-top: 5px;
    font-size: 0.9rem;
    opacity: 0.6;
}

/* --- ФІНАЛЬНИЙ ФУТЕР PRO VSE --- */
.site-footer {
    background-color: #0f1112; /* Глибокий графіт */
    color: #a0a0a0;
    padding: 70px 0 30px;
    border-top: 4px solid var(--accent);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 50px;
}

@media (max-width: 992px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
}

/* Лого та опис */
.footer-logo {
    font-size: 32px;
    font-weight: 900;
    color: #fff;
    text-decoration: none;
    letter-spacing: -1px;
    display: inline-block;
    margin-bottom: 20px;
}
.footer-logo span { color: var(--accent); }
.footer-logo:hover { color: #fff; text-decoration: none; }

.footer-desc {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 25px;
    max-width: 350px;
}
@media (max-width: 768px) { .footer-desc { margin: 0 auto 25px; } }

/* Соцмережі */
.footer-social { display: flex; gap: 15px; }
@media (max-width: 768px) { .footer-social { justify-content: center; } }

.footer-social a {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: 0.3s;
}
.footer-social a:hover { background: var(--accent); transform: translateY(-3px); }

/* Навігація та заголовки */
.site-footer h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-menu li { margin-bottom: 12px; }
.footer-menu a {
    color: #a0a0a0;
    text-decoration: none;
    transition: 0.2s;
    font-size: 14px;
}
.footer-menu a:hover { color: var(--accent); padding-left: 5px; }

/* Контакти */
.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}
@media (max-width: 768px) { .contact-item { justify-content: center; } }

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 13px;
}

/* Оновлений вигляд  перемикача */
.provse-lang-switcher {
    display: inline-flex;
    align-items: center;
    background: rgba(var(--text-main-rgb), 0.05) !important; /* Адаптивний фон */
    padding: 2px 12px !important;
    border-radius: 20px !important; /* Більш округлий, сучасний */
    border: 1px solid var(--border) !important;
    height: 34px !important;
    transition: all 0.3s ease;
}

body.dark-mode .provse-lang-switcher {
    background: rgba(255, 255, 255, 0.05) !important;
}

.lang-link {
    font-size: 12px !important;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.5 !important;
}

.lang-link.active {
    opacity: 1 !important;
    color: var(--accent) !important; /* червоний замість жовтого */
    text-shadow: 0 0 10px rgba(227, 30, 36, 0.2);
}

.lang-link:hover {
    opacity: 1 !important;
    color: var(--text-main) !important;
}

.sep { 
    margin: 0 6px !important; 
    opacity: 0.1 !important; 
    font-weight: 300;
}

/* --- БЛОК УПРАВЛІННЯ В ШАПЦІ --- */
.header-actions {
    display: flex;
    align-items: center;
    background: rgba(var(--text-main-rgb), 0.04);
    padding: 4px 12px;
    border-radius: 30px;
    border: 1px solid var(--border);
    gap: 8px;
}

body.dark-mode .header-actions {
    background: rgba(255, 255, 255, 0.05);
}

/* Стилізація кнопок-іконок */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--text-main);
    border-radius: 50%;
    transition: all 0.2s ease;
    padding: 0;
    position: relative;
}

.icon-btn:hover {
    background: rgba(var(--text-main-rgb), 0.08);
    color: var(--accent);
}

/* Розділювач між мовою та кнопками */
.lang-unit {
    display: flex;
    align-items: center;
    border-right: 1px solid var(--border);
    padding-right: 8px;
    margin-right: 4px;
}

/* Коригуємо твій плагін мов під новий дизайн */
.provse-lang-switcher {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    height: auto !important;
}

/* Іконки теми */
.sun-icon, .moon-icon { font-size: 16px; transition: 0.3s; }
body.dark-mode .sun-icon { display: block; }
body:not(.dark-mode) .sun-icon { display: none; }
body.dark-mode .moon-icon { display: none; }
body:not(.dark-mode) .moon-icon { display: block; }

/* Бургер-кнопка (приховуємо на десктопі, покажемо завтра в адаптиві) */
@media (min-width: 992px) {
    .burger-btn { display: none; }
}

@media (max-width: 991px) {
    .header-nav { display: none; } /* Ховаємо основне меню на мобільних */
    .burger-btn { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
    .burger-btn span { width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
}

/* Панель пошуку (виїжджаюча) */
.search-bar {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    border-bottom: 2px solid var(--accent);
    padding: 15px 0;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
    z-index: 10;
}

.search-bar.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.search-bar input {
    width: 100%;
    border: none;
    background: none;
    font-size: 18px;
    color: var(--text-main);
    outline: none;
}

.js-search-panel {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    border-bottom: 2px solid var(--accent);
    padding: 20px 0;
    z-index: 100;
    
    /* Ефект прихованої панелі */
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Клас, який додає JS при кліку */
.js-search-panel.active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* Стиль для результатів живого пошуку */
#ajax-search-results {
    background: var(--bg-card);
    max-height: 400px;
    overflow-y: auto;
}
#ajax-search-results.has-results {
    margin-top: 15px;
    border-top: 1px solid var(--border);
    padding-top: 15px;
}


/* --- СТИЛІ ПАНЕЛІ ПОШУКУ --- */
.site-header {
    position: relative;
    z-index: 999;
    /* Переконайся, що тут НЕМАЄ overflow: hidden; */
}

.js-search-panel {
    position: absolute;
    top: 100%; /* Одразу під лінією шапки */
    left: 0;
    width: 100%;
    background: var(--bg-card); /* Переконайся, що тут колір, а не прозорість */
    padding: 30px 0;
    z-index: 1000;
    
    /* Тінь, яка відокремить панель від контенту знизу */
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    border-bottom: 3px solid var(--accent);
    
    /* Анімація */
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

/* Коли активна */
.js-search-panel.active {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
}

/* Додамо затемнення основного контенту, коли пошук відкритий */
.search-is-open main {
    filter: blur(2px);
    opacity: 0.5;
    pointer-events: none;
    transition: 0.3s;
}

/* Коли JS додає клас active */
.js-search-panel.active {
    display: block !important; /* Примусово показуємо */
    opacity: 1;
    transform: translateY(0);
}

/* Стиль інпуту всередині */
.js-search-panel input {
    width: 85%;
    background: none;
    border: none;
    border-bottom: 2px solid var(--border);
    font-size: 20px;
    padding: 10px 0;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.3s;
}

.js-search-panel input:focus {
    border-color: var(--accent);
}

/* Контейнер для Аякс-результатів */
#ajax-search-results {
    margin-top: 15px;
    background: var(--bg-card);
    max-height: 350px;
    overflow-y: auto;
}

/* Ефект затемнення фону */
body.search-is-open::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Темний напівпрозорий фон */
    backdrop-filter: blur(3px); /* Легке розмиття контенту */
    z-index: 998; /* Нижче панелі пошуку, але вище сайту */
    transition: 0.3s;
}

/* Сама панель пошуку */
.js-search-panel {
    z-index: 999 !important; /* Найвищий пріоритет */
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
}

body.search-is-open {
   padding-right: 17px; /* Компенсація ширини скролбару, щоб сайт не стрибав */
}

@media (max-width: 991px) {
    body.search-is-open { padding-right: 0; }
}

/* --- ДЕСКТОПНЕ МЕНЮ (ховаємо на мобільних) --- */
@media (max-width: 991px) {
    .header-nav, .header-nav-desktop {
        display: none !important;
    }
}

/* --- МОБІЛЬНИЙ САЙДБАР --- */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    /* ВИПРАВЛЕННЯ: додаємо чіткий колір фону, щоб він не був прозорим */
    background: var(--bg-card, #ffffff); 
    z-index: 2100;
    transform: translateX(-100%); 
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 10px 0 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* Стан, коли меню відкрите */
.mobile-sidebar.active {
    transform: translateX(0);
}

/* Кнопка закриття (Зручний хрестик для PRO VSE) */
.close-sidebar {
    background: var(--bg-body, #f0f0f0); /* Світлий фон кнопки */
    border: 1px solid var(--border, #ddd);
    border-radius: 12px; /* Приємні закруглені кути */
    
    /* Збільшена область натискання */
    width: 48px;  
    height: 48px; 
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    font-size: 32px; /* Великий символ × */
    font-weight: 300; /* Робимо лінії хрестика тонкими та елегантними */
    color: var(--text-main, #333);
    cursor: pointer;
    
    transition: all 0.2s ease;
    margin-left: auto; /* Притискаємо до правого краю */
    margin-bottom: 20px;
    
    /* Прибираємо синє виділення при тапі на Android */
    -webkit-tap-highlight-color: transparent; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* Корекція для ТЕМНОЇ теми */
body.dark-theme .close-sidebar {
    background: #2c2c2c;
    border-color: #444;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Ефект при натисканні (фізичний відгук) */
.close-sidebar:active {
    transform: scale(0.92); /* Кнопка трохи "просідає" при натисканні */
    background: var(--accent, #007bff);
    color: #fff;
    border-color: transparent;
}

/* Колір хрестика в ТЕМНІЙ темі */
body.dark-theme .close-sidebar {
    background: #333;
    border-color: #444;
    color: #fff;
}

/* Ефект при натисканні */
.close-sidebar:active {
    transform: scale(0.9); /* Кнопка трохи стискається під пальцем */
    background: var(--accent, #007bff);
    color: #fff;
}

/* Оверлей (затемнення фону) */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7); /* Трохи темніше для контрасту */
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    backdrop-filter: blur(4px); /* Посилений блюр */
}

body.nav-is-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
}

/* --- СТИЛІЗАЦІЯ ПУНКТІВ МЕНЮ --- */
.mobile-main-menu {
    list-style: none !important;
    padding: 0 !important;
    margin: 20px 0 !important;
    display: flex !important;
    flex-direction: column;
}

.mobile-main-menu li {
    display: block !important;
    width: 100%;
    border-bottom: 1px solid var(--border, rgba(0,0,0,0.1));
}

.mobile-main-menu li a {
    display: block !important;
    padding: 18px 10px !important; /* Трохи більше місця для натискання */
    font-size: 19px !important; /* Чіткий розмір */
    font-weight: 600 !important; /* Жирніший шрифт для видимості */
    
    /* ВИПРАВЛЕННЯ: колір для світлої теми */
    color: #222222 !important; 
    
    text-decoration: none !important;
    transition: all 0.2s ease;
    text-indent: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ефект при натисканні */
.mobile-main-menu li a:active {
    background-color: rgba(0, 123, 255, 0.1);
    padding-left: 20px !important;
    color: var(--accent, #007bff) !important;
}

/* ВИПРАВЛЕННЯ ДЛЯ ТЕМНОЇ ТЕМИ: 
   Робимо текст БІЛИМ, а фон сайдбару ТЕМНИМ */
body.dark-theme .mobile-sidebar {
    background: #1a1a1a !important; /* Темний фон сайдбару */
}

body.dark-theme .mobile-main-menu li a {
    color: #ffffff !important; /* Примусово білий текст */
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .mobile-main-menu li a:active {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Додаємо простір для іконок */
.mobile-main-menu li a {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important; /* Відступ між іконкою та текстом */
}

/* Іконка для "Головна" */
.mobile-main-menu li a[href="/"]::before,
.mobile-main-menu li a[href*="home"]::before {
    content: "🏠"; /* Можна замінити на іконку з набору FontAwesome, якщо він підключений */
    font-size: 20px;
}

/* Іконка для Новин / Категорій */
.mobile-main-menu li a::before {
    content: "📁"; /* Стандартна іконка для всіх інших пунктів */
    font-size: 18px;
    opacity: 0.7;
}

/* Окремі іконки для популярних рубрик (приклади) */
.mobile-main-menu li a[href*="politika"]::before { content: "⚖️"; }
.mobile-main-menu li a[href*="zaporizhzhya"]::before { content: "📍"; }
.mobile-main-menu li a[href*="sport"]::before { content: "⚽"; }
.mobile-main-menu li a[href*="ekonomika"]::before { content: "📈"; }

/* Стилі для елемента результату */
.search-result-item {
    display: flex !important;
    align-items: flex-start !important;
    gap: 15px !important;
    padding: 12px !important;
    border-bottom: 1px solid var(--border);
    text-decoration: none !important;
}

/* Контейнер картинки */
.result-thumb {
    flex: 0 0 150px !important; /* Фіксуємо ширину контейнера */
    width: 150px !important;
    height: 150px !important;
    overflow: hidden;
    border-radius: 8px;
    background: #f0f0f0;
}

/* Сама картинка 150x150 */
.webp-search-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Обрізає зайве, роблячи ідеальний квадрат */
    display: block;
}

/* Інфо-блок поруч */
.result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Назва новини в пошуку */
.result-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    /* ВИПРАВЛЕННЯ: використовуємо змінну, яка змінюється разом з темою */
    color: var(--text-main) !important; 
    line-height: 1.4;
    display: block;
    margin-bottom: 5px;
    text-decoration: none !important;
}

/* Мета-дані (дата та перегляди) */
.result-meta {
    font-size: 12px !important;
    /* Використовуємо приглушений колір зі змінних */
    color: var(--text-muted) !important;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Фон самого елемента при наведенні */
.search-result-item:hover {
    background-color: rgba(var(--accent-rgb), 0.05); /* Легкий відтінок твого акценту */
}

/* Якщо у тебе в темній темі все одно погано видно, 
   додамо пряме правило для dark-mode */
body.dark-mode .result-title {
    color: #e8eaed !important; /* Чіткий світлий колір для темної теми */
}

body.dark-mode .result-meta {
    color: #9aa0a6 !important;
}

/* Прибираємо сині посилання, якщо вони десь вилізли */
.search-result-item, 
.search-result-item:hover, 
.search-result-item:focus {
    text-decoration: none !important;
    outline: none;
}

/* --- КОРЕКЦІЯ ТІЛЬКИ ДЛЯ СВІТЛОЇ ТЕМИ --- */
/* (Працює, коли на body НЕМАЄ класу dark-mode) */
body:not(.dark-mode) .js-search-panel {
    background-color: #ffffff !important; /* Чистий білий без прозорості */
    border: 1px solid #d1d5db; /* Тонка рамка навколо панелі */
}

body:not(.dark-mode) .search-result-item .result-title {
    color: #000000 !important; /* Глибокий чорний колір для максимальної чіткості */
    font-weight: 800 !important; /* Максимальна жирність */
    text-shadow: none; /* Прибираємо тіні, які у світлій темі роблять бруд */
}

body:not(.dark-mode) .result-meta {
    color: #4b5563 !important; /* Темніший сірий для дати та переглядів */
    font-weight: 500;
}

body:not(.dark-mode) .search-result-item {
    border-bottom: 1px solid #f3f4f6; /* Світла лінія розділювача */
}

/* Ефект наведення у світлій темі */
body:not(.dark-mode) .search-result-item:hover {
    background-color: #f9fafb !important;
}

/* Додатково: виділяємо слово, яке шукаємо, якщо воно підсвічується */
body:not(.dark-mode) .search-result-item mark,
body:not(.dark-mode) .search-result-item b {
    color: var(--accent);
    background: transparent;
}

.subscribe-window {
    position: fixed;
    bottom: -400px; /* Спочатку заховано */
    right: 20px;
    width: 320px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #eee);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 9999;
    transition: bottom 0.5s ease-in-out;
}
.subscribe-window.show { bottom: 20px; }
.dark-mode .subscribe-window { background: #1a1a1a; border-color: #333; }

.sub-inner h5 { font-weight: 700; margin-bottom: 10px; color: #d93025; }
.sub-inner p { font-size: 14px; margin-bottom: 15px; }

#ajax-sub-form { display: flex; gap: 5px; }
#sub-email { flex: 1; border: 1px solid #ddd; border-radius: 5px; padding: 8px; font-size: 14px; }
#sub-submit { background: #d93025; color: #fff; border: none; padding: 0 15px; border-radius: 5px; cursor: pointer; }

.close-sub { position: absolute; top: 5px; right: 10px; background: none; border: none; font-size: 22px; cursor: pointer; color: #999; }
#sub-msg { font-size: 12px; margin-top: 10px; }


.post-comments-count, .entry-comments {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}
.post-comments-count i, .entry-comments i {
    transition: 0.3s;
}
.post-comments-count:hover i {
    transform: scale(1.2); /* Легкий ефект при наведенні */
}


.close-sidebar {
    background: none;
    border: none;
    font-size: 35px; /* Великий зручний хрестик */
    line-height: 1;
    color: currentColor;
    cursor: pointer;
    padding: 10px;
}
