/* ==========================================================================
   Home page — video hero and the content layered on top of it.
   Dedicated stylesheet for the frontend home page (frontend/layouts/home.blade).
   ========================================================================== */

/* Hero height matches stage.athletescare.com: the slider there is 840px tall
   at its 1280px design width, capping at 840px on wider screens and scaling
   down by width below that (840 / 1280 = 65.625vw). */
:root {
    --hero-height: min(840px, 65.625vw);
}

/* global.css already pins .homebanner-block.banner_bg2 to 400px here, so the
   variable has to agree — otherwise the video would be sized for a shorter
   box than the container and letterbox on phones. */
@media (max-width: 768px) {
    :root {
        --hero-height: 400px;
    }
}

.homebanner-block {
    position: relative;
    isolation: isolate;
    width: 100%;
    min-height: var(--hero-height);
    height: auto;
    overflow: hidden;
}

/* --- Background video ---------------------------------------------------- */
.video-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}
.video-background iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    /* 16:9 cover for the hero box (100vw wide x --hero-height tall). The old
       rule sized against 100vh, which over-covered badly once the hero stopped
       being full-height and made the video look zoomed in. */
    width: max(100vw, calc(var(--hero-height) * 1.7778));
    height: max(56.25vw, var(--hero-height));
    /* Small scale-up so the player's own chrome sits outside the cropped area. */
    transform: translate(-50%, -50%) scale(1.08);
    border: 0;
    pointer-events: none;
}

/* --- Overlays layered on top of the video -------------------------------- */
.video-overlay-grid {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-size: 48px 48px;
    pointer-events: none;
    background: rgba(0,51,102,0.24);
}
.blue-banner-overlay {
    position: relative;
    z-index: 2;
    min-height: var(--hero-height);
    color: #fff;
}

/* Slight dark tint so the marquee + card read over the video */
.blue-banner-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.35) 100%);
    pointer-events: none;
}

/* --- Banner content ------------------------------------------------------ */
/* Centres the services list in the hero. Positioned and raised so it paints
   over the video and its tint, which are both absolutely positioned (z 0 and
   1) and would otherwise cover anything left in normal flow. */
.bannerblock1 {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

/* --- Services list over the video (stage.athletescare.com/home-3/) ------- */
/* Two columns of five, filled column by column so the markup reads in order.
   Type and spacing are stage's at desktop: Roboto 500 30px, 1px tracking,
   rows ~50px apart, columns 616px apart. The column gap is what keeps the
   block that wide; justify-content centres it.
   padding-top is the header's height (89px), so the list centres in the
   visible part of the hero below the header rather than in the whole box. */
.hero-services {
    display: grid;
    grid-template-rows: repeat(5, auto);
    grid-auto-flow: column;
    /* minmax(0, …) lets the columns shrink and the labels wrap on a phone,
       where two max-content columns would be wider than the screen. */
    grid-auto-columns: minmax(0, max-content);
    justify-content: center;
    column-gap: clamp(2rem, 13vw, 214px);
    row-gap: 17px;
    width: 100%;
    margin: 0;
    padding: 89px 16px 0;
    list-style: none;
    text-align: left;
}
.hero-services li {
    font-family: Roboto, sans-serif;
    font-weight: 500;
    /* 30px from 1280px up, scaling with the hero below that. */
    font-size: clamp(15px, 2.35vw, 30px);
    line-height: 1.1;
    letter-spacing: 1px;
    color: #fff;
}
/* Linked to the Our Team pages; white like the plain items, underlined on
   hover and keyboard focus so they read as links. */
.hero-services a {
    color: inherit;
    text-decoration: none;
    text-underline-offset: 0.2em;
    text-decoration-thickness: 2px;
}
.hero-services a:hover,
.hero-services a:focus-visible {
    color: #fff;
    text-decoration: underline;
}

/* Stage only scales its slider down here, which leaves 9px text on a phone.
   This keeps the list readable instead: smaller gaps, tighter tracking. */
@media (max-width: 768px) {
    .hero-services {
        padding-top: 80px;
        row-gap: 10px;
    }
    .hero-services li {
        letter-spacing: 0.5px;
    }
}

/* ==========================================================================
   Locations intro: clinic count, copy and the two calls to action, between
   the hero and the reviews (stage.athletescare.com/home-3/)
   ========================================================================== */
/* Stage's columns: 1/6 for the pin, 2/5 each for the copy and the buttons.
   60px from the hero to the heading, as stage. */
.ac-locations {
    padding: 60px 12px 0;
}
.ac-locations__inner {
    display: grid;
    grid-template-columns: 16.6667% 40% 40%;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
}
.ac-locations__pin {
    justify-self: end;
    padding: 43px 34px 0 0;
    color: #FF8205;
}
.ac-locations__pin svg {
    display: block;
    width: 86px;
    height: 128px;
}
.ac-locations__text {
    padding-left: 12px;
}
.ac-locations__title {
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    font-size: 44px;
    line-height: 42px;
    color: #003366;
    margin: 0 0 15px;
}
.ac-locations__copy {
    font-family: Roboto, sans-serif;
    font-size: 19px;
    font-weight: 400;
    line-height: 26px;
    color: #474747;
    margin: 0;
}
.ac-locations__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    padding-top: 40px;
}
.ac-locations__btn {
    display: block;
    width: 242px;
    max-width: 100%;
    padding: 14px 10px;
    border-radius: 25px;
    font-family: Roboto, sans-serif;
    font-size: 22px;
    font-weight: 400;
    line-height: 26.4px;
    text-align: center;
    text-decoration: none;
    color: #fff !important;
    transition: background-color 0.2s ease-in-out;
}
.ac-locations__btn--find {
    background-color: #003366;
}
.ac-locations__btn--find:hover,
.ac-locations__btn--find:focus {
    background-color: #00264d;
}
.ac-locations__btn--book {
    background-color: #FF8205;
}
.ac-locations__btn--book:hover,
.ac-locations__btn--book:focus {
    background-color: #e07304;
}
/* Stage's divider: 1px #dfdfdf, about 84% of the page, ~60px under the copy.
   Bootstrap's hr is otherwise currentColor at 25% opacity. */
.ac-locations__divider {
    width: 84%;
    margin: 61px auto 60px;
    border: 0;
    border-top: 1px solid #dfdfdf;
    opacity: 1;
}

/* Tablet: pin beside the copy, buttons in a row underneath. */
@media (max-width: 991px) {
    .ac-locations {
        padding-top: 45px;
    }
    .ac-locations__inner {
        grid-template-columns: auto 1fr;
    }
    .ac-locations__pin {
        padding: 6px 24px 0 0;
    }
    .ac-locations__pin svg {
        width: 64px;
        height: 95px;
    }
    .ac-locations__text {
        padding-left: 0;
    }
    .ac-locations__actions {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 18px;
        padding-top: 32px;
    }
    .ac-locations__divider {
        width: 92%;
        margin: 45px auto 40px;
    }
}

/* Phone: one column, pin above the heading, buttons stacked. */
@media (max-width: 575px) {
    .ac-locations {
        padding: 35px 16px 0;
    }
    .ac-locations__inner {
        grid-template-columns: 1fr;
    }
    .ac-locations__pin {
        justify-self: start;
        padding: 0 0 14px;
    }
    .ac-locations__pin svg {
        width: 50px;
        height: 74px;
    }
    .ac-locations__title {
        font-size: 34px;
        line-height: 38px;
    }
    .ac-locations__copy {
        font-size: 17px;
        line-height: 25px;
    }
    .ac-locations__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding-top: 26px;
    }
    .ac-locations__btn {
        width: 100%;
        font-size: 19px;
    }
    .ac-locations__divider {
        width: 100%;
        margin: 35px auto 30px;
    }
}

/* ==========================================================================
   Montserrat weight utilities (used across the home page)
   ========================================================================== */
.montserrat-400 { font-family: Montserrat, sans-serif; font-weight: 400; }
.montserrat-500 { font-family: Montserrat, sans-serif; font-weight: 500; }
.montserrat-600 { font-family: Montserrat, sans-serif; font-weight: 600; }
.montserrat-700 { font-family: Montserrat, sans-serif; font-weight: 700; }
.montserrat-800 { font-family: Montserrat, sans-serif; font-weight: 800; }

/* ==========================================================================
   Brand / services band ("Athlete's Care Sports Medicine Centres")
   ========================================================================== */
/* Geometry and colours measured from stage.athletescare.com/index.php/home-2/
   (section 5, the band under the reviews strip). */
.ac-band {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 700px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding: 60px 20px;
    text-align: center;
    color: #fff;
    overflow: hidden;
}
/* Navy tint over the photo — stage layers rgb(6,38,89) at 0.29 opacity. */
.ac-band::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(6, 38, 89, 0.29);
    z-index: 0;
}
/* Outlined panel around the copy. Stage's "frosted" look is a contrast lift on
   the backdrop rather than a blur, over a transparent fill. */
.ac-band__inner {
    position: relative;
    z-index: 1;
    width: min(847px, 92%);
    margin: 0 auto;
    padding: 61px 0 46px;
    border: 1px solid rgba(255, 255, 255, 0.19);
    border-radius: 15px;
    -webkit-backdrop-filter: contrast(1.12);
    backdrop-filter: contrast(1.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}
/* Title + subtitle move together, so they need their own flex context to keep
   the 22px rhythm they had as direct children of .ac-band__inner. */
.ac-band__heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}
.ac-band__title {
    font-family: Montserrat, sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: normal;
    font-size: 55px;
    line-height: 61px;
    margin: 0;
    color: #fff;
}
/* Stage sets this copy uppercase in the content; the transform does it here. */
.ac-band__subtitle {
    font-family: Montserrat, sans-serif;
    font-weight: 500;
    font-size: 29px;
    line-height: 39px;
    text-transform: uppercase;
    margin: 0;
    color: #fff;
}
.ac-band__btn {
    display: inline-block;
    margin-top: 11px;
    padding: 12px 20px;
    border-radius: 15px;
    background: #f48236;
    color: #fff !important;
    font-family: Roboto, sans-serif;
    font-size: 22px;
    line-height: 26.4px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}
.ac-band__btn:hover {
    background: #e0722a;
    transform: translateY(-1px);
    color: #fff !important;
}
/* The band type is fixed px to match stage, so it needs stepping down by hand
   below the desktop breakpoint. */
@media (max-width: 991px) {
    .ac-band { min-height: 520px; }
    /* Stage's panel has no side padding; narrow screens need some so the copy
       does not run into the border. */
    .ac-band__inner { padding: 40px 22px 34px; }
    .ac-band__title { font-size: 38px; line-height: 44px; }
    .ac-band__subtitle { font-size: 21px; line-height: 29px; }
    .ac-band__btn { font-size: 19px; }
}

@media (max-width: 767px) {
    .ac-band { background-attachment: scroll; min-height: 420px; }
    .ac-band__inner { padding: 30px 18px 28px; gap: 16px; }
    .ac-band__heading { gap: 16px; }
    .ac-band__title { font-size: 28px; line-height: 34px; }
    .ac-band__subtitle { font-size: 17px; line-height: 24px; }
    .ac-band__btn { font-size: 17px; line-height: 22px; }
}

/* ==========================================================================
   Reveal-on-scroll
   ==========================================================================
   Keyframes and the 1s/fill-both timing are lifted from Betheme's
   animations.min.css so the motion matches stage exactly. Elements start
   hidden and are revealed by the IntersectionObserver in home.blade.php,
   which adds .is-visible once they scroll into view. */
.ac-anim {
    opacity: 0;
}
.ac-anim.is-visible {
    animation-duration: 1s;
    animation-fill-mode: both;
}
.ac-anim.is-visible[data-anim="zoomIn"] { animation-name: ac-zoomIn; }
.ac-anim.is-visible[data-anim="fadeInUp"] { animation-name: ac-fadeInUp; }
.ac-anim.is-visible[data-anim="fadeIn"] { animation-name: ac-fadeIn; }

@keyframes ac-zoomIn {
    from { opacity: 0; transform: scale(0); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes ac-fadeInUp {
    from { opacity: 0; transform: translateY(200px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes ac-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes ac-bounceIn {
    0%   { opacity: 0; transform: scale(0); }
    50%  { opacity: 1; transform: scale(1.1); }
    70%  { opacity: 1; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* Never trade content for motion: show everything, unanimated. */
@media (prefers-reduced-motion: reduce) {
    .ac-anim { opacity: 1; }
    .ac-anim.is-visible { animation: none; }
    .ac-anim-init .card__article,
    .ac-anim-init .card__image img { opacity: 1; }
    .ac-anim-group.is-visible .card__article,
    .ac-anim-group.is-visible .card__image img { animation: none; }
}

/* ==========================================================================
   Services carousel band (matches stage.athletescare.com services section)
   ========================================================================== */
.ac-services {
    background-color: #EAEDF1;
    background-image: url('../img/services-background.png');
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding: 88px 0 63px;
}

/* Stage lays 4 cards of 350px across a 1425px wrapper with no gap between
   them — the visual gutter comes from each card's own 32px side padding.
   The Swiper is configured with spaceBetween: 0 to match. */
.ac-services__inner {
    max-width: 1425px;
    margin: 0 auto;
    padding: 0 12px;
}

.ac-services .card__article {
    height: auto;
    padding: 0 32px;
    border-radius: 12px;
    /* Stage tints the card body on hover over a full second. */
    transition: background-color 1s;
}

.ac-services .card__article:hover {
    background-color: rgba(71, 79, 120, 0.08);
}

.ac-services .card__image {
    padding: 20px 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Stage lifts the icon 25px when the icon band is hovered. */
    transition: transform 0.5s;
}

.ac-services .card__image:hover {
    transform: translateY(-25px);
}

.ac-services .card__image img {
    width: auto;
    max-width: 100px;
    max-height: 100px;
    height: auto;
}

.ac-services .card__name {
    font-family: Montserrat, sans-serif;
    font-size: 26px;
    font-weight: 500;
    line-height: 31px;
    color: #000;
    text-align: center;
    margin: 0 0 5px;
}

.ac-services .card__description {
    font-size: 16px;
    font-weight: 400;
    line-height: 26px;
    color: #0f0e0e;
    text-align: justify;
    margin: 0 0 15px;
}

.ac-services .card__more {
    display: inline-block;
    font-size: 16px;
    font-weight: 400;
    line-height: 26px;
    color: #145698;
    text-decoration: none;
}

.ac-services .card__more:hover {
    text-decoration: underline;
}

.ac-services .card__data {
    text-align: left;
}

.ac-services .swiper-pagination {
    position: static;
    margin-top: 34px;
}

/* Reveal-on-scroll. Stage fades each service card in on a ~400ms cascade and
   bounces its icon in just behind it. --ac-delay is set per card by the script
   in home.blade.php, ordered by on-screen position rather than DOM order so
   Swiper's loop clones cannot scramble the cascade.

   .ac-anim-init is server-rendered (so nothing flashes before the script runs)
   and the script strips it — along with .is-visible — once the cascade has
   finished, leaving the cards in their plain state. That matters here: Swiper
   clones slides, and a clone minted later must not inherit opacity: 0. */
.ac-services.ac-anim-init .card__article,
.ac-services.ac-anim-init .card__image img {
    opacity: 0;
}

.ac-services.is-visible .card__article {
    animation: ac-fadeIn 1s both;
    animation-delay: var(--ac-delay, 0ms);
}

.ac-services.is-visible .card__image img {
    animation: ac-bounceIn 1s both;
    animation-delay: calc(var(--ac-delay, 0ms) + 50ms);
}

@media (max-width: 767px) {
    .ac-services {
        background-attachment: scroll;
        padding: 50px 0 40px;
    }
    .ac-services .card__name { font-size: 22px; line-height: 27px; }
}

/* ==========================================================================
   Affiliate / partner logo strip (matches stage.athletescare.com)
   Rendered from tblfooterlogos — see HomeController@index.
   ========================================================================== */
.ac-logos {
    background-color: #01284F;
    padding: 45px 0;
}

.ac-logos__inner {
    max-width: 1425px;
    margin: 0 auto;
    padding: 0 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 34px 42px;
}

/* Stage flips each logo on its horizontal axis on hover — matrix(1,0,0,-1,0,0)
   is scaleY(-1) — over a deliberately slow 1.4s. */
.ac-logos__item {
    display: flex;
    align-items: center;
    transition: transform 1.4s;
}

.ac-logos__item:hover {
    transform: scaleY(-1);
}

.ac-logos__item img {
    display: block;
    height: 80px;
    width: auto;
    max-width: 100%;
}

@media (max-width: 767px) {
    .ac-logos {
        padding: 32px 0;
    }
    .ac-logos__inner {
        gap: 24px 28px;
    }
    .ac-logos__item img {
        height: 56px;
    }
}

/* ==========================================================================
   Clinics intro band — photo left / copy right (matches stage.athletescare.com)
   ========================================================================== */
.ac-clinics {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

.ac-clinics__media {
    flex: 0 0 50%;
    max-width: 50%;
    min-height: 600px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.ac-clinics__content {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 23px 45px 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* The copy is authored in the admin WYSIWYG, so it arrives as bare h2/h3/p
   without BEM classes — the element selectors carry the styling. */
.ac-clinics__title,
.ac-clinics__content h1,
.ac-clinics__content h2 {
    font-family: Oswald, sans-serif;
    font-size: 38px;
    font-weight: 600;
    line-height: 44px;
    color: #003366;
    margin: 0 0 15px;
}

.ac-clinics__title--sub,
.ac-clinics__content h3,
.ac-clinics__content h4 {
    font-family: Oswald, sans-serif;
    font-size: 28px;
    font-weight: 600;
    line-height: 34px;
    color: #003366;
    margin: 10px 0 15px;
}

.ac-clinics__content ul,
.ac-clinics__content ol {
    font-size: 18px;
    line-height: 26px;
    color: #000;
    margin: 0 0 15px;
    padding-left: 22px;
}

.ac-clinics__content a {
    color: #145698;
}

.ac-clinics__content img {
    max-width: 100%;
    height: auto;
}

.ac-clinics__content p {
    font-size: 18px;
    font-weight: 400;
    line-height: 26px;
    color: #000;
    margin: 0 0 15px;
}

.ac-clinics__testimonial {
    display: inline-block;
    font-family: Oswald, sans-serif;
    font-size: 20px;
    font-weight: 500;
    line-height: 28px;
    color: #003366;
    text-decoration: none;
    margin-bottom: 14px;
}

.ac-clinics__testimonial:hover {
    color: #145698;
    text-decoration: underline;
}

@media (max-width: 991px) {
    .ac-clinics__media,
    .ac-clinics__content {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .ac-clinics__media {
        min-height: 320px;
    }
    .ac-clinics__content {
        padding: 30px 20px;
    }
    .ac-clinics__title {
        font-size: 30px;
        line-height: 36px;
    }
    .ac-clinics__title--sub {
        font-size: 24px;
        line-height: 30px;
    }
}
