/* ==========================================================================
   AEC Event Gallery & Lightbox Styles
   ========================================================================== */

/* Grid and Section Layout */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 20px 0 40px;
}

/* Card Styling */
.gallery-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), 
                box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid #eaeef4;
    cursor: pointer;
}

.gallery-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(26, 58, 107, 0.15);
}

/* Image Container */
.gallery-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f0f2f5;
}

.gallery-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-img-wrapper img {
    transform: scale(1.08);
}

/* Photo Count Badge */
.gallery-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(10, 15, 30, 0.7);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Hover Overlay & Action Indicator */
.gallery-hover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26, 58, 107, 0.85), rgba(26, 58, 107, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

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

.gallery-view-btn {
    background: #ffc107;
    color: #0c1b33;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

.gallery-card:hover .gallery-view-btn {
    transform: scale(1);
}

/* Card Content Body */
.gallery-body {
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.gallery-category {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: #ffc107;
    background: rgba(26, 58, 107, 0.08);
    padding: 3px 10px;
    border-radius: 4px;
    align-self: flex-start;
    border: 1px solid rgba(26, 58, 107, 0.1);
}

.gallery-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    color: #1a3a6b;
    margin: 0;
    transition: color 0.2s ease;
}

.gallery-card:hover .gallery-title {
    color: #0c4da2;
}

/* ==========================================================================
   Premium Lightbox Styles
   ========================================================================== */
.custom-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 24, 0.97);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.custom-lightbox.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* Lightbox Layout Header */
.lightbox-header {
    position: absolute;
    top: 25px;
    left: 30px;
    color: #ffffff;
    z-index: 10001;
    max-width: calc(100% - 120px);
}

.lightbox-title {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #ffc107;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lightbox-counter {
    display: block;
    font-size: 13px;
    color: #a0aec0;
    font-weight: 500;
}

/* Close Button */
.lightbox-close {
    position: absolute;
    top: 25px;
    right: 30px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10002;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

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

/* Navigation Arrow Controls */
.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 26px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10001;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-arrow:hover {
    background: #ffc107;
    color: #0c1b33;
    border-color: #ffc107;
    box-shadow: 0 4px 20px rgba(255, 193, 7, 0.4);
}

.lightbox-prev:hover {
    transform: translateY(-50%) translateX(-4px);
}

.lightbox-next:hover {
    transform: translateY(-50%) translateX(4px);
}

/* Main Visual Content */
.lightbox-content {
    position: relative;
    max-width: 82%;
    max-height: 78vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.lightbox-img {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), 
                transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.lightbox-img.is-loaded {
    opacity: 1;
    transform: scale(1);
}

/* Modern Loading Spinner */
.lightbox-loader {
    position: absolute;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #ffc107;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: lightbox-spin 1s linear infinite;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.lightbox-loader.is-visible {
    opacity: 1;
}

@keyframes lightbox-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 991px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .lightbox-arrow {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
    
    .lightbox-prev {
        left: 20px;
    }
    
    .lightbox-next {
        right: 20px;
    }
}

@media (max-width: 768px) {
    .lightbox-header {
        top: 20px;
        left: 20px;
    }
    
    .lightbox-title {
        font-size: 16px;
    }
    
    .lightbox-counter {
        font-size: 12px;
    }
    
    .lightbox-close {
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .lightbox-arrow {
        top: auto;
        bottom: 25px;
        transform: none;
        width: 46px;
        height: 46px;
        font-size: 20px;
    }
    
    .lightbox-prev {
        left: calc(50% - 60px);
    }
    
    .lightbox-next {
        right: calc(50% - 60px);
    }
    
    .lightbox-prev:hover {
        transform: scale(1.05);
    }
    
    .lightbox-next:hover {
        transform: scale(1.05);
    }
    
    .lightbox-content {
        max-width: 92%;
        max-height: 65vh;
        margin-top: -30px;
    }
    
    .lightbox-img {
        max-height: 65vh;
    }
}
