/*
 * WPA Video Feed — Stylesheet v1.0.0
 * Root vars expected: --navy, --teal-dark, --cyan, --cyan-light, --yellow, --grey-light
 */

/* ── Grid ───────────────────────────────────── */
.wpa-video-feed {
    display: grid;
    grid-template-columns: repeat( 3, 1fr );
    gap: 1.5rem;
}

/* ── Card ───────────────────────────────────── */
.wpa-video-card {
    display: flex;
    flex-direction: column;
    background: #1a1a2e;
    border-radius: 8px;
    overflow: hidden;
}

/* ── Thumbnail ──────────────────────────────── */
.wpa-video-card__thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0d0d1a;
    cursor: pointer;
}

.wpa-video-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.wpa-video-card__thumb:hover .wpa-video-card__img {
    transform: scale(1.03);
    opacity: 0.85;
}

.wpa-video-card__no-thumb {
    width: 100%;
    height: 100%;
    background: linear-gradient( 135deg, #0d0d1a 0%, #1a1a3e 100% );
}

/* ── Play button overlay ────────────────────── */
.wpa-video-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate( -50%, -50% );
    width: 60px;
    height: 60px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    pointer-events: none;
}

.wpa-video-card__thumb:hover .wpa-video-card__play {
    transform: translate( -50%, -50% ) scale( 1.1 );
}

.wpa-video-card__play svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow( 0 2px 8px rgba(0,0,0,0.4) );
}

/* ── Embed iframe ───────────────────────────── */
.wpa-video-card__embed {
    position: absolute;
    inset: 0;
    background: #000;
}

.wpa-video-card__embed[hidden] {
    display: none;
}

.wpa-video-card__embed iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* When embed is active hide the play button */
.wpa-video-card__thumb.is-playing .wpa-video-card__play,
.wpa-video-card__thumb.is-playing .wpa-video-card__img {
    opacity: 0;
    pointer-events: none;
}

/* ── Body ───────────────────────────────────── */
.wpa-video-card__body {
    padding: 1rem;
}

/* ── Title ──────────────────────────────────── */
.wpa-video-card__title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.4rem;
    color: #fff;
}

/* Title as button (for inline play) */
.wpa-video-card__title-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: #fff;
    cursor: pointer;
    text-align: left;
    transition: color 0.2s;
}

.wpa-video-card__title-btn:hover {
    color: var(--cyan-light);
}

.wpa-video-card__title a {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s;
}

.wpa-video-card__title a:hover {
    color: var(--cyan-light);
}

/* ── Meta ───────────────────────────────────── */
.wpa-video-card__meta {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.wpa-video-card__meta time {
    color: rgba(255,255,255,0.5);
}

.wpa-video-card__meta-sep {
    opacity: 0.4;
}

.wpa-video-card__cat {
    color: var(--cyan);
}

/* ── Empty state ────────────────────────────── */
.wpa-video-feed__empty {
    color: #666;
    font-style: italic;
}

/* ── Responsive ─────────────────────────────── */
@media ( max-width: 980px ) {
    .wpa-video-feed {
        grid-template-columns: repeat( 2, 1fr );
    }
}

@media ( max-width: 640px ) {
    .wpa-video-feed {
        grid-template-columns: 1fr;
    }
}

/* ════════════════════════════════════════════════
   VIDEO ARCHIVE  [wpa_video_archive]
════════════════════════════════════════════════ */
.wpa-video-archive {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ── Hero ───────────────────────────────────── */
.wpa-video-hero {
    width: 100%;
}

.wpa-video-hero__thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--navy);
    overflow: hidden;
    cursor: pointer;
    border-radius: 20px;
}

.wpa-video-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.wpa-video-hero__no-thumb {
    width: 100%;
    height: 100%;
    background: linear-gradient( 135deg, #0d0d1a 0%, #002b5c 100% );
}

/* Dark overlay with centred play + info */
.wpa-video-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.1) 0%,
        rgba(0,0,0,0.55) 60%,
        rgba(0,0,0,0.75) 100%
    );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    transition: background 0.3s;
}

.wpa-video-hero__thumb:hover .wpa-video-hero__overlay {
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.15) 0%,
        rgba(0,0,0,0.6) 60%,
        rgba(0,0,0,0.8) 100%
    );
}

.wpa-video-hero__play {
    width: 80px;
    height: 80px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.wpa-video-hero__thumb:hover .wpa-video-hero__play {
    transform: scale( 1.1 );
}

.wpa-video-hero__play svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow( 0 4px 12px rgba(0,0,0,0.5) );
}

.wpa-video-hero__info {
    text-align: center;
    padding: 0 1rem;
}

.wpa-video-hero__title {
    font-size: clamp( 1.1rem, 2.5vw, 1.75rem );
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem;
    line-height: 1.25;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.wpa-video-hero__meta {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

/* Hero embed iframe */
.wpa-video-hero__embed {
    position: absolute;
    inset: 0;
    background: #000;
}

.wpa-video-hero__embed[hidden] { display: none; }

.wpa-video-hero__embed iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Hide overlay when playing */
.wpa-video-hero__thumb.is-playing .wpa-video-hero__overlay,
.wpa-video-hero__thumb.is-playing .wpa-video-hero__img {
    opacity: 0;
    pointer-events: none;
}

/* ── Grid ───────────────────────────────────── */
.wpa-video-archive__grid .alm-listing {
    display: grid !important;
    grid-template-columns: repeat( 4, 1fr ) !important;
    gap: 1.5rem;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.wpa-video-archive__grid .alm-listing .alm-item,
.wpa-video-archive__grid .alm-listing li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Load More button */
.wpa-video-archive__grid .alm-btn-wrap {
    margin-top: 2rem;
    text-align: center;
}

.wpa-video-archive__grid .alm-load-more-btn {
    display: inline-block;
    background: transparent;
    color: var(--navy);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 2px solid var(--navy);
    padding: 0.8rem 2.75rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.wpa-video-archive__grid .alm-load-more-btn:hover {
    background: var(--navy);
    color: #fff;
}

.wpa-video-archive__grid .alm-load-more-btn.loading { opacity: 0.6; cursor: wait; }
.wpa-video-archive__grid .alm-load-more-btn.done    { display: none; }

/* ── Responsive ─────────────────────────────── */
@media ( max-width: 980px ) {
    .wpa-video-archive__grid .alm-listing {
        grid-template-columns: repeat( 2, 1fr ) !important;
    }
}

@media ( max-width: 640px ) {
    .wpa-video-archive__grid .alm-listing {
        grid-template-columns: 1fr !important;
    }
}
