
/* =========================================================
   HaDeIn Gallery — COMPACT VERSION
   Cocok dengan class galeri di index.php
========================================================= */

.gallery-section {
    padding-top: 24px !important;
    padding-bottom: 24px !important;
    overflow: hidden;
}

.gallery-section .container {
    min-width: 0;
}

/* Header galeri */
.gallery-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.gallery-heading h2 {
    margin: 4px 0 6px;
    font-size: clamp(20px, 2vw, 26px);
    line-height: 1.25;
}

.gallery-heading p {
    max-width: 480px;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

/* Tombol slider */
.gallery-controls {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
}

.gallery-arrow {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(11, 143, 132, .35);
    border-radius: 50%;
    background: rgba(11, 143, 132, .08);
    color: inherit;
    font-size: 16px;
    cursor: pointer;
}

/* Layout utama: foto utama + slider */
.gallery-layout {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    width: 100%;
    min-width: 0;
}

/* Hilangkan kemungkinan ukuran minimum bawaan */
.gallery-feature,
.gallery-side,
.gallery-card {
    min-width: 0;
    width: 100%;
}

/* Foto utama */
.gallery-feature .gallery-image-link {
    position: relative;
    display: block;
    width: 100%;
    height: 125px;
    overflow: hidden;
    border-radius: 9px;
    background: rgba(127, 170, 170, .08);
}

/* Foto kartu slider */
.gallery-card .gallery-image-link {
    position: relative;
    display: block;
    width: 100%;
    height: 90px;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(127, 170, 170, .08);
}

/* Gambar mengikuti kotak, tanpa memperbesar elemen */
.gallery-image-link img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    margin: 0;
    object-fit: cover;
    object-position: center;
}

/* Label foto */
.gallery-view-label {
    position: absolute;
    right: 6px;
    bottom: 6px;
    padding: 4px 6px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 4px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 8px;
    line-height: 1.2;
    letter-spacing: .04em;
}

/* Judul dan deskripsi */
.gallery-caption {
    padding: 7px 1px 0;
}

.gallery-kicker {
    display: block;
    font-size: 9px;
    letter-spacing: .08em;
}

.gallery-caption h3 {
    margin: 3px 0;
    font-size: 12px;
    line-height: 1.35;
}

.gallery-caption p {
    margin: 3px 0 0;
    font-size: 10px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

/* Slider kartu horizontal */
.gallery-slider {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 145px);
    grid-auto-columns: 145px;
    gap: 9px;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 5px;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(11, 143, 132, .4) transparent;
}

.gallery-card {
    overflow: hidden;
    scroll-snap-align: start;
}

.gallery-slider-note {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    font-size: 8px;
    letter-spacing: .04em;
    opacity: .7;
}

/* Tablet dan HP */
@media (max-width: 700px) {
    .gallery-section {
        padding-top: 18px !important;
        padding-bottom: 18px !important;
    }

    .gallery-heading {
        gap: 8px;
        margin-bottom: 10px;
    }

    .gallery-heading h2 {
        font-size: 20px;
    }

    .gallery-heading p {
        font-size: 11px;
    }

    .gallery-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .gallery-feature .gallery-image-link {
        height: 145px;
    }

    .gallery-slider {
        grid-auto-columns: 125px;
        gap: 8px;
    }

    .gallery-card .gallery-image-link {
        height: 78px;
    }
}

/* HP kecil */
@media (max-width: 380px) {
    .gallery-feature .gallery-image-link {
        height: 120px;
    }

    .gallery-slider {
        grid-auto-columns: 108px;
    }

    .gallery-card .gallery-image-link {
        height: 68px;
    }

    .gallery-caption h3 {
        font-size: 11px;
    }
}

/* Aksesibilitas */
@media (prefers-reduced-motion: reduce) {
    .gallery-slider {
        scroll-behavior: auto;
    }
}



/* =========================================================
   FIX GALERI HaDeIn — FOTO UTUH & SLIDER LEBIH BESAR
========================================================= */

/* Foto utama: lebih tinggi dan tampil utuh */
.gallery-feature .gallery-image-link {
    height: 220px !important;
    aspect-ratio: auto !important;
    background: rgba(127, 170, 170, .08);
}

.gallery-feature .gallery-image-link img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
}

/* Foto slider: kartu diperbesar */
.gallery-slider {
    grid-auto-columns: 180px !important;
    gap: 12px !important;
}

.gallery-card .gallery-image-link {
    height: 130px !important;
    aspect-ratio: auto !important;
}

.gallery-card .gallery-image-link img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
}

/* Caption tetap ringkas dan rapi */
.gallery-caption h3 {
    font-size: 12px;
    line-height: 1.4;
}

.gallery-caption p {
    font-size: 11px;
    line-height: 1.5;
}

/* HP */
@media (max-width: 700px) {
    .gallery-feature .gallery-image-link {
        height: 190px !important;
    }

    .gallery-slider {
        grid-auto-columns: 155px !important;
    }

    .gallery-card .gallery-image-link {
        height: 110px !important;
    }
}

@media (max-width: 380px) {
    .gallery-feature .gallery-image-link {
        height: 165px !important;
    }

    .gallery-slider {
        grid-auto-columns: 140px !important;
    }

    .gallery-card .gallery-image-link {
        height: 100px !important;
    }
}



/* =========================================================
   HaDeIn Gallery — NATURAL PHOTO RATIO
========================================================= */

/* Foto utama */
.gallery-feature .gallery-image-link {
    display: block;
    width: 100%;
    height: auto !important;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 12px;
    background: transparent;
}

.gallery-feature .gallery-image-link img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    object-position: center;
}

/* Slider: kartu lebih besar dan nyaman dilihat */
.gallery-slider {
    grid-auto-columns: 180px !important;
    gap: 12px !important;
}

.gallery-card .gallery-image-link {
    display: block;
    width: 100%;
    height: auto !important;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 10px;
    background: transparent;
}

.gallery-card .gallery-image-link img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    object-position: center;
}

/* HP */
@media (max-width: 700px) {
    .gallery-slider {
        grid-auto-columns: 155px !important;
    }
}




/* =========================================================
   HADEIN — COMPACT HORIZONTAL GALLERY
   Override tampilan galeri lama
========================================================= */

.gallery-section {
    overflow: hidden;
}

.gallery-section .gallery-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.gallery-section .gallery-heading-text {
    min-width: 0;
}

.gallery-section .gallery-heading h2 {
    margin: 8px 0;
}

.gallery-section .gallery-heading p {
    margin: 0;
    max-width: 560px;
}

/* Slider horizontal */
.gallery-section .gallery-slider {
    display: flex;
    gap: 14px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 3px 2px 12px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(11, 143, 132, .45) transparent;
}

/* Setiap kartu memiliki ukuran tetap */
.gallery-section .gallery-card {
    flex: 0 0 300px;
    width: 300px;
    min-width: 0;
    overflow: hidden;
    scroll-snap-align: start;
    border-radius: 12px;
    background: transparent;
}

/* Foto persegi, seluruh foto konsisten */
.gallery-section .gallery-image-link {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px;
    background: #e8efee;
    isolation: isolate;
}

.gallery-section .gallery-image-link img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform .25s ease;
}

/* Ikon kecil untuk membuka foto */
.gallery-section .gallery-view-label {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 8px;
    background: rgba(10, 25, 27, .72);
    color: #fff;
    font-size: 16px;
    opacity: .9;
}

@media (hover: hover) {
    .gallery-section .gallery-image-link:hover img {
        transform: scale(1.04);
    }
}

/* Judul singkat di bawah foto */
.gallery-section .gallery-caption {
    padding: 9px 2px 2px;
}

.gallery-section .gallery-caption h3 {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* Tombol panah */
.gallery-section .gallery-controls {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
}

.gallery-section .gallery-arrow {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(11, 143, 132, .3);
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.gallery-section .gallery-arrow:hover {
    background: #0b8f84;
    color: #fff;
}

.gallery-section .gallery-slider-note {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    color: var(--muted, #7b8988);
    font-size: 10px;
    letter-spacing: .07em;
}

/* Tablet */
@media (max-width: 768px) {
    .gallery-section .gallery-heading {
        align-items: center;
        gap: 12px;
    }

    .gallery-section .gallery-heading h2 {
        font-size: clamp(20px, 4vw, 26px);
    }

    .gallery-section .gallery-slider {
        gap: 11px;
    }

    .gallery-section .gallery-card {
        flex-basis: 145px;
        width: 145px;
    }
}

/* HP */
@media (max-width: 480px) {
    .gallery-section .gallery-card {
        flex-basis: 125px;
        width: 125px;
    }

    .gallery-section .gallery-image-link {
        border-radius: 10px;
    }

    .gallery-section .gallery-caption h3 {
        font-size: 12px;
    }

    .gallery-section .gallery-controls {
        gap: 5px;
    }

    .gallery-section .gallery-arrow {
        width: 32px;
        height: 32px;
        font-size: 17px;
    }

    .gallery-section .gallery-slider-note {
        font-size: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-section .gallery-slider {
        scroll-behavior: auto;
    }

    .gallery-section .gallery-image-link img {
        transition: none;
    }
}
