/* ============================================
   GALLERY PAGE - CSS
   Boris Molinier Photographie
   Shared styling for all collection galleries
   ============================================ */

/* CSS Variables inherited from collections-gallery.css */
:root {
    --gallery-gap: 1.5rem;
    --gallery-columns: 3;
}

/* ============================================
   GALLERY SECTION
   ============================================ */
.gallery {
    background-color: var(--color-bg-primary, #0d0d0d);
    min-height: 100vh;
    padding: var(--spacing-3xl, 6rem) var(--spacing-lg, 2rem);
}

@media (max-width: 968px) {
    .gallery {
        padding: var(--spacing-2xl, 4rem) var(--spacing-md, 1.5rem);
    }
}

/* ============================================
   GALLERY HERO HEADER
   ============================================ */
.gallery__hero {
    max-width: 1400px;
    margin: 0 auto var(--spacing-3xl, 6rem);
    text-align: center;
    animation: fadeInUp 800ms ease-out forwards;
}

.gallery__hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.gallery__eyebrow {
    display: inline-block;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-accent-gold, #d4af37);
    margin-bottom: var(--spacing-sm, 1rem);
}

.gallery__title {
    font-family: var(--font-serif, 'Cormorant Garamond', serif);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 400;
    line-height: 1.1;
    color: var(--color-text-primary, #f5f5f5);
    margin-bottom: var(--spacing-md, 1.5rem);
}

.gallery__subtitle {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: clamp(1rem, 2vw, 1.125rem);
    font-weight: 300;
    line-height: 1.8;
    color: var(--color-text-secondary, #c4c4c4);
    margin-bottom: var(--spacing-xl, 3rem);
}

.gallery__meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-xl, 3rem);
    flex-wrap: wrap;
}

.gallery__meta-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs, 0.5rem);
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--color-text-secondary, #c4c4c4);
}

.gallery__meta-item svg {
    color: var(--color-accent-gold, #d4af37);
}

@media (max-width: 768px) {
    .gallery__hero {
        margin-bottom: var(--spacing-2xl, 4rem);
    }

    .gallery__meta {
        gap: var(--spacing-lg, 2rem);
    }
}

/* ============================================
   GALLERY CONTROLS
   ============================================ */
.gallery__controls {
    max-width: 1400px;
    margin: 0 auto var(--spacing-xl, 3rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md, 1.5rem);
    background: rgba(26, 26, 26, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    animation: fadeIn 800ms ease-out 0.2s forwards;
    opacity: 0;
}

.gallery__controls-left {
    display: flex;
    gap: var(--spacing-sm, 1rem);
}

.gallery__view-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs, 0.5rem);
    padding: var(--spacing-sm, 1rem) var(--spacing-md, 1.5rem);
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary, #c4c4c4);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: all 300ms ease;
}

.gallery__view-btn:hover {
    color: var(--color-accent-gold, #d4af37);
    border-color: rgba(212, 175, 55, 0.4);
    background: rgba(255, 255, 255, 0.03);
}

.gallery__view-btn--active {
    color: var(--color-bg-primary, #0d0d0d);
    background: var(--color-accent-gold, #d4af37);
    border-color: var(--color-accent-gold, #d4af37);
}

.gallery__view-btn svg {
    width: 20px;
    height: 20px;
}

.gallery__count {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-text-muted, #8a8a8a);
}

@media (max-width: 768px) {
    .gallery__controls {
        flex-direction: column;
        gap: var(--spacing-md, 1.5rem);
    }

    .gallery__controls-left {
        width: 100%;
    }

    .gallery__view-btn {
        flex: 1;
        justify-content: center;
    }

    .gallery__view-btn span {
        display: none;
    }
}

/* ============================================
   PHOTO GRID (Masonry Layout)
   ============================================ */
.gallery__grid {
    max-width: 1400px;
    margin: 0 auto;
    column-count: 3;
    column-gap: var(--gallery-gap);
    animation: fadeInUp 800ms ease-out 0.3s forwards;
    opacity: 0;
}

@media (max-width: 1200px) {
    .gallery__grid {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .gallery__grid {
        column-count: 1;
    }
}

/* Photo Card */
.gallery__photo {
    break-inside: avoid;
    margin-bottom: var(--gallery-gap);
    background: var(--color-bg-secondary, #1a1a1a);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.gallery__photo:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.gallery__photo-image-wrapper {
    position: relative;
    overflow: hidden;
}

.gallery__photo-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 600ms ease;
}

.gallery__photo:hover .gallery__photo-image {
    transform: scale(1.05);
}

.gallery__photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity 300ms ease;
}

.gallery__photo:hover .gallery__photo-overlay {
    opacity: 1;
}

.gallery__photo-info {
    padding: var(--spacing-md, 1.5rem);
}

.gallery__photo-title {
    font-family: var(--font-serif, 'Cormorant Garamond', serif);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--color-text-primary, #f5f5f5);
    margin-bottom: var(--spacing-xs, 0.5rem);
}

.gallery__photo-keywords {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.8125rem;
    font-weight: 300;
    color: var(--color-text-muted, #8a8a8a);
}

/* Loading State */
.gallery__loading {
    text-align: center;
    padding: var(--spacing-3xl, 6rem) var(--spacing-lg, 2rem);
    color: var(--color-text-secondary, #c4c4c4);
}

.gallery__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(212, 175, 55, 0.1);
    border-top-color: var(--color-accent-gold, #d4af37);
    border-radius: 50%;
    margin: 0 auto var(--spacing-md, 1.5rem);
    animation: spin 1s linear infinite;
}

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

/* ============================================
   LIGHTBOX (Full-Screen Photo Viewer)
   ============================================ */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox.is-open {
    display: flex;
}

.lightbox__close {
    position: absolute;
    top: var(--spacing-lg, 2rem);
    right: var(--spacing-lg, 2rem);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--color-text-primary, #f5f5f5);
    cursor: pointer;
    transition: all 300ms ease;
    z-index: 10002;
}

.lightbox__close:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--color-accent-gold, #d4af37);
    transform: rotate(90deg);
}

.lightbox__prev,
.lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--color-text-primary, #f5f5f5);
    cursor: pointer;
    transition: all 300ms ease;
    z-index: 10002;
}

.lightbox__prev {
    left: var(--spacing-lg, 2rem);
}

.lightbox__next {
    right: var(--spacing-lg, 2rem);
}

.lightbox__prev:hover,
.lightbox__next:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--color-accent-gold, #d4af37);
}

.lightbox__content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.lightbox__content::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.lightbox__image {
    max-width: 100%;
    max-height: calc(90vh - 200px);
    object-fit: contain;
    border-radius: 4px;
    transition: opacity 0.2s ease-in-out;
    flex-shrink: 0;
}

.lightbox__info {
    margin-top: var(--spacing-lg, 2rem);
    text-align: center;
    max-width: 600px;
    flex-shrink: 0;
    padding-bottom: 1rem;
}

.lightbox__title {
    font-family: var(--font-serif, 'Cormorant Garamond', serif);
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--color-text-primary, #f5f5f5);
    margin-bottom: var(--spacing-xs, 0.5rem);
}

.lightbox__collection {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.875rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent-gold, #d4af37);
    margin-bottom: var(--spacing-md, 1.5rem);
}

.lightbox__cta {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm, 1rem);
    padding: var(--spacing-md, 1.5rem) var(--spacing-xl, 3rem);
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-bg-primary, #0d0d0d);
    background: var(--color-accent-gold, #d4af37);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 300ms ease;
}

.lightbox__cta:hover {
    background: var(--color-accent-bronze, #cd7f32);
    transform: translateY(-2px);
}

.lightbox__counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1.25rem;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-primary, #f5f5f5);
    z-index: 10001;
}

@media (max-width: 768px) {
    .lightbox__close,
    .lightbox__prev,
    .lightbox__next {
        width: 40px;
        height: 40px;
    }

    .lightbox__prev {
        left: var(--spacing-sm, 1rem);
    }

    .lightbox__next {
        right: var(--spacing-sm, 1rem);
    }

    .lightbox__info {
        padding: 0 var(--spacing-md, 1.5rem);
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
