/* ==========================================================================
   Hero Slider Block
   Card geometry mirrors the Figma frame (1360 x 558). All inner positions are
   percentages of the card so the layout scales with the fluid container.
   ========================================================================== */

/* Match the Figma frame's vertical padding (24px), not the global 80px */
.section.heroslider {
    padding-top: 24px;
    padding-bottom: 24px;
}

.heroslider .heroslider-wrap {
    position: relative;
}

/* ---- Track / slide card ------------------------------------------------- */
.heroslider-track {
    margin: 0;
}

/* Avoid a stacked flash before Slick initialises */
.heroslider-track:not(.slick-initialized) .heroslider-slide + .heroslider-slide {
    display: none;
}

.heroslider-slide {
    position: relative;
    aspect-ratio: 1360 / 558;
    min-height: 600px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-neutral-100);
}

/* Media card — holds the photo + overlay + stripe + edge + controls.
   On desktop it fills the slide (text overlays it); on mobile it becomes a
   separate card below the text. */
.heroslider-media {
    position: absolute;
    inset: 0;
}

/* ---- Background photo --------------------------------------------------- */
.heroslider-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.heroslider-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---- Navy brand overlay (diagonal, ~15deg) ------------------------------ */
.heroslider-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(
        101deg,
        var(--color-navy) 0%,
        var(--color-navy) 33%,
        rgba(0, 32, 91, 0.92) 42%,
        rgba(0, 32, 91, 0.55) 52%,
        rgba(0, 32, 91, 0) 66%
    );
}

/* ---- Orange diagonal stripe (Figma Vector 9) ---------------------------- */
.heroslider-stripe {
    position: absolute;
    left: 78.5%;
    top: 58.42%;    /* 326 / 558  */
    width: 6.4%;    /* 87 / 1360  */
    height: 41.58%; /* 232 / 558  */
    z-index: 4;
    pointer-events: none;
}
.heroslider-stripe svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ---- Right edge: two layered angled wedges — a lighter-blue wedge behind,
   the dark navy wedge layered on top and inset so the blue reads as an
   angled-corner accent along the top + right edge ------------------------- */
.heroslider-edge {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}
/* Back layer — lighter blue */
.heroslider-edge::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 21%;
    background: color-mix(in srgb, var(--color-brand-light-blue) 60%, transparent);
    clip-path: polygon(54% 0, 100% 0, 100% 100%, 2% 100%);
}
/* Front layer — dark navy, inset right + down so the blue peeks behind it */
.heroslider-edge::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0px;
    bottom: 0;
    width: 17.5%;
    background: color-mix(in srgb, var(--color-navy) 85%, transparent);
    /* run matched to ::before (21% wide, 54%→2%) so the diagonal is parallel */
    clip-path: polygon(64.4% 0, 100% 0, 100% 100%, 2% 100%);
}

/* ---- Content layer ------------------------------------------------------ */
.heroslider-content {
    position: absolute;
    inset: 0;
    z-index: 4;
}

/* Text column — Figma: left 87, top 101, width 500 (of 1360 x 558) */
.heroslider-text {
    position: absolute;
    left: 6.4%;
    top: 18.1%;
    width: 36.8%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

/* Eyebrow tag — gray parallelogram, Inter Tight medium, white */
.heroslider-eyebrow {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: var(--text-label-xs);
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-background);
    background: var(--color-brand-gray);
    padding: 7px 14px 6px;
    clip-path: polygon(1.8% 0, 100% 0, 98.2% 100%, 0% 100%);
}

.heroslider-slide .heroslider-headline {
    font-size: var(--text-display-md); /* 60px cap, scales down on narrow viewports */
    margin: 0;
    color: var(--color-background);
}
.heroslider-slide .heroslider-subcopy {
    color: var(--color-background);
    margin: 0;
    max-width: 100%;
}

/* CTA row */
.heroslider-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);
    margin-top: 16px;
}

/* Size the FA arrow icon inside the primary CTA */
.heroslider-actions .btn .fa {
    font-size: 14px;
}

/* Light-mode slide: swap primary CTA to navy */
.heroslider-slide.is-light .btn-accent {
    background: var(--color-primary);
    color: var(--color-primary-foreground);
}
.heroslider-slide.is-light .btn-accent:hover {
    background: var(--color-primary-hover);
}

/* ---- Light mode (per slide) -------------------------------------------- */
.heroslider-slide.is-light .heroslider-overlay {
    background: linear-gradient(
        101deg,
        rgba(255, 255, 255, 0.94) 0%,
        rgba(255, 255, 255, 0.88) 33%,
        rgba(255, 255, 255, 0.55) 50%,
        rgba(255, 255, 255, 0) 66%
    );
}
.heroslider-slide.is-light .heroslider-headline,
.heroslider-slide.is-light .heroslider-subcopy { color: var(--color-foreground); }

/* Thumbnail navigation — Figma: left 1193, top 65, width 138, gap 29.571.
   One thumbnail per slide; click jumps to that slide, active slide highlighted. */
.heroslider-thumbs {
    position: absolute;
    left: 87.72%;
    top: 11.65%;
    width: 10.15%;
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 2vw, 30px); /* Figma ~29.571px; % gaps collapse in an auto-height column */
    z-index: 5;
}
.heroslider-thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 138 / 101;
    padding: 0;
    border-radius: 6px;
    border: 2px solid var(--color-secondary);
    overflow: hidden;
    cursor: pointer;
    background: none;
    opacity: 0.7;
    transition: opacity var(--ease-default), border-color var(--ease-default), transform var(--ease-fast);
}
.heroslider-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.heroslider-thumb:hover { opacity: 1; }
.heroslider-thumb:focus-visible {
    outline: 2px solid var(--color-background);
    outline-offset: 2px;
    opacity: 1;
}
.heroslider-thumb.is-active {
    border-color: var(--color-brand-orange);
    opacity: 1;
}

/* ---- Progress bar (autoplay indicator) ---------------------------------- */
.heroslider-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 10px;
    z-index: 5;
    background: var(--color-secondary);
    border-radius: 0 var(--radius-full) var(--radius-full) var(--radius-md);
    overflow: hidden;
}
.heroslider-progress-fill {
    display: block;
    height: 100%;
    width: 0;
    background: var(--color-brand-orange);
    border-radius: inherit;
}
.heroslider-wrap.is-animating .heroslider-progress-fill {
    width: 100%;
    transition: width linear var(--heroslider-speed, 7000ms);
}

/* ---- Arrows ------------------------------------------------------------- */
.heroslider-arrows {
    position: absolute;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 20px 8px 34px; /* extra left padding for the angled cut */
    background: var(--color-secondary);
    border: 0;
    border-radius: 0;
    /* squared box with an angled left edge (top cut in, matching the diagonal) */
    clip-path: polygon(18% 0, 100% 0, 100% 100%, 0% 100%);
    z-index: 7;
}
.heroslider-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--color-foreground);
    font-size: 16px;
    cursor: pointer;
    transition: background var(--ease-default), transform var(--ease-fast);
}
.heroslider-arrow:hover  { background: var(--color-muted); }
.heroslider-arrow:focus-visible { outline: 2px solid var(--color-foreground); outline-offset: 2px; }
.heroslider-arrow:active { transform: scale(0.94); }
.heroslider-arrow[disabled] { opacity: 0.4; cursor: default; }
.heroslider-arrow-sep {
    display: block;
    width: 1px;
    height: 28px;
    background: var(--color-foreground);
}

/* Pause / play toggle (bottom-left) — required for auto-rotation (WCAG 2.2.2) */
.heroslider-playtoggle {
    position: absolute;
    left: 2.1%;
    bottom: 26px;            /* clears the 10px progress bar + ~16px gap */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--color-brand-gray);
    font-size: 14px;
    cursor: pointer;
    z-index: 6;
    transition: background var(--ease-default), transform var(--ease-fast);
}
.heroslider-playtoggle:hover  { background: rgba(255, 255, 255, 0.16); }
.heroslider-playtoggle:focus-visible { outline: 2px solid var(--color-background); outline-offset: 2px; }
.heroslider-playtoggle:active { transform: scale(0.94); }
/* When the active slide is light, the bottom-left sits on a light scrim */
.heroslider-wrap.is-light-slide .heroslider-playtoggle { color: var(--color-brand-gray); }
.heroslider-wrap.is-light-slide .heroslider-playtoggle:hover { background: rgba(0, 0, 0, 0.08); }
.heroslider-wrap.is-light-slide .heroslider-playtoggle:focus-visible { outline-color: var(--color-foreground); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 991px) {
    /* Stacked layout: text (on white) above a separate photo card, then a row
       of thumbnails. Height is driven by content (can't predict its length). */
    .heroslider-slide {
        aspect-ratio: auto;
        min-height: 0;
        height: auto;
        overflow: visible;
        border-radius: 0;
        background: transparent;
    }

    /* Text block — normal flow, dark text on the section's white background.
       Copy comes first in the DOM, so it stacks above the photo. */
    .heroslider-content {
        position: static;
        inset: auto;
        margin-bottom: var(--space-10);
    }
    .heroslider-text {
        position: static;
        inset: auto;
        width: auto;
        padding: 0;
        gap: 16px;
    }
    .heroslider-slide .heroslider-headline,
    .heroslider-slide .heroslider-subcopy { color: var(--color-foreground); }
    .heroslider-headline { font-size: clamp(30px, 9vw, 40px); }

    /* Photo card */
    .heroslider-media {
        position: relative;
        inset: auto;
        aspect-ratio: 353 / 209;
        border-radius: var(--radius-sm);
        overflow: hidden;
    }
    .heroslider-overlay { display: none; }   /* no left scrim — photo stays clear */

    /* Controls scale down on the smaller card */
    .heroslider-arrows { padding: 5px 12px 5px 22px; gap: 4px; }
    .heroslider-arrow { width: 32px; height: 32px; font-size: 13px; }
    .heroslider-arrow-sep { height: 18px; }
    /* Autoplay is already disabled on mobile, so the pause/play toggle is moot —
       hide it entirely here. */
    .heroslider-playtoggle { display: none; }
    .heroslider-progress { height: 5px; }

    /* Thumbnails — horizontal row below the photo */
    .heroslider-thumbs {
        position: static;
        inset: auto;
        left: auto;
        top: auto;
        width: auto;
        flex-direction: row;
        gap: var(--space-4);
        margin-top: var(--space-4);
    }
    .heroslider-thumb {
        flex: 1 1 0;
        width: auto;
        aspect-ratio: 167 / 100;
    }
}

@media (max-width: 480px) {
    .heroslider-content { margin-bottom: var(--space-8); }
    .heroslider-text { gap: 14px; }
    .heroslider-thumbs { gap: var(--space-2); }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .heroslider-arrow { transition: none; }
    .heroslider-wrap.is-animating .heroslider-progress-fill { transition: none; }
}
