/**
 * Mapa Cultural - Gallery & Lightbox Styles
 * High-definition previews, interactive transitions, modern modal lightbox.
 */

/* ==========================================================================
   Gallery Card Grid (Entity Profile & Presentation)
   ========================================================================== */
.mc-gallery-card {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mc-gallery-card:hover {
    transform: translateY(-3px);
}

.mc-gallery-link {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 10px;
    background-color: #f1f5f9;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    text-decoration: none;
}

.mc-gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
    display: block;
}

.mc-gallery-link:hover .mc-gallery-img {
    transform: scale(1.07);
}

.mc-gallery-hover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.72) 0%, rgba(15, 23, 42, 0.2) 60%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 2;
}

.mc-gallery-link:hover .mc-gallery-hover-overlay {
    opacity: 1;
}

.mc-gallery-zoom-badge {
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 9999px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transform: translateY(8px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    letter-spacing: 0.3px;
}

.mc-gallery-link:hover .mc-gallery-zoom-badge {
    transform: translateY(0);
}

.mc-gallery-caption {
    padding: 6px 4px 2px;
}

.mc-gallery-caption-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

.mc-gallery-caption-desc {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.35;
}

/* ==========================================================================
   Interactive Lightbox Modal
   ========================================================================== */
body.mc-lightbox-open {
    overflow: hidden !important;
}

/* Oculta completamente quaisquer controles flutuantes de acessibilidade e VLibras quando a galeria estiver aberta */
body.mc-lightbox-open .mc-tts-continuous-container,
body.mc-lightbox-open .mc-tts-container,
body.mc-lightbox-open .mc-tts-hover-container,
body.mc-lightbox-open .mc-a11y-container,
body.mc-lightbox-open .mc-tts-player,
body.mc-lightbox-open .mc-tts-hover-indicator,
body.mc-lightbox-open [vw],
body.mc-lightbox-open .vw-plugin-wrapper,
body.mc-lightbox-open div[vw-access-button],
body.mc-lightbox-open #vlibras-access-wrapper,
body.mc-lightbox-open .access-button {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: -1 !important;
    transition: opacity 0.2s ease, visibility 0.2s ease !important;
}

.mc-lightbox {
    position: fixed;
    inset: 0;
    z-index: 20000000 !important;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
    user-select: none;
    -webkit-user-select: none;
}

.mc-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.mc-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 11, 18, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 1;
}

/* Top Toolbar */
.mc-lightbox-toolbar {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    color: #fff;
}

.mc-lightbox-info {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 60%;
}

.mc-lightbox-counter {
    background: rgba(255, 255, 255, 0.12);
    padding: 5px 14px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    color: #f8fafc;
    white-space: nowrap;
}

.mc-lightbox-group-title {
    font-size: 0.9rem;
    color: #cbd5e1;
    font-weight: 500;
}

.mc-lightbox-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mc-lightbox-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    outline: none;
}

.mc-lightbox-btn:hover,
.mc-lightbox-btn:focus-visible {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.35);
}

.mc-lightbox-close:hover,
.mc-lightbox-close:focus-visible {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
    transform: scale(1.08) rotate(90deg);
}

/* Center Stage */
.mc-lightbox-stage {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px 85px;
    cursor: pointer;
}

.mc-lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 50;
    outline: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.mc-lightbox-arrow:hover,
.mc-lightbox-arrow:focus-visible {
    background: #0284c7;
    border-color: #38bdf8;
    color: #fff;
    transform: translateY(-50%) scale(1.12);
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.5);
}

.mc-lightbox-arrow:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
}

.mc-lightbox-prev {
    left: 20px;
}

.mc-lightbox-next {
    right: 20px;
}

.mc-lightbox-media-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: calc(100vh - 200px);
    cursor: default;
}

.mc-lightbox-image {
    max-width: 90vw;
    max-height: calc(100vh - 200px);
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.85);
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.mc-lightbox-image.is-loading {
    opacity: 0.65;
    filter: blur(8px);
}

.mc-lightbox-image.is-loaded {
    opacity: 1;
    filter: none;
}

/* Zoomed State */
.mc-lightbox-stage.is-zoomed {
    overflow: auto;
    cursor: grab;
    display: block;
    text-align: center;
    padding: 20px;
}

.mc-lightbox-stage.is-zoomed:active {
    cursor: grabbing;
}

.mc-lightbox-stage.is-zoomed .mc-lightbox-media-wrapper {
    max-width: none;
    max-height: none;
    display: inline-block;
}

.mc-lightbox-stage.is-zoomed .mc-lightbox-image {
    max-width: none;
    max-height: none;
    transform: scale(1.6);
    transform-origin: center center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.95);
    margin: 60px;
}

.mc-lightbox-spinner {
    position: absolute;
    width: 48px;
    height: 48px;
    z-index: 10;
    display: none;
}

/* Bottom Caption */
.mc-lightbox-caption {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 10px 24px;
    color: #fff;
    max-width: 860px;
    margin: 0 auto;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mc-lightbox-caption-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 2px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.mc-lightbox-caption-desc {
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.4;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

/* Bottom Thumbnails Strip */
.mc-lightbox-thumbs-bar {
    position: relative;
    z-index: 10;
    padding: 6px 16px 14px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
    display: flex;
    justify-content: center;
}

.mc-lightbox-thumbs-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    max-width: 90vw;
    padding: 4px 8px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.mc-lightbox-thumbs-scroll::-webkit-scrollbar {
    height: 5px;
}

.mc-lightbox-thumbs-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.mc-lightbox-thumbs-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
}

.mc-lightbox-thumbs-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.45);
}

.mc-lightbox-thumb-item {
    width: 60px;
    height: 45px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    opacity: 0.5;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    background: #0f172a;
    padding: 0;
}

.mc-lightbox-thumb-item:hover,
.mc-lightbox-thumb-item:focus-visible {
    opacity: 0.85;
    transform: scale(1.08);
}

.mc-lightbox-thumb-item.is-active {
    opacity: 1;
    border-color: #38bdf8;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.7);
    transform: scale(1.12);
}

.mc-lightbox-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .mc-lightbox-stage {
        padding: 10px 14px;
    }

    .mc-lightbox-arrow {
        width: 42px;
        height: 42px;
        font-size: 1rem;
        background: rgba(20, 26, 38, 0.85);
    }

    .mc-lightbox-prev {
        left: 8px;
    }

    .mc-lightbox-next {
        right: 8px;
    }

    .mc-lightbox-media-wrapper {
        max-width: 96vw;
        max-height: calc(100vh - 220px);
    }

    .mc-lightbox-image {
        max-width: 96vw;
        max-height: calc(100vh - 220px);
    }

    .mc-lightbox-toolbar {
        padding: 10px 12px;
    }

    .mc-lightbox-btn {
        width: 36px;
        height: 36px;
        font-size: 0.88rem;
    }

    .mc-lightbox-group-title {
        display: none;
    }

    .mc-lightbox-thumb-item {
        width: 48px;
        height: 36px;
    }
}

