/**
 * Video widget.
 *
 * Scoped to `.goxom-vd`, which only this widget outputs. Everything the Style
 * tab reaches is a custom property, so the panel can retune the section
 * without the stylesheet knowing what it will send.
 *
 * Colours fall back to the theme's tokens where they exist, so a fresh widget
 * already looks like the site rather than like a default.
 */

.goxom-vd {
    --vd-ink: var(--color-black, #0C2338);
    --vd-body: var(--color-body, #5A7387);
    --vd-accent: var(--color-primary, #1273C4);
    --vd-line: var(--color-border, #D5E3EF);

    --vd-radius: 24px;
    --vd-scrim: 0.38;
    --vd-play: 92px;

    position: relative;
    isolation: isolate;
    padding: clamp(56px, 7vw, 100px) 0;
}

.goxom-vd *,
.goxom-vd *::before,
.goxom-vd *::after {
    box-sizing: border-box;
}

.goxom-vd__inner {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
}

.goxom-vd--split .goxom-vd__grid,
.goxom-vd--reel .goxom-vd__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 64px;
}

/* Reel gives the text the wider half — the poster is a shape, not a frame to
   be filled, so it holds its own at a smaller size. */
.goxom-vd--reel .goxom-vd__grid {
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
}

.goxom-vd--showcase .goxom-vd__grid {
    display: block;
}

/* ───────────────────────────────────────── poster */

.goxom-vd__stage {
    position: relative;
}

.goxom-vd__poster {
    position: relative;
    aspect-ratio: 1.2;
    overflow: hidden;
    border-radius: var(--vd-radius);
    background-color: var(--vd-ink);
    box-shadow: 0 34px 70px -34px rgba(6, 23, 38, 0.55);
}

.goxom-vd--reel .goxom-vd__poster {
    aspect-ratio: 0.84;
}

/* ───────────────────────────────────────── poster shapes

   The shape is a radius rather than a clip-path, so the frame, the outline and
   the brackets can all inherit it and stay concentric with the photo. */

.goxom-vd--shape-arch .goxom-vd__poster,
.goxom-vd--shape-arch .goxom-vd__outline {
    border-radius: 999px 999px var(--vd-radius) var(--vd-radius);
}

.goxom-vd--shape-leaf .goxom-vd__poster,
.goxom-vd--shape-leaf .goxom-vd__outline {
    border-radius: calc(var(--vd-radius) * 4) var(--vd-radius) calc(var(--vd-radius) * 4) var(--vd-radius);
}

.goxom-vd--shape-blob .goxom-vd__poster,
.goxom-vd--shape-blob .goxom-vd__outline {
    border-radius: 58% 42% 46% 54% / 46% 44% 56% 54%;
}

/* ───────────────────────────────────────── frame treatments */

.goxom-vd__outline {
    position: absolute;
    inset: -18px;
    border: 1px solid var(--vd-accent);
    border-radius: calc(var(--vd-radius) + 18px);
    opacity: 0.45;
    pointer-events: none;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.goxom-vd__stage:hover .goxom-vd__outline {
    transform: translate(10px, 10px);
    opacity: 0.9;
}

.goxom-vd__bracket {
    position: absolute;
    width: 62px;
    height: 62px;
    pointer-events: none;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.goxom-vd__bracket--tl {
    top: -16px;
    left: -16px;
    border-top: 2px solid var(--vd-accent);
    border-left: 2px solid var(--vd-accent);
    border-top-left-radius: 6px;
}

.goxom-vd__bracket--br {
    right: -16px;
    bottom: -16px;
    border-right: 2px solid var(--vd-accent);
    border-bottom: 2px solid var(--vd-accent);
    border-bottom-right-radius: 6px;
}

.goxom-vd__stage:hover .goxom-vd__bracket--tl {
    transform: translate(-8px, -8px);
}

.goxom-vd__stage:hover .goxom-vd__bracket--br {
    transform: translate(8px, 8px);
}

/* ───────────────────────────────────────── duotone

   Grade and tint, rather than a filter alone: `mix-blend-mode: color` keeps
   the photo's own light and shade and only replaces its hue, which is what
   separates a duotone from a colour wash. */

.goxom-vd__tint {
    position: absolute;
    inset: 0;
    background-color: var(--vd-accent);
    mix-blend-mode: color;
    opacity: 0.78;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.goxom-vd--grade .goxom-vd__img {
    filter: grayscale(1) contrast(1.06);
    transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1), filter 0.6s ease;
}

.goxom-vd--grade .goxom-vd__poster:hover .goxom-vd__img,
.goxom-vd--grade .goxom-vd__poster.is-playing .goxom-vd__img {
    filter: none;
}

.goxom-vd--grade .goxom-vd__poster:hover .goxom-vd__tint,
.goxom-vd--grade .goxom-vd__poster.is-playing .goxom-vd__tint {
    opacity: 0;
}

.goxom-vd__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.goxom-vd__poster:hover .goxom-vd__img {
    transform: scale(1.04);
}

/* Graded rather than flat: the button sits in the middle and any text sits at
   the bottom, so that is where the darkening has to be. */
.goxom-vd__scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(6, 23, 38, 0) 35%, rgba(6, 23, 38, 0.85) 100%),
        rgba(6, 23, 38, var(--vd-scrim));
    pointer-events: none;
}

.goxom-vd__chip {
    position: absolute;
    top: 18px;
    right: 18px;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background-color: rgba(6, 23, 38, 0.45);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ───────────────────────────────────────── play button */

.goxom-vd__cta {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 16px;
}

.goxom-vd--play-center .goxom-vd__cta {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.goxom-vd--play-bottom .goxom-vd__cta {
    left: clamp(18px, 4%, 40px);
    bottom: clamp(18px, 4%, 40px);
}

.goxom-vd__play {
    position: relative;
    display: grid;
    place-items: center;
    flex: none;
    width: var(--vd-play);
    height: var(--vd-play);
    border-radius: 50%;
    background-color: #fff;
    color: var(--vd-accent);
    text-decoration: none;
    box-shadow: 0 16px 40px -12px rgba(6, 23, 38, 0.5);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s ease, color 0.3s ease;
}

.goxom-vd__play:hover,
.goxom-vd__play:focus-visible {
    transform: scale(1.07);
    background-color: var(--vd-accent);
    color: #fff;
}

.goxom-vd__play:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 4px;
}

.goxom-vd__play-mark {
    width: calc(var(--vd-play) * 0.32);
    height: calc(var(--vd-play) * 0.32);
    /* The glyph's visual centre sits left of its box centre. */
    margin-left: calc(var(--vd-play) * 0.03);
}

.goxom-vd__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.55);
    opacity: 0;
    pointer-events: none;
}

.goxom-vd--pulse .goxom-vd__ring--1 {
    animation: goxomVdPulse 2.8s ease-out infinite;
}

.goxom-vd--pulse .goxom-vd__ring--2 {
    animation: goxomVdPulse 2.8s ease-out infinite 1.4s;
}

@keyframes goxomVdPulse {
    0% { opacity: 0.7; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.9); }
}

.goxom-vd__play-text {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 14px rgba(6, 23, 38, 0.5);
}

/* ───────────────────────────────────────── rotating caption

   Set on a circle with a real textPath rather than one letter per span: the
   spacing then follows the type's own metrics, and the whole ring is a single
   element to turn. */

.goxom-vd__spin {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(var(--vd-play) * 2.05);
    height: calc(var(--vd-play) * 2.05);
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: goxomVdSpin 22s linear infinite;
}

.goxom-vd__spin svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.goxom-vd__spin text {
    fill: #fff;
    font-size: 9.4px;
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
}

/* The button turns the other way on hover, so the ring reads as loose around
   it rather than fixed to it. */
.goxom-vd__play:hover .goxom-vd__spin {
    animation-duration: 9s;
}

@keyframes goxomVdSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* The player replaces the still in place, so it inherits the poster's frame. */
.goxom-vd__frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: inherit;
    background-color: #000;
    z-index: 2;
}

/* ───────────────────────────────────────── text */

.goxom-vd__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--vd-accent);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* A rule that runs out of the eyebrow, so the column has a starting mark. */
.goxom-vd--reel .goxom-vd__eyebrow::after {
    content: "";
    width: 46px;
    height: 1px;
    background-color: currentColor;
    opacity: 0.5;
}

.goxom-vd--reel .goxom-vd__title {
    font-size: clamp(32px, 3.5vw, 54px);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.goxom-vd__title {
    margin: 0 0 16px;
    font-size: clamp(28px, 3vw, 44px);
    font-weight: 700;
    line-height: 1.16;
    letter-spacing: -0.02em;
    color: var(--vd-ink);
}

.goxom-vd__desc {
    margin: 0;
    font-size: 17px;
    line-height: 1.75;
    color: var(--vd-body);
}

/* Text laid over the poster, in the showcase composition. */
.goxom-vd__over {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: clamp(24px, 4%, 48px);
    max-width: 720px;
}

.goxom-vd__over .goxom-vd__eyebrow {
    color: #fff;
    opacity: 0.85;
}

.goxom-vd__over .goxom-vd__title {
    color: #fff;
    text-shadow: 0 2px 22px rgba(6, 23, 38, 0.4);
}

.goxom-vd__over .goxom-vd__desc {
    color: rgba(255, 255, 255, 0.82);
}

/* The lower-left button and the overlay text would sit on top of each other. */
.goxom-vd--showcase.goxom-vd--play-bottom .goxom-vd__over {
    padding-left: calc(var(--vd-play) + clamp(38px, 7%, 80px));
}

/* ───────────────────────────────────────── counters */

.goxom-vd__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 24px;
    margin-top: 36px;
}

.goxom-vd--showcase .goxom-vd__stats {
    margin-top: 40px;
}

.goxom-vd__stat {
    position: relative;
    min-width: 0;
}

/* Panel — one raised card that reaches back across the poster's edge, so the
   two columns interlock instead of sitting side by side. The pull is only
   taken where there is a poster to reach over. */
.goxom-vd--stats-panel .goxom-vd__stats {
    position: relative;
    z-index: 2;
    padding: 30px 32px;
    border-radius: 20px;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(6, 23, 38, 0.05), 0 30px 60px -30px rgba(6, 23, 38, 0.42);
}

.goxom-vd--stats-panel.goxom-vd--reel .goxom-vd__stats,
.goxom-vd--stats-panel.goxom-vd--split .goxom-vd__stats {
    margin-left: calc(var(--vd-pull, 0px) * -1);
}

/* Mirrored when the poster is on the right. */
.goxom-vd--stats-panel.goxom-vd--media-right .goxom-vd__stats {
    margin-left: 0;
    margin-right: calc(var(--vd-pull, 0px) * -1);
}

.goxom-vd--stats-panel .goxom-vd__stat + .goxom-vd__stat {
    padding-left: 24px;
    border-left: 1px solid var(--vd-line);
}

/* Divided — a hairline before every item but the first in its row. Drawn with
   a border rather than a pseudo-element so a wrapped row does not leave a rule
   hanging at the start of the next line. */
.goxom-vd--stats-divided .goxom-vd__stat {
    padding-left: 24px;
    border-left: 1px solid var(--vd-line);
}

.goxom-vd--stats-divided .goxom-vd__stat:first-child {
    padding-left: 0;
    border-left: 0;
}

.goxom-vd--stats-cards .goxom-vd__stat {
    padding: 22px 20px;
    border: 1px solid var(--vd-line);
    border-radius: 16px;
    transition: border-color 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.goxom-vd--stats-cards .goxom-vd__stat:hover,
.goxom-vd--stats-cards .goxom-vd__stat.is-hold {
    border-color: var(--vd-accent);
    transform: translateY(-4px);
}

.goxom-vd__stat-num {
    display: block;
    font-size: clamp(26px, 2.4vw, 38px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--vd-ink);
    /* Digits of equal width, so a counting number does not jitter its
       neighbours on every frame. */
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

.goxom-vd__stat-affix {
    color: var(--vd-accent);
    font-size: 62%;
    font-weight: 600;
}

.goxom-vd__stat-label {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--vd-body);
}

/* ───────────────────────────────────────── lightbox */

.goxom-vd-lb {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    padding: clamp(16px, 4vw, 48px);
    background-color: rgba(6, 23, 38, 0.92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.goxom-vd-lb.is-open {
    opacity: 1;
}

.goxom-vd-lb__box {
    position: relative;
    width: min(1100px, 100%);
    aspect-ratio: 1.777;
    max-height: 100%;
    overflow: hidden;
    border-radius: 16px;
    background-color: #000;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8);
    transform: scale(0.96);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.goxom-vd-lb.is-open .goxom-vd-lb__box {
    transform: scale(1);
}

.goxom-vd-lb__box iframe,
.goxom-vd-lb__box video {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.goxom-vd-lb__close {
    position: absolute;
    top: -6px;
    right: 0;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    transform: translateY(-100%);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.goxom-vd-lb__close:hover {
    background-color: rgba(255, 255, 255, 0.24);
}

.goxom-vd-lb__close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* Only while a lightbox is open, and removed with it. */
.goxom-vd-lock {
    overflow: hidden;
}

/* ───────────────────────────────────────── entrance */

.goxom-vd--js .goxom-vd__stage,
.goxom-vd--js .goxom-vd__col > * {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.75s ease, transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.goxom-vd--js.is-in .goxom-vd__stage,
.goxom-vd--js.is-in .goxom-vd__col > * {
    opacity: 1;
    transform: none;
}

.goxom-vd--js.is-in .goxom-vd__col > *:nth-child(2) { transition-delay: 0.08s; }
.goxom-vd--js.is-in .goxom-vd__col > *:nth-child(3) { transition-delay: 0.16s; }
.goxom-vd--js.is-in .goxom-vd__col > *:nth-child(4) { transition-delay: 0.24s; }

/* ───────────────────────────────────────── responsive */

@media (max-width: 1199px) {
    .goxom-vd--reel .goxom-vd__grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 44px;
    }
}

@media (max-width: 991px) {
    .goxom-vd--split .goxom-vd__grid,
    .goxom-vd--reel .goxom-vd__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }

    /* The shapes need width to read; at one column the poster is wide and
       short, where an arch becomes a lozenge. */
    .goxom-vd--reel .goxom-vd__poster {
        aspect-ratio: 1.15;
    }

    .goxom-vd--shape-arch .goxom-vd__poster,
    .goxom-vd--shape-arch .goxom-vd__outline {
        border-radius: calc(var(--vd-radius) * 3) calc(var(--vd-radius) * 3) var(--vd-radius) var(--vd-radius);
    }

    .goxom-vd--stats-panel .goxom-vd__stats {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* The poster led the markup so it reads first; on one column the order
       control from the panel has nothing left to swap. */
    .goxom-vd__stage {
        order: 0 !important;
    }

    .goxom-vd--showcase.goxom-vd--play-bottom .goxom-vd__over {
        padding-left: clamp(24px, 4%, 48px);
        padding-bottom: calc(var(--vd-play) + 24px);
    }
}

@media (max-width: 575px) {
    .goxom-vd {
        --vd-play: 68px;
    }

    .goxom-vd__cta {
        gap: 12px;
    }

    .goxom-vd__play-text {
        display: none;
    }

    /* Two columns of stats on a phone: a rule before every item but the first
       would hang off the start of the second row, so the panel drops them. */
    .goxom-vd--stats-panel .goxom-vd__stats {
        padding: 22px 20px;
    }

    .goxom-vd--stats-panel .goxom-vd__stat + .goxom-vd__stat {
        padding-left: 0;
        border-left: 0;
    }

    .goxom-vd--stats-divided .goxom-vd__stat {
        padding-left: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .goxom-vd__img,
    .goxom-vd__play,
    .goxom-vd-lb,
    .goxom-vd-lb__box,
    .goxom-vd--js .goxom-vd__stage,
    .goxom-vd--js .goxom-vd__col > *,
    .goxom-vd--stats-cards .goxom-vd__stat {
        transition: none;
    }

    .goxom-vd--pulse .goxom-vd__ring--1,
    .goxom-vd--pulse .goxom-vd__ring--2,
    .goxom-vd__spin {
        animation: none;
    }

    .goxom-vd__poster:hover .goxom-vd__img,
    .goxom-vd__play:hover {
        transform: none;
    }

    .goxom-vd__stage:hover .goxom-vd__outline,
    .goxom-vd__stage:hover .goxom-vd__bracket--tl,
    .goxom-vd__stage:hover .goxom-vd__bracket--br {
        transform: none;
    }

    .goxom-vd__outline,
    .goxom-vd__bracket,
    .goxom-vd__tint,
    .goxom-vd--grade .goxom-vd__img {
        transition: none;
    }
}
