/**
 * Hub Video Player — front-end styles.
 * Everything is scoped under .hvp so it cannot leak into the theme.
 * Colours come from CSS custom properties set inline per instance by PHP.
 */

/*
 * Elementor stretches its OWN widgets to the container width via
 * --container-widget-width; a third-party widget gets nothing, so inside a
 * container with align-items:center it shrink-wraps to its content. This is
 * the same rule Elementor ships for .elementor-widget-video.
 */
.e-con > .elementor-widget-hub_video_player,
.e-con-inner > .elementor-widget-hub_video_player {
    width: var(--container-widget-width, 100%);
    max-width: 100%;
}

.elementor-widget-hub_video_player .elementor-widget-container {
    width: 100%;
}

.hvp {
    width: 100%;
    --hvp-accent: #c89e55;
    --hvp-accent-ink: #1a1a1a;
    --hvp-bg: #101010;
    --hvp-surface: #201e1c;
    --hvp-line: rgba(255, 255, 255, .10);
    --hvp-text: #f5f3ef;
    --hvp-dim: #928c82;
    --hvp-radius: 16px;
    /* The site's own faces: Merriweather for display, Merriweather Sans for UI. */
    --hvp-font: "Merriweather Sans", -apple-system, "Segoe UI", sans-serif;
    --hvp-display: Merriweather, Georgia, serif;

    position: relative;
    margin: 0 auto;
    font-family: var(--hvp-font);
    color: var(--hvp-text);
    -webkit-font-smoothing: antialiased;
}

.hvp,
.hvp * {
    box-sizing: border-box;
}

/* accent bloom behind the player */
.hvp::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -4%;
    width: 70%;
    height: 52%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 0;
    opacity: .5;
    background: radial-gradient(ellipse at center, var(--hvp-glow, rgba(200, 158, 85, .4)), transparent 68%);
    filter: blur(70px);
}

.hvp-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin: 0 0 14px;
    padding: 0 2px;
}

.hvp-eyebrow {
    font-family: var(--hvp-font);
    font-size: 11px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--hvp-accent);
    margin: 0;
}

.hvp-eyebrow::before {
    content: "\25CF\00a0";
    font-size: 8px;
    vertical-align: 2px;
}

/* ── player frame ──────────────────────────────────────────────────────── */
.hvp-frame {
    position: relative;
    z-index: 1;
    border-radius: var(--hvp-radius);
    overflow: hidden;
    background: var(--hvp-bg);
    border: 1px solid var(--hvp-line);
    box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .85), 0 2px 0 0 rgba(255, 255, 255, .04) inset;
    outline: none;
}

.hvp-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

@supports not (aspect-ratio: 16 / 9) {
    .hvp-stage {
        height: 0;
        padding-bottom: 56.25%;
    }
}

/* in fullscreen the frame owns the whole screen, whatever shape it is */
.hvp-frame:fullscreen,
.hvp-frame:-webkit-full-screen {
    border: 0;
    border-radius: 0;
    background: #000;
}

.hvp-frame:fullscreen .hvp-stage,
.hvp-frame:-webkit-full-screen .hvp-stage {
    aspect-ratio: auto;
    height: 100%;
    padding-bottom: 0;
}

.hvp-stage video,
.hvp-stage iframe,
.hvp-stage .hvp-embed {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
    max-width: none;
}

.hvp-stage video {
    object-fit: contain;
}

/* film grain */
.hvp-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: .14;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='.5'/></svg>");
}

/* click / gesture catcher — also lets us drive the YouTube & Vimeo iframes */
.hvp-catch {
    position: absolute;
    inset: 0;
    z-index: 3;
    cursor: pointer;
}

/* ── overlays ──────────────────────────────────────────────────────────── */
.hvp-scrim {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    background:
        linear-gradient(to top, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .35) 22%, transparent 45%),
        linear-gradient(to bottom, rgba(0, 0, 0, .55) 0%, transparent 26%);
    opacity: 1;
    transition: opacity .3s ease;
}

.hvp.is-idle .hvp-scrim {
    opacity: 0;
}

.hvp-meta {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    padding: 22px 26px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    pointer-events: none;
    transition: opacity .28s ease, transform .28s ease;
}

.hvp.is-idle .hvp-meta {
    opacity: 0;
    transform: translateY(-8px);
}

.hvp-titles h3 {
    font-family: var(--hvp-display);
    margin: 0;
    font-size: clamp(15px, 2.1vw, 21px);
    font-weight: 600;
    letter-spacing: -.015em;
    line-height: 1.25;
    color: #fff;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .6);
}

.hvp-titles p {
    margin: 2px 0 0;
    font-family: var(--hvp-font);
    font-size: 11px;
    letter-spacing: .06em;
    color: rgba(255, 255, 255, .62);
}

/* centre play / replay */
.hvp-big {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.hvp-big button {
    pointer-events: auto;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .22);
    color: #fff;
    background: rgba(12, 12, 14, .42);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    display: grid;
    place-items: center;
    padding: 0;
    transition: transform .22s cubic-bezier(.3, 1.4, .5, 1), background .2s, border-color .2s, opacity .22s;
    box-shadow: 0 18px 50px -18px rgba(0, 0, 0, .9);
}

.hvp-big button:hover {
    transform: scale(1.08);
    background: var(--hvp-accent);
    border-color: var(--hvp-accent);
    color: var(--hvp-accent-ink);
}

.hvp-big button svg {
    width: 28px;
    height: 28px;
}

.hvp.is-playing .hvp-big button {
    opacity: 0;
    transform: scale(.7);
    pointer-events: none;
}

.hvp.is-ended .hvp-big .i-replay {
    transform: none;
}

/* spinner */
.hvp-spin {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: none;
    place-items: center;
    pointer-events: none;
}

.hvp.is-buffering .hvp-spin {
    display: grid;
}

.hvp.is-buffering .hvp-big button {
    opacity: 0;
}

.hvp-spin i {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: block;
    border: 2px solid rgba(255, 255, 255, .16);
    border-top-color: var(--hvp-accent);
    animation: hvp-spin .7s linear infinite;
}

@keyframes hvp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* up-next toast */
.hvp-next {
    position: absolute;
    right: 20px;
    bottom: 96px;
    z-index: 5;
    max-width: 260px;
    background: rgba(10, 10, 12, .82);
    border: 1px solid var(--hvp-line);
    border-radius: 12px;
    padding: 11px 14px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: .3s ease;
}

.hvp.show-next .hvp-next {
    opacity: 1;
    transform: none;
}

.hvp-next span {
    display: block;
    font-family: var(--hvp-font);
    font-size: 10px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--hvp-accent);
    margin-bottom: 3px;
}

.hvp-next b {
    font-weight: 600;
    font-size: 13.5px;
    line-height: 1.3;
    display: block;
    color: #fff;
}

/* ── control bar ───────────────────────────────────────────────────────── */
.hvp-ui {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    padding: 0 14px 12px;
    transition: opacity .28s ease, transform .28s ease;
}

.hvp.is-idle .hvp-ui {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.hvp.is-idle .hvp-catch {
    cursor: none;
}

/* timeline */
.hvp-track {
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    /* pan-y, not none: a thumb dragged vertically still scrolls the page */
    touch-action: pan-y;
}

.hvp-track .rail {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .20);
    overflow: hidden;
    transition: height .15s;
}

.hvp-track .buf {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: rgba(255, 255, 255, .28);
}

.hvp-track .fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--hvp-accent);
}

.hvp-track .knob {
    position: absolute;
    left: 0;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--hvp-accent);
    transform: translate(-50%, 0) scale(0);
    transition: transform .15s;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, .25);
}

.hvp-track:hover .rail,
.hvp-track.is-drag .rail {
    height: 6px;
}

.hvp-track:hover .knob,
.hvp-track.is-drag .knob {
    transform: translate(-50%, 0) scale(1);
}

.hvp-bubble {
    position: absolute;
    bottom: 24px;
    transform: translateX(-50%);
    padding: 3px 7px;
    border-radius: 6px;
    background: #000;
    border: 1px solid var(--hvp-line);
    font-family: var(--hvp-font);
    font-size: 11px;
    opacity: 0;
    transition: opacity .15s;
    pointer-events: none;
    white-space: nowrap;
}

.hvp-track:hover .hvp-bubble,
.hvp-track.is-drag .hvp-bubble {
    opacity: 1;
}

.hvp-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.hvp-row .sp {
    flex: 1;
}

.hvp-btn {
    width: 38px;
    height: 38px;
    flex: none;
    display: grid;
    place-items: center;
    cursor: pointer;
    background: none;
    border: 0;
    border-radius: 9px;
    color: rgba(255, 255, 255, .9);
    padding: 0;
    box-shadow: none;
    transition: background .18s, color .18s, transform .18s;
}

.hvp-btn:hover,
.hvp-btn:focus {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.hvp-btn:active {
    transform: scale(.92);
}

.hvp-btn:focus-visible {
    outline: 2px solid var(--hvp-accent);
    outline-offset: 2px;
}

.hvp-btn svg {
    width: 19px;
    height: 19px;
    display: block;
}

.hvp-time {
    font-family: var(--hvp-font);
    font-size: 12px;
    letter-spacing: .02em;
    color: rgba(255, 255, 255, .85);
    padding: 0 8px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hvp-time em {
    color: rgba(255, 255, 255, .45);
    font-style: normal;
}

/* volume */
.hvp-vol {
    display: flex;
    align-items: center;
}

.hvp-vol .bar {
    width: 0;
    opacity: 0;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: width .22s ease, opacity .22s ease;
    touch-action: pan-y;
    overflow: hidden;
}

.hvp-vol:hover .bar,
.hvp-vol:focus-within .bar {
    width: 74px;
    opacity: 1;
    margin-right: 6px;
}

.hvp-vol .bar span {
    position: relative;
    display: block;
    width: 100%;
    height: 4px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .22);
}

.hvp-vol .bar i {
    position: absolute;
    inset: 0 auto 0 0;
    width: 100%;
    background: #fff;
    border-radius: 99px;
}

/* speed menu */
.hvp-menu {
    position: relative;
}

.hvp-pop {
    position: absolute;
    right: 0;
    bottom: 46px;
    min-width: 118px;
    padding: 6px;
    background: rgba(12, 12, 14, .94);
    border: 1px solid var(--hvp-line);
    border-radius: 12px;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 20px 40px -20px #000;
    display: none;
    flex-direction: column;
    gap: 1px;
}

.hvp-menu.is-open .hvp-pop {
    display: flex;
}

.hvp-pop b {
    font-family: var(--hvp-font);
    font-size: 10px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--hvp-dim);
    padding: 5px 9px 3px;
    font-weight: 400;
}

.hvp-pop button {
    cursor: pointer;
    padding: 7px 9px;
    border: 0;
    background: none;
    border-radius: 7px;
    font-size: 13px;
    font-family: inherit;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: rgba(255, 255, 255, .82);
    text-align: left;
}

.hvp-pop button:hover {
    background: rgba(255, 255, 255, .10);
    color: #fff;
}

.hvp-pop button[aria-checked="true"] {
    color: var(--hvp-accent);
}

.hvp-pop button[aria-checked="true"]::after {
    content: "\2713";
}

/* icon state switching */
.hvp .i-pause,
.hvp .i-replay,
.hvp .i-fs-exit,
.hvp .i-muted {
    display: none;
}

.hvp.is-playing .i-play {
    display: none;
}

.hvp.is-playing .i-pause {
    display: block;
}

.hvp.is-ended .hvp-big .i-replay {
    display: block;
}

.hvp.is-muted .i-vol {
    display: none;
}

.hvp.is-muted .i-muted {
    display: block;
}

.hvp.is-fs .i-fs {
    display: none;
}

.hvp.is-fs .i-fs-exit {
    display: block;
}

/* ── playlist ──────────────────────────────────────────────────────────── */
.hvp-listhead {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 30px 2px 14px;
}

.hvp-listhead h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--hvp-text);
}

.hvp-listhead .count {
    font-family: var(--hvp-font);
    font-size: 12px;
    color: var(--hvp-dim);
}

.hvp-listhead .rule {
    flex: 1;
    height: 1px;
    background: var(--hvp-line);
}

.hvp-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: none;
    border: 0;
    font-family: var(--hvp-font);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--hvp-dim);
    padding: 4px 0;
}

.hvp-toggle .sw {
    width: 30px;
    height: 17px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .16);
    position: relative;
    transition: background .2s;
}

.hvp-toggle .sw::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s;
}

.hvp-toggle[aria-pressed="true"] {
    color: var(--hvp-text);
}

.hvp-toggle[aria-pressed="true"] .sw {
    background: var(--hvp-accent);
}

.hvp-toggle[aria-pressed="true"] .sw::after {
    transform: translateX(13px);
}

.hvp-list {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(212px, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.hvp-item {
    cursor: pointer;
    display: block;
    width: 100%;
    text-align: left;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--hvp-surface);
    border: 1px solid var(--hvp-line);
    box-shadow: none;
    transition: border-color .22s, transform .22s, background .22s;
}

.hvp-item:hover,
.hvp-item:focus {
    background: var(--hvp-surface);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, .24);
}

.hvp-item:focus-visible {
    outline: 2px solid var(--hvp-accent);
    outline-offset: 2px;
}

.hvp-item .thumb {
    /* a <span>, so it needs a block box before aspect-ratio means anything —
       it used to get its height from the <video> child that no longer exists */
    display: block;
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #26231f, #131211);
    overflow: hidden;
}

/* no featured image — a quiet film-strip pattern rather than a black hole */
.hvp-item .thumb:not(:has(img))::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .5;
    background:
        radial-gradient(circle at 50% 45%, rgba(200, 158, 85, .16), transparent 60%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 14px);
}

.hvp-item .thumb img,
.hvp-item .thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s cubic-bezier(.2, .7, .3, 1), filter .3s;
    filter: saturate(.85) brightness(.86);
}

.hvp-item:hover .thumb img,
.hvp-item:hover .thumb video {
    transform: scale(1.06);
    filter: none;
}

.hvp-item .num {
    position: absolute;
    top: 8px;
    left: 9px;
    font-family: var(--hvp-font);
    font-size: 10.5px;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(0, 0, 0, .6);
    border: 1px solid rgba(255, 255, 255, .14);
    letter-spacing: .06em;
    color: #fff;
}

.hvp-item .dur {
    position: absolute;
    right: 8px;
    bottom: 8px;
    font-family: var(--hvp-font);
    font-size: 10.5px;
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(0, 0, 0, .72);
    letter-spacing: .04em;
    color: #fff;
}

.hvp-item .body {
    display: block;
    padding: 14px 16px 16px;
}

.hvp-item .body strong {
    font-family: var(--hvp-display);
    display: block;
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--hvp-text);
}

.hvp-item .body small {
    display: block;
    margin-top: 6px;
    font-family: var(--hvp-font);
    font-size: 10.5px;
    letter-spacing: .05em;
    color: var(--hvp-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hvp-item[aria-current="true"] {
    border-color: var(--hvp-accent);
}

.hvp-item[aria-current="true"] .thumb img,
.hvp-item[aria-current="true"] .thumb video {
    filter: none;
}

.hvp-item[aria-current="true"] .num {
    background: var(--hvp-accent);
    color: var(--hvp-accent-ink);
    border-color: transparent;
}

/* equaliser on the playing card */
.hvp-eq {
    position: absolute;
    left: 9px;
    bottom: 9px;
    display: none;
    align-items: flex-end;
    gap: 2px;
    height: 13px;
}

.hvp-item[aria-current="true"] .hvp-eq {
    display: flex;
}

.hvp-eq i {
    width: 2.5px;
    background: var(--hvp-accent);
    height: 4px;
    border-radius: 1px;
    animation: hvp-eq .9s ease-in-out infinite;
}

.hvp-eq i:nth-child(2) {
    animation-delay: .18s;
}

.hvp-eq i:nth-child(3) {
    animation-delay: .36s;
}

.hvp-eq i:nth-child(4) {
    animation-delay: .54s;
}

@keyframes hvp-eq {

    0%,
    100% {
        height: 3px;
    }

    50% {
        height: 13px;
    }
}

.hvp:not(.is-playing) .hvp-eq i {
    animation-play-state: paused;
}

/* something went wrong loading the film */
.hvp.is-error .hvp-titles p {
    color: #ffb4a2;
    font-size: 12.5px;
}

.hvp.is-error .hvp-big button {
    opacity: 0;
    pointer-events: none;
}

.hvp.is-error .hvp-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .02) 0 12px, transparent 12px 24px);
}

/* empty state (no videos yet) */
.hvp-empty {
    border: 1px dashed var(--hvp-line);
    border-radius: var(--hvp-radius);
    padding: 40px 24px;
    text-align: center;
    font-family: var(--hvp-font);
    font-size: 13px;
    color: var(--hvp-dim);
}

/* ── responsive ────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .hvp-list {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }

    .hvp-ui {
        padding: 0 8px 8px;
    }

    .hvp-btn {
        width: 34px;
        height: 34px;
    }

    .hvp-time {
        padding: 0 4px;
        font-size: 11px;
    }

    /* keep the mute button on phones — only the slider goes */
    .hvp-vol .bar,
    .hvp-pip {
        display: none;
    }

    .hvp-big button {
        width: 60px;
        height: 60px;
    }

    .hvp-big button svg {
        width: 24px;
        height: 24px;
    }

    .hvp-next {
        display: none;
    }

    .hvp-meta {
        padding: 14px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .hvp *,
    .hvp *::before,
    .hvp *::after {
        animation-duration: .01ms !important;
        /* without this the spinner and equaliser flicker once per frame */
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
