/* ========================================
   GALLERY LAYOUT OPTIONS
   ======================================== */

/* Layout Switcher */
.layout-switcher {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) 0;
    flex-wrap: wrap;
    margin-bottom: var(--spacing-lg);
}

.layout-switcher__btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--font-size-small);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: 4px;
}

.layout-switcher__btn:hover {
    border-color: var(--color-text);
}

.layout-switcher__btn.active {
    background: var(--color-text);
    color: var(--color-bg);
    border-color: var(--color-text);
}

/* Hide all layouts by default */
.gallery-layout {
    display: none;
}

.gallery-layout.active {
    display: block;
}

/* ========================================
   LAYOUT 1: CINEMATIC FULL-BLEED
   Full viewport images with fade transitions
   ======================================== */

.gallery-cinematic {
    position: relative;
    width: 100vw;
    height: calc(100vh - 80px);
    margin-left: calc(-50vw + 50%);
    overflow: hidden;
}

.gallery-cinematic__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.gallery-cinematic__slide.active {
    opacity: 1;
}

.gallery-cinematic__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-cinematic__nav {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-cinematic:hover .gallery-cinematic__nav {
    opacity: 1;
}

.gallery-cinematic__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.gallery-cinematic__dot:hover,
.gallery-cinematic__dot.active {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.3);
}

.gallery-cinematic__arrows {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.gallery-cinematic:hover .gallery-cinematic__arrows {
    opacity: 1;
}

.gallery-cinematic__arrow {
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-cinematic__arrow:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}

.gallery-cinematic__counter {
    position: absolute;
    bottom: 40px;
    right: 40px;
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-caption);
    font-family: var(--font-body);
    letter-spacing: 0.1em;
}

/* ========================================
   LAYOUT 2: MAGAZINE EDITORIAL
   Asymmetric mixed sizes like print magazine
   ======================================== */

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

.gallery-magazine__row {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.gallery-magazine__row--hero {
    grid-template-columns: 1fr;
}

.gallery-magazine__row--split {
    grid-template-columns: 1fr 1fr;
}

.gallery-magazine__row--thirds {
    grid-template-columns: 1fr 1fr 1fr;
}

.gallery-magazine__row--asymmetric {
    grid-template-columns: 2fr 1fr;
}

.gallery-magazine__row--asymmetric-reverse {
    grid-template-columns: 1fr 2fr;
}

.gallery-magazine__item {
    overflow: hidden;
    cursor: pointer;
}

.gallery-magazine__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--ease-out-expo);
}

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

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

.gallery-magazine__row--hero .gallery-magazine__item {
    height: 70vh;
    max-height: 800px;
}

.gallery-magazine__row--split .gallery-magazine__item {
    height: 50vh;
    max-height: 500px;
}

.gallery-magazine__row--thirds .gallery-magazine__item {
    height: 40vh;
    max-height: 400px;
}

.gallery-magazine__row--asymmetric .gallery-magazine__item,
.gallery-magazine__row--asymmetric-reverse .gallery-magazine__item {
    height: 45vh;
    max-height: 450px;
}

@media (max-width: 768px) {
    .gallery-magazine__row--split,
    .gallery-magazine__row--thirds,
    .gallery-magazine__row--asymmetric,
    .gallery-magazine__row--asymmetric-reverse {
        grid-template-columns: 1fr;
    }

    .gallery-magazine__row .gallery-magazine__item {
        height: 60vh;
        max-height: 400px;
    }
}

/* ========================================
   LAYOUT 3: PARALLAX DEPTH
   Photos at different depths with parallax scroll
   ======================================== */

.gallery-parallax {
    position: relative;
    min-height: 300vh;
}

.gallery-parallax__layer {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.gallery-parallax__item {
    position: relative;
    max-width: 85%;
    max-height: 85vh;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}

.gallery-parallax__item img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.gallery-parallax__item::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    border-radius: 4px;
    z-index: -1;
}

/* ========================================
   LAYOUT 4: FILM CONTACT SHEET
   Small thumbnails like film negatives
   ======================================== */

.gallery-contact {
    background: #1a1a1a;
    padding: var(--spacing-lg);
    margin-left: calc(-50vw + 50%);
    width: 100vw;
}

.gallery-contact__strip {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    background: #0a0a0a;
    padding: 20px 30px;
    position: relative;
}

/* Film sprocket holes */
.gallery-contact__strip::before,
.gallery-contact__strip::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15px;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 8px,
        #333 8px,
        #333 16px,
        transparent 16px,
        transparent 24px
    );
}

.gallery-contact__strip::before {
    left: 8px;
}

.gallery-contact__strip::after {
    right: 8px;
}

.gallery-contact__frame {
    aspect-ratio: 3/2;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 2px solid #333;
}

.gallery-contact__frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(1.1) saturate(0.9);
    transition: all 0.4s ease;
}

.gallery-contact__frame:hover img {
    filter: contrast(1) saturate(1);
    transform: scale(1.05);
}

.gallery-contact__frame::after {
    content: attr(data-number);
    position: absolute;
    bottom: 2px;
    right: 4px;
    color: rgba(255, 150, 0, 0.7);
    font-size: var(--font-size-tiny);
    font-family: monospace;
}

@media (max-width: 768px) {
    .gallery-contact__strip {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   LAYOUT 5: INFINITE CANVAS
   Pannable/zoomable canvas
   ======================================== */

.gallery-canvas {
    width: 100vw;
    height: calc(100vh - 80px);
    margin-left: calc(-50vw + 50%);
    overflow: hidden;
    cursor: grab;
    background: var(--color-bg);
    position: relative;
}

.gallery-canvas:active {
    cursor: grabbing;
}

.gallery-canvas__inner {
    position: absolute;
    width: 3000px;
    height: 2000px;
    transform-origin: center center;
    transition: transform 0.1s ease-out;
}

.gallery-canvas__item {
    position: absolute;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: box-shadow 0.3s ease, z-index 0s;
}

.gallery-canvas__item:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.gallery-canvas__item img {
    display: block;
    max-width: 400px;
    max-height: 300px;
    object-fit: cover;
}

.gallery-canvas__hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-text-muted);
    font-size: var(--font-size-small);
    opacity: 0.6;
    pointer-events: none;
}

/* ========================================
   LAYOUT 6: VERTICAL STORY SCROLL
   Full-page chapters per category
   ======================================== */

.gallery-story {
    scroll-snap-type: y mandatory;
    height: calc(100vh - 80px);
    overflow-y: scroll;
    margin-left: calc(-50vw + 50%);
    width: 100vw;
}

.gallery-story__chapter {
    scroll-snap-align: start;
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-story__chapter img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-story__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        transparent 30%,
        transparent 70%,
        rgba(0, 0, 0, 0.5) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--spacing-xl);
}

.gallery-story__title {
    color: white;
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 300;
    letter-spacing: 0.1em;
    margin-bottom: var(--spacing-sm);
}

.gallery-story__counter {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--font-size-caption);
    letter-spacing: 0.2em;
}

.gallery-story__scroll-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--font-size-caption);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* ========================================
   FEATURED + THUMBNAILS (Option 4 from before)
   ======================================== */

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

.gallery-featured__hero {
    width: 100%;
    height: 70vh;
    max-height: 700px;
    margin-bottom: var(--spacing-md);
    overflow: hidden;
    cursor: pointer;
}

.gallery-featured__hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--ease-out-expo);
}

.gallery-featured__hero:hover img {
    transform: scale(1.02);
}

.gallery-featured__thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.gallery-featured__thumb {
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-featured__thumb.active {
    opacity: 1;
    outline: 2px solid var(--color-text);
    outline-offset: 2px;
}

.gallery-featured__thumb:hover {
    opacity: 1;
}

.gallery-featured__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   HYBRID: FEATURED + FILM STRIP
   Hero image with clean film strip thumbnails
   ======================================== */

.gallery-filmstrip {
    max-width: 100%;
    margin: 0 auto;
}

.gallery-filmstrip__hero {
    width: 100%;
    height: 70vh;
    max-height: 750px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: #050505;
}

.gallery-filmstrip__hero img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
}

/* Navigation arrows on hero */
.gallery-filmstrip__nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-filmstrip__hero:hover .gallery-filmstrip__nav {
    opacity: 1;
}

.gallery-filmstrip__arrow {
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-filmstrip__arrow:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.1);
}

/* Film strip container */
.gallery-filmstrip__strip {
    background: #0d0d0d;
    padding: 16px 0;
    margin-top: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #333 #0d0d0d;
}

.gallery-filmstrip__strip::-webkit-scrollbar {
    height: 6px;
}

.gallery-filmstrip__strip::-webkit-scrollbar-track {
    background: #0d0d0d;
}

.gallery-filmstrip__strip::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.gallery-filmstrip__strip::-webkit-scrollbar-thumb:hover {
    background: #444;
}

.gallery-filmstrip__thumbs {
    display: flex;
    gap: 3px;
    padding: 0 20px;
    min-width: max-content;
}

.gallery-filmstrip__thumb {
    flex-shrink: 0;
    width: 100px;
    height: 67px; /* 3:2 aspect ratio */
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 1px solid #1a1a1a;
    transition: all 0.3s ease;
}

.gallery-filmstrip__thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    transition: background 0.3s ease;
    z-index: 1;
}

.gallery-filmstrip__thumb:hover::before {
    background: rgba(0, 0, 0, 0.2);
}

.gallery-filmstrip__thumb.active::before {
    background: transparent;
}

.gallery-filmstrip__thumb.active {
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

.gallery-filmstrip__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

/* Counter display */
.gallery-filmstrip__counter {
    position: absolute;
    bottom: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--font-size-caption);
    font-family: var(--font-body);
    letter-spacing: 0.15em;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 12px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

/* Progress bar for auto-advance */
.gallery-filmstrip__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    width: 0%;
    transition: width linear;
}

.gallery-filmstrip__progress.animating {
    width: 100%;
}

/* Category filters for filmstrip */
.gallery-filmstrip__filters {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) 0;
    flex-wrap: wrap;
}

.gallery-filmstrip__filter {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-family: var(--font-body);
    font-size: var(--font-size-small);
    cursor: pointer;
    padding: 0.3rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.gallery-filmstrip__filter:hover {
    color: var(--color-text);
}

.gallery-filmstrip__filter.active {
    color: var(--color-text);
}

.gallery-filmstrip__filter::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transition: transform 0.3s var(--ease-out-expo);
}

.gallery-filmstrip__filter.active::after {
    transform: scaleX(1);
}

.gallery-filmstrip__separator {
    color: var(--color-text-muted);
    font-size: var(--font-size-small);
    opacity: 0.3;
}

@media (max-width: 768px) {
    .gallery-filmstrip__hero {
        height: 50vh;
    }

    .gallery-filmstrip__thumb {
        width: 80px;
        height: 53px;
    }

    .gallery-filmstrip__nav {
        opacity: 1;
    }
}
