/* ==========================================================================
   MODUL CSS: HEADER & NAVIGASI LPTD AL-FAJR MALANG
   Fitur:
   1. Fix Overflow agar Sticky Tidak Lumpuh
   2. Top Bar Kontak & Pengumuman (Tergulung hilang saat di-scroll)
   3. Main Header Sticky Tinggi Proporsional (~95px)
   4. Logo dan Tipografi Seimbang
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. PENGAMAN ROOT AGAR STICKY BERFUNGSI 100%
   -------------------------------------------------------------------------- */
html, body {
    overflow-x: clip !important; /* Jangan gunakan overflow-x: hidden karena mematikan sticky */
}

/* --------------------------------------------------------------------------
   1. TOP BAR (HILANG SECARA ALAMI SAAT DI-SCROLL)
   -------------------------------------------------------------------------- */
.top-bar {
    background-color: var(--primary-color, #009698);
    color: #ffffff;
    font-size: 0.85rem;
    padding: 8px 0;
    width: 100%;
    position: relative;
    z-index: 10;
    display: block;
}

.top-bar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-contact {
    display: flex;
    gap: 20px;
}

.top-contact a {
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.3s ease;
}

.top-contact a:hover {
    opacity: 0.85;
}

.top-announcement {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ppdb-badge-text {
    background-color: var(--secondary-color, #FDC82F);
    color: #1A252C;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.8rem;
}

.ppdb-link-text {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   2. MAIN HEADER STICKY (LEBIH TINGGI & MENEMPEL DI TOP: 0)
   -------------------------------------------------------------------------- */
.main-header-sticky,
header.site-header {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    left: 0;
    width: 100%;
    background-color: #ffffff !important;
    padding: 18px 0 !important; /* Ditinggikan vertikal agar tidak mepet */
    border-bottom: 4px solid var(--secondary-color, #FDC82F);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    z-index: 99999 !important;
    transition: all 0.3s ease;
}

/* Kompensasi saat Admin Bar WordPress muncul */
body.admin-bar .main-header-sticky,
body.admin-bar header.site-header {
    top: 32px !important;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* --------------------------------------------------------------------------
   3. BRANDING, LOGO & IDENTITAS SEKOLAH
   -------------------------------------------------------------------------- */
.site-branding {
    display: flex;
    align-items: center;
}

.logo-wrapper-link {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.header-logo-img,
.custom-logo,
.site-branding img {
    width: 58px !important;       /* Ukuran logo proporsional */
    height: 58px !important;
    max-width: 58px !important;
    max-height: 58px !important;
    min-width: 58px !important;
    min-height: 58px !important;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.logo-text-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-subtitle {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary-color, #009698);
    letter-spacing: 0.8px;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.logo-title {
    font-size: 1.35rem; /* Lebih besar & seimbang */
    font-weight: 800;
    color: var(--primary-color, #009698);
    line-height: 1.15;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.logo-desc {
    font-size: 0.75rem;
    color: #666666;
    line-height: 1.2;
}

/* --------------------------------------------------------------------------
   4. NAVIGASI DESKTOP
   -------------------------------------------------------------------------- */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--primary-color, #009698);
    cursor: pointer;
    padding: 6px;
}

.main-navigation {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-menu-list li a {
    color: #1A252C;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.98rem;
    padding: 10px 14px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-menu-list li.current-menu-item > a,
.nav-menu-list li a:hover {
    color: var(--primary-color, #009698);
    background-color: rgba(0, 150, 152, 0.08);
}

.btn-ppdb-online {
    background-color: var(--secondary-color, #FDC82F);
    color: #1A252C !important;
    padding: 11px 24px;
    border-radius: 30px;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(253, 200, 47, 0.35);
    transition: all 0.3s ease;
}

.btn-ppdb-online:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(253, 200, 47, 0.45);
}

/* --------------------------------------------------------------------------
   5. RESPONSIF MOBILE & TABLET (MAX-WIDTH: 992PX)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    body.admin-bar .main-header-sticky,
    body.admin-bar header.site-header {
        top: 46px !important;
    }

    .main-header-sticky,
    header.site-header {
        padding: 14px 0 !important;
    }

    .header-logo-img,
    .custom-logo,
    .site-branding img {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
    }

    .logo-title {
        font-size: 1.15rem;
    }

    .top-bar-container {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    .top-contact {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
        z-index: 99999;
        border-bottom: 3px solid var(--secondary-color, #FDC82F);
    }

    .main-navigation.active {
        display: flex;
    }

    .nav-menu-list {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 8px;
        margin-bottom: 15px;
    }

    .nav-menu-list li {
        width: 100%;
    }

    .nav-menu-list li a {
        display: block;
        width: 100%;
        padding: 10px 12px;
    }

    .btn-ppdb-online {
        width: 100%;
        justify-content: center;
    }
}