/* ==========================================================================
   Gallery — Ink Tulum
   Dual infinite marquee — CSS animation, no JS needed for scroll
   ========================================================================== */

.gallery-section {
    background: var(--tk-black);
    padding: 3rem 0;
    overflow: hidden;
}

/* --- Header --- */
.gallery-header { margin-bottom: 2rem; }

.gallery-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
}

.gallery-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* --- Filters --- */
.gallery-filters { display: flex; gap: 6px; flex-wrap: wrap; }

.filter-chip {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--tk-gray);
    cursor: pointer;
    transition: all 0.25s ease;
}

.filter-chip:hover { border-color: rgba(255, 255, 255, 0.3); color: var(--tk-beige); }
.filter-chip.active { background: var(--tk-red); border-color: var(--tk-red); color: #fff; }

/* --- Rows --- */
.gallery-row {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
    margin-bottom: 5px;
}

/* --- Track: flex row, duplicated content, animated --- */
.gallery-track {
    display: flex;
    gap: 5px;
    width: max-content;
}

.gallery-track--left {
    animation: marquee-left 80s linear infinite;
}

.gallery-track--right {
    animation: marquee-right 80s linear infinite;
}

@keyframes marquee-left {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes marquee-right {
    0%   { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

/* Pause on hover */
.gallery-row:hover .gallery-track {
    animation-play-state: paused;
}

/* --- Slides --- */
.gallery-slide {
    flex-shrink: 0;
    width: 300px;
    height: 250px;
    overflow: hidden;
    cursor: pointer;
    border-radius: 3px;
}

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

.gallery-slide:hover img {
    transform: scale(1.04);
}

/* Filter hide */
.gallery-slide.hidden { display: none; }

/* --- Lightbox --- */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.97);
    display: none;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox.active { display: flex; }

.gallery-lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
}

.gallery-lightbox-close {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    width: 40px;
    height: 40px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.4rem;
    cursor: pointer;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: color 0.2s;
}
.gallery-lightbox-close:hover { color: #fff; }

.gallery-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 1.5rem;
    z-index: 10001;
    transition: color 0.2s;
}
.gallery-lightbox-nav:hover { color: #fff; }
.gallery-lightbox-nav.prev { left: 0; }
.gallery-lightbox-nav.next { right: 0; }

.lightbox-counter {
    position: absolute;
    bottom: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-sans);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.15em;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .gallery-slide { width: 250px; height: 210px; }
}

@media (max-width: 768px) {
    .gallery-slide { width: 200px; height: 170px; }
    .gallery-header-inner { flex-direction: column; align-items: flex-start; }
    .gallery-filters { overflow-x: auto; flex-wrap: nowrap; }
    .filter-chip { flex-shrink: 0; }
    .gallery-track--left { animation-duration: 40s; }
    .gallery-track--right { animation-duration: 40s; }
}

@media (max-width: 480px) {
    .gallery-slide { width: 160px; height: 140px; }
    .gallery-section { padding: 2rem 0; }
    .gallery-track--left { animation-duration: 30s; }
    .gallery-track--right { animation-duration: 30s; }
}
