﻿.gallery-page {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

.gallery-header {
    text-align: center;
    margin-bottom: 30px;
}

    .gallery-header h1 {
        margin-bottom: 10px;
    }

    .gallery-header p {
        margin: 0;
        opacity: 0.8;
    }


/* =========================
   GALLERY GRID
   ========================= */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax(220px, 1fr) );
    gap: 18px;
    width: 100%;
}


/* =========================
   INDIVIDUAL IMAGE
   ========================= */

.gallery-item {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: visible;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 1;
}

    .gallery-item img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
        border-radius: 8px;
        transition: transform 0.2s ease, filter 0.2s ease;
    }


    /* =========================
   HOVER EFFECT
   ========================= */

    .gallery-item:hover {
        transform: scale(1.05);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
        z-index: 10;
    }

        .gallery-item:hover img {
            filter: brightness(1.05);
        }


/* =========================
   LOADING
   ========================= */

.gallery-loading {
    text-align: center;
    padding: 40px;
    font-size: 1.1rem;
}

.gallery-empty {
    text-align: center;
    padding: 50px;
    opacity: 0.7;
}


/* =========================
   PAGINATION
   ========================= */

.gallery-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 35px;
    flex-wrap: wrap;
}

.gallery-page-button {
    border: none;
    background: #5b263f;
    color: white;
    padding: 8px 14px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

    .gallery-page-button:hover {
        background: #5b263f;
        transform: translateY(-1px);
    }

    .gallery-page-button.active {
        background: #385027;
    }

    .gallery-page-button:disabled {
        opacity: 0.4;
        cursor: not-allowed;
        transform: none;
    }


/* =========================
   LIGHTBOX
   ========================= */

.gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    padding: 40px;
}

    .gallery-lightbox.active {
        display: flex;
    }

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}


/* =========================
   LIGHTBOX BUTTONS
   ========================= */

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: white;
    font-size: 42px;
    cursor: pointer;
    z-index: 10001;
}

.lightbox-navigation {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 35px;
    width: 55px;
    height: 70px;
    cursor: pointer;
    border-radius: 5px;
    z-index: 10001;
    transition: background 0.2s ease;
}

    .lightbox-navigation:hover {
        background: rgba(0, 0, 0, 0.8);
    }

.lightbox-previous {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}


/* =========================
   MOBILE
   ========================= */

@media (max-width: 768px) {

    .gallery-page {
        padding: 20px 12px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .gallery-item:hover {
        transform: scale(1.02);
    }

    .gallery-lightbox {
        padding: 20px;
    }

    .lightbox-navigation {
        width: 45px;
        height: 55px;
        font-size: 25px;
    }

    .lightbox-previous {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }
}


/* =========================
   VERY SMALL PHONES
   ========================= */

@media (max-width: 400px) {

    .gallery-grid {
        gap: 8px;
    }

    .gallery-item {
        aspect-ratio: 1 / 1;
    }
}
