/* =========================================================
   WILAYAH KECAMATAN
========================================================= */

.wilayah {
    padding: 105px 0;
    background: var(--kertas);
}

.wilayah .wrap {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}


/* =========================================================
   MAIN LAYOUT
========================================================= */

.wilayah-layout {
    display: grid;
    grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
    gap: 28px;
    align-items: stretch;
}


/* =========================================================
   DIRECTORY
========================================================= */

.wilayah-directory {
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--garis);
    background: var(--putih);
    box-shadow: 0 14px 32px rgba(23, 59, 47, .05);
}


/* =========================================================
   DIRECTORY HEADER
========================================================= */

.wilayah-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 21px;
}

.wilayah-top h3 {
    margin: 5px 0 0;
    font-family: "Fraunces", serif;
    font-size: 25px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--tinta);
}

.wilayah-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: 0 0 auto;
}

.wilayah-total strong {
    font-family: "Fraunces", serif;
    font-size: 30px;
    font-weight: 600;
    line-height: 1;
    color: var(--hijau-tua);
}

.wilayah-total span {
    margin-top: 5px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(35, 41, 31, .45);
}


/* =========================================================
   SEARCH
========================================================= */

.wilayah-search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 46px;
    margin-bottom: 16px;
    padding: 0 13px;

    border: 1px solid var(--garis);
    background: var(--krem);

    transition:
        border-color .2s ease,
        background .2s ease,
        box-shadow .2s ease;
}

.wilayah-search:focus-within {
    border-color: rgba(184, 145, 71, .55);
    background: var(--putih);
    box-shadow: 0 0 0 3px rgba(184, 145, 71, .08);
}

.search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    width: 20px;
    height: 20px;

    font-size: 19px;
    line-height: 1;

    color: rgba(35, 41, 31, .48);
}

.wilayah-search input {
    width: 100%;
    height: 100%;
    padding: 0;

    border: 0;
    outline: 0;

    background: transparent;

    font-family: "Inter", sans-serif;
    font-size: 12px;
    color: var(--tinta);
}

.wilayah-search input::placeholder {
    color: rgba(35, 41, 31, .43);
}


/* =========================================================
   DIRECTORY LIST
========================================================= */

.wilayah-list {
    display: flex;
    flex-direction: column;

    gap: 7px;

    max-height: 590px;
    overflow-y: auto;

    padding-right: 4px;
}

.wilayah-list::-webkit-scrollbar {
    width: 5px;
}

.wilayah-list::-webkit-scrollbar-track {
    background: transparent;
}

.wilayah-list::-webkit-scrollbar-thumb {
    background: rgba(35, 41, 31, .14);
}

.wilayah-list::-webkit-scrollbar-thumb:hover {
    background: rgba(35, 41, 31, .25);
}


/* =========================================================
   DIRECTORY ITEM
========================================================= */

.wilayah-item {
    position: relative;

    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 22px;
    align-items: center;

    gap: 12px;

    width: 100%;
    min-height: 66px;

    padding: 10px 13px;

    border: 1px solid transparent;
    border-radius: 0;

    background: #fafaf7;
    color: var(--tinta);

    text-align: left;

    cursor: pointer;
    appearance: none;

    transition:
        transform .18s ease,
        border-color .18s ease,
        background .18s ease,
        box-shadow .18s ease;
}

.wilayah-item:hover {
    transform: translateX(3px);

    border-color: rgba(184, 145, 71, .38);

    background: var(--putih);

    box-shadow:
        0 7px 18px rgba(23, 59, 47, .045);
}

.wilayah-item.active {
    border-color: rgba(31, 78, 61, .24);

    background: rgba(31, 78, 61, .055);

    box-shadow:
        inset 3px 0 0 var(--hijau-tua);
}

.wilayah-item:focus-visible {
    outline: none;

    border-color: rgba(184, 145, 71, .55);

    box-shadow:
        0 0 0 3px rgba(184, 145, 71, .10);
}

.wilayah-item[hidden] {
    display: none;
}


/* =========================================================
   ITEM NUMBER
========================================================= */

.wilayah-number {
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    color: var(--emas);
}


/* =========================================================
   ITEM CONTENT
========================================================= */

.wilayah-item-content {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 4px;
}

.wilayah-item-content strong {
    overflow: hidden;

    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;

    white-space: nowrap;
    text-overflow: ellipsis;

    color: var(--hijau-tua);
}

.wilayah-item-content small {
    overflow: hidden;

    font-size: 9px;
    line-height: 1.2;

    text-transform: uppercase;
    letter-spacing: .06em;

    white-space: nowrap;
    text-overflow: ellipsis;

    color: rgba(35, 41, 31, .45);
}


/* =========================================================
   ARROW
========================================================= */

.wilayah-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 16px;
    line-height: 1;

    color: rgba(31, 78, 61, .42);

    transition:
        transform .18s ease,
        color .18s ease;
}

.wilayah-item:hover .wilayah-arrow,
.wilayah-item.active .wilayah-arrow {
    transform: translateX(3px);
    color: var(--hijau-tua);
}


/* =========================================================
   SEARCH EMPTY
========================================================= */

.wilayah-search-empty {
    padding: 20px 14px;

    border: 1px dashed var(--garis);

    background: var(--krem);

    text-align: center;

    font-family: "IBM Plex Mono", monospace;
    font-size: 8px;
    line-height: 1.6;

    text-transform: uppercase;
    letter-spacing: .06em;

    color: rgba(35, 41, 31, .40);
}


/* =========================================================
   EMPTY DATABASE
========================================================= */

.wilayah-empty {
    display: flex;
    flex-direction: column;

    gap: 7px;

    padding: 32px 20px;

    border: 1px dashed var(--garis);

    background: rgba(247, 244, 236, .60);
}

.wilayah-empty strong {
    font-family: "Fraunces", serif;
    font-size: 17px;
    font-weight: 500;
    color: var(--tinta);
}

.wilayah-empty span {
    font-size: 10px;
    line-height: 1.7;
    color: rgba(35, 41, 31, .52);
}


/* =========================================================
   PREVIEW
========================================================= */

.wilayah-preview {
    min-width: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border: 1px solid var(--garis);

    background: var(--putih);

    box-shadow:
        0 14px 32px rgba(23, 59, 47, .05);
}


/* =========================================================
   PREVIEW HEADER
========================================================= */

.wilayah-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    padding: 24px;
}

.wilayah-preview-header > div:first-child {
    min-width: 0;
}

.wilayah-preview-header h3 {
    margin: 5px 0 5px;

    font-family: "Fraunces", serif;
    font-size: 29px;
    font-weight: 600;
    line-height: 1.1;

    color: var(--tinta);
}

.wilayah-preview-header p {
    margin: 0;

    font-size: 11px;
    line-height: 1.6;

    color: rgba(35, 41, 31, .53);
}

.wilayah-status {
    flex: 0 0 auto;

    padding: 6px 9px;

    border: 1px solid rgba(31, 78, 61, .19);

    background: rgba(31, 78, 61, .05);

    font-family: "IBM Plex Mono", monospace;
    font-size: 8px;

    text-transform: uppercase;
    letter-spacing: .08em;

    color: var(--hijau-tua);
}


/* =========================================================
   PREVIEW IMAGE
========================================================= */

.wilayah-preview-image {
    position: relative;

    width: 100%;

    aspect-ratio: 16 / 8.5;

    overflow: hidden;

    background: #e8e7df;
}

.wilayah-preview-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform .35s ease;
}

.wilayah-preview:hover .wilayah-preview-image img {
    transform: scale(1.015);
}

.wilayah-image-placeholder {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(
        135deg,
        #dad9ce 0%,
        #efefe3 50%,
        #d6d4c8 100%
    );

    color: rgba(20, 35, 28, .31);

    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    letter-spacing: .12em;
}

.wilayah-image-placeholder[hidden] {
    display: none !important;
}


/* =========================================================
   PREVIEW BODY
========================================================= */

.wilayah-preview-body {
    padding: 24px;
}


/* =========================================================
   INFO GRID
========================================================= */

.wilayah-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 1px;

    overflow: hidden;

    border: 1px solid var(--garis);

    background: var(--garis);
}

.wilayah-info {
    display: flex;
    flex-direction: column;
    justify-content: center;

    min-height: 82px;

    padding: 15px;

    background: var(--putih);
}

.wilayah-info span,
.wilayah-description > span,
.wilayah-modal-description > span,
.wilayah-modal-location > span {
    display: block;

    margin-bottom: 6px;

    font-family: "IBM Plex Mono", monospace;
    font-size: 8px;

    text-transform: uppercase;
    letter-spacing: .08em;

    color: rgba(35, 41, 31, .44);
}

.wilayah-info strong {
    overflow: hidden;

    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;

    color: var(--tinta);

    text-overflow: ellipsis;
}


/* =========================================================
   DESCRIPTION
========================================================= */

.wilayah-description {
    padding-top: 21px;
}

.wilayah-description p {
    margin: 0;

    max-width: 760px;

    font-size: 12px;
    line-height: 1.8;

    color: rgba(35, 41, 31, .60);
}


/* =========================================================
   ACTION
========================================================= */

.wilayah-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 10px;

    margin-top: 23px;
}

.wilayah-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    min-height: 42px;

    padding: 0 17px;

    border: 1px solid var(--hijau-tua);
    border-radius: 0;

    background: transparent;

    color: var(--hijau-tua);

    font-family: "Inter", sans-serif;
    font-size: 10px;
    font-weight: 600;

    line-height: 1;
    text-decoration: none;

    cursor: pointer;
    appearance: none;

    transition:
        background .2s ease,
        color .2s ease,
        border-color .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}

.wilayah-actions .btn-primary {
    border-color: var(--hijau-tua);
    background: var(--hijau-tua);
    color: var(--krem);
}

.wilayah-actions .btn-primary:hover:not(:disabled) {
    border-color: var(--emas);
    background: var(--emas);
    color: var(--hijau-tua);

    transform: translateY(-1px);

    box-shadow:
        0 7px 16px rgba(23, 59, 47, .10);
}

.wilayah-actions .btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.wilayah-actions .btn:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 3px rgba(184, 145, 71, .16);
}


/* =========================================================
   MODAL
========================================================= */

.wilayah-modal[hidden] {
    display: none;
}

.wilayah-modal {
    position: fixed;
    inset: 0;

    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;
}

.wilayah-modal-overlay {
    position: absolute;
    inset: 0;

    background: rgba(16, 43, 34, .70);
}

.wilayah-modal-dialog {
    position: relative;
    z-index: 1;

    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);

    width: min(940px, 100%);

    max-height: min(720px, calc(100vh - 48px));

    overflow: hidden;

    border: 1px solid #d8d4c8;

    background: #f7f4eb !important;
    background-color: #f7f4eb !important;
    opacity: 1 !important;
    backdrop-filter: none !important;

    box-shadow:
        0 28px 70px rgba(0, 0, 0, .20);
}


/* =========================================================
   MODAL CLOSE
========================================================= */

.wilayah-modal-close {
    position: absolute;

    top: 13px;
    right: 13px;

    z-index: 5;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    padding: 0;

    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 0;

    background: rgba(16, 43, 34, .84);

    color: var(--putih);

    font-family: "Inter", sans-serif;
    font-size: 20px;

    line-height: 1;

    cursor: pointer;

    transition:
        background .2s ease,
        color .2s ease,
        transform .2s ease;
}

.wilayah-modal-close:hover {
    background: var(--emas);
    color: var(--hijau-tua);

    transform: translateY(-1px);
}

.wilayah-modal-close:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 3px rgba(184, 145, 71, .20);
}


/* =========================================================
   MODAL IMAGE
========================================================= */

.wilayah-modal-image {
    min-height: 380px;
    background: #deddd4;
}

.wilayah-modal-image img {
    display: block;

    width: 100%;
    height: 100%;

    min-height: 380px;

    object-fit: cover;
}


/* =========================================================
   MODAL CONTENT
========================================================= */

.wilayah-modal-content {
    min-width: 0;

    overflow-y: auto;

    padding: 38px 30px 30px;

    background: #f7f4eb !important;
    background-color: #f7f4eb !important;
    opacity: 1 !important;
}

.wilayah-modal-content h3 {
    margin: 6px 0 5px;

    font-family: "Fraunces", serif;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.08;

    color: var(--tinta);
}

.wilayah-modal-type {
    margin: 0 0 23px;

    font-family: "IBM Plex Mono", monospace;
    font-size: 8px;

    text-transform: uppercase;
    letter-spacing: .08em;

    color: var(--emas);
}


/* =========================================================
   MODAL INFO
========================================================= */

.wilayah-modal-info {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 1px;

    border: 1px solid var(--garis);

    background: var(--garis);
}

.wilayah-modal-info > div {
    min-width: 0;

    padding: 14px;

    background: #ffffff !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
}

.wilayah-modal-info span {
    display: block;

    margin-bottom: 6px;

    font-family: "IBM Plex Mono", monospace;
    font-size: 7px;

    text-transform: uppercase;
    letter-spacing: .07em;

    color: rgba(35, 41, 31, .43);
}

.wilayah-modal-info strong {
    display: block;

    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;

    color: var(--tinta);
}


/* =========================================================
   MODAL DESCRIPTION
========================================================= */

.wilayah-modal-description {
    padding-top: 22px;
}

.wilayah-modal-description p {
    margin: 0;

    font-size: 11px;
    line-height: 1.8;

    color: rgba(35, 41, 31, .61);
}


/* =========================================================
   MODAL LOCATION
========================================================= */

.wilayah-modal-location {
    margin-top: 21px;

    padding-top: 18px;

    border-top: 1px solid var(--garis);
}

.wilayah-modal-location[hidden] {
    display: none;
}

.wilayah-modal-location p {
    margin: 0;

    font-family: "IBM Plex Mono", monospace;
    font-size: 8px;
    line-height: 1.6;

    color: rgba(35, 41, 31, .52);
}


/* =========================================================
   SCROLL LOCK
========================================================= */

html.wilayah-modal-open,
body.wilayah-modal-open {
    overflow: hidden;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1000px) {

    .wilayah-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .wilayah-list {
        max-height: 450px;

        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 8px;
    }

    .wilayah-modal-dialog {
        grid-template-columns: 1fr;

        max-height: calc(100vh - 40px);
    }

    .wilayah-modal-image {
        min-height: 230px;
        max-height: 320px;
    }

    .wilayah-modal-image img {
        min-height: 230px;
        max-height: 320px;
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 680px) {

    .wilayah {
        padding: 78px 0;
    }

    .wilayah .wrap {
        width: min(100% - 30px, 1180px);
    }

    .wilayah-directory {
        padding: 18px;
    }

    .wilayah-list {
        display: flex;
        max-height: 420px;
    }

    .wilayah-preview-header {
        flex-direction: column;
        gap: 12px;

        padding: 19px;
    }

    .wilayah-preview-header h3 {
        font-size: 25px;
    }

    .wilayah-status {
        align-self: flex-start;
    }

    .wilayah-preview-body {
        padding: 19px;
    }

    .wilayah-preview-image {
        aspect-ratio: 16 / 9;
    }

    .wilayah-info-grid {
        grid-template-columns: 1fr;
    }

    .wilayah-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .wilayah-actions .btn {
        width: 100%;
    }

    .wilayah-modal {
        padding: 12px;
    }

    .wilayah-modal-dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
    }

    .wilayah-modal-image {
        min-height: 190px;
        max-height: 230px;
    }

    .wilayah-modal-image img {
        min-height: 190px;
        max-height: 230px;
    }

    .wilayah-modal-content {
        padding: 29px 18px 20px;
    }

    .wilayah-modal-content h3 {
        font-size: 26px;
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 430px) {

    .wilayah {
        padding: 66px 0;
    }

    .wilayah-top {
        flex-direction: column;
        gap: 11px;
    }

    .wilayah-total {
        align-items: flex-start;
    }

    .wilayah-search {
        height: 44px;
    }

    .wilayah-item {
        min-height: 63px;

        grid-template-columns: 32px minmax(0, 1fr) 20px;

        gap: 9px;

        padding: 9px 11px;
    }

    .wilayah-item-content strong {
        font-size: 11px;
    }

    .wilayah-preview-header h3 {
        font-size: 23px;
    }

    .wilayah-modal-info {
        grid-template-columns: 1fr;
    }
}