/* ==========================================================================
   FIT FOR LIFE - Premium Gallery Stylesheet
   ========================================================================== */

/* --- Override Global Scroll Lock from style.css --- */
html,
body.gallery-page {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
}

/* --- Main Content Styling --- */
.gallery-main {
    background-color: var(--color-bg-deep);
    min-height: 100vh;
    padding-top: 100px; /* Offset fixed header */
    display: flex;
    flex-direction: column;
}

.gallery-section {
    padding: 60px 24px 120px 24px !important;
    flex-grow: 1;
}

/* --- Gallery Grid Layout --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

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

/* --- Card Styles --- */
.gallery-card {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.gallery-image-wrapper {
    position: relative;
    aspect-ratio: 16 / 10;
    width: 100%;
    overflow: hidden;
    background-color: #000;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Hover Zoom & Glow Effects */
.gallery-card:hover {
    transform: translateY(-6px);
    border-color: var(--color-border-glow);
    box-shadow: var(--shadow-neon);
}

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

/* Image Hover Overlay */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

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

.zoom-icon {
    font-size: 1.8rem;
    color: #ffffff;
    background: var(--color-primary-gradient);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(255, 94, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gallery-card:hover .zoom-icon {
    transform: scale(1);
}

/* Card Information Text */
.gallery-card-info {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.gallery-card-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 10px 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.gallery-card:hover .gallery-card-info h3 {
    color: var(--color-primary);
}

.gallery-card-info p {
    font-size: 0.88rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* --- Lightbox Styles --- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(15px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

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

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    color: #ffffff;
    font-size: 3rem;
    font-weight: 200;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
    transition: var(--transition-smooth);
    z-index: 2100;
}

.lightbox-close:hover {
    color: var(--color-primary);
    transform: rotate(90deg);
}

/* Navigation Arrows */
.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    z-index: 2050;
}

.arrow-left {
    left: 30px;
}

.arrow-right {
    right: 30px;
}

.lightbox-arrow:hover {
    background: rgba(255, 94, 0, 0.15);
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-neon);
}

/* Lightbox Content Container */
.lightbox-content {
    max-width: 85%;
    max-height: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

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

/* Caption details */
.lightbox-caption {
    margin-top: 24px;
    text-align: center;
    max-width: 600px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
}

.lightbox.active .lightbox-caption {
    opacity: 1;
    transform: translateY(0);
}

.lightbox-caption h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.lightbox-caption p {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Mobile Adjustments for Lightbox */
@media (max-width: 768px) {
    .lightbox-arrow {
        width: 46px;
        height: 46px;
    }
    
    .arrow-left {
        left: 15px;
    }
    
    .arrow-right {
        right: 15px;
    }
    
    .lightbox-close {
        top: 20px;
        right: 20px;
        font-size: 2.5rem;
    }
    
    .lightbox-content {
        max-width: 90%;
    }
    
    .lightbox-caption h3 {
        font-size: 1.2rem;
    }
    
    .lightbox-caption p {
        font-size: 0.85rem;
    }
}
