/* style.css */

/* Reset CSS dasar */
body {
    font-family: 'Inter', Arial, sans-serif; /* Menggunakan font Inter */
    margin: 0;
    padding: 0;
    background-color: #f4f4f4; /* Warna latar belakang umum */
    color: #333; /* Warna teks default */
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Header */
header {
    background-color: #003366; /* Warna khas Polri (biru tua) */
    color: white;
    padding: 10px 0;
    border-bottom: 5px solid #ffcc00; /* Garis kuning khas Polri */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Untuk responsif */
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.logo img {
    height: 60px; /* Ukuran logo */
    margin-right: 15px;
    border-radius: 8px; /* Sudut membulat */
}

.logo h1 {
    margin: 0;
    font-size: 1.8em;
    color: white;
    /* Sembunyikan teks nama website di semua ukuran layar */
    display: none;
}

.logo a {
    text-decoration: none;
    color: inherit;
}

.main-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex; /* Untuk menu horizontal */
    flex-wrap: wrap;
}

.main-menu ul li {
    margin-left: 20px;
}

.main-menu ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.main-menu ul li a:hover {
    color: #ffcc00; /* Warna kuning saat hover */
}

/* Styling untuk Menu yang di-Highlight */
.main-menu ul li.highlight-menu a {
    background-color: #ffcc00; /* Latar belakang kuning */
    color: #003366; /* Teks biru tua */
    padding: 8px 15px; /* Padding lebih besar */
    border-radius: 5px; /* Sudut membulat */
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.main-menu ul li.highlight-menu a:hover {
    background-color: #e6b800; /* Kuning lebih gelap saat hover */
    color: #001a33; /* Biru lebih gelap saat hover */
}


/* Hamburger Menu Styling */
.hamburger {
    display: none; /* Sembunyikan secara default di desktop */
    background: none;
    border: none;
    font-size: 1.8em;
    color: white;
    cursor: pointer;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.hamburger:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Hero Slider */
.hero-slider {
    background-color: #eee;
    padding: 20px 0; /* Padding atas dan bawah slider */
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
    /* Mengatur lebar maksimum dan memusatkan slider */
    max-width: 1200px; /* <--- UBAH LEBAR MAKSIMUM SLIDER DI SINI */
    margin: 20px auto; /* Memberi jarak atas/bawah dan memusatkan */
    border-radius: 8px; /* Sudut membulat untuk seluruh bagian slider */
}

.slider-container {
    display: flex;
    overflow-x: hidden; /* Sembunyikan scrollbar */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.slider-item {
    min-width: 100%;
    box-sizing: border-box;
    scroll-snap-align: start;
    position: relative;
    text-align: center;
    border-radius: 8px; /* Sudut membulat */
    overflow: hidden;
}

.slider-item img {
    width: 100%;
    /* Mengatur tinggi gambar agar lebih responsif */
    height: 390px; /* Diubah menjadi 390px untuk desktop */
    object-fit: cover; /* Pastikan gambar mengisi area tanpa distorsi */
    display: block;
}

.slider-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7); /* Latar belakang semi-transparan */
    color: white;
    padding: 15px;
    text-align: left;
}

.slider-caption h2 {
    margin: 0 0 10px;
    font-size: 1.8em;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.slider-caption h2 a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.slider-caption h2 a:hover {
    color: #ffcc00;
}

.slider-caption p {
    margin: 0;
    font-size: 1em;
}

/* Content Area */
.content-area .container {
    display: flex;
    justify-content: space-between;
    gap: 30px; /* Jarak antar kolom */
    padding: 30px 0; /* Padding vertikal tetap, horizontal akan diatur di media query */
    flex-wrap: wrap; /* Untuk responsif */
}

.main-content {
    flex: 3; /* Mengambil 3 bagian dari 4 (jika sidebar 1) */
    background-color: white;
    padding: 25px; /* Padding default untuk desktop */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Styling untuk grid berita utama */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Dua kolom dengan lebar sama */
    gap: 25px; /* Jarak antar item grid */
}

.news-item-grid { /* Gaya untuk setiap item berita di dalam grid */
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden; /* Penting untuk border-radius pada gambar */
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex; /* Untuk menumpuk gambar dan teks di dalam item grid */
    flex-direction: column;
    height: 100%; /* Memastikan semua item memiliki tinggi yang sama jika kontennya pendek */
}

.news-item-grid img {
    width: 100%;
    height: 200px; /* Tinggi gambar thumbnail di grid */
    object-fit: cover;
    display: block;
    border-bottom: 1px solid #eee; /* Garis pemisah antara gambar dan teks */
}

.news-info-grid {
    padding: 15px;
    flex-grow: 1; /* Memastikan info mengisi sisa ruang vertikal */
    display: flex;
    flex-direction: column;
}

.news-info-grid h3 {
    margin-top: 0;
    font-size: 1.2em;
    line-height: 1.3;
    margin-bottom: 10px;
}

.news-info-grid h3 a {
    text-decoration: none;
    color: #003366;
    transition: color 0.3s ease;
}

.news-info-grid h3 a:hover {
    color: #007bff;
}

.news-info-grid .news-meta {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 10px;
}

.news-info-grid p {
    font-size: 0.9em;
    margin-bottom: 15px;
    flex-grow: 1; /* Agar paragraf mengisi ruang dan 'Baca Selengkapnya' tetap di bawah */
}

.news-info-grid p a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}
.news-info-grid p a:hover {
    text-decoration: underline;
}


.sidebar {
    flex: 1; /* Mengambil 1 bagian */
    background-color: white;
    padding: 25px; /* Padding default untuk desktop */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.main-content h2, .sidebar h3 {
    color: #003366;
    border-bottom: 2px solid #ffcc00;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Styling untuk Formulir Pengaduan (complaint.php) */
.complaint-form {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.complaint-form .form-group {
    margin-bottom: 20px;
}

.complaint-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
    font-size: 1em;
}

.complaint-form input[type="text"],
.complaint-form input[type="email"], /* Tambahkan jika ada input email */
.complaint-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box; /* Penting agar padding tidak menambah lebar */
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.complaint-form input[type="text"]:focus,
.complaint-form input[type="email"]:focus,
.complaint-form textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none; /* Hapus outline default browser */
}

.complaint-form textarea {
    resize: vertical; /* Izinkan textarea diubah ukurannya secara vertikal */
    min-height: 120px; /* Tinggi minimum textarea */
}

.complaint-form button[type="submit"] {
    background-color: #007bff;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: auto; /* Agar tombol tidak mengisi 100% lebar */
}

.complaint-form button[type="submit"]:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Styling untuk pesan status di frontend (info/error) */
.content-area .info-message,
.content-area .error-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 1em;
    font-weight: bold;
    text-align: center;
    border: 1px solid transparent; /* Default border */
}

.content-area .info-message {
    background-color: #d4edda; /* Light green */
    color: #155724; /* Dark green */
    border-color: #c3e6cb;
}

.content-area .error-message {
    background-color: #f8d7da; /* Light red */
    color: #721c24; /* Dark red */
    border-color: #f5c6cb;
}

/* Styling untuk bagian WhatsApp Pengaduan */
.whatsapp-complaint-section {
    background-color: #e6ffed; /* Latar belakang hijau muda */
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 30px; /* Jarak dari form di atasnya */
    text-align: center;
}

.whatsapp-complaint-section h2 {
    color: #003366;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5em;
    border-bottom: 2px solid #ffcc00; /* Garis bawah kuning */
    display: inline-block; /* Agar garis bawah hanya selebar teks */
    padding-bottom: 5px;
}

.whatsapp-complaint-section p {
    margin-bottom: 20px;
    font-size: 1.1em;
    color: #555;
}

.whatsapp-button {
    background-color: #25D366; /* Warna hijau WhatsApp */
    color: white !important; /* Penting untuk override warna link default */
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2em;
    display: inline-flex; /* Agar ikon dan teks sejajar */
    align-items: center;
    gap: 10px; /* Jarak antara ikon dan teks */
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.whatsapp-button:hover {
    background-color: #1DA851; /* Warna hijau lebih gelap saat hover */
    transform: translateY(-2px);
}

.whatsapp-button i {
    font-size: 1.5em; /* Ukuran ikon WhatsApp */
}

.whatsapp-note {
    font-size: 0.9em;
    color: #777;
    margin-top: 15px;
}


/* News Detail Page */
.news-detail h1 {
    color: #003366;
    margin-bottom: 15px;
}

.news-detail .news-meta {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 20px;
    display: block;
}

.news-detail img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 25px auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.news-content p {
    line-height: 1.8;
    margin-bottom: 15px;
    text-align: justify;
}

/* Sidebar - Pejabat */
.official-photos {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* Mengatur item agar rata kiri */
    gap: 20px; /* Jarak antar item pejabat */
    margin-bottom: 30px;
}

.official-photos .official-item {
    text-align: center;
    width: 100%; /* Item mengisi lebar penuh kontainer .official-photos */
    max-width: 250px; /* Batasi lebar maksimum di desktop */
}

.official-photos .official-item img {
    width: 100%; /* Gambar mengisi lebar penuh itemnya */
    height: auto; /* Tinggi otomatis untuk menjaga rasio aspek */
    border-radius: 8px; /* Sudut membulat untuk bentuk kotak */
    object-fit: cover; /* Memastikan gambar mengisi area tanpa distorsi */
    margin-bottom: 8px;
    border: 3px solid #003366;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.official-photos .official-item p {
    margin: 0;
    font-size: 0.85em;
    line-height: 1.3;
}

/* Sidebar - Gambar Lainnya */
.other-images img {
    width: 100%; /* Gambar mengisi lebar penuh kontainer */
    height: auto; /* Tinggi otomatis untuk menjaga rasio aspek */
    max-width: 250px; /* Batasi lebar maksimum di desktop */
    display: block;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.other-images a {
    display: block; /* Agar link membungkus seluruh gambar dan margin bawah bekerja */
    margin-bottom: 15px;
    /* Tidak perlu max-width di sini karena sudah di img */
}

/* Styling untuk Galeri */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Tiga kolom di desktop */
    gap: 20px; /* Jarak antar gambar galeri */
    margin-top: 20px;
}

.gallery-item {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
    display: flex;
    flex-direction: column;
    height: 100%; /* Memastikan item memiliki tinggi yang sama */
    cursor: pointer; /* Menunjukkan bahwa item bisa diklik */
}

.gallery-item img {
    width: 100%;
    height: 200px; /* Tinggi gambar galeri */
    object-fit: cover;
    display: block;
    border-bottom: 1px solid #eee;
}

.gallery-title {
    padding: 10px;
    font-size: 0.9em;
    font-weight: bold;
    color: #003366;
    flex-grow: 1; /* Agar judul mengisi sisa ruang vertikal */
    display: flex;
    align-items: center; /* Pusatkan teks vertikal */
    justify-content: center; /* Pusatkan teks horizontal */
}

/* Styling untuk Lightbox/Modal */
.lightbox {
    display: none; /* Tersembunyi secara default */
    position: fixed; /* Tetap di viewport saat scroll */
    z-index: 1001; /* Di atas semua elemen lain */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Aktifkan scroll jika konten terlalu besar */
    background-color: transparent; /* Latar belakang diubah menjadi transparan */
    display: flex; /* Untuk memusatkan gambar */
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%; /* Lebar maksimum gambar */
    max-height: 90%; /* Tinggi maksimum gambar */
    border-radius: 8px; /* Sudut membulat pada gambar yang di-zoom */
    box-shadow: 0 0 20px rgba(0,0,0,0.8); /* Bayangan pada gambar */
    animation-name: zoom; /* Animasi saat muncul */
    animation-duration: 0.6s;
}

/* Animasi Zoom */
@keyframes zoom {
    from {transform: scale(0.1)} 
    to {transform: scale(1)}
}

.close-button {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1002; /* Pastikan tombol di atas gambar */
}

.close-button:hover,
.close-button:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.lightbox-caption {
    margin-top: 15px;
    text-align: center;
    color: #ccc;
    font-size: 1.2em;
    padding: 10px 0;
    width: 80%;
    max-width: 700px;
}

/* Styling untuk Berita Populer di Sidebar */
.popular-news-list {
    margin-bottom: 30px;
}

.popular-news-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-news-list li {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #eee; /* Garis putus-putus */
}

.popular-news-list li:last-child {
    border-bottom: none; /* Hapus border pada item terakhir */
}

.popular-news-list img {
    width: 70px; /* Ukuran thumbnail gambar berita populer */
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.popular-news-list a {
    flex-grow: 1; /* Membuat link mengisi sisa ruang */
    text-decoration: none;
    color: #003366;
    font-size: 0.9em;
    font-weight: bold;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.popular-news-list a:hover {
    color: #007bff;
}

.popular-news-list small {
    display: block; /* Membuat teks "Dilihat" di baris baru */
    font-size: 0.75em;
    color: #888;
    margin-top: 5px;
    text-align: right; /* Rata kanan untuk teks "Dilihat" */
}


/* Footer */
footer {
    background-color: #003366;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.2);
}

/* Responsiveness */
@media (max-width: 992px) { /* Untuk tablet dan layar menengah */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr); /* Dua kolom di tablet */
    }

    /* Penyesuaian untuk menu highlight di mobile/tablet */
    .main-menu ul li.highlight-menu a {
        padding: 10px 0; /* Sesuaikan padding agar konsisten dengan menu mobile lain */
        width: 100%;
        display: block;
        background-color: #ffcc00; /* Tetap kuning */
        color: #003366; /* Tetap biru */
        border-radius: 5px;
    }
    .main-menu ul li.highlight-menu a:hover {
        background-color: #e6b800;
        color: #001a33;
    }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: row; /* Tetap row untuk logo dan hamburger */
        justify-content: space-between; /* Logo di kiri, hamburger di kanan */
        align-items: center;
    }

    .logo {
        margin-bottom: 0; /* Hapus margin bawah */
    }

    /* Teks nama website sudah disembunyikan secara global, jadi aturan ini tidak lagi diperlukan di sini */
    /* .logo h1 {
        display: none;
    } */

    .main-menu {
        display: none; /* Sembunyikan menu utama secara default */
        flex-direction: column;
        width: 100%;
        background-color: #003366;
        position: absolute;
        top: 80px; /* Sesuaikan dengan tinggi header */
        left: 0;
        z-index: 1000;
        box-shadow: 0 5px 10px rgba(0,0,0,0.3);
        padding: 10px 0;
        border-radius: 0 0 8px 8px;
    }

    .main-menu.active {
        display: flex; /* Tampilkan menu saat aktif */
    }

    .main-menu ul {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .main-menu ul li {
        margin: 10px 0;
        width: 100%;
        text-align: center;
    }

    .main-menu ul li a {
        padding: 10px 0;
        width: 100%;
        display: block;
        background-color: rgba(255, 255, 255, 0.1);
        border-radius: 5px;
    }

    .main-menu ul li a:hover {
        background-color: rgba(255, 255, 255, 0.3);
    }

    /* Penyesuaian untuk menu highlight di mobile (dalam menu hamburger) */
    .main-menu ul li.highlight-menu a {
        background-color: #ffcc00; /* Tetap kuning */
        color: #003366; /* Tetap biru */
        padding: 10px 0; /* Sesuaikan padding agar konsisten dengan menu mobile lain */
        border-radius: 5px;
    }
    .main-menu ul li.highlight-menu a:hover {
        background-color: #e6b800;
        color: #001a33;
    }

    .hamburger {
        display: block; /* Tampilkan hamburger di mobile */
    }

    .content-area .container {
        flex-direction: column;
        /* Hapus padding horizontal di sini agar main-content dan sidebar bisa mengisi penuh */
        padding: 30px 0; /* Hanya padding vertikal */
    }

    .main-content, .sidebar {
        flex: none;
        width: 100%;
        /* Tambahkan padding horizontal di sini */
        padding: 20px; /* Padding 20px di semua sisi untuk mobile */
        box-sizing: border-box; /* Pastikan padding termasuk dalam lebar 100% */
    }

    /* Berita utama menjadi satu kolom di mobile */
    .news-grid {
        grid-template-columns: 1fr; /* Satu kolom di mobile */
    }

    .news-item-grid img {
        height: 180px; /* Tinggi gambar berita di grid lebih kecil di mobile */
    }

    .news-item img { /* Ini adalah aturan lama, bisa dihapus jika tidak ada lagi news-item */
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%;
        height: 200px;
    }

    .slider-item img {
        /* Tinggi slider lebih kecil di mobile, tetap cover */
        height: 250px; /* Tetap 250px untuk mobile/tablet */
        object-fit: cover; /* Pastikan gambar mengisi area tanpa distorsi */
        display: block;
    }

    .slider-caption h2 {
        font-size: 1.2em;
    }
    .slider-caption p {
        font-size: 0.8em;
    }

    /* Penyesuaian untuk gambar pejabat di mobile (sama dengan gambar lainnya) */
    .official-photos {
        flex-direction: column; /* Tumpuk item secara vertikal */
        align-items: center; /* Pusatkan item */
    }
    .official-photos .official-item {
        width: 100%; /* Lebar item mengisi penuh sidebar di mobile */
        max-width: none; /* Hapus max-width di mobile agar mengisi penuh sidebar */
        margin-bottom: 20px; /* Beri jarak antar item yang menumpuk */
    }
    .official-photos .official-item img {
        width: 100%; /* Lebar foto mengisi penuh itemnya */
        height: auto; /* Tinggi otomatis agar tidak terdistorsi */
    }
    /* Penyesuaian untuk gambar sidebar lainnya di mobile */
    .other-images img {
        width: 100%; /* Gambar mengisi lebar penuh sidebar di mobile */
        height: auto; /* Tinggi otomatis agar tidak terdistorsi */
        max-width: none; /* Hapus max-width di mobile agar mengisi penuh sidebar */
    }
    .other-images a {
        width: 100%; /* Pastikan link juga mengisi lebar penuh */
        margin-left: auto;
        margin-right: auto;
    }

    /* Galeri menjadi satu kolom di mobile */
    .gallery-grid {
        grid-template-columns: 1fr; /* Satu kolom di mobile */
    }
    .gallery-item img {
        height: 180px; /* Tinggi gambar galeri lebih kecil di mobile */
    }

    /* Lightbox di mobile */
    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }
    .close-button {
        font-size: 30px;
        top: 15px;
        right: 15px;
    }
    .lightbox-caption {
        font-size: 1em;
        width: 90%;
    }

    /* Berita Populer di Mobile */
    .popular-news-list li {
        flex-direction: row; /* Tetap horizontal di mobile */
        align-items: center;
        text-align: left;
    }
    .popular-news-list img {
        width: 60px; /* Sedikit lebih kecil di mobile */
        height: 45px;
    }
    .popular-news-list small {
        text-align: left; /* Rata kiri di mobile */
    }
}
