/* ============================================== */
/* === VARIABEL WARNA & FONT ==================== */
/* ============================================== */
:root {
    --primary-color: #067de5; /* Deep Blue */
    --secondary-color: #ffc107; /* Gold/Yellow */
    --text-dark: #212121;
    --text-light: #f8f9fa;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
}

#info-publik, #kontak {
    scroll-margin-top: 100px; /* offset biar gak ketutup navbar */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background-color: #f4f7f9;
    padding-top: 80px; /* offset navbar fixed-top */
}

h1, h2, h3, h4, h5, .navbar-brand, .nav-link, .btn, .card-title {
    font-family: var(--font-heading);
    font-weight: 600;
}
p { font-size: 18px; }

/* ============================================== */
/* === NAVBAR =================================== */
/* ============================================== */
.navbar {
    transition: all 0.3s ease-in-out;
    background-color: transparent;
    padding: 12px 8px;
    z-index: 9999;
}

.navbar-scrolled {
    background-color: #fff !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding-top: 10px !important; 
    padding-bottom: 10px !important; 
}

.navbar-brand img { height: 35px; }
.navbar-brand span { font-size: 1.2rem; color: var(--primary-color); }

.navbar-nav .nav-link {
    font-size: 15px;
    font-weight: 500;
    padding: 10px 15px;
    margin: 0 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: var(--text-dark) !important;
    white-space: nowrap;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
    background-color: rgba(0,78,146,0.08);
}

.navbar-nav .nav-link.active {
    font-weight: 600;
    border-bottom: 3px solid var(--primary-color);
    border-radius: 0;
}

/* ============================================== */
/* === DROPDOWN MENU ============================ */
/* ============================================== */
.dropdown-menu {
    border: none;
    min-width: 250px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 8px 0;
    z-index: 9998;
}

.dropdown-item {
    font-family: var(--font-body);
    font-weight: 400;
    padding: 8px 15px; 
    transition: background-color 0.2s;
}
.dropdown-item:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* ============================================== */
/* === MEGA MENU PEMERINTAHAN =================== */
/* ============================================== */
.nav-item.dropdown-hover .mega-menu {
    left: 50% !important;
    transform: translateX(-50%) translateY(10px);
}

.mega-menu {
    width: 780px;
    max-width: 95vw;
    padding: 20px 25px;
    border-radius: 12px;
    border: none;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.mega-menu .left-menu h6 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.mega-menu .left-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu .left-menu ul li {
    margin-bottom: 8px;
}

/* ✅ Perbaikan Hover Pemerintahan */
.mega-menu .left-menu ul li a {
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.25s ease-in-out;
}
.mega-menu .left-menu ul li a:hover {
    background-color: rgba(6,125,229,0.08);
    color: var(--primary-color);
    padding-left: 16px; /* efek halus geser kanan */
}

/* Right image */
.mega-menu .right-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.mega-menu .right-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.mega-menu .right-image img:hover {
    transform: scale(1.05);
}

.mega-menu .right-image::after {
    content: "Pemerintahan Kota Bandar Lampung";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    color: #fff;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 500;
}

/* Hover trigger desktop */
@media (min-width: 992px) {
    .nav-item.dropdown-hover:hover .mega-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    .mega-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        position: absolute;
        top: 100%;
        z-index: 9998;
    }
}

/* ============================================== */
/* === OVERWRITE: MEGA MENU MOBILE RAPIH ========= */
/* ============================================== */
@media (max-width: 991.98px) {

    /* 1. Reset Container Utama Navbar */
    .navbar-collapse {
        /* Hapus padding default Bootstrap yang mendorong konten ke kanan */
        padding-left: 0 !important; 
        padding-right: 0 !important;
    }
    
    /* 2. Style Nav Link Utama di Mobile */
    .navbar .nav-link {
        padding: 10px 15px; /* Padding standar untuk link utama */
        padding-left: 1rem; /* Indentasi awal */
        margin: 0;
        border-radius: 0;
    }
    
    /* 3. Dropdown Kontainer Mega Menu */
    .mega-menu {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important; /* Hapus padding kontainer mega menu */
        box-shadow: none !important;
        border-radius: 0 !important;
        background-color: #fff;
        overflow: hidden; /* Penting untuk mencegah konten keluar */
    }

    /* 4. Dropdown Row & Column (Hilangkan Struktur Grid) */
    /* Hapus penargetan .mega-menu .row karena sudah diubah di HTML */

    .mega-menu .left-menu {
        /* Pastikan kolom mengambil lebar penuh dan mereset padding kolom */
        width: 100%;
        padding: 0; 
        margin-bottom: 0;
    }

    /* 5. Daftar Link di Mega Menu (Inti Perbaikan) */
    .mega-menu .left-menu h6 {
        /* Sembunyikan judul "Tentang Kota Bandar Lampung" */
        display: none; 
    }

    .mega-menu .left-menu ul {
        list-style: none;
        /* PENTING: Hapus padding bawaan UL agar link rata kiri */
        padding-left: 0 !important; 
        margin: 0;
    }
    
    .mega-menu .left-menu ul li {
        margin-bottom: 0;
    }
    
    .mega-menu .left-menu ul li a {
        /* Styling agar link terlihat seperti dropdown item biasa */
        text-decoration: none;
        font-size: 15px;
        font-weight: 500;
        color: var(--text-dark);
        display: block;
        width: 100%;
        /* Atur padding agar sejajar dengan link Layanan PPID */
        padding: 10px 15px; 
        padding-left: 2.5rem; /* Tambahkan indentasi agar terlihat sebagai sub-menu */
        border-radius: 0;
        transition: all 0.25s ease-in-out;
    }

    .mega-menu .left-menu ul li a:hover {
        background-color: rgba(6,125,229,0.08);
        color: var(--primary-color);
        padding-left: 2.5rem; /* Pertahankan padding saat hover (hilangkan efek geser) */
    }

    /* 6. Atur Ulang Dropdown Biasa (Layanan PPID) */
    .dropdown-menu {
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        /* Tambahkan ini agar dropdown Layanan PPID juga rata kiri */
        position: static !important;
    }

    /* 7. Sembunyikan Gambar di Mobile */
    .mega-menu .right-image {
        display: none;
    }


    /* === NAVBAR MOBILE RATA KIRI (Pastikan semua menu rata kiri) === */
    .navbar-nav {
        text-align: left !important;
        align-items: flex-start !important;
    }

    .navbar-collapse {
        padding-left: 1rem;
    }

    .navbar .nav-item {
        width: 100%;
    }

    .navbar .nav-link {
        display: block;
        width: 100%;
        text-align: left;
        padding-left: 0.5rem !important; /* Agar link menu utama mepet kiri */
    }

    .dropdown-item-custom, .dropdown-item {
        padding-left: 2.5rem !important; /* Indentasi konsisten untuk sub-menu */
    }
}
/* ============================================== */
/* === HERO SECTION ============================= */
.hero-section {
    background: linear-gradient(rgba(255, 255, 255, 0.9), rgb(1, 124, 255));
    min-height: auto;
    padding-top: 40px;
    padding-bottom: 40px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    color: #fff;
    position: relative;
    z-index: 1;
}
.hero-content {
    text-align: center;
    max-width: 1100px;
    margin: 0 auto;
}
.hero-content h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 20px;
}
.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 25px;
}

/* Responsif */
@media (max-width: 991.98px) {
    .hero-section {
        padding-top: 30px;
        padding-bottom: 30px;
    }
    .hero-content h1 { font-size: 1.8rem; }
    .hero-content p { font-size: 1rem; }
}
@media (max-width: 576px) {
    .hero-content h1 { font-size: 1.5rem; }
    .hero-content p { font-size: 0.9rem; }
}

/* ============================================== */
/* === FOOTER =================================== */
.footer {
    background-color: #0A3A6E;
    color: #f8f9fa;
    font-size: 0.95rem;
}

.footer a {
    color: #f8f9fa;
    text-decoration: none;
    transition: color 0.3s;
}
.footer a:hover { color: #ffc107; }

.footer .social-icons a {
    color: #f8f9fa;
    font-size: 1.4rem;
    transition: color 0.3s;
}
.footer .social-icons a:hover { color: #ffc107; }

/* ============================================== */
/* === SCROLL UP BUTTON ========================= */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: opacity 0.3s, transform 0.3s;
    opacity: 0;
    transform: scale(0.9);
    z-index: 1000;
}
.fab:hover { background-color: #ffdb58; transform: scale(1.05); }
.show-fab { opacity: 1; }

/* ============================================== */
/* === TABLE & TOC ============================== */
.table-custom {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,.05);
}
.table-custom thead {
    background-color: var(--primary-color);
    color: #fff;
}
.toc-sidebar { position: sticky; top: 100px; z-index: 10; }
.toc-menu { list-style: none; padding-left: 0; }
.toc-menu li { margin-bottom: 10px; }
.toc-menu li a {
    display: block;
    padding: 10px 15px;
    border-radius: 20px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
}
.toc-menu li a:hover,
.toc-menu li a.active {
    background-color: var(--primary-color);
    color: #fff;
}

/* ============================================== */
/* === DROPDOWN ITEM CUSTOM ===================== */
.dropdown-item-custom {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px; 
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    white-space: normal;
    z-index: 10;
}

.dropdown-item-custom .icon-wrapper {
    flex-shrink: 0;
    width: 32px;
    height: 32px; 
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.dropdown-item-custom .text-wrapper { line-height: 1.2; }

.dropdown-item-custom .title {
    font-weight: 600;
    font-size: 15px;
    color: #0A3A6E;
    margin-bottom: 2px;
}

.dropdown-item-custom .subtitle {
    font-size: 13px;
    color: #6c757d;
}

.dropdown-item-custom:hover {
    background-color: #f5f9ff;
}
.dropdown-item-custom:hover .title {
    color: #1E88E5;
}

.dropdown-divider {
    margin: 8px 0;
}

/* ============================================== */
/* === KONTEN BERITA ============================ */
.konten-berita a {
    color: #0d6efd;
    text-decoration: underline;
    word-break: break-word;
}
.konten-berita a:hover {
    color: #ffc107;
}
