/* ===============================
   GALLERY BASE
================================ */

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

/* ===== STICKY FOOTER FIX ===== */
/* Pastikan body mengisi full viewport height */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Main content mengisi sisa ruang antara navbar dan footer */
#page {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Gallery wrapper mengisi sisa ruang di dalam #page */
.gallery-wrapper {
    flex: 1;
}

/* ===== NAVBAR & FOOTER FULL WIDTH ===== */
nav.topnav,
footer {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    flex-shrink: 0;
}

/* ===============================
   GALLERY WRAPPER
================================ */
.gallery-wrapper {
    font-family: 'Cormorant Garamond', serif;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 60px 24px 40px;
    box-sizing: border-box;
}

.gallery-title {
    text-align: center;
    font-size: 42px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 12px;
}

.gallery-subtitle {
    text-align: center;
    font-size: 16px;
    color: #777;
    margin-bottom: 40px;
}

/* ===============================
   MASONRY
================================ */
.gallery-masonry {
    column-count: 4;
    column-gap: 24px;
}

/* ===============================
   GALLERY ITEM
================================ */
.gallery-item {
    break-inside: avoid;
    margin-bottom: 24px;
    border-radius: 22px;
    overflow: hidden;
    background: #f5f5f5;
    cursor: pointer;
    position: relative;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .4s, transform .4s, box-shadow .3s;
}

.gallery-item.show {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 45px rgba(0,0,0,.18);
}

.gallery-item::after {
    content: '⌕';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    background: rgba(0,0,0,.35);
    color: #fff;
    opacity: 0;
    transition: opacity .3s;
}

.gallery-item.video::after {
    content: '▶';
    font-size: 48px;
}

.gallery-item:hover::after {
    opacity: 1;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    display: block;
    object-fit: cover;
}

/* ===============================
   LIGHTBOX
================================ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.lightbox.active {
    display: flex;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 18px;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 32px;
    color: #fff;
    cursor: pointer;
    z-index: 10000;
    background: rgba(0,0,0,0.5);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .3s ease;
}

.lightbox-close:hover {
    background: rgba(0,0,0,0.8);
}

/* ========================================
   RESPONSIVE — 1024px
======================================== */
@media (max-width: 1200px) {
    .gallery-masonry {
        column-count: 3;
    }
}

@media (max-width: 1024px) {
    .gallery-masonry {
        column-count: 3;
        column-gap: 18px;
    }

    .gallery-wrapper {
        padding: 50px 18px 30px;
    }

    .gallery-title {
        font-size: 36px;
    }

    .gallery-subtitle {
        font-size: 14px;
        margin-bottom: 30px;
    }
}

/* ========================================
   RESPONSIVE — 768px
======================================== */
@media (max-width: 768px) {
    .gallery-wrapper {
        padding: 40px 16px 25px;
    }

    .gallery-masonry {
        column-count: 2;
        column-gap: 14px;
    }

    .gallery-title {
        font-size: 28px;
        margin-bottom: 8px;
    }

    .gallery-subtitle {
        font-size: 13px;
        margin-bottom: 24px;
    }

    .gallery-item {
        margin-bottom: 14px;
        border-radius: 16px;
    }

    .gallery-item::after {
        font-size: 28px;
    }

    .gallery-item.video::after {
        font-size: 40px;
    }

    .lightbox-content img,
    .lightbox-content video {
        max-width: 95vw;
        max-height: 80vh;
    }

    .lightbox-close {
        top: 16px;
        right: 16px;
        font-size: 24px;
        width: 40px;
        height: 40px;
    }
}

/* ========================================
   RESPONSIVE — 600px
======================================== */
@media (max-width: 600px) {
    .gallery-wrapper {
        padding: 30px 12px 20px;
    }

    .gallery-masonry {
        column-count: 2;
        column-gap: 10px;
    }

    .gallery-title {
        font-size: 22px;
        margin-bottom: 6px;
        font-weight: 600;
    }

    .gallery-subtitle {
        font-size: 12px;
        margin-bottom: 18px;
    }

    .gallery-item {
        margin-bottom: 10px;
        border-radius: 12px;
    }

    .gallery-item::after {
        font-size: 24px;
    }

    .gallery-item.video::after {
        font-size: 32px;
    }

    .lightbox-content img,
    .lightbox-content video {
        max-width: 98vw;
        max-height: 85vh;
        border-radius: 12px;
    }

    .lightbox-close {
        font-size: 20px;
        width: 36px;
        height: 36px;
        top: 12px;
        right: 12px;
    }
}

/* ========================================
   RESPONSIVE — 480px
======================================== */
@media (max-width: 480px) {
    .gallery-wrapper {
        padding: 24px 10px 18px;
    }

    .gallery-masonry {
        column-count: 1;
        column-gap: 0;
    }

    .gallery-title {
        font-size: 18px;
    }

    .gallery-subtitle {
        font-size: 11px;
        margin-bottom: 14px;
    }

    .gallery-item {
        margin-bottom: 8px;
        border-radius: 10px;
    }

    .gallery-item::after {
        font-size: 20px;
    }

    .gallery-item.video::after {
        font-size: 28px;
    }

    .lightbox-close {
        font-size: 18px;
        width: 34px;
        height: 34px;
        top: 10px;
        right: 10px;
    }
}

/* ========================================
   RESPONSIVE — 360px
======================================== */
@media (max-width: 360px) {
    .gallery-wrapper {
        padding: 18px 8px 14px;
    }

    .gallery-title {
        font-size: 16px;
    }

    .gallery-subtitle {
        font-size: 10px;
    }

    .gallery-item {
        margin-bottom: 6px;
        border-radius: 8px;
    }
}