/* ============================================
   FEATURED CONTENT - what js/index/video-carousel.js adds to the carousel
   (css/index/video-carousel.css): a card is a button, a video's card shows its
   thumbnail, a featured picture is a card of its own, and opens large.
   ============================================ */

.featured-card {
    display: block;
    text-align: left;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
}
.featured-card:focus-visible {
    outline: 3px solid var(--button-bg);
    outline-offset: 3px;
}
.featured-card .video-thumbnail,
.featured-card .video-info,
.featured-card .video-title,
.featured-card .video-description { display: block; }
.featured-card .video-meta { display: flex; }
.featured-card .video-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.featured-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.featured-card.is-picture .video-thumbnail { background: var(--hover-bg, #f3f4f6); }
.featured-card.is-picture .featured-thumb { object-fit: contain; }
.featured-card .video-play-btn { z-index: 1; }

.featured-duration {
    position: absolute;
    right: 0.6rem;
    bottom: 0.6rem;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 0.75rem;
}
.featured-kind {
    position: absolute;
    left: 0.6rem;
    top: 0.6rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
}

.video-categories[hidden] { display: none !important; }

/* Everything fits: nothing to rotate, so no arrows, and the cards sit centred
   (video-carousel.js sets .fits). */
.video-carousel-wrapper.fits .carousel-control { display: none !important; }
.video-carousel-wrapper.fits .video-carousel-track { justify-content: center; }

/* Pause / Play (WCAG 2.2.2): the reader can stop the row turning by itself. */
.featured-rotation-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.5rem auto;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(var(--border-rgb, 229, 231, 235), 0.9);
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.featured-rotation-toggle[hidden] { display: none; }
.featured-rotation-toggle:hover { border-color: var(--button-bg); }
.featured-rotation-toggle:focus-visible { outline: 3px solid var(--button-bg); outline-offset: 2px; }
.featured-rotation-toggle span { font-size: 0.7rem; }
.featured-meta-kind {
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    background: rgba(var(--button-bg-rgb), 0.1);
}

/* Phones: the arrows sit beside the card, not over it, and a step is a real
   slide - responsive.css makes every transition 0.15s on touch screens, which
   turned the rotation into a flick. */
@media (max-width: 767px) {
    #video-showcase-section .video-carousel-wrapper { padding: 0 44px; }
}
@media (hover: none) and (pointer: coarse) {
    #video-carousel { transition-duration: 0.45s !important; }
}

/* a featured picture, large */
.featured-picture-viewer {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.featured-picture-viewer.open { display: flex; }
.fpv-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.82); }
.fpv-frame {
    position: relative;
    margin: 0;
    max-width: min(1100px, 100%);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.fpv-image {
    max-width: 100%;
    max-height: calc(100vh - 9rem);
    border-radius: 10px;
    background: #fff;
    display: block;
}
.fpv-caption {
    margin-top: 0.75rem;
    color: #fff;
    text-align: center;
    max-width: 48rem;
}
.fpv-caption strong { display: block; font-size: 1.05rem; }
.fpv-text { display: block; margin-top: 0.25rem; font-size: 0.9rem; opacity: 0.85; white-space: pre-line; }
.fpv-text[hidden] { display: none; }
.fpv-close {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #111827;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    z-index: 1;
}
