/* ============================================ */
/* GALLERY PAGE — Uniform grid + lightbox        */
/* ============================================ */

.gallery-page {
    padding: 140px 20px 80px;
    background: #f5f4f4;
    min-height: 100vh;
}

.gallery-header {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-subtitle {
    color: #666;
    font-size: 1.05rem;
    margin-top: 1rem;
    line-height: 1.6;
}

/* ── Grid ───────────────────────────────────── */
.gallery-grid {
    display: grid;
    grid-gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    max-width: 1400px;
    margin: 0 auto;
}

/* ── Card (thumbnails, cropped) ─────────────── */
.gallery-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: #222;
    cursor: pointer;
    box-shadow: -2px 2px 10px rgba(68, 68, 68, 0.15);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: -2px 4px 20px rgba(68, 68, 68, 0.3);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;      /* Cropped, uniform grid */
    display: block;
    transition: transform 0.4s ease-in-out;
}

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

/* Caption overlay */
.gallery-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 45%);
    pointer-events: none;
    z-index: 1;
}

.gallery-item-details {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 15px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gallery-item-details strong {
    font-size: 1rem;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.gallery-item-details span {
    font-size: 0.85rem;
    opacity: 0.95;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* ── Empty state ────────────────────────────── */
.gallery-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #999;
    font-size: 1.1rem;
}

/* ============================================ */
/* LIGHTBOX                                     */
/* ============================================ */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.94);
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: lbFadeIn 0.25s ease;
}

.lightbox.active {
    display: flex;
}

@keyframes lbFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-inner {
    position: relative;
    max-width: 95vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

/* The image: natural aspect ratio, no crop, no distortion */
.lightbox-img {
    max-width: 95vw;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
    color: #fff;
    text-align: center;
    max-width: 700px;
    padding: 0 1rem;
}

.lightbox-caption strong {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.lightbox-caption span {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Close button */
.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* Prev / Next arrows */
.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.lightbox-arrow:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

/* Counter */
.lightbox-counter {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
}

/* ── Mobile ─────────────────────────────────── */
@media (max-width: 768px) {
    .gallery-page {
        padding: 100px 15px 60px;
    }
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        grid-gap: 12px;
    }
    .gallery-item-details {
        padding: 10px;
    }
    .gallery-item-details strong {
        font-size: 0.85rem;
    }
    .gallery-item-details span {
        font-size: 0.72rem;
    }

    .lightbox {
        padding: 1rem;
    }
    .lightbox-img {
        max-width: 100vw;
        max-height: 75vh;
    }
    .lightbox-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
    .lightbox-arrow {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }
    .lightbox-prev { left: 0.5rem; }
    .lightbox-next { right: 0.5rem; }
}