/* ==========================================================================
   APE Distribution Kits — Wilayah Implementasi
   Scoped to body.ape-wilayah-page
   ========================================================================== */

/* ==========================================================================
   Variables
   ========================================================================== */

body.ape-wilayah-page {
    --wilayah-primary: #2878c8;
    --wilayah-primary-dark: #1f68b2;
    --wilayah-navy: #082b5f;
    --wilayah-muted: #40536b;
    --wilayah-border: #dbeeff;
    --wilayah-soft: #f3faff;
    --wilayah-card-radius: 16px;
    --wilayah-card-shadow: 0 10px 24px rgba(12, 47, 89, 0.07);
    font-family: Inter, sans-serif;
    color: var(--wilayah-navy);
    background: #ffffff;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.ape-wilayah {
    overflow: visible;
}

.ape-wilayah *,
.ape-wilayah *::before,
.ape-wilayah *::after {
    box-sizing: border-box;
}

.wilayah-container {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}

.wilayah-section {
    padding: 34px 0;
    background: #ffffff;
}

.wilayah-section-title {
    text-align: center;
    margin-bottom: 22px;
}

.wilayah-section-title h2 {
    margin: 0;
    color: var(--wilayah-navy);
    font-weight: 900;
}

.wilayah-section-title h2::after {
    content: "";
    display: block;
    width: 72px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: var(--wilayah-primary);
}

.wilayah-section-title p {
    max-width: 640px;
    margin: 12px auto 0;
    color: var(--wilayah-muted);
    line-height: 1.65;
}

.wilayah-state-message,
.wilayah-loading,
.wilayah-empty-state {
    padding: 24px;
    border: 1px dashed var(--wilayah-border);
    border-radius: var(--wilayah-card-radius);
    background: var(--wilayah-soft);
    color: var(--wilayah-muted);
    text-align: center;
    line-height: 1.6;
}

.wilayah-loading {
    color: var(--wilayah-primary);
    background: linear-gradient(135deg, #e8f5ff, #f7fbff);
}

.wilayah-empty-state {
    border-style: solid;
    background: #ffffff;
}

.wilayah-eyebrow {
    display: inline-block;
    color: var(--wilayah-primary);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.wilayah-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    border: 0;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.wilayah-btn:hover,
.wilayah-btn:focus {
    text-decoration: none;
}

.wilayah-btn-primary {
    color: #ffffff;
    background: var(--wilayah-primary);
    box-shadow: 0 10px 24px rgba(40, 120, 200, 0.2);
}

.wilayah-btn-primary:hover,
.wilayah-btn-primary:focus {
    transform: translateY(-2px);
    background: var(--wilayah-primary-dark);
    color: #ffffff;
}

.wilayah-btn-secondary {
    color: var(--wilayah-primary);
    background: #ffffff;
    border: 1px solid var(--wilayah-border);
}

.wilayah-btn-secondary:hover,
.wilayah-btn-secondary:focus {
    transform: translateY(-2px);
    border-color: #b8d4f0;
    box-shadow: var(--wilayah-card-shadow);
    color: var(--wilayah-primary);
}

.wilayah-btn-small {
    min-height: 40px;
    padding: 0 16px;
    font-size: 13px;
}

.wilayah-btn-inline {
    margin-top: 18px;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.wilayah-hero {
    background: linear-gradient(135deg, #eef8ff 0%, #ffffff 48%, #dff3ff 100%);
    padding-top: calc(var(--ape-nav-height, 90px) + 56px);
    padding-bottom: 72px;
    overflow: visible;
}

.wilayah-hero-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 40px;
    align-items: center;
    overflow: visible;
}

.wilayah-hero-copy h1 {
    margin: 14px 0 18px;
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.08;
    font-weight: 900;
    color: var(--wilayah-navy);
}

.wilayah-hero-copy p {
    max-width: 520px;
    color: #2f4058;
    line-height: 1.7;
}

.wilayah-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.wilayah-hero-visual {
    position: relative;
    padding: 22px;
    border-radius: 42px;
    background: #ffffff;
    box-shadow: 0 28px 70px rgba(12, 47, 89, 0.12);
    overflow: visible;
}

.wilayah-hero-visual::before {
    content: "";
    position: absolute;
    left: -38px;
    top: -32px;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    border: 2px dotted rgba(0, 174, 239, 0.32);
    z-index: 0;
    pointer-events: none;
}

.wilayah-hero-visual::after {
    content: "";
    position: absolute;
    right: -54px;
    bottom: -54px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: rgba(0, 174, 239, 0.16);
    z-index: 0;
    pointer-events: none;
}

.wilayah-hero-photo {
    position: relative;
    z-index: 1;
    margin: 0;
    height: 620px;
    border-radius: 34px;
    overflow: hidden;
    background: #eef8ff;
}

.wilayah-hero-photo::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 34%;
    background: linear-gradient(180deg, rgba(8, 43, 95, 0), rgba(8, 43, 95, 0.48));
    pointer-events: none;
    z-index: 1;
}

.wilayah-hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.wilayah-hero-photo figcaption {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 22px;
    z-index: 2;
    margin: 0;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
    text-shadow: 0 3px 14px rgba(0, 0, 0, 0.32);
}

.wilayah-hero-visual > .wilayah-photo-placeholder {
    position: relative;
    z-index: 1;
    min-height: 620px;
    margin: 0;
    border-radius: 34px;
    background: linear-gradient(135deg, #e8f5ff, #f7fbff);
    color: var(--wilayah-primary);
    box-shadow: none;
}

.wilayah-photo-placeholder {
    min-height: 320px;
    border-radius: 34px;
    background: linear-gradient(135deg, #cceeff, #5bc0ff);
    display: grid;
    place-items: center;
    color: #ffffff;
    text-align: center;
    font-size: 18px;
    font-weight: 800;
}

.wilayah-photo-placeholder i {
    display: block;
    font-size: 48px;
    margin-bottom: 12px;
}

.wilayah-photo-placeholder span {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    opacity: 0.92;
}

/* ==========================================================================
   Map
   ========================================================================== */

.wilayah-map-panel {
    display: grid;
    grid-template-columns: 1fr 390px;
    gap: 28px;
    padding: 28px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--wilayah-soft), #ffffff);
    border: 1px solid var(--wilayah-border);
    box-shadow: var(--wilayah-card-shadow);
}

.wilayah-map-left h2,
.wilayah-gallery-head h2,
.wilayah-closing-card h2 {
    margin: 0;
    color: var(--wilayah-navy);
    font-weight: 900;
}

.wilayah-map-left h2 i,
.wilayah-gallery-head h2 i {
    color: #169bf2;
    margin-right: 8px;
}

.wilayah-map-left p {
    color: #3d5068;
    margin-bottom: 22px;
    line-height: 1.65;
}

.wilayah-map-placeholder {
    position: relative;
    min-height: 285px;
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(0, 114, 206, 0.08), rgba(255, 255, 255, 0.3)),
        repeating-linear-gradient(35deg, transparent 0 22px, rgba(0, 114, 206, 0.045) 23px 24px);
    display: grid;
    place-items: center;
    color: #7b98b7;
    font-weight: 800;
}

.wilayah-pin {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: var(--wilayah-primary);
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0, 114, 206, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wilayah-pin:hover,
.wilayah-pin:focus {
    transform: rotate(-45deg) scale(1.08);
    box-shadow: 0 10px 22px rgba(0, 114, 206, 0.32);
    outline: none;
}

.wilayah-pin::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    top: 8px;
    left: 8px;
    border-radius: 50%;
    background: #ffffff;
}

.wilayah-pin-papua {
    right: 12%;
    top: 38%;
}

.wilayah-pin-ntt-1,
.wilayah-pin-ntt-2 {
    background: #15965a;
}

.wilayah-pin-ntt-1 {
    left: 43%;
    bottom: 22%;
}

.wilayah-pin-ntt-2 {
    left: 52%;
    bottom: 25%;
}

.wilayah-map-legend {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(12, 47, 89, 0.06);
}

.wilayah-map-legend div {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 8px;
    align-items: center;
}

.wilayah-map-legend strong {
    color: var(--wilayah-navy);
    font-size: 14px;
}

.wilayah-map-legend small {
    grid-column: 2;
    color: #64758a;
    font-size: 12px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.blue {
    background: var(--wilayah-primary);
}

.dot.green {
    background: #15965a;
}

.dot.purple {
    background: #8b5cf6;
}

.wilayah-map-info {
    padding: 24px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid #dbeaff;
    box-shadow: 0 12px 30px rgba(12, 47, 89, 0.08);
}

.wilayah-illustration {
    height: 112px;
    border-radius: 18px;
    background: linear-gradient(135deg, #cdeeff, #80cffb);
    margin-bottom: 22px;
}

.wilayah-map-info h3 {
    margin: 0 0 10px;
    color: var(--wilayah-navy);
    font-size: 22px;
}

.wilayah-map-info p {
    color: var(--wilayah-muted);
    line-height: 1.6;
}

.wilayah-benefit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 22px;
}

.wilayah-benefit-grid div {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: #334963;
    font-size: 13px;
    line-height: 1.45;
}

.wilayah-benefit-grid i {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    color: var(--wilayah-primary);
    background: #e8f5ff;
}

/* ==========================================================================
   Detail
   ========================================================================== */

.wilayah-detail-section {
    padding-top: 18px;
}

.wilayah-detail-card {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 24px;
    padding: 34px;
    border-radius: 30px;
    border: 1px solid #cfe6ff;
    background: linear-gradient(135deg, #f4fbff, #ffffff);
    margin-bottom: 28px;
    align-items: start;
    box-shadow: var(--wilayah-card-shadow);
}

.wilayah-detail-green {
    border-color: #bfe8cd;
    background: linear-gradient(135deg, #f2fff7, #ffffff);
}

.wilayah-number {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #168de2;
    color: #ffffff;
    font-weight: 900;
    font-size: 15px;
}

.wilayah-detail-green .wilayah-number {
    background: #15965a;
}

.wilayah-number.purple {
    background: #8b5cf6;
}

.wilayah-detail-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px 24px;
}

.wilayah-detail-copy h3,
.wilayah-detail-copy > strong,
.wilayah-detail-copy > p {
    grid-column: 1;
}

.wilayah-detail-copy h3 {
    margin: 0 0 6px;
    color: var(--wilayah-navy);
    font-size: clamp(26px, 3vw, 32px);
    line-height: 1.15;
}

.wilayah-detail-green .wilayah-detail-copy h3 {
    color: #14723a;
}

.wilayah-detail-copy > strong {
    color: #21374f;
    font-size: 15px;
    font-weight: 700;
}

.wilayah-detail-copy > p {
    max-width: none;
    margin: 0;
    color: var(--wilayah-muted);
    line-height: 1.75;
    font-size: 15px;
}

.wilayah-stat-row {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: start;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    max-width: 440px;
    margin: 0;
}

.wilayah-stat-row div,
.wilayah-stat-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: auto;
    padding: 9px 12px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #d8ebff;
    box-shadow: 0 4px 14px rgba(12, 47, 89, 0.04);
}

.wilayah-detail-green .wilayah-stat-item {
    border-color: #ccefd9;
}

.wilayah-stat-row i {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    font-size: 13px;
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    color: var(--wilayah-primary);
    background: #e8f5ff;
}

.wilayah-detail-green .wilayah-stat-row i {
    color: #15965a;
    background: #e8f8ef;
}

.wilayah-stat-row strong,
.wilayah-stat-row b {
    margin: 0;
    color: var(--wilayah-navy);
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    font-weight: 800;
}

.wilayah-stat-row span {
    display: none;
}

.wilayah-stat-row b {
    display: inline;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #15803d;
}

.wilayah-stat-item.stat-period strong {
    white-space: normal;
    max-width: 160px;
    line-height: 1.25;
}

.wilayah-photo-grid {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 360px 120px;
    gap: 12px;
    height: auto;
    margin-top: 24px;
}

.wilayah-photo-main,
.wilayah-photo-small {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, #cfeeff, #7ecbff);
}

.wilayah-detail-green .wilayah-photo-main,
.wilayah-detail-green .wilayah-photo-small {
    background: linear-gradient(135deg, #d9fbe5, #9ce2b7);
}

.wilayah-photo-main {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 360px;
}

.wilayah-photo-small {
    grid-row: 2;
    min-height: 120px;
}

.wilayah-photo-grid img,
.wilayah-photo-cover {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wilayah-photo-grid .wilayah-photo-placeholder,
.wilayah-photo-grid .wilayah-photo-empty {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: 120px;
    color: #2775aa;
    font-weight: 800;
    font-size: 12px;
    text-align: center;
    padding: 10px;
    border-radius: 20px;
    box-shadow: none;
    background: linear-gradient(135deg, #cfeeff, #7ecbff);
}

.wilayah-photo-main .wilayah-photo-placeholder,
.wilayah-photo-main .wilayah-photo-empty {
    min-height: 360px;
}

.wilayah-detail-green .wilayah-photo-grid .wilayah-photo-placeholder,
.wilayah-detail-green .wilayah-photo-grid .wilayah-photo-empty {
    color: #14723a;
    background: linear-gradient(135deg, #d9fbe5, #9ce2b7);
}

.wilayah-photo-empty i {
    display: block;
    font-size: 22px;
    margin-bottom: 6px;
}

.wilayah-next-card {
    display: grid;
    grid-template-columns: 46px 1fr 520px;
    gap: 22px;
    align-items: center;
    min-height: 120px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid #dfd2ff;
    background: linear-gradient(135deg, #fbf7ff, #ffffff);
    box-shadow: var(--wilayah-card-shadow);
}

.wilayah-next-card h3 {
    margin: 0 0 8px;
    color: #6d28d9;
    font-size: 24px;
}

.wilayah-next-card p {
    color: var(--wilayah-muted);
    line-height: 1.6;
}

.wilayah-next-illustration {
    height: 96px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f0e7ff, #d8c7ff);
}

/* ==========================================================================
   Gallery
   ========================================================================== */

.wilayah-gallery-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.wilayah-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.wilayah-gallery-item {
    margin: 0;
    overflow: hidden;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid var(--wilayah-border);
    box-shadow: var(--wilayah-card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.wilayah-gallery-item:hover {
    transform: translateY(-3px);
    border-color: #b8d4f0;
    box-shadow: 0 16px 32px rgba(12, 47, 89, 0.1);
}

.wilayah-gallery img {
    display: block;
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.wilayah-gallery figcaption {
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--wilayah-muted);
}

/* ==========================================================================
   Closing
   ========================================================================== */

.wilayah-closing {
    padding: 20px 0 70px;
    background: #ffffff;
}

.wilayah-closing-card {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 28px;
    align-items: center;
    padding: 30px;
    border-radius: 24px;
    background: linear-gradient(135deg, #e7f6ff, #f8fcff);
    box-shadow: var(--wilayah-card-shadow);
}

.wilayah-closing-icon {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--wilayah-primary);
    color: #ffffff;
    font-size: 38px;
}

.wilayah-closing-card p {
    max-width: 820px;
    color: var(--wilayah-muted);
    line-height: 1.7;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {

    .wilayah-hero-grid,
    .wilayah-map-panel,
    .wilayah-next-card {
        grid-template-columns: 1fr;
    }

    .wilayah-hero-photo,
    .wilayah-hero-visual > .wilayah-photo-placeholder {
        height: 480px;
        min-height: 480px;
    }

    .wilayah-hero-visual::after {
        right: -28px;
        bottom: -28px;
        width: 140px;
        height: 140px;
    }

    .wilayah-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .wilayah-map-legend {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .wilayah-detail-card {
        grid-template-columns: 48px minmax(0, 1fr);
        padding: 26px;
        height: auto;
        min-height: 0;
        gap: 14px 12px;
    }

    .wilayah-detail-card .wilayah-number {
        margin-bottom: 0;
    }

    .wilayah-detail-copy {
        grid-template-columns: 1fr;
        gap: 14px;
        min-width: 0;
    }

    .wilayah-stat-row {
        grid-column: 1;
        grid-row: auto;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
        max-width: none;
        width: 100%;
        gap: 10px;
    }

    .wilayah-stat-row .wilayah-stat-item {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .wilayah-photo-grid {
        grid-column: 1 / -1;
        width: 100%;
        margin-top: 8px;
        gap: 10px;
        height: auto;
        min-height: 0;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: none;
        grid-auto-rows: auto;
    }

    .wilayah-photo-main {
        grid-column: 1 / -1;
        grid-row: auto;
        width: 100%;
        min-height: 0;
        height: auto;
        aspect-ratio: 16 / 10;
    }

    .wilayah-photo-small {
        grid-row: auto;
        width: 100%;
        min-height: 0;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .wilayah-photo-grid .wilayah-photo-placeholder,
    .wilayah-photo-grid .wilayah-photo-empty,
    .wilayah-photo-main .wilayah-photo-placeholder,
    .wilayah-photo-main .wilayah-photo-empty {
        min-height: 0;
        height: 100%;
    }
}

@media (max-width: 767.98px) {
    body.ape-wilayah-page {
        max-width: 100%;
        overflow-x: hidden;
    }

    body.ape-wilayah-page #mainNav .container-fluid {
        width: 100%;
        max-width: 100%;
        padding-left: max(16px, env(safe-area-inset-left, 0px));
        padding-right: max(16px, env(safe-area-inset-right, 0px));
        box-sizing: border-box;
    }

    body.ape-wilayah-page #mainNav .navbar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 72px;
        margin: 0;
    }

    body.ape-wilayah-page #mainNav .navbar-brand {
        float: none;
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 64px);
        padding: 8px 12px 8px 0;
        font-size: 14px;
        line-height: 1.3;
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }

    body.ape-wilayah-page #mainNav .navbar-toggle {
        float: none;
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-width: 44px;
        min-height: 44px;
        margin: 0;
        padding: 10px 12px;
        border-radius: 10px;
    }

    .wilayah-detail-card {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 0;
        margin-bottom: 20px;
        padding: 22px 20px 24px;
        border-radius: 26px;
        gap: 12px 10px;
        box-sizing: border-box;
        align-items: start;
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .wilayah-detail-card .wilayah-number {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        font-size: 15px;
        margin-bottom: 0;
    }

    .wilayah-detail-copy {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        min-width: 0;
    }

    .wilayah-detail-copy h3,
    .wilayah-detail-copy > strong,
    .wilayah-detail-copy > p,
    .wilayah-detail-copy .wilayah-stat-row {
        grid-column: auto;
    }

    .wilayah-detail-copy h3 {
        margin: 0 0 12px;
        font-size: clamp(28px, 8vw, 32px);
        line-height: 1.15;
    }

    .wilayah-detail-copy > strong {
        display: block;
        margin: 0 0 16px;
        font-size: 15px;
        line-height: 1.4;
    }

    .wilayah-detail-copy > p {
        margin: 0 0 20px;
        font-size: 15px;
        line-height: 1.6;
        max-width: none;
    }

    .wilayah-stat-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
        max-width: none;
        margin: 0 0 24px;
        justify-content: stretch;
    }

    .wilayah-stat-row .wilayah-stat-item {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        min-width: 0;
        min-height: 44px;
        padding: 10px 12px;
        border-radius: 14px;
        box-sizing: border-box;
    }

    .wilayah-stat-row strong,
    .wilayah-stat-row b {
        white-space: normal;
        font-size: 13px;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .wilayah-stat-item.stat-period strong {
        max-width: none;
    }

    .wilayah-stat-row b {
        color: #15803d;
    }

    .wilayah-photo-grid {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: none;
        grid-auto-rows: auto;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 0;
        margin-top: 0;
        margin-bottom: 0;
        box-sizing: border-box;
    }

    .wilayah-photo-main,
    .wilayah-photo-small {
        position: relative;
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 0;
        border-radius: 16px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .wilayah-photo-main {
        grid-column: 1 / -1;
        grid-row: auto;
        aspect-ratio: 16 / 10;
    }

    .wilayah-photo-small {
        grid-row: auto;
        aspect-ratio: 1 / 1;
    }

    .wilayah-photo-grid img,
    .wilayah-photo-cover {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .wilayah-photo-grid .wilayah-photo-placeholder,
    .wilayah-photo-grid .wilayah-photo-empty,
    .wilayah-photo-main .wilayah-photo-placeholder,
    .wilayah-photo-main .wilayah-photo-empty {
        width: 100%;
        height: 100%;
        min-height: 0;
        border-radius: 16px;
    }

    .wilayah-next-card {
        grid-template-columns: 48px 1fr;
        min-height: 0;
        height: auto;
        padding: 20px;
        border-radius: 24px;
    }

    .wilayah-next-card .wilayah-next-illustration {
        display: none;
    }
}

@media (max-width: 359.98px) {
    .wilayah-stat-row {
        grid-template-columns: 1fr;
    }

    .wilayah-detail-card {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .wilayah-photo-grid {
        grid-column: 1;
    }
}

@media (max-width: 640px) {
    .wilayah-container {
        width: min(100% - 28px, 1180px);
    }

    .wilayah-hero {
        padding-top: calc(var(--ape-nav-height, 72px) + 40px);
        padding-bottom: 56px;
    }

    .wilayah-hero-visual {
        padding: 16px;
        border-radius: 32px;
    }

    .wilayah-hero-visual::before {
        left: -18px;
        top: -18px;
        width: 88px;
        height: 88px;
    }

    .wilayah-hero-visual::after {
        right: -16px;
        bottom: -16px;
        width: 110px;
        height: 110px;
    }

    .wilayah-hero-photo,
    .wilayah-hero-visual > .wilayah-photo-placeholder {
        height: 320px;
        min-height: 320px;
        border-radius: 24px;
    }

    .wilayah-hero-photo figcaption {
        left: 18px;
        right: 18px;
        bottom: 16px;
        font-size: 12px;
    }

    .wilayah-hero-actions {
        flex-direction: column;
    }

    .wilayah-hero-actions .wilayah-btn {
        width: 100%;
    }

    .wilayah-map-panel {
        padding: 18px;
    }

    .wilayah-map-legend,
    .wilayah-benefit-grid,
    .wilayah-gallery,
    .wilayah-closing-card {
        grid-template-columns: 1fr;
    }

    .wilayah-gallery-head {
        align-items: flex-start;
        flex-direction: column;
    }

}

