/* css/gallery.css - Masonry Grid, Filter Tabs & Luxury Lightbox */

/* ─── 1. Page Section ─── */
.gallery-page-section {
    padding: 60px 0 100px;
    background-color: #f4f7f5;
    min-height: 60vh;
}

.home-container {
    max-width: 1400px;
    width: 92%;
    margin: 0 auto;
}

/* ─── 2. Category Filter Tabs ─── */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 45px;
    flex-wrap: wrap;
}

.gallery-filter-btn {
    padding: 10px 22px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 50px;
    border: 1.5px solid #d0ddd7;
    background: #ffffff;
    color: #3d5c4a;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.gallery-filter-btn:hover {
    border-color: #0f7b4d;
    color: #0f7b4d;
    background: #f0faf5;
}

.gallery-filter-btn.active {
    background: #0f7b4d;
    border-color: #0f7b4d;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(15, 123, 77, 0.25);
}

/* ─── 3. Masonry / CSS Grid ─── */
.gallery-masonry {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    width: 100%;
}

@media (max-width: 1200px) {
    .gallery-masonry {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-masonry {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .gallery-masonry {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ─── 4. Individual Gallery Item ─── */
.gallery-item {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    background: #e8eeeb;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    aspect-ratio: 4 / 3;
}

.gallery-item:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.14);
    transform: translateY(-3px);
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

/* ─── 5. Overlay on Hover ─── */
.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(7, 31, 20, 0.85) 0%, rgba(7, 31, 20, 0.2) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 18px 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    gap: 6px;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-category {
    font-size: 0.72rem;
    font-weight: 600;
    color: #5bbd85;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transform: translateY(8px);
    transition: transform 0.35s ease;
    font-family: 'Poppins', sans-serif;
}

.gallery-zoom-icon {
    font-size: 1.3rem;
    color: #ffffff;
    transform: translateY(8px);
    transition: transform 0.35s ease 0.05s;
}

.gallery-item:hover .gallery-item-category,
.gallery-item:hover .gallery-zoom-icon {
    transform: translateY(0);
}

/* ─── 6. Lightbox Overlay ─── */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(4, 11, 7, 0.96);
    z-index: 9000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.lightbox-overlay.active {
    display: flex;
}

/* Close button */
.lightbox-close {
    position: absolute;
    top: 24px;
    right: 28px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 9010;
}

.lightbox-close:hover {
    background: #0f7b4d;
    border-color: #0f7b4d;
    transform: rotate(90deg);
}

/* Prev / Next buttons */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 9010;
}

.lightbox-prev { left: 30px; }
.lightbox-next { right: 30px; }

.lightbox-prev:hover,
.lightbox-next:hover {
    background: #0f7b4d;
    border-color: #0f7b4d;
    transform: translateY(-50%) scale(1.08);
}

/* Image wrapper */
.lightbox-content {
    max-width: 82vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 9005;
}

#lightbox-img {
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    animation: lbZoomIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.lightbox-caption {
    color: #5bbd85;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Poppins', sans-serif;
}

.lightbox-counter {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.78rem;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 1px;
}

@keyframes lbZoomIn {
    from { transform: scale(0.93); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

/* Mobile lightbox adjustments */
@media (max-width: 768px) {
    .lightbox-prev { left: 12px; }
    .lightbox-next { right: 12px; }
    .lightbox-content { max-width: 90vw; }
    #lightbox-img { max-height: 65vh; }
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
}
