/* ==========================================================
   hero.css - homepage hero slider (Swiper). Each slide carries
   its own image and its own left-side text.
   ========================================================== */
.hero {
    position: relative;
    background: var(--white);
    overflow: hidden;
}

/* ---------- Slider (mobile first: text on top, image below) ---------- */
.hero-swiper { width: 100%; }
.hero-swiper .swiper-slide {
    display: flex;
    flex-direction: column;
    height: auto;
    background: var(--white);
}
.slide-content { padding: 28px 0 20px; }
.slide-img {
    display: block;
    width: 100%;
    height: clamp(200px, 62vw, 300px);
    margin-top: auto;              /* image always sits at the bottom of the slide */
    object-fit: cover;
    object-position: 80% center;   /* keeps the people in view on narrow screens */
}

/* Slider controls, themed with the bank colours */
.hero-swiper .swiper-pagination-bullet { background: var(--primary-color); opacity: .35; width: 10px; height: 10px; }
.hero-swiper .swiper-pagination-bullet-active { background: var(--secondary-color); opacity: 1; width: 26px; border-radius: 6px; transition: width var(--transition); }
.hero-swiper .swiper-button-prev,
.hero-swiper .swiper-button-next {
    display: none;                 /* arrows only on desktop */
    width: 44px; height: 44px;
    border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
    transition: background var(--transition), color var(--transition);
}
.hero-swiper .swiper-button-prev::after,
.hero-swiper .swiper-button-next::after { font-size: 16px; font-weight: 700; }
.hero-swiper .swiper-button-prev:hover,
.hero-swiper .swiper-button-next:hover { background: var(--primary-color); color: var(--white); }
.hero-swiper .swiper-button-prev:focus-visible,
.hero-swiper .swiper-button-next:focus-visible { outline: 3px solid var(--secondary-color); outline-offset: 2px; }

/* ---------- Text (standard hero title + paragraph sizes) ---------- */
.hero-text { max-width: 560px; }

.hero-title {
    margin: 0 0 12px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(1.75rem, 7vw, 2.25rem);
    line-height: 1.15;
    color: var(--primary-color);
    min-height: 2.3em;             /* reserves two lines so the layout doesn't jump while typing */
}
.hero-title .cursor {
    display: none;                 /* shown only on the slide that is currently typing */
    width: 3px; height: .95em;
    margin-left: 4px;
    vertical-align: -.1em;
    background: var(--secondary-color);
    animation: hero-blink 1s steps(1) infinite;
}
.hero-title.is-typing .cursor { display: inline-block; }

.hero-text p {
    margin: 0;
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--text-color);
}
.hero-text p strong {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 6px;
    background: var(--primary-color);
    color: var(--secondary-color);
    font-family: var(--font-heading);
    letter-spacing: .02em;
}

/* Buttons (optional per slide) */
.hero-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; pointer-events: auto; }
.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 22px;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius);
    background: var(--primary-color);
    color: var(--white);
    font-family: var(--font-heading);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
.hero-btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.hero-btn-outline { background: transparent; color: var(--primary-color); }
.hero-btn-outline:hover { background: var(--primary-color); color: var(--white); border-color: var(--primary-color); }
.hero-btn:focus-visible { outline: 3px solid var(--secondary-color); outline-offset: 2px; }

@keyframes hero-blink { 50% { opacity: 0; } }

/* ==========================================================
   Desktop: image fills the slide, text sits on the left
   ========================================================== */
@media (min-width: 992px) {
    .hero-swiper { height: clamp(460px, calc(100vh - 202px), 720px); height: clamp(460px, calc(100svh - 202px), 720px); } /* fills the screen below the sticky header */
    .hero-swiper .swiper-slide { display: block; position: relative; height: 100%; }

    .slide-img {
        position: absolute;
        inset: 0;
        height: 100%;
        object-position: right top;
    }
    .slide-content {
        position: absolute;
        inset: 0;
        z-index: 2;
        display: flex;
        align-items: center;
        padding: 0;
        pointer-events: none;      /* slider stays draggable behind the text */
    }
    .slide-content .container { width: 100%; }

    .hero-swiper .swiper-button-prev,
    .hero-swiper .swiper-button-next { display: flex; }

    .hero-text { max-width: min(480px, 38vw); }
    .hero-title { font-size: clamp(2rem, 3.4vw, 3rem); min-height: 0; }
    .hero-text p { font-size: clamp(1.0625rem, 1.5vw, 1.25rem); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-title .cursor { animation: none; }
}
