/* ==============================
   Gallery Section — Photo Grid
   ============================== */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.gallery-item {
    overflow: hidden;
    border-radius: 8px;
    height: 190px;
    cursor: pointer;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.gallery-item:hover img {
    transform: scale(1.04);
}

/* ==============================
   Gallery Lightbox — Fullscreen Viewer
   ============================== */

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    -webkit-user-select: none;
    user-select: none;
}

.gallery-lightbox.is-active {
    display: flex;
}

/* Backdrop */
.gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 1);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.gallery-lightbox.is-visible .gallery-lightbox__backdrop {
    opacity: 1;
}

/* Close Button */
.gallery-lightbox__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.35s ease 0.15s, transform 0.35s ease 0.15s, background 0.2s ease;
    line-height: 1;
}

.gallery-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.18);
}

.gallery-lightbox.is-visible .gallery-lightbox__close {
    opacity: 1;
    transform: translateY(0);
}

/* Counter */
.gallery-lightbox__counter {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    z-index: 10;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-en, 'Playfair Display', serif);
    font-size: 13px;
    letter-spacing: 3px;
    opacity: 0;
    transition: opacity 0.35s ease 0.2s, transform 0.35s ease 0.2s;
}

.gallery-lightbox.is-visible .gallery-lightbox__counter {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Stage (image area) */
.gallery-lightbox__stage {
    position: relative;
    z-index: 5;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

/* Image Container */
.gallery-lightbox__img-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 60px 12px;
}

.gallery-lightbox__img-container.is-loading::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: gallery-spin 0.7s linear infinite;
}

@keyframes gallery-spin {
    to { transform: rotate(360deg); }
}

/* Image */
.gallery-lightbox__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    will-change: transform;
    transform-origin: center center;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.35s ease 0.1s, transform 0.35s ease 0.1s;
    cursor: default;
}

.gallery-lightbox.is-visible .gallery-lightbox__img {
    opacity: 1;
    transform: scale(1);
}

/* Navigation Arrows */
.gallery-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.35s ease 0.25s, background 0.2s ease;
}

.gallery-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.15);
}

.gallery-lightbox.is-visible .gallery-lightbox__nav {
    opacity: 1;
}

.gallery-lightbox__nav--prev {
    left: 10px;
}

.gallery-lightbox__nav--next {
    right: 10px;
}

/* Zoom Indicator */
.gallery-lightbox__zoom-indicator {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.85);
    font-family: var(--font-en, 'Playfair Display', serif);
    font-size: 12px;
    letter-spacing: 1px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-lightbox__zoom-indicator.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.gallery-lightbox__zoom-indicator svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

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

@media (max-width: 440px) {
    .gallery-lightbox__nav {
        width: 34px;
        height: 34px;
    }

    .gallery-lightbox__nav--prev {
        left: 6px;
    }

    .gallery-lightbox__nav--next {
        right: 6px;
    }

    .gallery-lightbox__nav svg {
        width: 18px;
        height: 18px;
    }

    .gallery-lightbox__img-container {
        padding: 55px 6px;
    }
}
