/* =========================================
   1. DASAR & RESET (Wajib Ada)
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
}

/* =========================================
   2. CSS KHUSUS HALAMAN INDEX (UTAMA)
   ========================================= */
.halaman-utama {
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('perpus.jpg');
    justify-content: center;
}

/* =========================================
   3. CSS KHUSUS HALAMAN BACA BUKU & ARTIKEL
   ========================================= */
/* Menyatukan kedua halaman agar otomatis memuat wallpaper perpustakaan bawaanmu */
.halaman-baca, .halaman-artikel {
    background-image: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('perpus.jpg');
}

.di-mana-abdul {
    padding: 30px 20px;
    text-align: center;
    width: 100%;
}

.judul-text {
    font-size: 28px;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}

/* Grid Koleksi Konten (Otomatis 4 Kolom Rapi di PC) */
.daftar-buku {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 25px;                             
    padding: 30px 20px;
    width: 100%;
    max-width: 1200px;                     
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* --- [A] GAYA KARTU KHUSUS HALAMAN ARTIKEL (GELAP TRANSPARAN) --- */
.halaman-artikel .card-buku {
    background: rgba(0, 0, 0, 0.6);        /* Kotak hitam transparan premium */
    padding: 18px;
    border-radius: 15px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s, box-shadow 0.2s;
}

.halaman-artikel .card-buku p {
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;                         /* Teks judul artikel warna putih menyala */
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.8);
}

/* --- [B] GAYA KARTU KHUSUS HALAMAN BACA BUKU (PUTIH BERSIH) --- */
.halaman-baca .card-buku {
    background: rgba(255, 255, 255, 0.95);  /* Putih bersih sedikit transparan ala web temanmu */
    padding: 18px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.halaman-baca .card-buku p {
    font-size: 16px;
    font-weight: bold;
    color: #222222;                         /* Warna gelap agar terbaca jelas di atas kartu putih */
    text-align: center;
    margin-bottom: 15px;
}

/* Efek saat kursor mouse melewati kartu (Hover) */
.card-link:hover .card-buku {
    transform: translateY(-5px);           
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.card-link:active .card-buku {
    transform: scale(0.95);               
}

.foto-buku {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 12px;
}

/* Tombol "Baca Sekarang" Kapsul Otomatis */
.btn-baca-sekarang {
    display: block;
    width: 100%;
    padding: 10px 0;
    background-color: #0056b3;             /* Warna biru tegas */
    color: #ffffff !important;
    text-align: center;
    font-weight: bold;
    border-radius: 25px;                   
    font-size: 14px;
    margin-top: auto;                      
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3);
}

/* =========================================
   4. CSS TOMBOL & NAVIGASI ATAS
   ========================================= */
.menu-kontainer {
    display: flex;
    flex-direction: row;                   /* Berjejer mendatar kesamping */
    justify-content: center;
    gap: 15px;                             
    width: 100%;
    max-width: 600px;
    margin-bottom: 30px;
}

.btn {
    text-decoration: none;
    color: white;
    background: rgba(255, 255, 255, 0.15);
    padding: 10px 22px;
    border-radius: 50px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    font-weight: 600;
    transition: background 0.2s;
}

.btn:hover {
    background: #0056b3;                   /* Berubah biru saat kursor mendekat */
    border-color: #0056b3;
}

/* =========================================
   5. CSS SISTEM POP-UP (MODAL)
   ========================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.modal-overlay:target {
    display: flex;
}

.konten-baca {
    background: #1a1a1a;
    width: 90%;
    max-width: 600px;
    max-height: 85%;
    padding: 25px;
    border-radius: 20px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tombol-tutup {
    float: right;
    color: #ff4d4d;
    text-decoration: none;
    font-weight: bold;
}

.teks-cerita {
   white-space: pre-wrap;
   line-height: 1.8;
   font-size: 16px;
   color: #e0e0e0;
}

/* =========================================
   6. CSS RESPONSIF (Layar HP Otomatis Menyesuaikan)
   ========================================= */
@media (max-width: 768px) {
    .daftar-buku {
        grid-template-columns: repeat(2, 1fr); /* Menjadi 2 kolom di HP */
        gap: 15px;
    }
    .menu-kontainer {
        flex-direction: column;            /* Menu menumpuk vertikal di HP */
        width: 90%;
    }
}

/* Tentang Kami - Info Kapsul Developer */
.text-1 {
    text-decoration: none;
    color: white;
    background: green;
    padding: 12px;
    border-radius: 30px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    font-weight: 600;
    list-style: none;
    font-size: 10px;
}
