/* Saltimbanque Gallery Suite CSS */
.saltim-gallery-wrapper {
    width: 100%;
    margin: 2rem 0;
}

/* Tabs */
.saltim-gallery-tabs-wrap {
    margin-bottom: 2.5rem;
    position: sticky;
    top: 75px;
    z-index: 30;
    background: rgba(250, 248, 245, 0.95);
    backdrop-filter: blur(8px);
    padding: 1rem 0;
    border-bottom: 1px solid rgba(210, 0, 59, 0.15);
}

.saltim-gallery-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
}

.gallery-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 50px;
    color: #1A1A1A;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.gallery-tab-btn .tab-badge {
    background: #F1F5F9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    transition: all 0.25s ease;
}

.gallery-tab-btn:hover {
    border-color: #D2003B;
    color: #D2003B;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(210, 0, 59, 0.08);
}

.gallery-tab-btn.active {
    background: #D2003B;
    border-color: #D2003B;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(210, 0, 59, 0.25);
}

.gallery-tab-btn.active .tab-badge {
    background: #FFFFFF;
    color: #D2003B;
}

/* Album Sections */
.gallery-album-section {
    margin-bottom: 4rem;
    animation: fadeInGallery 0.35s ease;
}

@keyframes fadeInGallery {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.album-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #F1F5F9;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.album-header-tag {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tag-year {
    background: #D2003B;
    color: #FFF;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.tag-title {
    font-family: 'Cinzel', 'Playfair Display', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #1A1A1A;
}

.album-desc {
    margin: 0;
    color: #64748B;
    font-size: 0.95rem;
    font-style: italic;
    width: 100%;
}

.album-count {
    color: #94A3B8;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Grid layout (Masonry/Responsive 4 columns) */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.album-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 4 / 3;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.album-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.album-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}

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

.album-item:hover .album-link img {
    transform: scale(1.06);
}

.album-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.album-item:hover .album-item-overlay {
    opacity: 1;
}

.overlay-icon {
    font-size: 1.8rem;
    color: #FFF;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* ==========================================================================
   Saltim'Banques Ultra-Responsive Lightbox Modal with Full Navigation
   ========================================================================== */
.saltim-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.saltim-gallery-modal.is-active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

/* Dark blurred theatrical backdrop */
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 8, 12, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Modal Wrapper */
.modal-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    box-sizing: border-box;
    pointer-events: none; /* Let backdrop clicks pass through except on interactive children */
}

.modal-wrapper > * {
    pointer-events: auto;
}

/* Top Control Bar */
.modal-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0.5rem 0.75rem 0.5rem;
    z-index: 20;
}

.modal-counter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(20, 20, 25, 0.85);
    border: 1px solid rgba(212, 175, 55, 0.6);
    color: #F8FAFC;
    padding: 0.45rem 0.9rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.modal-counter-badge .modal-counter-icon {
    font-size: 0.95rem;
}

.modal-counter-badge .modal-counter {
    color: #D4AF37;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-hint-keys {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    display: none;
}

@media (min-width: 992px) {
    .modal-hint-keys {
        display: inline-block;
    }
}

.modal-close-btn {
    background: rgba(25, 25, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.modal-close-btn:hover {
    background: #D2003B;
    border-color: #D4AF37;
    transform: rotate(90deg) scale(1.08);
    box-shadow: 0 0 15px rgba(210, 0, 59, 0.7);
}

/* Stage Area with Fixed / Hover Nav Arrows */
.modal-stage {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    margin: 0.5rem 0;
}

.modal-img-container {
    max-width: 88vw;
    max-height: calc(85vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    user-select: none;
}

.modal-img {
    max-width: 100%;
    max-height: calc(85vh - 120px);
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.85);
    transition: opacity 0.22s ease-in-out, transform 0.22s ease-in-out;
    opacity: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-img.is-loading {
    opacity: 0.25;
    transform: scale(0.98);
}

/* Navigation Chevron Buttons (Left & Right) */
.modal-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(18, 18, 24, 0.82);
    border: 2px solid #D4AF37;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7), 0 0 10px rgba(212, 175, 55, 0.3);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.modal-nav-btn:hover {
    background: #D2003B;
    border-color: #FFFFFF;
    color: #FFFFFF;
    transform: translateY(-50%) scale(1.12);
    box-shadow: 0 8px 25px rgba(210, 0, 59, 0.8), 0 0 18px rgba(212, 175, 55, 0.6);
}

.modal-nav-btn:active {
    transform: translateY(-50%) scale(0.96);
}

.modal-nav-btn.modal-prev {
    left: 24px;
}

.modal-nav-btn.modal-next {
    right: 24px;
}

.modal-nav-btn svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    stroke-width: 2.8;
}

/* Bottom Bar: Caption & Interactive Dots */
.modal-bottom-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.5rem 1rem;
    z-index: 20;
    text-align: center;
}

.modal-caption {
    color: #F8FAFC;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: var(--font-serif, "Playfair Display", Georgia, serif);
    letter-spacing: 0.02em;
    max-width: 800px;
    line-height: 1.4;
    text-shadow: 0 2px 6px rgba(0,0,0,0.9);
    margin-bottom: 0.5rem;
}

/* Dots Navigation Ribbon */
.modal-dots-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    max-width: 90vw;
    max-height: 48px;
    overflow-y: hidden;
    padding: 0.25rem 0.5rem;
}

.modal-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.modal-dot:hover {
    background: rgba(212, 175, 55, 0.8);
    transform: scale(1.3);
}

.modal-dot.is-active {
    background: #D4AF37;
    border-color: #FFFFFF;
    transform: scale(1.4);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.9);
}

/* Mobile & Tablet Optimizations */
@media (max-width: 768px) {
    .modal-wrapper {
        padding: 0.75rem 0.75rem;
    }

    .modal-img-container {
        max-width: 96vw;
        max-height: calc(80vh - 100px);
    }

    .modal-img {
        max-height: calc(80vh - 100px);
    }

    .modal-nav-btn {
        width: 48px;
        height: 48px;
    }

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

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

    .modal-nav-btn svg {
        width: 24px;
        height: 24px;
    }

    .modal-caption {
        font-size: 0.9rem;
    }

    .modal-dots-nav {
        display: none; /* Hide dots on small screens to save space for swipe */
    }
}
