/* ═══════════════════════════════════════════════════════════
   Aevita Video Cards — Widget Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ── CSS custom properties (fallbacks when theme vars absent) ── */
.aevita-video-widget {
    --av-blue:      #3753F0;
    --av-teal:      #00BC8E;
    --av-teal-dark: #00967A;
    --av-dark:      #002327;
    --av-muted:     #7B8FA6;
}

/* ── Base card ── */
.aevita-video-card {
    flex-shrink: 0;
    width: 240px;
    aspect-ratio: 9 / 16;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 6px 28px rgba(0, 35, 39, 0.16);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.aevita-video-card.no-video {
    cursor: default;
}

.aevita-video-card.has-video:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 48px rgba(0, 35, 39, 0.24);
}

/* ── Dark gradient overlay on top of thumbnail ── */
.aevita-vcard-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 10, 20, 0.35) 0%,
        rgba(0, 10, 20, 0.10) 40%,
        rgba(0, 10, 20, 0.55) 100%
    );
    z-index: 0;
}

/* ── Top overlay with name & duration ── */
.aevita-vcard-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 16px 14px 48px;
    background: linear-gradient(to bottom, rgba(0, 10, 20, 0.55) 0%, transparent 100%);
    z-index: 1;
}

.aevita-vcard-name {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 3px;
    line-height: 1.3;
}

.aevita-vcard-duration {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

/* ── Play button (bottom-left) ── */
.aevita-vcard-play {
    position: absolute;
    bottom: 16px;
    left: 14px;
    width: 38px;
    height: 38px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 2;
}

.aevita-vcard-play::after {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 0 6px 12px;
    border-color: transparent transparent transparent #3753F0;
    margin-left: 3px;
    display: block;
}

.aevita-video-card.has-video:hover .aevita-vcard-play {
    transform: scale(1.12);
    background: #3753F0;
}

.aevita-video-card.has-video:hover .aevita-vcard-play::after {
    border-color: transparent transparent transparent #ffffff;
}

/* ── Optional result badge (bottom-right) ── */
.aevita-vcard-badge {
    position: absolute;
    bottom: 16px;
    right: 14px;
    background: rgba(0, 188, 142, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 188, 142, 0.45);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 2;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════
   Layout: Fixed Row (centered)
═══════════════════════════════════════════════ */
.aevita-vcards-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* When there are exactly 5 cards: equal 1/5 width */
.aevita-vcards-row .aevita-video-card {
    width: calc((100% - 64px) / 5);
    min-width: 120px;
}

@media (max-width: 860px) {
    .aevita-vcards-row { gap: 12px; }
    .aevita-vcards-row .aevita-video-card {
        width: calc((100% - 36px) / 4);
    }
}

@media (max-width: 600px) {
    .aevita-vcards-row { gap: 10px; }
    .aevita-vcards-row .aevita-video-card {
        width: calc((100% - 20px) / 3);
    }
}

/* ═══════════════════════════════════════════════
   Layout: Horizontal Scroll (peek)
═══════════════════════════════════════════════ */
.aevita-vcards-outer {
    overflow-x: clip;
    overflow-y: visible;
    width: 100%;
}

.aevita-vcards-track {
    display: flex;
    gap: 16px;
    overflow-x: scroll;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 12px 80px 44px;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
    will-change: scroll-position;
}

.aevita-vcards-track::-webkit-scrollbar {
    display: none;
}

.aevita-vcards-track.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.aevita-vcards-track .aevita-video-card {
    width: 240px;
    scroll-snap-align: start;
}

@media (max-width: 640px) {
    .aevita-vcards-track {
        padding: 12px 36px 44px;
        gap: 12px;
        scroll-snap-type: x mandatory;
    }
    .aevita-vcards-track .aevita-video-card {
        width: calc(100vw - 88px);
        border-radius: 14px;
        scroll-snap-align: center;
    }
}

/* ═══════════════════════════════════════════════
   Section header
═══════════════════════════════════════════════ */
.aevita-video-header {
    text-align: center;
    margin-bottom: 48px;
}

.aevita-section-label {
    display: inline-block;
    background: rgba(0, 188, 142, 0.1);
    color: #00967A;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.aevita-video-header h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    color: #002327;
    margin: 0 0 16px;
    line-height: 1.2;
}

.aevita-video-header .lead {
    font-size: 1rem;
    color: #7B8FA6;
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════
   Inline video overlay (plays inside the card)
═══════════════════════════════════════════════ */

/* Full-card overlay that sits on top of the gradient/thumbnail */
.aevita-video-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: #000;
    border-radius: inherit;
    display: flex;
    flex-direction: column;
    animation: aevitaOverlayIn 0.22s ease both;
}

/* Close button — teal circle top-right, matching the screenshot */
.aevita-video-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 30;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #00BC8E;
    color: #ffffff;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: background 0.18s, transform 0.18s;
    font-family: inherit;
    padding: 0;
}

.aevita-video-close:hover {
    background: #009E78;
    transform: scale(1.1);
}

/* Player fills the overlay */
.aevita-video-player {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
}

.aevita-video-player iframe,
.aevita-video-player video {
    width: 100%;
    height: 100%;
    display: block;
    border: none;
    object-fit: cover;
}

/* Fade-in animation */
@keyframes aevitaOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
