/* Portfolio Gallery Page Styles */

/* Gallery Navigation */
.gallery-nav {
    padding: 40px 0;
    background-color: #0d1f2d;
}

.gallery-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.back-to-portfolio {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: 'halyard-text', 'Georgia', serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.back-to-portfolio:hover {
    color: #d9c7bd;
}

.back-to-portfolio svg {
    width: 22px;
    height: 11px;
    transition: transform 0.3s ease;
}

.back-to-portfolio:hover svg {
    transform: translateX(-5px);
}

/* Gallery Section */
.gallery-section {
    padding: 0 0 80px;
    background-color: #0d1f2d;
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Gallery Rows */
.gallery-row {
    margin-bottom: 20px;
}

.gallery-row:last-child {
    margin-bottom: 0;
}

.gallery-row-full {
    display: block;
}

.gallery-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Gallery Items */
.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: #112739;
}

.gallery-item picture {
    display: block;
    width: 100%;
    height: 100%;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
    transform: scale(1.03);
}

/* Subtle overlay on hover */
.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 31, 45, 0);
    transition: background 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover::after {
    background: rgba(13, 31, 45, 0.1);
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Lightbox Counter */
.lightbox-counter {
    position: absolute;
    top: 20px;
    left: 30px;
    font-family: 'halyard-text', 'Georgia', serif;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

/* Lightbox Close Button */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    color: #ffffff;
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
}

/* Lightbox Navigation Arrows */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.6);
    color: #ffffff;
}

.lightbox-prev svg,
.lightbox-next svg {
    width: 30px;
    height: 15px;
}

/* Lightbox Image Container */
.lightbox-image-container {
    max-width: 85%;
    max-height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image-container img {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

/* CTA Section Overrides for Gallery Page */
.portfolio-gallery-page .cta-section {
    background-color: #112739;
}

/* CTA Heading Desktop/Mobile Visibility */
.cta-heading-mobile {
    display: none;
}

.cta-heading-desktop {
    display: inline;
}

/* Mobile break - hidden on desktop, shown on mobile */
.mobile-break {
    display: none;
}

.images-size .gallery-row-full .gallery-item img {height: 75vh; object-fit: cover;}
.images-size .gallery-row-half .gallery-item img {height: 45vh; object-fit: cover;}

/* Responsive Design */
@media (max-width: 968px) {
    .gallery-nav-container,
    .gallery-container {
        padding: 0 24px;
    }
    
    .gallery-row {
        margin-bottom: 16px;
    }
    
    .gallery-row-half {
        gap: 16px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 50px;
        height: 50px;
    }
    
    .lightbox-prev svg,
    .lightbox-next svg {
        width: 24px;
        height: 12px;
    }
}

@media (max-width: 640px) {
    .gallery-nav {
        padding: 30px 0;
    }
    
    .gallery-section {
        padding: 0 0 60px;
    }
    
    .gallery-row-half {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .gallery-row {
        margin-bottom: 12px;
    }
    
    .lightbox-counter {
        top: 15px;
        left: 20px;
        font-size: 0.8125rem;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-close svg {
        width: 20px;
        height: 20px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 44px;
        height: 44px;
    }
    
    .lightbox-prev {
        left: 5px;
    }
    
    .lightbox-next {
        right: 5px;
    }
    
    .lightbox-prev svg,
    .lightbox-next svg {
        width: 20px;
        height: 10px;
    }
    
    .lightbox-image-container {
        max-width: 95%;
        max-height: 80%;
    }
    
    /* CTA Mobile Styles */
    .cta-heading-desktop {
        display: none;
    }
    
    .cta-heading-mobile {
        display: inline;
    }
    
    .mobile-break {
        display: block;
    }
    
    .back-to-portfolio {font-size: 1.0rem;}
    .images-size .gallery-row-full .gallery-item img {height: auto; }
.images-size .gallery-row-half .gallery-item img {height: auto; }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .gallery-item img {
        transition: none;
    }
    
    .gallery-item:hover img {
        transform: none;
    }
    
    .lightbox {
        transition: none;
    }
    
    .lightbox-image-container img {
        transition: none;
    }
}
