/* Wiki explore — fullscreen image viewer (Fandom-inspired) */

.wiki-photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(8px, 1.2vw, 20px);
    box-sizing: border-box;
}

.wiki-photo-lightbox[hidden] {
    display: none !important;
}

.wiki-photo-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 18, 28, 0.72);
    backdrop-filter: blur(4px);
}

.wiki-photo-lightbox__panel {
    position: relative;
    z-index: 1;
    width: min(1280px, 98vw);
    max-height: min(95vh, 980px);
    display: flex;
    flex-direction: column;
    background: #eceaf4;
    border-radius: 10px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    border: 1px solid rgba(88, 76, 140, 0.18);
}

.wiki-photo-lightbox__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: clamp(12px, 1.1vw, 18px) clamp(14px, 1.2vw, 20px) 10px;
    flex-shrink: 0;
}

.wiki-photo-lightbox__meta {
    min-width: 0;
    flex: 1;
}

.wiki-photo-lightbox__title {
    margin: 0;
    font-family: "Rubik", "Inter", system-ui, sans-serif;
    font-size: clamp(15px, 1.05vw, 18px);
    font-weight: 700;
    color: #3d2f6b;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.wiki-photo-lightbox__sub {
    margin: 6px 0 0;
    font-family: "Inter", system-ui, sans-serif;
    font-size: clamp(12px, 0.82vw, 14px);
    font-weight: 500;
    color: #5b4a8a;
    line-height: 1.35;
}

.wiki-photo-lightbox__close {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #0f172a;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.12s ease;
    padding: 0;
}

.wiki-photo-lightbox__close:hover {
    background: transparent;
    color: #000;
}

.wiki-photo-lightbox__close:active {
    transform: scale(0.96);
}

.wiki-photo-lightbox__close-icon,
.wiki-photo-lightbox__close .lucide-icon {
    width: 16px;
    height: 16px;
}

.wiki-photo-lightbox__main {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: linear-gradient(180deg, #e4e2ee 0%, #dcd8ea 100%);
}

.wiki-photo-lightbox__stage {
    flex: 1;
    min-height: 0;
    max-height: min(65vh, 760px);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(8px, 1vw, 16px);
}

.wiki-photo-lightbox__img {
    max-width: min(98%, 1220px);
    max-height: min(65vh, 760px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.wiki-photo-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.46);
    background: rgba(24, 26, 36, 0.62);
    color: rgba(255, 255, 255, 0.97);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    transition: background 0.15s ease, color 0.15s ease;
    padding: 0;
}

.wiki-photo-lightbox__nav:hover:not(:disabled) {
    background: rgba(24, 26, 36, 0.78);
    color: #fff;
}

.wiki-photo-lightbox__nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.wiki-photo-lightbox__nav .lucide-icon {
    width: 24px;
    height: 24px;
}

.wiki-photo-lightbox__nav--prev {
    left: clamp(10px, 1.1vw, 16px);
}

.wiki-photo-lightbox__nav--next {
    right: clamp(10px, 1.1vw, 16px);
}

.wiki-photo-lightbox__thumbs-outer {
    flex-shrink: 0;
    padding: 10px clamp(12px, 1vw, 18px) 6px;
    background: #e8e6f1;
    border-top: 1px solid rgba(88, 76, 140, 0.12);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.wiki-photo-lightbox__thumbs {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    width: max-content;
    margin: 0 auto;
    padding-bottom: 4px;
}

.wiki-photo-lightbox__thumb-slot {
    flex: 0 0 auto;
    width: clamp(88px, 9.5vw, 128px);
    aspect-ratio: 16 / 9;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.wiki-photo-lightbox__thumb-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    display: block;
}

.wiki-photo-lightbox__thumb-slot--active .wiki-photo-lightbox__thumb-img {
    outline: 3px solid #5c4b90;
    outline-offset: 2px;
    border-radius: 2px;
}

.wiki-photo-lightbox__footer {
    flex-shrink: 0;
    text-align: center;
    padding: 8px 12px 14px;
    font-family: "Inter", system-ui, sans-serif;
    font-size: clamp(12px, 0.8vw, 14px);
    font-weight: 600;
    color: #4a3d72;
    letter-spacing: 0.02em;
}

.news-article-wiki-container--wiki-explore .wiki-photo-lightbox-trigger {
    cursor: zoom-in;
}

.news-article-wiki-container--news-article .wiki-photo-lightbox-trigger {
    cursor: zoom-in;
}

.news-article-wiki-container--wiki-explore .article-text img {
    cursor: zoom-in;
}

.news-article-wiki-container--news-article .article-text img {
    cursor: zoom-in;
}

@media (max-width: 640px) {
    .wiki-photo-lightbox__nav {
        width: 36px;
        height: 36px;
    }

    .wiki-photo-lightbox__panel {
        max-height: 96vh;
    }

    .wiki-photo-lightbox__nav .lucide-icon {
        width: 20px;
        height: 20px;
    }
}

html:not([data-vc-rail="light"]) .wiki-photo-lightbox__close {
    color: rgba(255, 255, 255, 0.9);
}

html:not([data-vc-rail="light"]) .wiki-photo-lightbox__close:hover {
    color: #fff;
}
