/* ============================================================
   Custom Video FAQ Widget — custom-video-faq-widget.css
   ============================================================ */

/* ── CSS Variables (defaults, overridden by inline vars) ─── */
.cvfaq-wrapper {
    --cvfaq-lb-overlay:   rgba(0, 0, 0, 0.88);
    --cvfaq-lb-max-w:     960px;
    --cvfaq-lb-close:     #ffffff;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

/* ── Grid ────────────────────────────────────────────────── */
.cvfaq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 24px;
    row-gap: 32px;
}

/* ══════════════════════════════════════════════════════════
   CARD
   ══════════════════════════════════════════════════════════ */
.cvfaq-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    background: transparent;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    outline: none;
}

.cvfaq-card:hover {
    transform: translateY(-3px);
}

.cvfaq-card:focus-visible {
    outline: 3px solid #cd5050;
    outline-offset: 3px;
}

/* ── Thumbnail wrapper (aspect-ratio via padding-bottom trick) */
.cvfaq-thumb-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 default */
    overflow: hidden;
    border-radius: 6px 6px 0 0;
    background: #1a1a1a;
    flex-shrink: 0;
}

.cvfaq-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.cvfaq-thumb--placeholder {
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
}

/* Hover overlay */
.cvfaq-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    transition: background 0.28s ease;
    z-index: 1;
}

.cvfaq-card:hover .cvfaq-overlay {
    background: rgba(0, 0, 0, 0.15);
}

/* Inline iframe replaces thumb */
.cvfaq-thumb-wrap iframe.cvfaq-inline-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 3;
}

/* ── Play Button ─────────────────────────────────────────── */
.cvfaq-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 52px;
    height: 52px;
    background: rgba(205, 80, 80, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.22s ease, transform 0.22s ease;
    pointer-events: none;
}

.cvfaq-card:hover .cvfaq-play {
    background: rgba(180, 40, 40, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.cvfaq-play svg {
    width: 45%;
    height: 45%;
    fill: #fff;
    display: block;
    margin-left: 3px; /* optical centre for play triangle */
}

/* Styles */
.cvfaq-play-style-circle   .cvfaq-play { border-radius: 50%; }
.cvfaq-play-style-rounded  .cvfaq-play { border-radius: 8px; }
.cvfaq-play-style-youtube  .cvfaq-play { border-radius: 12px; width: 64px; height: 44px; }
.cvfaq-play-style-youtube  .cvfaq-play svg { width: 35%; }

/* ── Card Body ───────────────────────────────────────────── */
.cvfaq-body {
    padding: 0;
}

.cvfaq-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.45;
    color: #1a1a1a;
    margin: 12px 0 0;
    transition: color 0.2s ease;
}

.cvfaq-card:hover .cvfaq-title {
    color: #c0392b;
}

/* ══════════════════════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════════════════════ */
.cvfaq-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.cvfaq-lightbox[hidden] {
    display: none;
}

/* Opening animation */
.cvfaq-lightbox.is-open {
    animation: cvfaqLbFadeIn 0.25s ease forwards;
}

.cvfaq-lightbox.is-closing {
    animation: cvfaqLbFadeOut 0.2s ease forwards;
}

@keyframes cvfaqLbFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes cvfaqLbFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* Backdrop */
.cvfaq-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: var(--cvfaq-lb-overlay, rgba(0, 0, 0, 0.88));
    cursor: pointer;
}

/* Inner container */
.cvfaq-lightbox__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--cvfaq-lb-max-w, 960px);
    animation: cvfaqLbSlideUp 0.3s ease forwards;
}

@keyframes cvfaqLbSlideUp {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Video wrapper (16:9) */
.cvfaq-lightbox__video-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
}

.cvfaq-lightbox__iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Close button */
.cvfaq-lightbox__close {
    position: absolute;
    top: -44px;
    right: 0;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cvfaq-lb-close, #ffffff);
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.85;
}

.cvfaq-lightbox__close:hover {
    transform: rotate(90deg);
    opacity: 1;
}

.cvfaq-lightbox__close svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media ( max-width: 1024px ) {
    .cvfaq-title {
        font-size: 0.9rem;
    }
}

@media ( max-width: 767px ) {
    .cvfaq-grid {
        grid-template-columns: 1fr;
        row-gap: 24px;
    }

    .cvfaq-lightbox {
        padding: 12px;
    }

    .cvfaq-lightbox__close {
        top: -40px;
    }
}

@media ( max-width: 480px ) {
    .cvfaq-play {
        width: 42px !important;
        height: 42px !important;
    }
}