/* Gallery Page Specific Stylesheet */

.gallery-filter-bar {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.gallery-card {
    position: relative;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: var(--transition-normal);
    aspect-ratio: 4/3;
    background: var(--color-bg-light);
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.gallery-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

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

.gallery-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(11, 34, 64, 0.95) 0%, rgba(11, 34, 64, 0) 100%);
    padding: 1.5rem;
    color: var(--color-bg-white);
    opacity: 0;
    transition: var(--transition-normal);
}

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

.gallery-card-overlay h4 {
    color: var(--color-accent);
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
    font-family: var(--font-heading);
}

.gallery-card-overlay p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
}

/* Responsive Overrides */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 580px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Lightbox Styles */
.gallery-card {
    cursor: pointer;
}

.gallery-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 34, 64, 0.96); /* matching primary navy color with transparency */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.gallery-lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 85%;
    max-height: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: zoomIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--border-radius-md);
    border: 3px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    object-fit: contain;
}

.lightbox-caption {
    width: 100%;
    text-align: center;
    margin-top: 1.5rem;
    color: var(--color-bg-white);
}

.lightbox-caption h4 {
    color: var(--color-accent);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.lightbox-caption p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin: 0 auto;
}

/* Close button */
.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2.5rem;
    color: #ffffff;
    font-size: 3rem;
    font-weight: 200;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
}

.lightbox-close:hover {
    color: var(--color-accent);
    transform: scale(1.08);
    background-color: rgba(255, 255, 255, 0.1);
}

/* Navigation buttons */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #ffffff;
    font-size: 3rem;
    padding: 1rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    z-index: 10000;
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    color: var(--color-accent);
    transform: translateY(-50%) scale(1.1);
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsive Lightbox overrides */
@media (max-width: 768px) {
    .lightbox-prev {
        left: 0.5rem;
    }
    .lightbox-next {
        right: 0.5rem;
    }
    .lightbox-prev, .lightbox-next {
        font-size: 2rem;
    }
    .lightbox-close {
        top: 1rem;
        right: 1.5rem;
        font-size: 2rem;
    }
}
