/* ============================================================
   wiki-article-media.css — Embeds, carousel, lightbox
   ============================================================ */

/* ---------- Embeds (YouTube + video) ---------- */
.article-embed {
    margin-block: var(--space-5);
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.article-embed--video {
    aspect-ratio: 16 / 9;
}

.article-embed iframe,
.article-embed video {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---------- Carousel ---------- */
.article-carousel {
    position: relative;
    margin-block: var(--space-5);
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.article-carousel__track {
    position: relative;
}

.article-carousel__slide {
    width: 100%;
}

.article-carousel__slide img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.article-carousel__slide figcaption {
    padding: var(--space-2) var(--space-4);
    font-size: var(--fs-sm);
    color: var(--text-muted);
    text-align: center;
    background: var(--surface-2);
}

/* Arrows — reuse btn-icon pattern */
.article-carousel__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    color: var(--text-muted);
    cursor: pointer;
    transition:
        background var(--dur-fast) var(--ease-standard),
        color var(--dur-fast) var(--ease-standard);
}

.article-carousel__arrow:hover:not(:disabled) {
    background: var(--surface-3);
    color: var(--text);
}

.article-carousel__arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.article-carousel__arrow--prev {
    left: var(--space-3);
}

.article-carousel__arrow--next {
    right: var(--space-3);
}

/* Dot indicators */
.article-carousel__dots {
    position: absolute;
    bottom: var(--space-3);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-2);
    z-index: 2;
}

.article-carousel__dot {
    width: 6px;
    height: 6px;
    border-radius: var(--r-full);
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background var(--dur-fast) var(--ease-standard);
}

.article-carousel__dot--active {
    background: #fff;
}

.article-carousel__dot:hover {
    background: rgba(255, 255, 255, 0.75);
}

/* ---------- Lightbox ---------- */
.article-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: var(--overlay);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.article-lightbox-overlay--hidden {
    opacity: 0;
}

.article-lightbox-overlay--visible {
    opacity: 1;
}

.article-lightbox-overlay--enter,
.article-lightbox-overlay--leave {
    transition: opacity var(--dur) var(--ease-out);
}

.article-lightbox__close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    color: var(--text-muted);
    cursor: pointer;
    transition:
        background var(--dur-fast) var(--ease-standard),
        color var(--dur-fast) var(--ease-standard);
}

.article-lightbox__close:hover {
    background: var(--surface-3);
    color: var(--text);
}

.article-lightbox__img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: var(--r-lg);
    object-fit: contain;
    box-shadow: var(--shadow-lg);
}

/* ---------- Mobile adjustments ---------- */
@media (max-width: 768px) {
    .article-carousel__arrow {
        width: 32px;
        height: 32px;
    }

    .article-figure figcaption,
    .article-carousel__slide figcaption {
        font-size: var(--fs-xs);
        padding: var(--space-1) var(--space-3);
    }

    .article-embed,
    .article-carousel {
        margin-block: var(--space-4);
    }
}

@media (prefers-reduced-motion: reduce) {
    .article-lightbox-overlay--enter,
    .article-lightbox-overlay--leave {
        transition-duration: 0.001ms;
    }
}
