/* =========================================================
   PERSONAL HOME SLIDER (phs)
   Partial: Views/Partials/_PersonalHomeSlider.cshtml
   Script:  wwwroot/scripts/personalhomeslider.js
   ========================================================= */

:root {
    /* Kept in sync at runtime from data-phs-duration so the bar fill and the
       autoplay timer can never drift apart. */
    --phs-duration: 5000ms;
    --phs-height: 520px;
    --phs-fade: 600ms;
    --phs-bar-width: 44px;
    --phs-track: rgba(255, 255, 255, 0.35);
}

.phs {
    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) {
    .phs.Hero_Section {
        height: auto;
        min-height: 0;
        aspect-ratio: 3 / 1;
    }
}

/* ---------- Slides ---------- */
.phs__viewport {
    position: absolute;
    inset: 0;
}

.phs__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--phs-fade) ease, visibility var(--phs-fade) ease;
}

    .phs__slide.is-active {
        opacity: 1;
        visibility: visible;
    }

.phs__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.phs__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;
}

.phs__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;
}

.phs__headline {
    margin: 0;
    width: 100%;
    color: var(--white);
    font-size: 28px;
    font-weight: 400;
    line-height: 1.35;
    overflow-wrap: break-word;
}

/* ---------- Prev / Next (text + rule, no arrow icons) ---------- */
.phs__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);
}

    .phs__nav:hover {
        opacity: 0.7;
    }

    .phs__nav:focus-visible {
        outline: 2px solid var(--white);
        outline-offset: 4px;
    }

/* inset-inline handles RTL without a mirror rule */
.phs__nav--prev {
    inset-inline-start: -2px;
}

.phs__nav--next {
    inset-inline-end: -2px;
}

.phs__nav-line {
    display: block;
    width: 30px;
    height: 1px;
    background: currentColor;
    flex-shrink: 0;
}

.phs__nav-text {
    white-space: nowrap;
    letter-spacing: 0.02em;
}

/* ---------- Progress bars ---------- */
.phs__bars {
    /* position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 8px;*/
    display:none !important;
    position: absolute;
    bottom: 30px;
    z-index: 3;
    display: flex;
    gap: 8px;
}

/* Button is taller than the visible track purely to give a usable hit area */
.phs__bar {
    display: flex;
    align-items: center;
    width: var(--phs-bar-width);
    height: 20px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
}

    .phs__bar:focus-visible {
        outline: 2px solid var(--white);
        outline-offset: 3px;
    }

.phs__bar-track {
    width: 100%;
    height: 3px;
    background: var(--phs-track);
    border-radius: 2px;
    overflow: hidden;
}

.phs__bar-fill {
    display: block;
    width: 0;
    height: 100%;
    background: var(--white);
}

/* Completed slides stay solid white */
.phs__bar.is-complete .phs__bar-fill {
    width: 100%;
}

/* The active bar fills over exactly one autoplay interval.
   personalhomeslider.js restarts this by clearing the inline animation and
   forcing a reflow, so clicks and Prev/Next always begin the fill from zero. */
.phs__bar.is-active .phs__bar-fill {
    animation: phs-fill var(--phs-duration) linear forwards;
}

@keyframes phs-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) {
    .phs__slide {
        transition: none;
    }

    .phs__bar.is-active .phs__bar-fill {
        animation: none;
        width: 100%;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    :root {
        --phs-height: 420px;
    }

    .phs__content {
        padding: 0 32px 88px;
    }

   /* .phs__nav--prev {
        inset-inline-start: 14px;
    }

    .phs__nav--next {
        inset-inline-end: 14px;
    }*/

    .phs__nav-line {
        width: 18px;
    }
}

@media (max-width: 768px) {
    .phs__headline {
        font-size: 16px;
    }
    :root {
        --phs-height: 340px;
        --phs-bar-width: 32px;
    }

    .phs__content {
        padding: 0 16px 78px;
    }
}
