/*
 * Gallery Page Stylesheet
 * Built by: Nasaj
 * 
 * Features:
 * - Gallery hero section styling
 * - Masonry grid layout for images
 * - Lightbox modal styles
 * - Responsive image cards
 * - Navigation arrows and controls
 * - Mobile-optimized design
 */

/* =========================================
   GALLERY PAGE STYLES
   Matching Dirty Bloom 50 Design System
   ========================================= */

/* Gallery Hero Section */
.gallery-hero {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--header-height) + 2rem) 1rem 4rem;
    background-color: var(--color-bg-dark);
    overflow: hidden;
}

.gallery-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/Gallery/IMG_20260204_092112.jpg');
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.gallery-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(10, 33, 38, 0.7), rgba(10, 33, 38, 0.9));
    z-index: 1;
}

.gallery-hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: var(--color-text-inv);
}

.gallery-hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent-yellow);
}

.gallery-hero-title {
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.gallery-hero-title .highlight {
    color: var(--color-primary);
}

.gallery-hero-subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 300;
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .gallery-hero-subtitle {
        font-size: 1.35rem;
    }
}

/* Desktop Hero Adjustments */
@media (min-width: 768px) {
    .gallery-hero {
        min-height: 500px;
        padding-top: calc(var(--header-height) + 4rem);
    }
    
    .gallery-hero-title {
        font-size: 4.5rem;
    }
    
    .gallery-hero-subtitle {
        font-size: 1.25rem;
    }
}

/* Gallery Section */
.gallery-section {
    padding: 4rem 0;
}

.gallery-header {
    margin-bottom: 3rem;
    text-align: center;
}

.gallery-header .section-title {
    text-align: center;
}

.gallery-header .divider {
    margin: 0 auto 1rem;
}

.gallery-intro {
    color: var(--color-text-light);
    font-size: 1rem;
}

/* Gallery Masonry Grid */
.gallery-masonry {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* Tablet - 2 columns */
@media (min-width: 640px) {
    .gallery-masonry {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop - 3 columns */
@media (min-width: 1024px) {
    .gallery-masonry {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

/* Large Desktop - 4 columns */
@media (min-width: 1280px) {
    .gallery-masonry {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Gallery Item */
.gallery-item-card {
    position: relative;
    aspect-ratio: 4/3;
    background-color: var(--color-surface-dark);
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.gallery-item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.2);
}

.gallery-item-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

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

/* Overlay on hover */
.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 33, 38, 0.8) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
}

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

.gallery-item-zoom {
    color: white;
    font-size: 2rem;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.gallery-item-card:hover .gallery-item-zoom {
    transform: translateY(0);
}

/* Staggered Animation Delays */
.gallery-item-card:nth-child(1) { animation-delay: 0.05s; }
.gallery-item-card:nth-child(2) { animation-delay: 0.1s; }
.gallery-item-card:nth-child(3) { animation-delay: 0.15s; }
.gallery-item-card:nth-child(4) { animation-delay: 0.2s; }
.gallery-item-card:nth-child(5) { animation-delay: 0.25s; }
.gallery-item-card:nth-child(6) { animation-delay: 0.3s; }
.gallery-item-card:nth-child(7) { animation-delay: 0.35s; }
.gallery-item-card:nth-child(8) { animation-delay: 0.4s; }
.gallery-item-card:nth-child(9) { animation-delay: 0.45s; }
.gallery-item-card:nth-child(10) { animation-delay: 0.5s; }
.gallery-item-card:nth-child(11) { animation-delay: 0.55s; }
.gallery-item-card:nth-child(12) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading State */
.gallery-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.gallery-loading.hidden {
    display: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(252, 0, 75, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.gallery-loading p {
    color: var(--color-text-light);
    font-size: 0.875rem;
}

/* =========================================
   LIGHTBOX STYLES
   ========================================= */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 33, 38, 0.95);
    backdrop-filter: blur(8px);
}

.lightbox-content {
    position: relative;
    z-index: 1001;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

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

/* Lightbox Counter */
.lightbox-counter {
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.lightbox-counter span {
    color: white;
}

/* Lightbox Controls */
.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.lightbox-close:hover {
    background: var(--color-primary);
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.lightbox-nav:hover {
    background: var(--color-primary);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav .material-symbols-outlined {
    font-size: 2rem;
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

/* Hide nav buttons on mobile when not needed */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .lightbox-nav .material-symbols-outlined {
        font-size: 1.5rem;
    }
    
    .lightbox-prev {
        left: 0.5rem;
    }
    
    .lightbox-next {
        right: 0.5rem;
    }
    
    .lightbox-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* Active Navigation State */
.nav-desktop a.active,
.mobile-nav-links a[href="gallery.html"] {
    color: var(--color-primary);
}

/* Improve image loading */
.gallery-item-card img {
    background-color: var(--color-surface-dark);
}

/* Focus styles for accessibility */
.gallery-item-card:focus {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

.lightbox-close:focus,
.lightbox-nav:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .gallery-item-card,
    .gallery-item-card img,
    .lightbox,
    .lightbox-content img {
        animation: none;
        transition: none;
    }
    
    .gallery-item-card {
        opacity: 1;
    }
}

/* Gallery CTA Section */
.gallery-cta-section {
    position: relative;
    padding: 8rem 0;
    background-color: var(--color-bg-dark);
    overflow: hidden;
}

.gallery-cta-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/Gallery/IMG_20260204_092053.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.4;
}

.gallery-cta-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10, 33, 38, 0.95) 0%, rgba(10, 33, 38, 0.85) 100%);
}

.gallery-cta-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: var(--color-text-inv);
}

.gallery-cta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(252, 0, 75, 0.15);
    border: 1px solid rgba(252, 0, 75, 0.3);
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gallery-cta-badge .material-symbols-outlined {
    font-size: 1.25rem;
}

.gallery-cta-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: white;
}

@media (min-width: 768px) {
    .gallery-cta-title {
        font-size: 3.5rem;
    }
}

.gallery-cta-text {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.gallery-cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 3rem;
}

@media (min-width: 640px) {
    .gallery-cta-buttons {
        flex-direction: row;
    }
}

.gallery-cta-buttons .btn-large {
    min-width: 200px;
}

.btn-outline-white {
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    transition: all 0.3s ease;
}

.btn-outline-white:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
    transform: translateY(-2px);
}

.gallery-cta-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

@media (min-width: 640px) {
    .gallery-cta-features {
        flex-direction: row;
        gap: 2rem;
    }
}

.gallery-cta-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
}

.gallery-cta-feature .material-symbols-outlined {
    color: var(--color-accent-yellow);
    font-size: 1.25rem;
}

/* Print styles */
@media print {
    .gallery-hero {
        min-height: auto;
        padding: 2rem 1rem;
    }
    
    .lightbox,
    .gallery-item-overlay {
        display: none !important;
    }
    
    .gallery-masonry {
        display: block;
    }
    
    .gallery-item-card {
        break-inside: avoid;
        margin-bottom: 1rem;
        page-break-inside: avoid;
    }
}
