/* =============================================================================
   WP Video Testimonials — Frontend CSS  v1.0.0
   Mobile-first. CPC brand orange: #F4580D. Poppins inherited from Breakdance.
   Class prefix: .vtm-
   ============================================================================= */

/* ── CSS Variables: Dark mode ─────────────────────────────────────────────── */

.vtm-wrapper[data-theme="dark"] {
    --vtm-bg:                #1c1c1c;
    --vtm-card-bg:           #252525;
    --vtm-nav-bg:            #2d2d2d;
    --vtm-nav-active-border: #F4580D;
    --vtm-nav-active-bg:     #2d2d2d;
    --vtm-text:              #ffffff;
    --vtm-text-muted:        rgba(255, 255, 255, 0.62);
    --vtm-headline-color:    #ffffff;
    --vtm-name-color:        #F4580D;
    --vtm-star-filled:       #F4580D;
    --vtm-star-empty:        rgba(255, 255, 255, 0.18);
    --vtm-radius:            16px;
    --vtm-nav-radius:        12px;
}

/* ── CSS Variables: Light mode ────────────────────────────────────────────── */

.vtm-wrapper[data-theme="light"] {
    --vtm-bg:                #f2f2f2;
    --vtm-card-bg:           #ffffff;
    --vtm-nav-bg:            #e8e8e8;
    --vtm-nav-active-border: #F4580D;
    --vtm-nav-active-bg:     #ffffff;
    --vtm-text:              #111111;
    --vtm-text-muted:        #606060;
    --vtm-headline-color:    #111111;
    --vtm-name-color:        #F4580D;
    --vtm-star-filled:       #F4580D;
    --vtm-star-empty:        #cccccc;
    --vtm-radius:            16px;
    --vtm-nav-radius:        12px;
}

/* ── Wrapper ──────────────────────────────────────────────────────────────── */

.vtm-wrapper {
    background: var(--vtm-bg);
    border-radius: calc(var(--vtm-radius) + 6px);
    padding: 10px;
    box-sizing: border-box;
    font-family: inherit;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Stage (transition container) ────────────────────────────────────────── */

.vtm-stage {
    margin-bottom: 10px;
    transition: opacity 0.2s ease;
}

/* ── Panel — Mobile: video as overlay background ──────────────────────────── */

.vtm-panel {
    display: none;
    position: relative;
    background: var(--vtm-card-bg);
    border-radius: var(--vtm-radius);
    overflow: hidden;
    min-height: 390px;
}

.vtm-panel.is-active {
    display: flex;
    flex-direction: column;
}

/* Thumbnail fills the whole panel as a background on mobile */
.vtm-thumb-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
}

/* Mobile: !important overrides Breakdance/theme img { height: auto } reset */
.vtm-thumb-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
}

/* Gradient overlay — mobile only, darkened for text readability */
.vtm-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: var(--vtm-radius);
    pointer-events: none;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.97) 0%,
        rgba(0, 0, 0, 0.88) 50%,
        rgba(0, 0, 0, 0.72) 100%
    );
}

/* Text content — mobile: sits on top of gradient */
.vtm-text-col {
    position: relative;
    z-index: 2;
    padding: 22px 22px 26px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 390px;
    box-sizing: border-box;
}

/* ── Play button ─────────────────────────────────────────────────────────── */

/* Floating play button (desktop only) — direct child of .vtm-panel */
.vtm-play-btn:not(.vtm-play-btn--inline) {
    display: none; /* hidden on mobile */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 0;
    transition: transform 0.2s ease, filter 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.vtm-play-btn:not(.vtm-play-btn--inline):hover,
.vtm-play-btn:not(.vtm-play-btn--inline):focus-visible {
    transform: translate(-50%, -50%) scale(1.1);
    filter: drop-shadow(0 6px 20px rgba(232, 93, 4, 0.55));
    outline: none;
}

/* Inline play button — inside text stack, mobile only */
.vtm-play-btn--inline {
    /* Reset all inherited floating positioning */
    position: static;
    transform: none;
    top: auto;
    left: auto;
    z-index: 1;
    min-width: auto;
    min-height: 44px;
    /* CTA appearance: dark glass with orange border */
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #00000096;
    color: #ffffff;
    border: 1px solid #F4580E;
    border-radius: 8px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    margin-bottom: 14px;
    align-self: flex-start;
    transition: background 0.18s ease, transform 0.15s ease, filter 0.18s ease;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.2;
}

.vtm-play-btn--inline:hover,
.vtm-play-btn--inline:focus-visible {
    background: rgba(0, 0, 0, 0.75);
    border-color: #ff6b28;
    transform: translateY(-1px);
    filter: drop-shadow(0 4px 12px rgba(244, 88, 14, 0.35));
    outline: none;
}

/* ── Stars ────────────────────────────────────────────────────────────────── */

.vtm-stars {
    display: flex;
    gap: 3px;
    margin-bottom: 12px;
    align-items: center;
}

.vtm-star {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    color: var(--vtm-star-empty);
}

.vtm-star--filled {
    color: var(--vtm-star-filled);
}

/* ── Headline / Quote ─────────────────────────────────────────────────────── */

/* Hard-reset: blockquote/p/cite border-left, margin, padding that themes inject */
.vtm-wrapper .vtm-headline,
.vtm-wrapper .vtm-name,
.vtm-wrapper .vtm-review {
    border: none !important;
    border-left: none !important;
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

.vtm-wrapper .vtm-headline::before,
.vtm-wrapper .vtm-headline::after,
.vtm-wrapper .vtm-name::before,
.vtm-wrapper .vtm-name::after {
    display: none !important;
    content: none !important;
}

.vtm-headline {
    font-size: clamp(1.15rem, 5.5vw, 1.7rem);
    font-weight: 700;
    color: var(--vtm-headline-color);
    line-height: 1.28;
    margin: 0 0 12px;
    padding: 0;
    quotes: none;
}

/* ── Reviewer name ────────────────────────────────────────────────────────── */

.vtm-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    font-style: normal;
    color: var(--vtm-name-color);
    margin-bottom: 10px;
    letter-spacing: 0.01em;
}

/* ── Full review text ─────────────────────────────────────────────────────── */

.vtm-review {
    font-size: clamp(0.82rem, 3vw, 0.93rem);
    color: var(--vtm-text-muted);
    line-height: 1.7;
    margin: 0;
}

/* ── Nav strip ────────────────────────────────────────────────────────────── */

.vtm-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.vtm-nav::-webkit-scrollbar {
    display: none;
}

.vtm-nav__item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--vtm-nav-bg);
    border: 2px solid transparent;
    border-radius: var(--vtm-nav-radius);
    padding: 10px 14px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
    min-width: 155px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.vtm-nav__item:hover,
.vtm-nav__item:focus-visible {
    border-color: rgba(244, 88, 13, 0.45);
    outline: none;
}

.vtm-nav__item.is-active {
    border-color: var(--vtm-nav-active-border);
    background: var(--vtm-nav-active-bg);
}

/* Base size: portrait 44×78 (matches 220:390 panel ratio) */
.vtm-nav__thumb {
    flex-shrink: 0;
    width: 44px;
    height: 78px;
    border-radius: 7px;
    overflow: hidden;
}

/* !important overrides Breakdance/theme img { height: auto } */
.vtm-nav__thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
}

.vtm-nav__info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.vtm-nav__name {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--vtm-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.vtm-nav__cat {
    font-size: 0.74rem;
    color: var(--vtm-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* ══════════════════════════════════════════════════════════════════════════════
   DESKTOP LAYOUT — side-by-side grid
   ══════════════════════════════════════════════════════════════════════════════ */

@media (min-width: 768px) {
    .vtm-wrapper {
        padding: 14px;
    }

    /* Portrait two-column grid — 220px video column */
    .vtm-panel.is-active {
        display: grid;
        grid-template-columns: 220px 1fr;
        min-height: 390px;
        align-items: stretch;
    }

    .vtm-thumb-wrap {
        position: relative;
        inset: auto;
        z-index: auto;
        border-radius: calc(var(--vtm-radius) - 2px) 0 0 calc(var(--vtm-radius) - 2px);
        overflow: hidden;
        align-self: stretch;
    }

    /* Force desktop thumb image to fill portrait container.
       !important overrides Breakdance / theme resets. */
    .vtm-wrapper .vtm-thumb-wrap img {
        display: block;
        width: 100% !important;
        height: 100% !important;
        min-height: 390px;
        object-fit: cover !important;
        object-position: center center;
    }

    /* Play button: show floating on desktop, hide inline */
    .vtm-play-btn:not(.vtm-play-btn--inline) {
        display: flex;
        top: 50%;
        left: 110px; /* half of 220px column = centered in video side */
    }

    .vtm-play-btn--inline {
        display: none;
    }

    /* No gradient on desktop */
    .vtm-panel::after {
        display: none;
    }

    /* Text column resets */
    .vtm-text-col {
        position: static;
        justify-content: center;
        min-height: auto;
        padding: 32px 36px;
    }

    /* Larger stars on desktop */
    .vtm-star {
        font-size: 22px;
    }

    /* Nav items: a bit wider */
    .vtm-nav__item {
        min-width: 180px;
    }

    /* Portrait nav thumbnails — ratio matches 220:390 panel (22:39) */
    /* Base already set to 44×78 — keep same on desktop */
    .vtm-nav__thumb {
        border-radius: 6px;
    }
}

@media (min-width: 1024px) {
    .vtm-panel.is-active {
        grid-template-columns: 220px 1fr;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   LIGHTBOX
   position: fixed — rendered in <body> via wp_footer, safe from Breakdance
   ══════════════════════════════════════════════════════════════════════════════ */

/* Lightbox: dark mode vars */
.vtm-lightbox[data-theme="dark"] {
    --vtm-lb-backdrop:  rgba(0, 0, 0, 0.92);
    --vtm-lb-card:      #1e1e1e;
    --vtm-lb-text:      #ffffff;
    --vtm-lb-muted:     rgba(255, 255, 255, 0.62);
    --vtm-lb-divider:   rgba(255, 255, 255, 0.08);
    --vtm-nav-bg:       #2d2d2d;
    --vtm-nav-active-border: #F4580D;
    --vtm-nav-active-bg: #2d2d2d;
    --vtm-text:         #ffffff;
    --vtm-text-muted:   rgba(255, 255, 255, 0.62);
    --vtm-nav-radius:   12px;
}

/* Lightbox: light mode vars */
.vtm-lightbox[data-theme="light"] {
    --vtm-lb-backdrop:  rgba(0, 0, 0, 0.82);
    --vtm-lb-card:      #ffffff;
    --vtm-lb-text:      #111111;
    --vtm-lb-muted:     #606060;
    --vtm-lb-divider:   rgba(0, 0, 0, 0.08);
    --vtm-nav-bg:       #e8e8e8;
    --vtm-nav-active-border: #F4580D;
    --vtm-nav-active-bg: #ffffff;
    --vtm-text:         #111111;
    --vtm-text-muted:   #606060;
    --vtm-nav-radius:   12px;
}

.vtm-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.vtm-lightbox[hidden] {
    display: none;
}

.vtm-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: var(--vtm-lb-backdrop);
    cursor: pointer;
}

.vtm-lightbox__inner {
    position: relative;
    z-index: 1;
    background: var(--vtm-lb-card);
    border-radius: var(--vtm-radius, 16px);
    width: 100%;
    max-width: 840px;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    scrollbar-width: thin;
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.65);
}

/* Close button */
.vtm-lightbox__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.45);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    transition: background 0.2s ease, transform 0.2s ease;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.vtm-lightbox__close:hover,
.vtm-lightbox__close:focus-visible {
    background: #F4580D;
    transform: scale(1.1);
    outline: none;
}

/* 16:9 video ratio wrapper */
.vtm-lightbox__video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--vtm-radius, 16px) var(--vtm-radius, 16px) 0 0;
    background: #000;
}

.vtm-lightbox__iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Transcript section */
.vtm-lightbox__body {
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--vtm-lb-divider);
}

.vtm-lightbox__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #F4580D;
    margin: 0 0 8px;
}

.vtm-lightbox__transcript {
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
    color: var(--vtm-lb-text);
    line-height: 1.72;
    margin: 0;
}

/* Lightbox nav strip */
.vtm-lightbox__nav {
    padding: 14px 14px 16px;
}

/* ── Empty state ──────────────────────────────────────────────────────────── */

.vtm-empty {
    padding: 18px 22px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #333;
}

.vtm-empty a {
    color: #F4580D;
}
