/* ============================================================ 
   GALLERY PAGE STYLES - SRBSGC
   A premium dark-themed showcase with enhanced pagination.
   ============================================================ */

/* 1. Global Page Settings */
body {
    background-color: var(--charcoal);
    color: var(--white);
}

/* 2. Gallery Section Layout */
.gallery-section {
    padding: 70px 0 100px 0;
    min-height: 80vh;
    background-color: var(--charcoal);
    position: relative;
}


/* 3. Section Header Styling */
.gallery-section .section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.gallery-section .section-header h1 {
    color: var(--white);
    font-size: 3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
    background: linear-gradient(to right, var(--white), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gallery-section .section-header p {
    color: var(--accent-gold);
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 1px;
}

/* 4. Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-bottom: 5rem;
    padding: 0 1rem;
    width: 100%;
}

/* Incremental Loading Logic */
.gallery-item.hidden-item {
    display: none; 
}

.gallery-item.visible-item {
    display: block;
}

/* 5. Gallery Item */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 3 / 2; /* Landscape orientation */
    width: 100%;
    background-color: var(--dark-gray);
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: skeleton-loading 1.2s linear infinite alternate;
}

@keyframes skeleton-loading {
    0% { background-color: var(--dark-gray); }
    100% { background-color: var(--gray); }
}

.gallery-item.loaded {
    animation: none;
    background-color: var(--charcoal);
}

.gallery-item:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(232, 165, 32, 0.2);
    border-color: var(--accent-gold);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

.gallery-item.loaded .gallery-image {
    opacity: 1;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(30, 39, 46, 0.9) 0%, rgba(10, 115, 119, 0.4) 100%);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s ease;
}

.gallery-overlay i {
    color: var(--accent-gold);
    font-size: 2.5rem;
    transform: scale(0.5);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

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

.gallery-item:hover .gallery-overlay i {
    transform: scale(1);
}

/* 6. Lightbox */
.lightbox {
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 39, 46, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 98%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.95);
    transform: scale(0.9);
    transition: transform 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    background: rgba(30, 39, 46, 0.85);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(232, 165, 32, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10001;
    backdrop-filter: blur(5px);
}

.lightbox-close:hover {
    background: var(--secondary-maroon);
    border-color: var(--accent-gold);
    transform: rotate(90deg) scale(1.15);
    box-shadow: 0 0 25px rgba(232, 165, 32, 0.6);
}

/* 7. REFINED PAGINATION DESIGN */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 40px auto;
    padding: 12px 20px;
    background: rgba(30, 39, 46, 0.7);
    border-radius: 100px;
    width: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-md);
}

.page-link {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--dark-gray);
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 10px;
}

/* Nav buttons (First, Prev, Next, Last) */
.first-page,
.last-page,
.prev-page,
.next-page {
    border-radius: 30px;
    width: auto;
    padding: 0 16px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    gap: 6px;
}

.page-link:hover {
    background: var(--accent-gold);
    color: var(--charcoal);
    border-color: var(--accent-gold);
    transform: translateY(-3px);
}

.page-link.current {
    background: var(--accent-gold);
    color: var(--charcoal);
    border-color: var(--accent-gold);
    font-weight: 700;
}

.page-link.disabled {
    opacity: 0.2;
    pointer-events: none;
    filter: grayscale(1);
}

.dots {
    color: rgba(255, 255, 255, 0.4);
    padding: 0 5px;
}

/* 8. Responsiveness */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .gallery-item {
        border-radius: 8px;
        aspect-ratio: 3 / 2; /* Same rectangle preview in mobile versions too */
    }

    .pagination-container {
        padding: 10px;
        gap: 5px;
    }

    .page-link {
        min-width: 35px;
        height: 35px;
        font-size: 0.8rem;
        padding: 0 8px;
    }

    .first-page,
    .last-page,
    .prev-page,
    .next-page {
        padding: 0 10px;
    }
}

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

    /* Hide text icons on small mobile to fit First/Last/Numbers */
    .page-link span {
        display: none;
    }

    .page-link {
        min-width: 32px;
        height: 32px;
    }
}

/* 9. Footer Wave Fix - Match Dark Body BG
   -------------------------------------------------------------------------- */
#footer .custom-shape-divider-top .shape-fill {
    fill: var(--charcoal);
}