/* =====================================================================
   DETAIL INFORMASI - jendela detail informasi (admin, kepala bidang,
   masyarakat). Dibuat oleh js/detail-informasi.js
   ===================================================================== */

.di-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(5, 20, 13, 0.72);
    backdrop-filter: blur(4px);
}

.di-overlay.terbuka {
    display: flex;
}

.di-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 860px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--surface, #fff);
    border-radius: 22px;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.55);
    overscroll-behavior: contain;
}

/* Foto: selalu selebar jendela, tinggi mengikuti rasio foto asli
   (tanpa jarak di sisi, tanpa terpotong). Elemen <img> asli, bisa klik kanan > simpan gambar */
.di-foto {
    position: relative;
    flex-shrink: 0;
    margin: 0;
    overflow: hidden;
    background: #0d1f16;
    border-radius: 22px 22px 0 0;
    line-height: 0;
}

.di-foto[hidden] {
    display: none;
}

.di-foto a {
    display: block;
    width: 100%;
}

.di-foto img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: auto;
    max-height: 62vh;
    object-fit: contain;
}

/* Foto yang sangat tinggi (portrait): sisi kiri-kanan diisi latar blur dari foto itu sendiri */
.di-foto::before {
    content: "";
    position: absolute;
    inset: -60px;
    background: var(--di-bg, none) center / cover no-repeat;
    filter: blur(22px) brightness(0.65);
}

.di-tutup {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    color: #10231a;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.5);
    transition: background 0.2s ease, color 0.2s ease;
}

.di-tutup:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.di-tutup:focus-visible {
    outline: 3px solid #4ade80;
    outline-offset: 2px;
}

.di-isi {
    padding: 28px 32px 34px;
}

.di-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-bottom: 14px;
    color: var(--text-3, #77897f);
    font-size: 13px;
    font-weight: 500;
}

.di-label {
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--brand-100, #dcfce7);
    color: var(--brand-700, #166534);
    font-size: 12px;
    font-weight: 700;
}

.di-label.dinas {
    background: #e0f2fe;
    color: #075985;
}

.di-judul {
    margin: 0 0 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border, #e3eae5);
    color: var(--brand-900, #0f3323);
    font-size: clamp(21px, 3vw, 28px);
    line-height: 1.3;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.di-teks {
    color: var(--text-2, #435a4e);
    font-size: 16px;
    line-height: 1.85;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.di-petunjuk {
    margin: 18px 0 0;
    color: var(--text-3, #77897f);
    font-size: 12.5px;
}

/* Kartu yang bisa diklik untuk membuka detail */
[data-di-judul] {
    cursor: pointer;
}

.di-tombol {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    min-height: 36px;
    background: var(--brand-50, #f0fdf4);
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    color: var(--brand-700, #166534);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.di-tombol:hover {
    background: var(--brand-100, #dcfce7);
}

.di-thumbs {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 6px;
    background: rgba(8, 24, 16, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 14px;
    line-height: normal;
}

.di-thumbs[hidden] {
    display: none;
}

.di-thumb {
    width: 76px;
    height: 56px;
    padding: 0;
    overflow: hidden;
    background: #000;
    border: 2px solid transparent;
    border-radius: 10px;
    opacity: 0.65;
    cursor: pointer;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.di-thumb:hover,
.di-thumb.aktif {
    border-color: #4ade80;
    opacity: 1;
}

.di-thumb:focus-visible {
    outline: 3px solid #4ade80;
    outline-offset: 2px;
}

.di-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lampiran berkas */
.di-lampiran {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border, #e3eae5);
}

.di-lampiran[hidden] {
    display: none;
}

.di-lampiran-judul {
    margin: 0 0 12px;
    color: var(--brand-900, #0f3323);
    font-size: 16px;
}

.di-lampiran-daftar {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.di-lampiran-daftar li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 12px 14px;
    background: var(--surface-2, #f8faf9);
    border: 1px solid var(--border, #e3eae5);
    border-radius: 12px;
}

.di-jenis {
    min-width: 62px;
    padding: 4px 10px;
    background: var(--brand-100, #dcfce7);
    border-radius: 8px;
    color: var(--brand-700, #166534);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.di-berkas {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.di-berkas strong {
    color: var(--text, #10231a);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.di-berkas small {
    color: var(--text-3, #77897f);
    font-size: 12.5px;
}

.di-aksi {
    display: flex;
    gap: 8px;
}

.di-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 16px;
    background: var(--surface, #fff);
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    color: var(--brand-700, #166534);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.di-btn:hover {
    background: var(--brand-50, #f0fdf4);
}

.di-btn.utama {
    background: var(--brand-600, #15803d);
    border-color: var(--brand-600, #15803d);
    color: #fff;
}

.di-btn.utama:hover {
    background: var(--brand-700, #166534);
}

body.di-kunci {
    overflow: hidden;
}

@media (max-width: 600px) {
    .di-overlay {
        padding: 10px;
    }

    .di-dialog {
        max-height: calc(100vh - 20px);
        border-radius: 18px;
    }

    .di-foto {
        border-radius: 18px 18px 0 0;
    }

    .di-isi {
        padding: 22px 20px 28px;
    }
}

/* Keterangan tiap lampiran */
.di-ket {
    color: var(--text-2, #3f5448);
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
