/* =========================================================
   BUSINESS HOME SLIDER (bhs)
   Partial: Views/Partials/_BusinessHomeSlider.cshtml
   Script:  wwwroot/scripts/businesshomeslider.js
   ========================================================= */

:root {
    /* Kept in sync at runtime from data-bhs-duration so the bar fill and the
       autoplay timer can never drift apart. */
    --bhs-duration: 5000ms;
    --bhs-height: 520px;
    --bhs-fade: 600ms;
    --bhs-bar-width: 44px;
    --bhs-track: rgba(255, 255, 255, 0.35);
}

.bhs {
    position: relative;
    width: 100%;
    height: 395px;
    overflow: hidden;
    background: var(--primary-dark-blue);
}

/* Desktop only (tablet and mobile keep 395px): same size as the old eg-bank.com home
   banner — full-bleed 1350x450 artwork at width:100% / height:auto, i.e. a 3:1 box that
   scales with the viewport. Upload slider images at 1350x450 so object-fit: cover shows
   them uncropped. Compound selector so it beats .Hero_Section's fixed height/min-height
   (GeneralStyle.css). */
@media (min-width: 1025px) {
    .bhs.Hero_Section {
        height: auto;
        min-height: 0;
        aspect-ratio: 3 / 1;
    }

    /* The Personal/Corporate tabs (.top-right) stay in flow but are pushed 62px down
       (position: relative; top: 62px — same offset as .HeaderTopMenu in Master.css), so
       the slider has to clear that offset or the tabs cover the top of the artwork.
       .bh-page's "* { margin: 0 }" reset already wipes .Hero_Section's margin. */
    .bh-page .bhs.Hero_Section {
        margin-top: 62px;
    }
}

/* ---------- Slides ---------- */
.bhs__viewport {
    position: absolute;
    inset: 0;
}

.bhs__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--bhs-fade) ease, visibility var(--bhs-fade) ease;
}

    .bhs__slide.is-active {
        opacity: 1;
        visibility: visible;
    }

.bhs__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bhs__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 59, 112, 0.10) 0%, rgba(0, 59, 112, 0.45) 55%, rgba(0, 59, 112, 0.82) 100%);
    opacity: 0.5;
}

.bhs__content {
    position: absolute;
    inset-inline-start: 0;
    bottom: 0;
    z-index: 2;
    /* Bottom padding clears the progress bars */
    padding: 0 30px 65px;
    max-width: 640px;
    /* Flex ancestors elsewhere on the page can squeeze this; keep the text wrapping */
    min-width: 0;
    font-size: 32px;
}

.bhs__headline {
    margin: 0;
    width: 100%;
    color: var(--white);
    font-size: 28px;
    font-weight: 400;
    line-height: 1.35;
    overflow-wrap: break-word;
}

/* mintTextSlider — same teal highlight treatment as Hero_Title_Accent elsewhere */
.bhs__headline-accent {
    color: #00C4B3;
}

/* ---------- Prev / Next (text + rule, no arrow icons) ---------- */
.bhs__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--white);
    font-size: 16px;
    font-weight: var(--font-regular);
    transition: opacity var(--transition-fast);
}

    .bhs__nav:hover {
        opacity: 0.7;
    }

    .bhs__nav:focus-visible {
        outline: 2px solid var(--white);
        outline-offset: 4px;
    }

/* inset-inline handles RTL without a mirror rule */
.bhs__nav--prev {
    inset-inline-start: -2px;
}

.bhs__nav--next {
    inset-inline-end: -2px;
}

.bhs__nav-line {
    display: block;
    width: 30px;
    height: 1px;
    background: currentColor;
    flex-shrink: 0;
}

.bhs__nav-text {
    white-space: nowrap;
    letter-spacing: 0.02em;
}

/* ---------- Progress bars ---------- */
.bhs__bars {
    position: absolute;
    bottom: 30px;
    z-index: 3;
    display: flex;
    gap: 8px;
    display:none !important;
}

/* Button is taller than the visible track purely to give a usable hit area */
.bhs__bar {
    display: flex;
    align-items: center;
    width: var(--bhs-bar-width);
    height: 20px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
}

    .bhs__bar:focus-visible {
        outline: 2px solid var(--white);
        outline-offset: 3px;
    }

.bhs__bar-track {
    width: 100%;
    height: 3px;
    background: var(--bhs-track);
    border-radius: 2px;
    overflow: hidden;
}

.bhs__bar-fill {
    display: block;
    width: 0;
    height: 100%;
    background: var(--white);
}

/* Completed slides stay solid white */
.bhs__bar.is-complete .bhs__bar-fill {
    width: 100%;
}

/* The active bar fills over exactly one autoplay interval.
   businesshomeslider.js restarts this by clearing the inline animation and
   forcing a reflow, so clicks and Prev/Next always begin the fill from zero. */
.bhs__bar.is-active .bhs__bar-fill {
    animation: bhs-fill var(--bhs-duration) linear forwards;
}

@keyframes bhs-fill {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

/* ---------- Reduced motion ----------
   Autoplay is also disabled in JS, so no slide moves without a deliberate click.
   The active bar is shown filled rather than animating. */
@media (prefers-reduced-motion: reduce) {
    .bhs__slide {
        transition: none;
    }

    .bhs__bar.is-active .bhs__bar-fill {
        animation: none;
        width: 100%;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    :root {
        --bhs-height: 420px;
    }

    .bhs__content {
        padding: 0 32px 88px;
    }

/*    .bhs__nav--prev {
        inset-inline-start: 14px;
    }*/

/*    .bhs__nav--next {
        inset-inline-end: 14px;
    }*/

    .bhs__nav-line {
        width: 18px;
    }
}

@media (max-width: 768px) {
    .bhs__headline {
        font-family: Co Headline;
        font-weight: 400;
        font-size: 24px;
        line-height: 150%;
        letter-spacing: 0%;
    }
    :root {
        --bhs-height: 340px;
        --bhs-bar-width: 32px;
    }

    .bhs__content {
        padding: 0 16px 78px;
    }
}
