/*
============================================================
PANDUAN LAYANAN PTSP v1.1.1
Responsive Modal UI Fix
MAN Kota Blitar
============================================================
*/

/* =========================================================
   KOTAK PANDUAN
   ========================================================= */

.panduan-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin: 22px 0 28px;
    padding: 18px 20px;

    border: 1px solid #d8eadf;
    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            #f3faf5 0%,
            #ffffff 65%,
            #fffaf0 100%
        );

    box-shadow: 0 8px 24px rgba(0,0,0,.045);
}

.panduan-box-copy {
    flex: 1;
    min-width: 0;
}

.panduan-box-copy strong {
    display: block;

    margin: 0 0 5px;

    color: #165f37;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.35;
}

.panduan-box-copy p {
    margin: 0;

    color: #647067;
    font-size: 14px;
    line-height: 1.55;
}


/* =========================================================
   TOMBOL LIHAT PANDUAN
   ========================================================= */

.panduan-open,
.panduan-close-btn {

    appearance: none;

    border: 0;
    border-radius: 10px;

    background: #087548;
    color: #ffffff;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    padding: 11px 18px;

    transition:
        background .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}

.panduan-open {
    flex: 0 0 auto;
    white-space: nowrap;
}

.panduan-open:hover,
.panduan-close-btn:hover {

    background: #075f3b;

    box-shadow:
        0 6px 18px rgba(8,117,72,.20);
}

.panduan-open:active,
.panduan-close-btn:active {
    transform: translateY(1px);
}

.panduan-open:focus-visible,
.panduan-x:focus-visible,
.panduan-close-btn:focus-visible {

    outline: 3px solid rgba(225,177,44,.55);
    outline-offset: 3px;
}


/* =========================================================
   MODAL
   ========================================================= */

.panduan-modal {

    position: fixed;
    inset: 0;

    z-index: 999999;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 18px;
}


/*
JS v1.1.1 menambahkan class is-open.
*/
.panduan-modal.is-open {
    display: flex;
}


/*
Tambahan proteksi terhadap atribut hidden.
*/
.panduan-modal[hidden] {
    display: none !important;
}


/* =========================================================
   BACKDROP
   ========================================================= */

.panduan-backdrop {

    position: absolute;
    inset: 0;

    background: rgba(5, 25, 16, .78);

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}


/* =========================================================
   DIALOG
   ========================================================= */

.panduan-dialog {

    position: relative;

    z-index: 2;

    width: min(900px, 100%);

    max-height: calc(100vh - 36px);
    max-height: calc(100dvh - 36px);

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border-radius: 20px;

    background: #ffffff;

    box-shadow:
        0 30px 90px rgba(0,0,0,.38);

    animation:
        panduanMasuk .20s ease-out;
}


/* =========================================================
   ANIMASI
   ========================================================= */

@keyframes panduanMasuk {

    from {
        opacity: 0;
        transform:
            translateY(12px)
            scale(.985);
    }

    to {
        opacity: 1;
        transform:
            translateY(0)
            scale(1);
    }
}


/* =========================================================
   HEADER MODAL
   ========================================================= */

.panduan-header {

    flex: 0 0 auto;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 18px;

    padding: 16px 20px;

    border-bottom:
        1px solid #e4ece7;

    background: #ffffff;
}

.panduan-header h3 {

    margin: 0;

    color: #155f37;

    font-size: 20px;
    font-weight: 800;

    line-height: 1.3;
}


/* =========================================================
   TOMBOL X
   ========================================================= */

.panduan-x {

    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    display: flex;

    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background: #edf4ef;
    color: #17462e;

    font-family: Arial, sans-serif;
    font-size: 28px;
    line-height: 1;

    cursor: pointer;

    transition:
        background .2s ease,
        transform .2s ease;
}

.panduan-x:hover {

    background: #dfece3;

    transform: rotate(4deg);
}


/* =========================================================
   AREA INFOGRAFIS
   ========================================================= */

.panduan-body {

    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    overscroll-behavior: contain;

    padding: 18px;

    background: #edf3ef;

    text-align: center;

    -webkit-overflow-scrolling: touch;
}


/* GAMBAR */

.panduan-body img {

    display: block;

    width: auto;
    max-width: 100%;
    height: auto;

    margin: 0 auto;

    border-radius: 12px;

    background: #ffffff;

    box-shadow:
        0 8px 28px rgba(0,0,0,.08);
}


/* =========================================================
   FOOTER MODAL
   ========================================================= */

.panduan-footer {

    flex: 0 0 auto;

    display: flex;

    align-items: center;
    justify-content: flex-end;

    padding: 14px 20px;

    border-top:
        1px solid #e4ece7;

    background: #ffffff;
}

.panduan-close-btn {

    min-width: 220px;
}


/* =========================================================
   BODY LOCK
   ========================================================= */

body.ptsp-panduan-lock {
    overflow: hidden;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 768px) {

    .panduan-box {

        align-items: flex-start;

        gap: 14px;

        padding: 16px;
    }

    .panduan-dialog {

        width: 100%;

        max-height:
            calc(100dvh - 20px);

        border-radius: 17px;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .panduan-box {

        display: block;

        margin: 18px 0 24px;

        padding: 15px;

        border-radius: 14px;
    }

    .panduan-box-copy strong {
        font-size: 16px;
    }

    .panduan-box-copy p {
        font-size: 13px;
    }

    .panduan-open {

        width: 100%;

        margin-top: 13px;

        padding: 12px 15px;
    }


    /* FULL SCREEN MOBILE */

    .panduan-modal {

        padding: 0;

        align-items: stretch;
    }

    .panduan-dialog {

        width: 100%;
        height: 100dvh;
        max-height: 100dvh;

        border-radius: 0;

        animation: none;
    }


    /* HEADER */

    .panduan-header {

        padding:
            calc(12px + env(safe-area-inset-top))
            14px
            12px;
    }

    .panduan-header h3 {

        font-size: 17px;
    }

    .panduan-x {

        width: 40px;
        height: 40px;

        flex-basis: 40px;

        font-size: 25px;
    }


    /* INFOGRAFIS */

    .panduan-body {

        padding: 10px;
    }

    .panduan-body img {

        width: 100%;

        border-radius: 8px;
    }


    /* FOOTER */

    .panduan-footer {

        padding:
            11px
            12px
            calc(11px + env(safe-area-inset-bottom));
    }

    .panduan-close-btn {

        width: 100%;
        min-width: 0;

        padding: 13px 15px;
    }

}