/* ==========================================================================
   Artist Gallery - Horizontal Scroll with Modal
   ========================================================================== */

/* Gallery Container */
.artist-gallery {
    width: 100%;
    margin: 3rem 0;
}

.artist-gallery-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    color: var(--color-dark-blue);
    margin-bottom: 1.5rem;
    text-align: left;
}

/* Horizontal Scroll Strip */
.gallery-scroll-container {
    position: relative;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1rem 0;
    margin-bottom: 1rem;
    /* Smooth scrolling */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* Ensure content doesn't wrap */
    white-space: nowrap;
}

/* Custom scrollbar */
.gallery-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.gallery-scroll-container::-webkit-scrollbar-track {
    background: rgba(0, 45, 115, 0.1);
    border-radius: 4px;
}

.gallery-scroll-container::-webkit-scrollbar-thumb {
    background: var(--color-teal);
    border-radius: 4px;
}

.gallery-scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--color-gold);
}

/* Gallery Strip */
.gallery-strip {
    display: flex;
    flex-wrap: nowrap; /* CRITICAL: Prevent wrapping */
    gap: 1rem;
    padding: 0.5rem 0;
    width: max-content; /* Allow strip to be wider than container */
}

/* Gallery Thumbnail */
.gallery-thumbnail {
    flex-shrink: 0; /* Prevent shrinking */
    flex-grow: 0; /* Prevent growing */
    width: 180px;
    min-width: 180px; /* Force minimum width */
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 3px solid transparent;
    display: inline-block; /* Ensure proper rendering */
    white-space: normal; /* Reset white-space for content inside */
}

.gallery-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--color-gold);
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Overlay on hover */
.gallery-thumbnail::after {
    content: '🔍';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 9, 47, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-thumbnail:hover::after {
    opacity: 1;
}

/* ==========================================================================
   Modal Lightbox
   ========================================================================== */

.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 9, 47, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

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

.gallery-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-modal img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 4px solid var(--color-gold);
}

/* Close Button */
.gallery-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: var(--color-gold);
    color: var(--color-cosmic-blue);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 10000;
}

.gallery-modal-close:hover {
    background: var(--color-white);
    transform: rotate(90deg);
}

/* Navigation Arrows */
.gallery-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 177, 23, 0.8);
    color: var(--color-cosmic-blue);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10000;
}

.gallery-modal-nav:hover {
    background: var(--color-gold);
    transform: translateY(-50%) scale(1.1);
}

.gallery-modal-nav.prev {
    left: -70px;
}

.gallery-modal-nav.next {
    right: -70px;
}

/* Counter */
.gallery-modal-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 45, 115, 0.9);
    color: var(--color-white);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-family: var(--font-numbers);
    font-size: 1rem;
    border: 2px solid var(--color-gold);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 767px) {
    .gallery-thumbnail {
        width: 140px;
        height: 140px;
    }

    .artist-gallery-title {
        font-size: 1.5rem;
    }

    .gallery-modal {
        padding: 1rem;
    }

    .gallery-modal-close {
        top: 10px;
        right: 10px;
    }

    .gallery-modal-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .gallery-modal-nav.prev {
        left: 10px;
    }

    .gallery-modal-nav.next {
        right: 10px;
    }

    .gallery-modal-counter {
        position: fixed;
        bottom: 10px;
        font-size: 0.9rem;
        padding: 0.4rem 1rem;
    }
}

/* Empty state */
.gallery-empty {
    text-align: center;
    color: var(--color-light-blue);
    font-style: italic;
    padding: 2rem;
}
