/*
Theme Name: Lyceum 5 Final Fixed
Version: 9.0
*/

:root {
    --maroon: #7d2a24;
    --orange: #e67e22;
    --dark-blue: #2c3e50;
    --blue: #2a5479;
    --white-glass: rgba(255, 255, 255, 0.9);
}

body { margin: 0; padding: 0; font-family: 'Segoe UI', Arial, sans-serif; background: #f0f2f5; overflow-x: hidden; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ТОП ЛІНІЯ */
.top-orange-line {
    background: #e67e22;
    padding: 7px 0;
    position: relative;
    z-index: 9999;
}
.top-container {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
}

/* СЛАЙДЕР */
.slider-area { position: relative; width: 100%; line-height: 0; max-height: 500px; overflow: hidden; }
.slider-area img,
.slider-area .sp-slide,
.slider-area .sp-layer { max-height: 500px; }
.slider-area .sp-canvas { max-height: 500px !important; }

.ultra-thin-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    background: rgba(30, 15, 10, 0.62);
    backdrop-filter: blur(2px);
    padding: 12px 0;
    z-index: 8888;
}

.overlay-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.overlay-flex img { max-height: 80px; width: auto; }

.overlay-text h1 {
    font-size: 34px;
    color: #ffffff;
    margin: 0;
    text-transform: uppercase;
    font-family: 'Georgia', serif;
    font-weight: 900;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
    letter-spacing: 1px;
}
.overlay-text p { font-size: 13px; color: #e67e22; margin: 4px 0 0 0; font-weight: bold; letter-spacing: 1px; }

/* WELCOME БЛОК — десктоп: все видно */
.welcome-logo { float: left; }
.welcome-extra { display: block; }
.welcome-toggle-btn { display: none; }

/* КНОПКА БУРГЕР — прихована на десктопі */
.mobile-menu-toggle-wrap {
    display: none;
}

/* ГОЛОВНА СІТКА */
.main-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.side-menu-box {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.side-menu-box h3 { font-size: 15px; color: #7d2a24; border-bottom: 2px solid #e67e22; padding-bottom: 8px; margin-bottom: 12px; }
.side-menu-box ul { list-style: none; padding: 0; margin: 0; }
.side-menu-box li { padding: 8px 0; border-bottom: 1px solid #f4f4f4; }
.side-menu-box a { text-decoration: none; color: #444; font-size: 14px; font-weight: 500; }
.side-menu-box a:hover { color: #e67e22; }

/* КАРТКИ КАТЕГОРІЙ */
.cat-row {
    display: flex;
    gap: 15px;
    margin: -50px auto 30px;
    position: relative;
    z-index: 9000;
    max-width: 1200px;
}

.cat-card {
    background: #fff;
    flex: 1;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #333;
    border-bottom: 4px solid #e67e22;
    font-size: 30px;
    position: relative;
    top: 0;
    transition: all 0.3s ease;
    display: block;
}

.cat-card:hover {
    top: -10px;
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
    background-color: #fcfcfc;
}

.cat-card h4 { margin: 10px 0 0 0; font-size: 16px; color: #333; }

.cat-card-label {
    display: block;
    margin: 10px 0 0 0;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.cat-btn { background: #fff; flex: 1; padding: 15px; text-align: center; border-radius: 6px; box-shadow: 0 3px 10px rgba(0,0,0,0.1); text-decoration: none; color: #333; border-bottom: 3px solid #e67e22; font-size: 14px; font-weight: bold; }

/* ТОП-ЛІНІЯ (single) */
.top-info-line {
    background: var(--orange);
    color: white;
    padding: 10px 0;
    position: relative;
    z-index: 2000;
}
.top-info-flex { display: flex; justify-content: flex-end; gap: 25px; font-size: 14px; font-weight: bold; }

/* ШАПКА SINGLE — з картинкою */
.page-mini-header {
    background-color: #2a5479 !important;
    background-image: url('images/fon.png') !important;
    background-repeat: repeat-x !important;
    background-size: auto 100% !important;
    background-position: left center !important;
}

/* БРЕНДИНГ */
.main-hero-section { position: relative; margin-top: 0; padding: 0; }

.branding-strip-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    background: var(--white-glass);
    padding: 15px 0;
    z-index: 1500;
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.branding-content-left { display: flex; align-items: center; gap: 20px; justify-content: flex-start; }
.branding-logo img { max-height: 90px; width: auto; display: block; }
.lyceum-main-name { font-size: 30px; color: var(--maroon); margin: 0; font-family: 'Georgia', serif; text-transform: uppercase; font-weight: 900; }
.lyceum-sub-motto { font-size: 15px; color: var(--orange); margin: 5px 0 0 0; font-weight: bold; }

/* КАТЕГОРІЇ */
.category-boxes { display: flex; gap: 15px; margin: -40px auto 40px; position: relative; z-index: 1600; }
.cat-box { background: #fff; flex: 1; padding: 25px 10px; text-align: center; border-radius: 10px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); border-bottom: 5px solid var(--orange); text-decoration: none; color: #333; transition: 0.3s; }
.cat-box:hover { transform: translateY(-10px); background: var(--maroon); color: #fff; }
.cat-box .icon { font-size: 32px; display: block; margin-bottom: 8px; }

/* СІТКА SINGLE */
.main-grid-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    margin-top: 30px;
}

/* МЕНЮ */
.left-navigation, .side-menu-box {
    background: #fff;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: none;
}

.left-navigation h3, .side-menu-box h3 {
    font-size: 18px;
    color: var(--maroon);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--orange);
    display: block;
}

.left-navigation ul, .side-menu-box ul { list-style: none; padding: 0; margin: 0; }
.left-navigation li, .side-menu-box li { padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.left-navigation li:last-child, .side-menu-box li:last-child { border-bottom: none; }
.left-navigation a, .side-menu-box a { text-decoration: none; color: #444; font-size: 15px; font-weight: 600; transition: all 0.3s ease; display: block; }
.left-navigation a:hover, .side-menu-box a:hover { color: var(--orange); padding-left: 8px; }

/* КАРТКИ НОВИН */
.block-title { font-size: 22px; color: var(--blue); border-left: 6px solid var(--orange); padding-left: 15px; margin-bottom: 30px; }
.news-card { display: flex; gap: 25px; background: #fff; padding: 20px; margin-bottom: 30px; border-radius: 15px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.news-card-img { flex: 0 0 260px; }
.news-card-img img { width: 100%; height: 170px; object-fit: cover; border-radius: 10px; }
.news-card-title a { color: var(--blue); text-decoration: none; font-size: 22px; font-weight: 800; }
.btn-read-more { display: inline-block; background: var(--blue); color: #fff; padding: 12px 28px; border-radius: 8px; text-decoration: none; font-weight: bold; margin-top: 15px; }

/* ЗАГОЛОВКИ НОВИН В КАРТКАХ НА ГОЛОВНІЙ */
.content-side h3 a { color: var(--blue) !important; }

/* ФУТЕР */
.site-footer { background: var(--dark-blue); color: #fff; padding: 60px 0 30px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.footer-bottom { text-align: center; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 40px; color: #ccc; font-size: 14px; }


/* ============================================
   АДАПТИВНИЙ ДИЗАЙН
   ============================================ */

/* ПЛАНШЕТ — до 1024px */
@media (max-width: 1024px) {
    .main-grid { grid-template-columns: 200px 1fr !important; gap: 20px !important; padding: 0 15px !important; }
    .main-grid-layout { grid-template-columns: 220px 1fr !important; gap: 25px !important; }
    .cat-row { gap: 10px !important; margin: -35px 15px 25px !important; }
    .cat-card { font-size: 24px !important; padding: 15px 10px !important; }
    .cat-card h4, .cat-card-label { font-size: 13px !important; }
    .footer-grid { gap: 25px !important; }
}

/* МОБІЛЬНИЙ — до 768px */
@media (max-width: 768px) {

    /* ТОП ЛІНІЯ */
    .top-container,
    .top-info-flex {
        justify-content: center !important;
        gap: 10px !important;
        font-size: 12px !important;
    }

    /* ЛОГОТИП НАД СЛАЙДЕРОМ */
    .overlay-flex img { max-height: 48px !important; }
    .overlay-text h1 { font-size: 14px !important; letter-spacing: 0 !important; line-height: 1.3 !important; word-break: break-word !important; white-space: normal !important; max-width: 100% !important; }
    .overlay-text p { font-size: 11px !important; }
    .ultra-thin-overlay { padding: 8px 0 !important; }

    /* СЛАЙДЕР — менша висота на мобільному */
    .slider-area { max-height: 260px !important; }
    .slider-area img,
    .slider-area .sp-slide,
    .slider-area .sp-layer { max-height: 260px !important; }
    .slider-area .sp-canvas { max-height: 260px !important; }

    /* Додаткові стилі для слайдера — перенесення тексту */
    .overlay-flex {
        flex-wrap: wrap !important;
        text-align: center !important;
        gap: 6px !important;
    }
    
    .overlay-flex img {
        max-height: 35px !important;
    }

    /* КНОПКА БУРГЕР — показуємо */
    .mobile-menu-toggle-wrap {
        display: block !important;
        position: relative !important;
        padding: 10px 12px !important;
        background: #fff !important;
        border-bottom: 1px solid #f0f0f0 !important;
        z-index: 9500 !important;
    }

    .mobile-menu-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        background: var(--blue) !important;
        color: #fff !important;
        border: none !important;
        padding: 10px 18px !important;
        border-radius: 8px !important;
        font-size: 15px !important;
        font-weight: bold !important;
        cursor: pointer !important;
        width: 100% !important;
    }

    .burger-icon { font-size: 18px !important; }

    /* DROPDOWN МЕНЮ — сховано за замовчуванням */
    .mobile-menu-dropdown {
        display: none !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: #fff !important;
        box-shadow: 0 8px 20px rgba(0,0,0,0.12) !important;
        border-radius: 0 0 12px 12px !important;
        z-index: 9999 !important;
        padding: 5px 0 10px !important;
    }

    /* DROPDOWN МЕНЮ — відкрите */
    .mobile-menu-dropdown.open {
        display: block !important;
    }

    .mobile-menu-dropdown ul {
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .mobile-menu-dropdown li {
        border-bottom: 1px solid #f0f0f0 !important;
    }

    .mobile-menu-dropdown li:last-child {
        border-bottom: none !important;
    }

    .mobile-menu-dropdown a {
        display: block !important;
        padding: 13px 20px !important;
        color: #444 !important;
        text-decoration: none !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        transition: all 0.2s ease !important;
    }

    .mobile-menu-dropdown a:hover {
        color: var(--orange) !important;
        background: #fafafa !important;
        padding-left: 28px !important;
    }

    /* ГОЛОВНА — одна колонка, бічне меню сховане */
    .main-grid {
        display: flex !important;
        flex-direction: column !important;
        margin: 0 !important;
        padding: 12px !important;
        gap: 15px !important;
    }

    /* Бічне десктопне меню — повністю сховане на мобільному */
    .side-menu-box {
        display: none !important;
    }

    .content-side { order: 1 !important; }

    /* КАРТКИ КАТЕГОРІЙ — сховані на мобільному */
    .cat-row {
        display: none !important;
    }

    /* НОВИННІ КАРТКИ — вертикально */
    .content-side > div[style] { flex-direction: column !important; }
    .content-side > div[style] a[style] img { width: 100% !important; height: 160px !important; }

    /* БЛОК ПРО ЛІЦЕЙ — лого сховане на мобільному */
    .welcome-logo { display: none !important; }

    /* Третій абзац — схований за замовчуванням */
    .welcome-extra { display: none !important; }
    .welcome-extra.open { display: block !important; }

    /* Стрілочка — показуємо на мобільному */
    .welcome-toggle-btn {
        display: block !important;
        background: none !important;
        border: none !important;
        color: #2a5479 !important;
        font-size: 22px !important;
        cursor: pointer !important;
        width: 100% !important;
        text-align: center !important;
        padding: 4px 0 0 !important;
        opacity: 0.5 !important;
        line-height: 1 !important;
    }

    /* ТЕКСТ БЛОКУ ПРО ЛІЦЕЙ — такий самий розмір як новини */
    .content-side p[style*="font-size:15px"] {
        font-size: 13px !important;
    }

    /* SINGLE — одна колонка */
    .main-grid-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        margin-top: 20px !important;
    }
    .left-navigation { order: 2 !important; display: none !important; }
    .single-post-content { order: 1 !important; padding: 20px !important; }
    .single-post-content h1 { font-size: 22px !important; }
    .page-mini-header h2 { font-size: 16px !important; }

    /* ФУТЕР */
    .footer-grid { grid-template-columns: 1fr !important; gap: 20px !important; }
    footer > div[style*="grid"] { display: flex !important; flex-direction: column !important; gap: 20px !important; }
    .site-footer { margin-top: 30px !important; padding: 35px 0 20px !important; }
}

/* МАЛИЙ ЕКРАН — до 480px */
@media (max-width: 480px) {

    .top-container,
    .top-info-flex {
        flex-direction: column !important;
        align-items: center !important;
        gap: 3px !important;
        padding: 6px 12px !important;
    }

    .overlay-flex { padding: 0 10px !important; gap: 5px !important; }
    .overlay-flex img { max-height: 30px !important; }
    .overlay-text h1 { font-size: 11px !important; line-height: 1.2 !important; }

    .container { padding: 0 10px !important; }

    .single-post-content { padding: 15px !important; border-radius: 10px !important; }
    .single-post-content h1 { font-size: 19px !important; }

    .site-footer { padding: 30px 0 15px !important; }
    .footer-bottom { font-size: 12px !important; }
}