/* =====================================================================
   DETAIL LAYANAN - jendela detail layanan publik (halaman masyarakat).
   Dibuat oleh js/detail-layanan.js. Tampilannya mengikuti detail informasi.
   ===================================================================== */

/* Kartu layanan yang bisa diklik */
.layanan-card[data-dl-nama] {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.layanan-card[data-dl-nama]:focus-visible {
    outline: 3px solid #4ade80;
    outline-offset: 3px;
}

.layanan-card .ringkas-layanan {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    margin: 0 0 14px;
    overflow: hidden;
    color: var(--text-2, #435a4e);
    font-size: 13.5px;
    line-height: 1.6;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.layanan-card .bawah-layanan {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border, #e3eae5);
}

.layanan-card .jumlah-syarat {
    color: var(--text-3, #77897f);
    font-size: 12.5px;
    font-weight: 600;
}

.layanan-card .btn-detail {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 14px;
    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;
    text-decoration: none;
    cursor: pointer;
}

.layanan-card .btn-detail:hover {
    background: var(--brand-100, #dcfce7);
}

/* ---------- Jendela detail ---------- */
.dl-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);
}

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

.dl-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 760px;
    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;
}

.dl-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;
    transition: background 0.2s ease, color 0.2s ease;
}

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

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

.dl-kepala {
    padding: 28px 70px 20px 32px;
    background: linear-gradient(135deg, #0f3323, #166534);
    border-radius: 22px 22px 0 0;
    color: #fff;
}

.dl-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    font-weight: 500;
}

.dl-label {
    padding: 3px 12px;
    background: #dcfce7;
    border-radius: 999px;
    color: #166534;
    font-size: 12px;
    font-weight: 700;
}

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

.dl-nama {
    margin: 0;
    color: #fff;
    font-size: clamp(20px, 3vw, 26px);
    line-height: 1.3;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.dl-isi {
    display: grid;
    gap: 22px;
    padding: 26px 32px 8px;
}

.dl-bagian-judul {
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--brand-100, #dcfce7);
    color: var(--brand-700, #166534);
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

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

.dl-teks.kosong {
    color: var(--text-3, #77897f);
}

.dl-aksi {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 32px 28px;
}

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

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

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

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

body.dl-kunci {
    overflow: hidden;
}

@media (max-width: 600px) {
    .dl-overlay { padding: 10px; }
    .dl-dialog { max-height: calc(100vh - 20px); border-radius: 18px; }
    .dl-kepala { padding: 22px 64px 18px 20px; border-radius: 18px 18px 0 0; }
    .dl-isi { padding: 20px 20px 4px; }
    .dl-aksi { padding: 16px 20px 24px; }
    .dl-btn { flex: 1 1 100%; }
}
