/*
 * Home hero: slider + overlapping category bar.
 * Loaded only on HomePage (HomePageController), after style.css.
 * Uses its own class names so none of the legacy .slider / .sample /
 * .catgory / .cat-col rules in style.css apply here.
 *
 * Tweak the layout via the custom properties on .home-hero:
 *   --hero-offset   height of the fixed header above the hero
 *   --hero-height   slider height
 *   --hero-overlap  how far the category bar overlaps the slider bottom
 */

.home-hero {
    --hero-offset: 87px;
    --hero-height: clamp(400px, 40vw, 680px);
    --hero-overlap: 64px;
    --hero-banner-font: clamp(20px, 2.4vw, 40px);
    --hero-banner-space: 0px;

    position: relative;
    width: 100%;
    margin-top: var(--hero-offset);
}

.home-hero--has-banner {
    /* banner line + its padding + gap above the category bar */
    --hero-banner-space: calc(var(--hero-banner-font) * 1.2 + 60px);
}

.home-hero--no-cats {
    --hero-overlap: 0px;
}

/* ---------- Slider ---------- */

.home-hero__slider {
    position: relative;
    width: 100%;
    height: var(--hero-height);
    overflow: hidden;
    background: #0a2d55;
}

.home-hero .home-hero__slides,
.home-hero .home-hero__dots {
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-hero__slide {
    background-size: cover;
    background-position: 50% 50%;
}

.home-hero__slide::after {
    /* light scrim so white captions stay readable on bright images */
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 30%, rgba(0, 0, 0, 0.35));
    pointer-events: none;
}

.home-hero__caption {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    /* keep the caption centred in the visible area above the banner and bar */
    padding: 40px 96px calc(var(--hero-overlap) + var(--hero-banner-space) + 40px);
    text-align: center;
}

.home-hero__caption h2 {
    margin: 0;
    max-width: 1000px;
    color: #fff;
    font-size: clamp(26px, 3.2vw, 49px);
    font-weight: bold;
    line-height: 1.2;
    text-transform: capitalize;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}

.home-hero__caption .lrn-btn {
    margin: 0;
}

/* Arrows (slidizle adds .slidizle-next / .slidizle-previous for position) */
.home-hero .home-hero__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 22px;
    /* centre in the visible area, not the full slider */
    top: calc(50% - (var(--hero-overlap) + var(--hero-banner-space)) / 2);
}

.home-hero .home-hero__arrow:hover,
.home-hero .home-hero__arrow:focus-visible {
    background: rgba(0, 0, 0, 0.5);
}

.home-hero .home-hero__arrow--next {
    right: 24px;
}

.home-hero .home-hero__arrow--prev {
    left: 24px;
}

/* Dots (slidizle adds .slidizle-navigation and fills the <li>s) */
.home-hero .home-hero__dots {
    bottom: calc(var(--hero-overlap) + var(--hero-banner-space) + 16px);
}

/* Header notice */
.home-hero__alert {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    padding: 10px 48px 10px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 14px;
    text-align: center;
}

.home-hero__alert p {
    margin: 0;
    color: #fff;
}

.home-hero__alert a {
    color: #fff;
    text-decoration: underline;
}

.home-hero__alert .closealertbtn {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

/* Static banner, sits on the slider just above the category bar */
.home-hero__banner {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: calc(var(--hero-overlap) + 24px);
    z-index: 25;
    max-width: 1150px;
    margin: 0 auto;
    border-radius: 34px;
    background: #fff;
    box-shadow: 0 8px 14px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.home-hero__banner a,
.home-hero__banner span {
    display: block;
    padding: 18px 24px;
    color: #ff3246;
    font-size: var(--hero-banner-font);
    line-height: 1.2;
}

/* ---------- Category bar ---------- */

.home-hero__overlap {
    position: relative;
    z-index: 50;
    margin-top: calc(-1 * var(--hero-overlap));
    padding: 0 16px;
}

.home-cats {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: min(1150px, calc(var(--cats, 6) * 210px));
    margin: 0 auto;
    padding: 0 32px;
    border-radius: 64px;
    background: #fff;
    box-shadow: 0 8px 14px 10px rgba(0, 0, 0, 0.05);
}

.home-cats__item {
    position: relative;
    isolation: isolate;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 10px 22px;
    color: #383636;
    text-align: center;
    text-decoration: none;
}

.home-cats__item + .home-cats__item {
    border-left: 1px solid #eee;
}

.home-cats__item::before {
    /* hover tile, pops slightly above and below the bar */
    content: "";
    position: absolute;
    inset: -14px 0;
    z-index: -1;
    border-radius: 6px;
    background: linear-gradient(to right, #0a4c94, #1070d8);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.home-cats__item img {
    width: 48px;
    height: 44px;
    object-fit: contain;
    transition: filter 0.2s ease-in-out;
}

.home-cats__title {
    max-width: 100%;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: break-word;
    hyphens: auto;
    transition: color 0.2s ease-in-out;
}

.home-cats__item:hover,
.home-cats__item:focus-visible {
    border-left-color: transparent;
    text-decoration: none;
}

.home-cats__item:hover + .home-cats__item,
.home-cats__item:focus-visible + .home-cats__item {
    border-left-color: transparent;
}

.home-cats__item:hover::before,
.home-cats__item:focus-visible::before {
    opacity: 1;
}

.home-cats__item:hover .home-cats__title,
.home-cats__item:focus-visible .home-cats__title {
    color: #fff;
}

.home-cats__item:hover img,
.home-cats__item:focus-visible img {
    filter: brightness(0) invert(1);
}

/* ---------- Responsive ---------- */

@media (max-width: 1199px) {
    .home-cats {
        padding: 0 16px;
    }

    .home-cats__title {
        font-size: 15px;
    }
}

/* Below desktop the bar becomes a tiled panel: 3 per row (2 for 2/4 items) */
@media (max-width: 991px) {
    .home-hero {
        --hero-overlap: 48px;
    }

    .home-cats {
        flex-wrap: wrap;
        gap: 1px;
        max-width: 720px;
        padding: 0;
        border-radius: 16px;
        overflow: hidden;
        background: #eee;
    }

    .home-cats__item {
        flex: 1 1 calc(33.333% - 1px);
        padding: 20px 8px;
        background: #fff;
    }

    .home-cats--count-1 .home-cats__item {
        flex-basis: 100%;
    }

    .home-cats--count-2 .home-cats__item,
    .home-cats--count-4 .home-cats__item {
        flex-basis: calc(50% - 1px);
    }

    .home-cats__item + .home-cats__item {
        border-left: 0;
    }

    .home-cats__item::before {
        inset: 0;
        border-radius: 0;
    }
}

@media (max-width: 900px) {
    .home-hero {
        --hero-offset: 73px;
    }
}

@media (max-width: 767px) {
    .home-hero {
        --hero-height: clamp(360px, 80vw, 480px);
        --hero-overlap: 36px;
    }

    .home-hero--has-banner {
        --hero-banner-space: calc(var(--hero-banner-font) * 1.2 + 44px);
    }

    .home-hero__caption {
        gap: 16px;
        padding-left: 56px;
        padding-right: 56px;
    }

    .home-hero .home-hero__arrow {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .home-hero .home-hero__arrow--next {
        right: 10px;
    }

    .home-hero .home-hero__arrow--prev {
        left: 10px;
    }

    .home-hero .home-hero__dots {
        display: none;
    }

    .home-hero__alert {
        font-size: 12px;
    }

    .home-hero__banner {
        bottom: calc(var(--hero-overlap) + 16px);
        border-radius: 20px;
    }

    .home-hero__banner a,
    .home-hero__banner span {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .home-hero__caption {
        padding-left: 48px;
        padding-right: 48px;
    }

    .home-cats__item {
        gap: 6px;
        padding: 16px 6px;
    }

    .home-cats__item img {
        width: 36px;
        height: 34px;
    }

    .home-cats__title {
        font-size: 13px;
    }
}
