/*
 * Devders Hero Slider — Preset "Style 1"
 * Ported from the original slider1.html design (glassmorphism + Ken Burns).
 *
 * Structure classes (.dhs-*) are shared by all presets; the .dhs-s1 skin
 * defines this preset's look. User settings arrive as CSS custom properties
 * on the .dhs-hero wrapper, each with the original design value as fallback.
 */

/* ---------- Base ---------- */
.dhs-hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    user-select: none;
    touch-action: pan-y;
}

/* Lock the box model inside the slider regardless of the theme's global
   box-sizing (Divi and most themes set border-box only on their own scope). */
.dhs-hero,
.dhs-hero *,
.dhs-hero *::before,
.dhs-hero *::after {
    box-sizing: border-box;
}

.dhs-s1 {
    aspect-ratio: var(--dhs-ratio, 16/9);
    /* Unset (--dhs-h absent) -> auto: aspect-ratio rules. Set -> exact height. */
    height: var(--dhs-h, auto);
    background: #071831;
    /* When --dhs-font is unset (font loading disabled) font-family becomes
       invalid-at-computed-value-time and correctly inherits from the theme. */
    font-family: var(--dhs-font);
    color: #253430;
}

.dhs-s1 button,
.dhs-s1 a {
    font-family: var(--dhs-font);
}

.dhs-s1 :focus-visible {
    outline: 2px solid var(--dhs-accent-hi, #e2a963);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- Track & slides ---------- */
.dhs-track {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.dhs-slide {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    z-index: 1;
    transition: opacity .9s cubic-bezier(.4, 0, .2, 1);
}

.dhs-slide.is-active {
    opacity: 1;
    z-index: 2;
}

.dhs-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.05) translateZ(0);
    transition: transform 1.2s cubic-bezier(.25, .5, .3, 1);
    user-select: none;
    -webkit-user-drag: none;
}

/* Ken Burns — direction alternates per slide via data-dhs-pan */
.dhs-slide.is-active img {
    animation: dhs-s1-kbIn 7s cubic-bezier(.22, .61, .36, 1) forwards;
}

.dhs-slide[data-dhs-pan="out"].is-active img {
    animation-name: dhs-s1-kbOut;
}

@keyframes dhs-s1-kbIn {
    from { transform: scale(1.05); }
    to   { transform: scale(1.16); }
}

@keyframes dhs-s1-kbOut {
    from { transform: scale(1.16) translateX(1.5%); }
    to   { transform: scale(1.05); }
}

/* ---------- Scrim ---------- */
.dhs-scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top,
            rgba(6, 18, 38, 0.94) 0%,
            rgba(6, 18, 38, 0.85) 15%,
            rgba(7, 22, 45, 0.65) 30%,
            rgba(8, 25, 52, 0.38) 45%,
            rgba(9, 28, 58, 0.16) 60%,
            rgba(9, 28, 58, 0.04) 75%,
            transparent 100%),
        linear-gradient(205deg,
            rgba(10, 31, 64, 0.50) 0%,
            rgba(10, 31, 64, 0.18) 40%,
            transparent 70%);
}

/* ---------- Progress bar ---------- */
.dhs-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 7;
    height: var(--dhs-progress-h, 3px);
    background: rgba(255, 255, 255, .16);
    pointer-events: none;
}

.dhs-progress--bottom {
    top: auto;
    bottom: 0;
}

.dhs-progress-fill {
    height: 100%;
    width: 100%;
    background: var(--dhs-progress-color, #e2a963);
    transform: scaleX(0);
    transform-origin: left center;
    transition: opacity .35s ease;
}

.dhs-progress.is-paused .dhs-progress-fill {
    opacity: var(--dhs-progress-paused, .4);
}

/* ---------- Prev / Next arrows (glassmorphism) ---------- */
.dhs-nav {
    position: absolute;
    top: 36%;
    z-index: 6;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .32);
    background: linear-gradient(135deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .06));
    -webkit-backdrop-filter: blur(14px) saturate(1.5);
    backdrop-filter: blur(14px) saturate(1.5);
    color: rgba(255, 255, 255, .95);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .35),
        0 8px 26px rgba(6, 16, 12, .35);
    transition: transform .25s ease, background .25s ease,
        border-color .25s ease, box-shadow .25s ease;
    touch-action: manipulation;
}

.dhs-nav:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, .32), rgba(255, 255, 255, .14));
    border-color: rgba(255, 255, 255, .55);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .45),
        0 12px 30px rgba(6, 16, 12, .45);
}

.dhs-nav:active {
    transform: scale(.94);
}

.dhs-nav svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.dhs-prev { left: clamp(12px, 2.4vw, 36px); }
.dhs-next { right: clamp(12px, 2.4vw, 36px); }

/* ---------- Caption box (glassmorphism) ---------- */
.dhs-caption {
    position: absolute;
    z-index: 5;
    left: 50%;
    bottom: clamp(12px, 2.6vw, 30px);
    transform: translateX(-50%);
    width: 90%;
    background: linear-gradient(135deg, rgba(255, 255, 255, .15) 0%, rgba(255, 255, 255, .04) 100%);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    backdrop-filter: blur(20px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 16px;
    box-shadow:
        inset 0 1.5px 0 0 rgba(255, 255, 255, .40),
        inset 0 0 20px 0 rgba(255, 255, 255, .02),
        0 20px 50px -12px rgba(4, 12, 24, .65);
    padding: clamp(12px, 1.7vw, 24px) clamp(14px, 2.1vw, 32px) clamp(10px, 1.2vw, 14px);
    cursor: pointer;
    transition: border-color .45s cubic-bezier(.25, .5, .3, 1), box-shadow .45s cubic-bezier(.25, .5, .3, 1);
}

.dhs-caption::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, .08) 0%, rgba(226, 169, 99, .03) 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .45s cubic-bezier(.25, .5, .3, 1);
    z-index: 0;
}

.dhs-caption:hover::before,
.dhs-caption.is-expanded::before {
    opacity: 1;
}

.dhs-caption:hover {
    border-color: rgba(255, 255, 255, .38);
    background: linear-gradient(135deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, .08) 100%);
    box-shadow:
        inset 0 1.5px 0 0 rgba(255, 255, 255, .60),
        inset 0 0 30px 0 rgba(255, 255, 255, .06),
        0 28px 70px -10px rgba(4, 12, 24, .75);
}

.dhs-caps {
    position: relative;
    z-index: 1;
}

.dhs-caps {
    display: grid;
}

.dhs-cap {
    grid-area: 1/1;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .45s ease, visibility 0s .45s;
}

.dhs-cap.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity .6s ease .18s, visibility 0s;
}

.dhs-anim {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .55s cubic-bezier(.25, .5, .3, 1),
        transform .55s cubic-bezier(.25, .5, .3, 1);
}

.dhs-cap.is-active .dhs-anim {
    opacity: 1;
    transform: translateY(0);
    transition-delay: calc(.22s + var(--dhs-d, 0s));
}

/* ---------- Caption header (kicker / badge / date) — dynamic slides only ---------- */
.dhs-cap-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(5px, .8vw, 10px);
}

/* Static slides have no kicker content — the empty header's bottom
   margin would create dead space above the title. Collapse it. */
.dhs-cap-top--bare {
    margin-bottom: 0;
}

.dhs-kicker {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: clamp(.58rem, .70vw, .70rem);
    font-weight: 700;
    letter-spacing: .06em;
    color: #fef8e7;
    text-transform: uppercase;
}

.dhs-kicker-badge {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 1px;
}

.dhs-kicker-badge::after {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dhs-accent-hi, #e2a963);
}

.dhs-kicker-sep {
    color: rgba(255, 255, 255, .65);
    font-weight: 700;
    margin: 0 1px;
}

.dhs-kicker-date {
    color: #fef8e7;
    letter-spacing: .04em;
    font-weight: 600;
}

/* ---------- Title & excerpt (driven by General settings) ---------- */
.dhs-cap h2 {
    font-weight: var(--dhs-header-weight, 600);
    font-size: clamp(calc(var(--dhs-header-size, 21px) * .72), 1.35vw, var(--dhs-header-size, 21px));
    line-height: 1.45;
    letter-spacing: normal;
    color: var(--dhs-header-color, #fdfcf8);
    /* No text-wrap: balance here — it misplaces the line-clamp ellipsis in
       several Chromium versions (ellipsis after line 1 while line 2 still
       paints half-clipped). Explicitly overriding to prevent theme inheritance. */
    text-wrap: wrap;
    display: -webkit-box;
    -webkit-line-clamp: var(--dhs-header-lines, 2);
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    padding: 0;
    word-break: break-word;
}

/* ---------- Collapse (details hidden until expanded) ---------- */
.dhs-cap-collapse {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.dhs-cap-collapse-inner {
    min-height: 0;
    overflow: hidden;
    /* Bleed room so the CTA shadow is never cut off at the sides. */
    padding-left: 20px;
    margin-left: -20px;
    padding-right: 20px;
    margin-right: -20px;
    margin-bottom: 0;
    /* margin-bottom stays at 0 in every state (shadow room is CTA padding) */
}

/*
 * Expand rules match the reference exactly. :focus-within is restored
 * for keyboard accessibility (tabbing to the CTA expands the collapse).
 * The blur in dhs-slider.js prevents focus-within from pinning the
 * collapse open after is-expanded is removed.
 */
/* Full height when expanded (CTA carries its own shadow padding now) */
.dhs-caption.is-expanded .dhs-cap-collapse,
.dhs-caption:focus-within .dhs-cap-collapse {
    grid-template-rows: 1fr;
}

.dhs-cap p {
    margin: clamp(4px, .7vw, 9px) 0 0;
    font-size: clamp(calc(var(--dhs-excerpt-size, 15px) * .78), 1vw, var(--dhs-excerpt-size, 15px));
    font-weight: var(--dhs-excerpt-weight, 300);
    line-height: 1.65;
    color: var(--dhs-excerpt-color, rgba(255, 255, 255, .82));
    text-wrap: wrap;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 0;
}

/* ---------- CTA button ---------- */
.dhs-cap-action {
    margin-top: clamp(8px, 1.1vw, 14px);
    /*
     * Shadow room lives here as PADDING (part of content height) rather
     * than margin + a -28px compensation elsewhere. Slides WITHOUT a
     * button therefore end cleanly at the description with no clipped
     * lines.
     */
    padding-bottom: 28px;
}

.dhs-btn-cta {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: clamp(6px, .8vw, 9px) clamp(14px, 1.4vw, 20px);
    border-radius: 99px;
    font-size: clamp(.72rem, .9vw, .85rem);
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    background: var(--dhs-accent, #b4762f);
    border: 1px solid var(--dhs-accent, #b4762f);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    transition: background .28s cubic-bezier(.25, .5, .3, 1),
        border-color .28s cubic-bezier(.25, .5, .3, 1),
        color .28s cubic-bezier(.25, .5, .3, 1),
        transform .28s cubic-bezier(.25, .5, .3, 1),
        box-shadow .28s cubic-bezier(.25, .5, .3, 1);
    touch-action: manipulation;
}

.dhs-btn-cta::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 70%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-20deg);
    transition: left .6s ease;
}

.dhs-btn-cta:hover::after {
    left: 140%;
}

.dhs-btn-cta:hover {
    background: var(--dhs-accent-hi, #e2a963);
    border-color: var(--dhs-accent-hi, #e2a963);
    color: #071831;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 22px rgba(226, 169, 99, .5);
}

.dhs-btn-cta svg {
    width: 14px;
    height: 14px;
    pointer-events: none;
    transition: transform .28s cubic-bezier(.25, .5, .3, 1);
}

.dhs-btn-cta:hover svg {
    transform: translateX(4px);
}

/* ---------- Caption reveal on hover/tap (opt-in via Controls setting) ----------
   The caption slides below the bottom edge (hero clips overflow) and slides
   back up on real hover, keyboard focus inside it, or the is-caption-open
   class toggled by taps on non-hover devices. Dots move to their own bar. */
.dhs-hero--reveal-hover .dhs-caption {
    bottom: 52px; /* legacy resting position — overridden by the controls bar raise below */
    transform: translateX(-50%) translateY(calc(100% + 60px));
    opacity: 0;
    pointer-events: none;
    /* Material Design standard easing: fast start, gentle finish */
    /* Gentle cinematic rise: slower start-to-mid, long smooth settle.
     * Opacity trails slightly behind so the motion reads as one gesture. */
    transition: transform .65s cubic-bezier(.25, .7, .15, 1),
                opacity .55s ease .08s;
    will-change: transform, opacity;
}

.dhs-hero--reveal-hover .dhs-caption:focus-within,
.dhs-hero--reveal-hover.is-caption-open .dhs-caption {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

@media (hover: hover) {
    .dhs-hero--reveal-hover:hover .dhs-caption {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
}

/* Faint bottom gradient hinting at the hidden caption */
.dhs-hero--reveal-hover::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    background: linear-gradient(to top, rgba(6, 18, 38, .38), transparent);
    opacity: .35;
    pointer-events: none;
    z-index: 3;
}

/* ---------- Caption position: middle (opt-in) ---------- */
.dhs-hero--pos-middle .dhs-caption {
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(var(--dhs-caption-w, 60%), calc(100% - 40px));
    max-height: calc(100% - 110px);
    overflow-y: auto;
}

/* Reveal hidden state: exit downward from center instead of sinking below */
.dhs-hero--pos-middle.dhs-hero--reveal-hover .dhs-caption {
    transform: translate(-50%, -50%) translateY(120%);
}

.dhs-hero--pos-middle.dhs-hero--reveal-hover.is-caption-open .dhs-caption {
    transform: translate(-50%, -50%);
}

/*
 * Middle + keyboard focus: same-specificity tie-breaker placed after the
 * hidden rule above — without this, focusing the CTA via keyboard keeps
 * the card parked at its hidden offset while opacity fades it in.
 */
.dhs-hero--pos-middle.dhs-hero--reveal-hover .dhs-caption:focus-within {
    transform: translate(-50%, -50%);
}

@media (hover: hover) {
    .dhs-hero--pos-middle.dhs-hero--reveal-hover:hover .dhs-caption {
        transform: translate(-50%, -50%);
    }
}

/* Middle mode: keep clear of the dots row */
.dhs-hero--pos-middle .dhs-caption.is-expanded,
.dhs-hero--pos-middle .dhs-caption:focus-within {
    max-height: calc(100% - 110px);
}

/* ---------- Custom scrim (opt-in via Controls setting) ---------- */
.dhs-scrim--custom {
    background: var(--dhs-scrim-bg);
}

/* ---------- Caption background: solid (opt-in via Controls setting) ----------
   Flat color card: no backdrop blur, no glass sheen, typography and card
   chrome (counter, divider, icon borders) take the ink color. Hover and
   expanded states feed back through border + shadow only - the background
   never changes, so the picked color always reads exactly as chosen. */
.dhs-caption.dhs-caption--solid {
    background: var(--dhs-caption-bg, #0f2749);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    /* Borderless: the picked background color meets the image directly.
       (transparent, not removed, keeps the 1px layout identical). */
    border-color: transparent;
    box-shadow: 0 20px 50px -12px rgba(4, 12, 24, .65);
    color: var(--dhs-caption-ink, #fff);
}

.dhs-caption--solid::before {
    content: none;
}

.dhs-caption--solid:hover,
.dhs-caption--solid.is-expanded {
    background: var(--dhs-caption-bg, #0f2749);
    border-color: transparent;
    box-shadow: 0 28px 70px -10px rgba(4, 12, 24, .75);
}

/* Ink application: title, excerpt (slightly softer), meta chrome */
.dhs-caption--solid .dhs-cap h2 {
    color: var(--dhs-caption-ink, #fff);
}

.dhs-caption--solid .dhs-cap p {
    color: var(--dhs-caption-ink-body, rgba(255, 255, 255, .82));
}

.dhs-caption--solid .dhs-kicker,
.dhs-caption--solid .dhs-kicker-sep,
.dhs-caption--solid .dhs-kicker-date {
    color: var(--dhs-caption-ink, #fff);
}

/* Kicker badge ring (dynamic slides) follows the ink as well. */
.dhs-caption--solid .dhs-kicker-badge {
    background: var(--dhs-caption-ink-soft, rgba(255, 255, 255, .18));
}

/* ---------- No-collapse mode (reveal=hover): description always visible ---------- */
.dhs-caption--no-collapse .dhs-cap-collapse {
    grid-template-rows: 1fr !important;
    transition: none;
}

/*
 * Reveal mode has no clipped collapse container — shadows extend freely.
 * Keep a modest cushion so the CTA does not sit flush on the box edge.
 */
.dhs-caption--no-collapse .dhs-cap-action {
    padding-bottom: 12px;
}

/* Hover trigger (collapse_trigger=hover): the box is not click-to-toggle,
   so the pointer cursor from the click skin would be misleading. */
.dhs-hero--collapse-hover .dhs-caption {
    cursor: default;
}

/* ---------- Caption alignment (Settings → Controls) ---------- */
/* Left is the default: no class is emitted and no rule is needed. Center/
   right set text-align on the card — the heading, description, inline-flex
   kicker and CTA button all follow — and justify the block-level flex
   header row, whose single child would otherwise stay at flex-start. */
.dhs-hero--align-center .dhs-caption {
    text-align: center;
}

.dhs-hero--align-center .dhs-cap-top {
    justify-content: center;
}

.dhs-hero--align-right .dhs-caption {
    text-align: right;
}

.dhs-hero--align-right .dhs-cap-top {
    justify-content: flex-end;
}

.dhs-btn-play-pause {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .85);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
    flex-shrink: 0;
    padding: 0;
    touch-action: manipulation;
}

.dhs-btn-play-pause:hover {
    background: rgba(255, 255, 255, .28);
    color: #fff;
    border-color: rgba(255, 255, 255, .55);
    transform: scale(1.08);
}

.dhs-btn-play-pause svg {
    width: 12px;
    height: 12px;
    pointer-events: none;
}

/* ---------- Dots ---------- */
.dhs-dots {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dhs-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 99px;
    background: rgba(255, 255, 255, .32);
    cursor: pointer;
    position: relative;
    transition: width .45s cubic-bezier(.22, .61, .36, 1), background .3s ease;
    touch-action: manipulation;
}

/* Larger hit area so taps and clicks never miss */
.dhs-dot::before {
    content: "";
    position: absolute;
    top: -12px;
    bottom: -12px;
    left: -8px;
    right: -8px;
}

.dhs-dot:hover {
    background: rgba(255, 255, 255, .55);
}

.dhs-dot.active {
    width: 46px;
    background: rgba(255, 255, 255, .22);
}

/* The wrapper clips the fill to the pill shape, so the fill itself can
   stay on transform: scaleX (compositor-smooth) without its radius being
   squished at low progress. */
.dhs-fill-wrap {
    position: absolute;
    inset: 0;
    border-radius: 99px;
    overflow: hidden;
    display: block;
}

.dhs-dot .dhs-fill {
    position: absolute;
    inset: 0;
    background: #fff;
    transform: scaleX(0);
    transform-origin: left center;
    display: block;
}

/* Dot tooltip */
.dhs-dot-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    opacity: 0;
    pointer-events: none;
    background: rgba(7, 24, 49, .92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
    padding: 5px 10px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
    transition: opacity .25s ease, transform .25s cubic-bezier(.25, 1, .5, 1);
    z-index: 10;
}

.dhs-dot-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(7, 24, 49, .92);
}

.dhs-dot:hover .dhs-dot-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.dhs-dot-tip-num {
    font-size: .62rem;
    font-weight: 700;
    color: var(--dhs-accent-hi, #e2a963);
}

.dhs-dot-tip-title {
    font-size: .70rem;
    font-weight: 500;
    color: #fdfcf8;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .dhs-nav {
        width: 46px;
        height: 46px;
        top: 32%;
    }
}

@media (max-width: 768px) {
    .dhs-s1 {
        aspect-ratio: var(--dhs-ratio-t, 16/10);
        height: var(--dhs-h-t, auto);
    }
}

@media (max-width: 640px) {
    .dhs-s1 {
        aspect-ratio: var(--dhs-ratio-m, 4/3);
        min-height: var(--dhs-min-h-m, 400px);
        height: var(--dhs-h-m, auto);
    }

    /* Lighter glass on small screens: the caption sits over a continuously
       animating (Ken Burns) image, so cheaper filters save real battery/GPU. */
    .dhs-caption {
        -webkit-backdrop-filter: blur(12px) saturate(1.4);
        backdrop-filter: blur(12px) saturate(1.4);
    }

    .dhs-nav {
        -webkit-backdrop-filter: blur(10px) saturate(1.4);
        backdrop-filter: blur(10px) saturate(1.4);
    }

    .dhs-nav {
        width: 38px;
        height: 38px;
        top: 25%;
        opacity: .95;
    }

    .dhs-nav svg {
        width: 16px;
        height: 16px;
    }

    .dhs-caption {
        width: 92%;
    }

    .dhs-hero--pos-middle .dhs-caption {
        width: 90%;
        /* Reassert vertical centering: the generic mobile rule above sets
         * bottom: 12px, which would offset the centered card. */
        top: 50%;
        bottom: auto;
        padding: 12px 14px 10px;
        border-radius: 14px;
    }

    .dhs-cap p {
        font-size: .8rem;
    }

    .dhs-cap h2 {
        font-size: clamp(calc(var(--dhs-header-size, 21px) * .62), 3.5vw, calc(var(--dhs-header-size, 21px) * .75));
    }

    .dhs-dot.active {
        width: 32px;
    }

    .dhs-dot-tooltip {
        display: none;
    }
}

@media (max-width: 380px) {
    .dhs-s1 {
        min-height: calc(var(--dhs-min-h-m, 400px) + 30px);
    }

}

/* ---------- Image fit: contain + blurred backdrop (opt-in via General) ----------
   The slide image shows at its real scale (nothing cropped, no Ken Burns),
   centred over a blurred copy of itself that fills the rest of the frame.
   The backdrop bleeds past the edges so the blur has no transparent fringe. */
.dhs-hero--fit-contain .dhs-slide-bg {
    position: absolute;
    inset: -30px;
    background-size: cover;
    background-position: center;
    filter: blur(var(--dhs-blur, 22px));
    transform: translateZ(0);
}

.dhs-hero--fit-contain .dhs-slide img {
    /* Lift above the absolute backdrop (positioned elements paint over
       static content); the scrim lifts one more so it stays on top. */
    position: relative;
    z-index: 1;
    object-fit: contain;
    transform: none;
}

.dhs-hero--fit-contain .dhs-scrim {
    z-index: 2;
}

.dhs-hero--fit-contain .dhs-slide.is-active img,
.dhs-hero--fit-contain .dhs-slide[data-dhs-pan="out"].is-active img {
    animation: none;
}

/* ---------- Floating controls bar: play | dots ----------
   Fixed to the bottom-centre of the SLIDER — independent of the caption
   card, per Swiper/Splide/WCAG practice: controls never move and never
   overlap content. The bottom-mode caption floats above the bar. */
.dhs-controls-bar {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: clamp(8px, 1.5vw, 14px);
    z-index: 6;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(7, 24, 49, .55);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, .16);
    box-shadow: 0 10px 26px rgba(4, 12, 24, .35);
}

.dhs-controls-bar .dhs-btn-play-pause {
    width: 24px;
    height: 24px;
}

.dhs-controls-bar .dhs-btn-play-pause svg {
    width: 11px;
    height: 11px;
}

/* Bottom-mode caption floats above the bar (middle is centred, reveal
   already sits at 52px — both clear the bar without extra rules). */
.dhs-hero--has-controls:not(.dhs-hero--pos-middle) .dhs-caption {
    bottom: calc(clamp(8px, 1.5vw, 14px) + 48px);
}

/* External dots bar — fallback when the controls bar is hidden in reveal
   mode (Settings → Controls → Show Controls Bar = off). Pinned to the
   bottom edge, always visible. */
.dhs-dots-bar {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: clamp(10px, 1.6vw, 18px);
    z-index: 6;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .dhs-cap-collapse {
        transition: none;
    }

    .dhs-hero--reveal-hover .dhs-caption,
    .dhs-hero--pos-middle.dhs-hero--reveal-hover .dhs-caption {
        transition: none;
    }

    .dhs-slide.is-active img {
        animation: none;
    }

    .dhs-slide img {
        transition: none;
    }

    .dhs-anim {
        transition-duration: .01s;
        transition-delay: 0s;
    }
}
