/* ========== OPTIMIZED GALLERY PAGE STYLES ========== */

.gallery-hero {
    padding: 140px 0 80px 0;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.gallery-hero::before {
    content: '';
    position: absolute;
    top: 20%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 109, 31, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.gallery-hero-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    padding: 0 var(--spacing-xl);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 109, 31, 0.15);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--spacing-xl);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.hero-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 109, 31, 0.15);
}

.hero-badge svg {
    width: 16px;
    height: 16px;
}

.gallery-hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: var(--spacing-lg);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.title-accent {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gallery-hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-medium);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
    font-family: var(--font-serif);
}

/* Gallery Grid Section */
.gallery-section {
    padding: var(--spacing-4xl) 0;
    background: var(--bg-primary);
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
}

.gallery-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.section-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-medium);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-medium);
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto;
}

/* Modern Masonry Gallery Grid */
.masonry-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-auto-rows: 250px;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-2xl);
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-slow);
    cursor: pointer;
}

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

.gallery-item.large-featured {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item.medium {
    grid-row: span 1;
}

.gallery-item.square {
    grid-row: span 1;
}

.gallery-item.wide {
    grid-column: span 2;
}

.gallery-item.large-center {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item.tall {
    grid-row: span 2;
}

.image-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 60%);
    display: flex;
    align-items: flex-end;
    padding: var(--spacing-lg);
    opacity: 0;
    transition: opacity var(--transition-base);
}

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

.overlay-content {
    color: var(--text-white);
}

.image-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-white);
}

.image-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    margin: 0;
}

.text-card {
    background: var(--bg-gradient);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-xl);
}

.text-card-content {
    max-width: 250px;
}

.quote-mark {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.3);
    font-weight: bold;
    display: block;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: var(--spacing-md) 0;
    color: var(--text-white);
}

.card-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
}

/* Responsive Gallery */
@media (max-width: 1200px) {
    .masonry-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 200px;
    }
    
    .gallery-item.large-featured,
    .gallery-item.wide,
    .gallery-item.large-center {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .gallery-hero {
        padding: 100px 0 40px 0;
    }
    
    .gallery-hero-content {
        padding: 0 var(--spacing-lg);
    }
    
    .gallery-hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    
    .gallery-hero-subtitle {
        font-size: 1.1rem;
    }
    
    .gallery-section {
        padding: var(--spacing-2xl) 0;
    }
    
    .gallery-container {
        padding: 0 var(--spacing-lg);
    }
    
    .masonry-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 180px;
        gap: var(--spacing-md);
    }
    
    .gallery-item.large-featured,
    .gallery-item.wide,
    .gallery-item.large-center {
        grid-column: span 2;
    }
    
    .image-overlay {
        padding: var(--spacing-md);
    }
    
    .image-title {
        font-size: 1rem;
    }
    
    .image-description {
        font-size: 0.85rem;
    }
    
    .text-card {
        padding: var(--spacing-lg);
    }
    
    .text-card-content {
        max-width: 200px;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .card-description {
        font-size: 0.85rem;
    }
}

/* Lightbox */
.lightbox {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.lightbox.active {
    display: flex !important;
}
.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    object-fit: contain;
}
.lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    color: #fff;
}
.lightbox-close:hover {
    background: rgba(0,0,0,0.85);
}
.lightbox-info {
    padding: 16px 20px;
    background: #fff;
}
.lightbox-info h3 {
    margin: 0;
    font-size: 1rem;
    color: #333;
}

@media (max-width: 480px) {
    .gallery-hero {
        padding: 80px 0 30px 0;
    }
    
    .gallery-hero-content {
        padding: 0 var(--spacing-md);
    }
    
    .gallery-container {
        padding: 0 var(--spacing-md);
    }
    
    .masonry-gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 200px;
        gap: var(--spacing-sm);
    }
    
    .gallery-item.large-featured,
    .gallery-item.wide,
    .gallery-item.large-center {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .image-overlay {
        padding: var(--spacing-sm);
    }
    
    .text-card {
        padding: var(--spacing-md);
    }
    
    .text-card-content {
        max-width: none;
    }
}