/* Pengaturan Dasar dan Font */
:root {
    --primary-color: #6b479e ; /* Warna ungu sesuai permintaan */
    --secondary-color: #f4f4f9;
    --dark-grey: #333;
    --light-grey: #e9e9e9;
    --text-color: #2c2c2c;
    --white-color: #ffffff;
}


/* Bagian Utama */
/* main {
    width: 100%;
    overflow-x: hidden;
} */

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* 1. Kustomisasi Hero Banner */
.hero-section {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 100px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    /* Efek garis diagonal di background */
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.03),
        rgba(255, 255, 255, 0.03) 1px,
        transparent 1px,
        transparent 20px
    );
}

/* Bentuk melengkung kustom di sisi kanan */
.hero-section::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -150px;
    width: 400px;
    height: calc(100% + 100px);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
    border-radius: 50% / 40%;
    transform: rotate(15deg);
    filter: blur(10px);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.hero-content p {
    font-size: 1.1rem;
    font-style: italic;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}


/* 2. Bagian Konten (Kebijakan & Buku Saku) */
.content-section {
    padding: 60px 20px;
    max-width: 900px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

/* Garis dekoratif di bawah judul */
.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.section-title p {
    font-size: 1rem;
    color: #666;
    margin-top: 10px;
}

/* 3. Tampilan Frame Dokumen (Mirip PDF Viewer) */
.document-viewer {
    background-color: var(--white-color);
    border: 1px solid var(--light-grey);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.document-viewer:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.viewer-header {
    background-color: #4a4a4a;
    padding: 12px 20px;
    color: var(--white-color);
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--light-grey);
}

.viewer-body {
    padding: 25px;
    min-height: 200px;
}
/* 2. Bagian Konten (Kebijakan & Buku Saku) */
.content-section-1 {
    padding: 5px 20px;
    max-width: 900px;
    margin: 0 auto;
}

.section-title-1 {
    text-align: center;
    margin-bottom: 40px;
}

.section-title-1 h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

/* Garis dekoratif di bawah judul */
.section-title-1 h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.section-title-1 p {
    font-size: 1rem;
    color: #666;
    margin-top: 10px;
}

/* 3. Tampilan Frame Dokumen (Mirip PDF Viewer) */
.document-viewer-1 {
    background-color: var(--white-color);
    border: 1px solid var(--light-grey);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.document-viewer-1:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.viewer-header-1 {
    background-color: #4a4a4a;
    padding: 12px 20px;
    color: var(--white-color);
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--light-grey);
}

.viewer-body-1 {
    padding: 0; 
}

/* BARU: Styling untuk tag <embed> agar responsif */
.pdf-embed {
    width: 100%;
    /* Menggunakan unit vh (viewport height) agar tingginya pas di layar besar maupun kecil */
    height: 75vh; 
    display: block;
    border: none; /* Menghilangkan border default jika ada */
}

/* Kustomisasi untuk daftar kebijakan */
.policy-list ol {
    padding-left: 25px;
}

.policy-list li {
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Kustomisasi untuk gambar buku saku */
.viewer-body img {
    max-width: 100%;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

/* Penyesuaian untuk Tampilan Mobile */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
    .content-section-1 {
        padding: 40px 15px;
    }
    /* Menyesuaikan tinggi PDF di layar kecil agar tidak terlalu dominan */
    .pdf-embed {
        height: 65vh;
    }

    .hero-section::after {
        width: 300px;
        right: -120px;
    }
}



/* CSS untuk bagian kategori galeri */
.gallery-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 50px 20px;
    max-width: 1200px;
    margin: 0 auto;
    background-color: #ffffff;
    align-items: start; /* <-- PERBAIKAN PENTING: Mencegah kartu memanjang secara vertikal */
}

.category-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

.category-card h2 {
    font-size: 1.6em;
    color: #6b479e ;
    margin-bottom: 8px;
    position: relative;
    padding-bottom: 5px;
}

.category-card h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #6b479e ;
    border-radius: 1.5px;
}

.category-card p {
    font-size: 0.95em;
    color: #555;
    line-height: 1.5;
    margin-top: 0;
    margin-bottom: 20px;
}

/* KOREKSI CSS untuk galeri gambar di dalam kartu */
.gallery-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 20px;
    padding-bottom: 0;
    justify-content: center;
    align-items: start;
    transition: max-height 0.5s ease-out;
    max-height: fit-content;
    overflow: hidden;
}

.gallery-images.limited-view {
    /* Tinggi untuk menampilkan hanya 1 gambar. Ini akan lebih besar dari 100px. */
    max-height: 250px; /* Cukup untuk satu gambar yang lebih besar */
    overflow: hidden;
    /* Tambahkan pengaturan grid khusus untuk mode limited-view */
    grid-template-columns: 1fr; /* Untuk memastikan 1 gambar mengambil 1 kolom penuh di mode terbatas */
    justify-items: center; /* Pusatkan gambar secara horizontal */
}

.gallery-images.limited-view .gallery-item:nth-child(n + 2) {
    display: none;
}

/* --- PERBAIKAN untuk tampilan gambar itu sendiri --- */
.gallery-item {
    display: flex; /* Gunakan flexbox pada wrapper link */
    align-items: center; /* Tengahkan konten (termasuk alt text jika gambar rusak) */
    justify-content: center;
    height: 180px; /* <--- PERBAIKAN: Tinggi yang lebih besar untuk gambar utama */
    overflow: hidden;
    border-radius: 8px;
    background-color: #f0f0f0;
    text-align: center;
    font-size: 0.8em;
    color: #7f8c8d;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

/* Kembali ke ukuran asli saat tidak di mode limited-view atau saat ditampilkan semua */
.gallery-images:not(.limited-view) .gallery-item {
    height: 100px; /* Kembali ke tinggi 100px untuk gambar-gambar lainnya */
}


.gallery-item img {
    width: 100%;
    height: 100%; /* Gambar akan mengisi 100% tinggi parent (.gallery-item) */
    object-fit: cover; /* Tetap cover agar gambar mengisi penuh */
    border-radius: 8px;
    transition: transform 0.2s ease;
    line-height: 0;
    font-size: 0;
}

.gallery-item img:not([src=""]):not([src^="data:"]) {
    font-size: initial;
    line-height: initial;
}

.gallery-images img:hover {
    transform: scale(1.05);
}

/* --- Gaya untuk Tombol "Lihat Semua Gambar" (sama seperti sebelumnya) --- */
.show-more-images-button {
    background-color: #6b479e ;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 20px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.show-more-images-button:hover {
    background-color: rgba(92, 75, 153, 0.75);
    transform: translateY(-2px);
}

/* Penyesuaian responsif */
@media (max-width: 768px) {
    .gallery-intro h1 {
        font-size: 2em;
    }

    .gallery-intro p {
        font-size: 1em;
    }

    .gallery-categories {
        grid-template-columns: 1fr;
        padding: 30px 15px;
    }

    .category-card {
        padding: 25px;
    }

    .gallery-images {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }

    .gallery-images img {
        height: 80px;
    }

    .gallery-images.limited-view {
        /* Tinggi untuk 1 gambar pada layar kecil */
        max-height: 180px; /* Sesuaikan untuk 1 gambar yang lebih besar di mobile */
    }

    .gallery-images.limited-view .gallery-item:nth-child(1) {
        height: 150px; /* Ukuran gambar utama di mobile */
    }
}

/* --- Customisasi Tampilan Link Kategori (sama seperti sebelumnya) --- */
.category-card h2 .category-link {
    color: #6b479e ;
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-card h2 .category-link:hover {
    color: rgba(92, 75, 153, 0.75);
}

/* --- Modal Styles (sama seperti sebelumnya) --- */
.modal {
    display: none;
    padding-top: 70px;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.modal-title {
    font-size: 1.8em;
    color: #6b479e ;
    margin-bottom: 20px;
    font-weight: bold;
    text-align: center;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

/* --- Slider Styles (sama seperti sebelumnya) --- */
.slider-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background:  linear-gradient(to bottom, rgba(176, 132, 204, 0.7), rgb(107, 71, 158));
    border-radius: 8px;
    overflow: hidden;
}

.slider-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#modalImage {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 70vh;
    display: block;
    object-fit: contain;
    animation: fadeIn 0.5s ease-in-out;
}

.prev-button, .next-button {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    transform: translateY(-50%);
    color: white;
    font-weight: bold;
    font-size: 25px;
    transition: 0.6s ease;
    user-select: none;
    -webkit-user-select: none;
    background-color: rgba(92, 75, 153, 0.75);
}

.prev-button {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.next-button {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev-button:hover, .next-button:hover {
    background-color: rgba(130, 114, 187, 0.75);
}

.image-counter {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.9em;
    background-color: rgba(92, 75, 153, 0.75);
    padding: 5px 10px;
    border-radius: 5px;
}

/* Animasi Fade-in */
@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* Responsif untuk modal */
@media (max-width: 768px) {
    .modal-content {
        padding: 15px;
        max-width: 95%;
        max-height: 95%;
    }
    .close-button {
        font-size: 30px;
        top: 10px;
        right: 15px;
    }
    .modal-title {
        font-size: 1.5em;
    }
    .prev-button, .next-button {
        padding: 10px;
        font-size: 20px;
    }
    #modalImage {
        max-height: 60vh;
    }
}




.document-container {
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    padding: 0 20px;
    margin-bottom: 50px;
    box-sizing: border-box;
}

/* ========================================= */
/* GANTI h3 MENJADI .document-title          */
/* ========================================= */
.document-title {
    color: #6b479e;
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 3px solid #6b479e;
    padding-bottom: 15px;
    font-size: 2rem; /* Ukuran font untuk desktop */
}

#pdf-viewer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.page {
    max-width: 100%;
    height: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    transition: filter 0.3s ease;
}

.blurred {
    filter: blur(8px);
    user-select: none;
}


/* ========================================= */
/* RESPONSIVE - TABLET & DI BAWAHNYA     */
/* ========================================= */
@media (max-width: 900px) {
    /* body {
        padding: 30px 0;
    } */

    /* GANTI h3 MENJADI .document-title */
    .document-title {
        font-size: 1.8rem; /* Sedikit kecilkan judul */
    }

    #pdf-viewer {
        gap: 20px;
    }
}


/* ========================================= */
/* RESPONSIVE - HANDPHONE                */
/* ========================================= */
@media (max-width: 600px) {
    /* body {
        padding: 20px 0;
    } */
    
    .document-container {
        padding: 0 15px;
    }

    /* GANTI h3 MENJADI .document-title */
    .document-title {
        font-size: 1.5rem; /* Kecilkan lagi judul untuk HP */
        margin-bottom: 20px;
        padding-bottom: 10px;
    }

    #pdf-viewer {
        gap: 15px;
    }
}
