/* Pengaturan Dasar dan Font */
:root {
    --biru-tua: #00204A;
    --merah-tua: #A00000;
    --gold: #FFD700;
    --putih: #FFFFFF;
    --latar-terang: #FFFFFF;
    --latar-alternatif: #f0f4f8; /* Biru sangat muda */
    --teks-biasa: #333;
    --biru-muda: #0000ff;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--latar-terang);
    color: var(--teks-biasa);
    line-height: 1.6;
    overflow-x: hidden; /* Mencegah scroll horizontal */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header dan Navigasi */
header {
    background-color: var(--biru-tua);
    color: var(--gold);
    padding: 1rem 0;
    border-bottom: 5px solid var(--biru-muda);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

nav .logo h2 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--gold);
}

nav .logo p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--putih);
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 1.5rem;
}

nav ul li a {
    text-decoration: none;
    color: var(--putih);
    font-weight: bold;
    font-size: 1rem;
    padding: 0.5rem;
    transition: color 0.3s ease, border-bottom 0.3s ease;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

nav ul li a:hover,
nav ul li a:focus {
    color: var(--gold);
    border-bottom: 2px solid var(--gold);
}

/* Tombol Hamburger (Sembunyi di Desktop) */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001; 
    flex-shrink: 0; /* PENTING: Hamburger jangan ikutan nyusut */
}
.hamburger span {
    width: 100%;
    height: 3px;
    background-color: var(--putih);
    border-radius: 2px;
    transition: all 0.3s ease;
}
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}
@media (max-width: 768px) {
    .hamburger {
        position: absolute;
        top: 15px;
        right: 15px;
    }
}



/* KODE KUNCI UNTUK TRANSISI HALAMAN FADE */
.page-container {
    position: relative;
    overflow-x: hidden; 
    flex-grow: 1; /* PENTING: Mendorong footer ke bawah */
    /* ======================================= */
    /* === PERBAIKAN "SPACE PUTIH" START === */
    /* ======================================= */
    display: flex;
    flex-direction: column;
    /* ======================================= */
    /* === SELESAI === */
    /* ======================================= */
}

.page-section {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: opacity 0.4s ease-in-out;
    padding: 2rem 0; /* Padding atas/bawah */
    box-sizing: border-box;
    /* min-height dihapus untuk fix 'space putih' */
}

.page-section.active {
    opacity: 1;
    visibility: visible;
    position: relative; 
    /* ======================================= */
    /* === PERBAIKAN "SPACE PUTIH" START === */
    /* ======================================= */
    flex-grow: 1; /* Halaman AKTIF akan mengisi sisa ruang */
    display: flex; /* Aktifkan flex untuk centering (khusus beranda) */
    flex-direction: column;
    /* ======================================= */
    /* === SELESAI === */
    /* ======================================= */
}


.content-section,
#beranda.hero-section {
    padding-left: 2rem; 
    padding-right: 2rem;
    box-sizing: border-box;
    width: 100%;
}

/* ======================================= */
/* === PERBAIKAN "SPACE PUTIH" START === */
/* ======================================= */
/* Kita override sedikit khusus untuk #beranda */
#beranda.hero-section.active {
    justify-content: center; /* Tetap center konten beranda */
}
/* Halaman KONTEN lain tidak perlu center */
.content-section.active {
    flex-grow: 1; /* Pastikan halaman konten juga tumbuh */
    display: block; /* Ganti jadi block biasa, tidak perlu flex center */
}
/* ======================================= */
/* === SELESAI === */
/* ======================================= */


/* Bagian 1: Hero Section (Beranda) */
#beranda.hero-section {
    background: linear-gradient(rgba(0, 32, 74, 0.8), rgba(0, 32, 74, 0.8)), url('foto_latar_belakang.jpg');
    background-size: cover;
    background-position: center;
    color: var(--putih);
    text-align: center;
    padding-top: 3rem;
    padding-bottom: 3rem;
    box-sizing: border-box; 
}

.hero-title-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

#beranda.hero-section h1 {
    font-size: 3.5rem;
    margin: 0;
    color: var(--gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    background-color: transparent;
    border-radius: 0; 
    padding: 5px;
    border: 2px solid var(--gold);
}

#beranda.hero-section h2 {
    font-size: 1.5rem;
    margin: 0.5rem 0 1rem 0;
    font-weight: 300;
}

#beranda.hero-section p {
    font-size: 1.1rem;
    max-width: 800px; /* Konten di dalam beranda tetap dibatasi */
    margin: 0 auto;
}

/* Konten Utama */
.content-section {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.alternate-bg {
    background-color: var(--latar-alternatif);
}

.content-section h2 {
    font-size: 2.5rem;
    color: var(--merah-tua);
    border-bottom: 3px solid var(--gold);
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
    text-align: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.profil-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #555;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
}

/* CSS KEGIATAN (TIMELINE) */
.timeline {
    position: relative;
    max-width: 900px; 
    margin: 0 auto;
    padding: 2rem 0;
    border-left: 4px solid var(--merah-tua);
}
.timeline-item {
    display: flex;
    position: relative;
    margin-bottom: 2.5rem;
    padding-left: 2.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 0 8px 8px 0; /* Radius di kanan */
}
.timeline-item:hover {
    background-color: rgba(255, 215, 0, 0.1);
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 5px;
    width: 20px;
    height: 20px;
    background-color: var(--gold);
    border: 3px solid var(--biru-tua);
    border-radius: 50%;
    z-index: 1;
}
.timeline-date {
    flex-basis: 30%;
    padding-right: 2rem;
    text-align: right;
    flex-shrink: 0;
    box-sizing: border-box;
}
.timeline-date span { font-size: 1.3rem; font-weight: bold; color: var(--merah-tua); display: block; }
.timeline-date p { font-size: 1rem; color: var(--teks-biasa); margin: 0.2rem 0 0 0; }
.timeline-content {
    flex-basis: 70%;
    background-color: var(--putih);
    border: 1px solid #ddd;
    border-left: 5px solid var(--gold);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    flex-grow: 1;
    min-width: 0;
    box-sizing: border-box;
}
.timeline-content h3 { margin: 0 0 1rem 0; color: var(--biru-tua); font-size: 1.4rem; }
.timeline-content ul { margin: 0; padding-left: 1.5rem; }
.timeline-content li { margin-bottom: 0.5rem; line-height: 1.5; }


/* CSS PROFIL (KARTU BARU - GRID 3 KOLOM) */
.profil-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}
.profil-card {
    background-color: var(--putih);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    border-top: 5px solid var(--gold);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}
.profil-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}
.profil-card img {
    width: 200px; 
    height: 250px; 
    border-radius: 8px; 
    object-fit: cover; 
    margin-bottom: 1rem;
    border: 3px solid var(--biru-tua);
    background-color: #eee;
}
.profil-card h3 {
    margin: 0.5rem 0;
    color: var(--merah-tua);
    font-size: 1.3rem;
    min-height: 40px; 
}
.profil-card[data-nama="Ahmad Luthfi Firdaus S.Pd"] {
    grid-column: 1 / -1;
    max-width: 500px;
    margin: 0 auto 2rem auto;
    order: -1; /* Pembina di ATAS (sesuai permintaan) */
}
.profil-card[data-nama="Ahmad Luthfi Firdaus S.Pd"] img {
     width: 200px;
     height: 250px;
}
.pembina-label-simple {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--merah-tua);
    color: var(--putih);
    padding: 0.5rem 1.5rem;
    border-radius: 5px;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
}


/* CSS UNTUK SEMUA MODAL (POP-UP) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 32, 74, 0.85);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    box-sizing: border-box; 
}
.modal-content {
    background-color: var(--putih);
    padding: 2rem;
    border-radius: 8px;
    border-top: 5px solid var(--gold);
    border-bottom: 5px solid var(--merah-tua);
    width: 100%;
    max-width: 500px;
    max-height: 90vh; /* Beri sedikit ruang */
    overflow-y: auto;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-sizing: border-box; 
}
.modal-close {
    position: sticky; 
    top: -1rem; /* Sesuaikan posisi */
    margin-right: -1rem; /* Sesuaikan posisi */
    float: right;
    font-size: 2.5rem;
    font-weight: bold;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    z-index: 2010;
}
.modal-close:hover { color: var(--merah-tua); }

/* --- Style Modal Profil --- */
#modalFoto {
    width: 220px; 
    height: 280px; 
    border-radius: 8px; 
    object-fit: cover;
    border: 4px solid var(--biru-tua);
    margin-bottom: 1rem;
}
#modalNama {
    font-size: 1.8rem;
    color: var(--merah-tua);
    margin: 0.5rem 0;
}
#modalPeran {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--biru-tua);
    margin: 0.5rem 0;
}
#modalSekolah {
    font-size: 1rem;
    color: #333;
    margin: 0.3rem 0;
    padding-bottom: 0.5rem;
}
.modal-kontak {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    text-align: left;
}
.modal-kontak .kontak-link {
    display: block;
    background-color: #25D366; /* Warna WA */
    color: var(--putih) !important;
    padding: 10px 15px;
    margin: 8px 0;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    text-align: center;
    transition: background-color 0.3s ease;
}
.modal-kontak .kontak-link:hover {
    background-color: #128C7E;
}


/* --- Style Modal Kegiatan --- */
.kegiatan-modal-content {
    max-width: 700px;
    text-align: left;
}
#kegiatanModalBody h4 {
    font-size: 1.6rem;
    color: var(--merah-tua);
    text-align: center;
    margin-top: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 0.5rem;
}
#kegiatanModalBody h5 {
    font-size: 1.3rem;
    color: var(--biru-tua);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #eee;
}
#kegiatanModalBody p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}


/* CSS SEJARAH (Layout Kiri-Kanan) */
.sejarah-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    background-color: var(--latar-alternatif);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border-left: 5px solid var(--merah-tua);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}
.sejarah-item img {
    width: 100%;
    max-width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    background-color: #eee;
    flex-shrink: 0;
}
.sejarah-item div {
    flex: 1;
    min-width: 0; /* Cegah teks keluar */
}
.sejarah-item h3 {
    color: var(--biru-tua);
    margin-top: 0;
    font-size: 1.5rem;
}
.sejarah-item p {
    font-size: 0.95rem;
    line-height: 1.6;
}


/* ======================================= */
/* Media Query (Tampilan HP) */
/* ======================================= */
@media (max-width: 768px) {
    
    /* Atur Navigasi HP */
    nav {
        flex-direction: row;
        justify-content: space-between; /* Logo di kiri, hamburger di kanan */
        align-items: center;
        width: 100%;
        padding: 0 1rem; /* Padding di HP */
        gap: 1rem; /* Jarak aman antara logo & hamburger */
    }

    /* Logo di header TETAP ADA */
    nav .logo {
        display: block;
        flex-grow: 1;  /* Biarkan dia mengisi ruang */
        flex-shrink: 1; /* Izinkan dia menyusut */
        min-width: 0;   /* INI KUNCINYA: Boleh menyusut jadi 0 */
    }

    /* Atur teks di dalam logo */
    nav .logo h2, nav .logo p {
        white-space: nowrap;     /* Jangan turun ke bawah */
        overflow: hidden;        /* Sembunyikan yg kepanjangan */
        text-overflow: ellipsis; /* Kasih titik-titik (...) */
        margin: 0; /* Reset margin */
    }
    nav .logo h2 {
        font-size: 1.5rem; /* Ukuran font tablet */
    }
    nav .logo p {
        font-size: 0.8rem; /* Ukuran font tablet */
    }


    .hamburger {
        display: flex; /* Tampilkan tombol hamburger */
        flex-shrink: 0; /* Hamburger JANGAN menyusut */
    }
    nav ul {
        display: none; /* Sembunyi by default */
        flex-direction: column;
        position: absolute; /* Buat menu "melayang" */
        top: 85px; /* Sesuaikan dengan tinggi header Anda */
        left: 0;
        width: 100%;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        padding: 1rem 0;
        border-bottom: 3px solid var(--biru-muda);
        z-index: 1500;
        background-color: var(--putih); /* Ganti jadi putih */
    }
    nav ul.nav-active {
        display: flex; /* Tampilkan menu jika diklik */
    }
    nav ul li {
        width: 100%;
        text-align: center;
        margin: 0.5rem 0;
    }
    nav ul li a {
        display: block; /* Buat link jadi full-width */
        padding: 0.8rem;
        color: var(--biru-tua); /* Ganti warna link jadi biru */
        border-bottom: none !important; /* Hilangkan border gold di HP */
    }
    /* Ganti warna hover di HP */
    nav ul li a:hover,
    nav ul li a:focus {
        color: var(--merah-tua);
        background-color: #f0f0f0;
    }


    /* Atur judul beranda di HP (Ini fix logo kanan-kiri) */
    .hero-title-container { 
        gap: 1rem; 
        flex-wrap: nowrap; /* Jangan di-wrap, biarkan sejajar */
    }
    #beranda.hero-section h1 { 
        font-size: 2rem; /* Kecilkan font judul */
        margin: 0;
    }
    .hero-logo { 
        width: 45px; /* Kecilkan logo */
        height: 45px; 
    }
    
    #beranda.hero-section h2 { 
        font-size: 1.3rem; 
    }

    /* Atur section */
    .content-section, #beranda.hero-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .content-section h2 { font-size: 2rem; }

    /* Atur timeline di HP */
    .timeline { padding: 1rem 0 1rem 0.5rem; border-left: 3px solid var(--merah-tua); }
    .timeline-item { flex-direction: column; padding-left: 1.5rem; margin-bottom: 2rem; }
    .timeline-item::before { left: -10px; top: 0px; width: 16px; height: 16px; }
    .timeline-date { flex-basis: auto; text-align: left; padding-right: 0; margin-bottom: 0.5rem; }
    .timeline-date span { font-size: 1.2rem; }
    .timeline-content { flex-basis: auto; }

    /* Atur profil & sejarah di HP */
    .sejarah-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .sejarah-item img {
        width: 100%;
        max-width: 300px;
    }
    .profil-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

    .profil-card[data-nama="Ahmad Luthfi Firdaus S.Pd"] {
        grid-column: 1 / -1;
        max-width: 100%;
    }
    .profil-card img {
        width: 130px;
        height: 165px; /* Sesuaikan rasio */
    }
     .profil-card[data-nama="Ahmad Luthfi Firdaus S.Pd"] img {
        width: 130px;
        height: 165px;
    }
    .profil-card h3 {
        font-size: 1.1rem;
        min-height: 30px;
    }

     #modalFoto {
        width: 150px;
        height: 190px;
     }
     .modal-content {
         padding: 1.5rem;
     }

}

@media (max-width: 480px) {
     /* Kalau layar KECIL banget, profil jadi 1 kolom lagi */
     .profil-grid { grid-template-columns: 1fr; }
     .profil-card img { /* Sedikit lebih besar di 1 kolom */
         width: 180px;
         height: 225px;
     }
     .profil-card[data-nama="Ahmad Luthfi Firdaus S.Pd"] img {
         width: 180px;
         height: 225px;
     }
     
     /* Kecilkan font logo LAGI di HP sempit */
     nav .logo h2 {
        font-size: 1.2rem;
     }
     nav .logo p {
        font-size: 0.75rem;
     }
     
     #beranda.hero-section h1 { 
        font-size: 1.8rem; /* Kecilkan lagi di HP super sempit */
     }
     .hero-logo {
         width: 40px; /* Kecilkan lagi */
         height: 40px;
     }
     .hero-title-container {
         gap: 0.5rem; /* Rapatkan jaraknya */
     }
}


/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--biru-tua);
    color: var(--gold);
    border-top: 5px solid var(--merah-tua);
    font-size: 0.9rem;
}
/* ========================================= */
/* === TAMBAHAN CSS HALAMAN DOKUMENTASI === */
/* ========================================= */

/* 1. Video Full Frame (Dibatasi max-width agar enak dilihat di PC) */
.doc-video-container {
    width: 100%;
    max-width: 1000px; 
    margin: 0 auto 2rem auto;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}

.doc-video-container video {
    display: block;
    width: 100%;
    height: auto;
}

/* 2. Galeri 3 Foto */
.doc-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 Kolom */
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto 2rem auto;
}

.doc-gallery img {
    width: 100%;
    height: 200px; 
    object-fit: cover; 
    border-radius: 8px;
    border: 2px solid var(--biru-tua);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.doc-gallery img:hover {
    transform: scale(1.05);
}

/* 3. Tombol Link */
.doc-links-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap; 
    max-width: 1000px;
    margin: 0 auto;
}

.doc-btn {
    display: inline-block;
    background-color: var(--biru-tua);
    color: var(--putih);
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    border: 2px solid var(--gold);
    transition: all 0.3s ease;
    min-width: 200px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.doc-btn:hover {
    background-color: var(--merah-tua);
    transform: translateY(-3px);
}

/* Tombol Proposal beda warna dikit */
.doc-btn-proposal {
    background-color: var(--merah-tua);
    border-color: var(--putih);
}
.doc-btn-proposal:hover {
    background-color: var(--biru-tua);
}

/* Responsif HP */
@media (max-width: 768px) {
    .doc-gallery {
        grid-template-columns: 1fr; /* Jadi 1 kolom di HP */
    }
    .doc-btn {
        width: 80%;
    }
}
