/* ==========================================================================
   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;
}
.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;
}

/* --- Outlined card (headline + subtitle + CTAs) over the video ---------- */
.hero-card {
    position: relative;
    z-index: 3;
    /* Wide enough to hold the 37px headline on one line: ~865px of text plus
       the 68px of side padding. */
    /* Box geometry measured from stage.athletescare.com/index.php/home-2/ */
    width: min(958px, 94%);
    /* margin-top:auto pins the card near the bottom of the hero, so the bottom
       margin is what lifts it — 8vh plus 30px. */
    margin: auto auto calc(8vh + 30px);
    padding: 30px 34px;
    text-align: center;
    color: #fff;
    /* Border only — the frosted fill and blur were removed so the video shows
       through cleanly. */
    background: transparent;
    border: 1px solid rgba(158, 158, 158, 0.44);
    border-radius: 15px;
}
.hero-card__title {
    font-family: Roboto, sans-serif;
    font-size: 37px;
    font-weight: 500;
    line-height: 42px;
    letter-spacing: 1px;
    margin: 0 0 0.6rem;
    color: #fff;
}
/* Stage sets the subtitle in Poppins while the headline stays Roboto, and
   tracks it wider than the headline (2px vs 1px). */
.hero-card__subtitle {
    font-family: Poppins, sans-serif;
    font-size: 23px;
    font-weight: 500;
    line-height: 30px;
    letter-spacing: 2px;
    margin: 0 0 1.5rem;
    color: #fff;
}
.hero-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}
/* 50px tall pills, per stage: line-height carries the height, padding the width. */
.hero-btn {
    display: inline-block;
    padding: 0 40px;
    border-radius: 14px;
    font-family: Roboto, sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 50px;
    text-decoration: none;
    background: #FF8205;
    color: #fff !important;
    transition: background 0.2s ease, transform 0.2s ease;
}
.hero-btn:hover {
    background: #e07304;
    transform: translateY(-1px);
    color: #fff !important;
}
/* Stage's button label is already uppercase in the content with no extra
   tracking, so the transform stays but letter-spacing must not be added. */
.hero-btn--find {
    padding: 0 70px;
    text-transform: uppercase;
}

/* The hero type is set in fixed px for desktop, so it needs stepping down by
   hand on phones — 37px would otherwise run the headline to about four lines. */
@media (max-width: 575px) {
    .hero-card {
        padding: 22px 20px;
    }
    .hero-card__title {
        font-size: 26px;
        line-height: 32px;
        letter-spacing: 0.5px;
    }
    /* Tracking scaled back with the type — 2px at 17px would push the subtitle
       onto an extra line on a phone. */
    .hero-card__subtitle {
        font-size: 17px;
        line-height: 24px;
        letter-spacing: 1px;
        margin-bottom: 1.1rem;
    }
    .hero-btn,
    .hero-btn--find {
        font-size: 17px;
        line-height: 44px;
        padding: 0 22px;
    }
}

/* --- Banner content ------------------------------------------------------ */
.bannerblock1 {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    gap: 2.5rem;
    box-sizing: border-box;
}
.banner-services {
    width: 100%;
    display: flex;
    /* padding-top is the knob for how far down the marquee sits; margin-top:auto
       is kept as a safety floor so that on shorter heroes the auto margin simply
       collapses to 0 instead of driving the marquee into the hero card. */
    margin: auto auto 0;
    padding-top: calc(var(--hero-height) * 0.30);
    justify-content: center;
    align-items: center;
}
.banner-services ul {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}
.banner-services li {
    position: relative;
    overflow: hidden;
    width: 100%;
    display: block;
}

/* --- Marquee headline ---------------------------------------------------- */
.banner-marquee {
    overflow: hidden;
    width: 100%;
}
.banner-marquee-track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: max-content;
    will-change: transform;
    direction: ltr;
    opacity: 0;
    transition: opacity 0.3s ease;
    /* Ensures text is off-screen by default so it can't flash in the middle */
    transform: translate3d(100vw, 0, 0);
}
.banner-marquee-track.active {
    opacity: 1;
    /* forwards: text stays off-screen left after animation finishes */
    animation: banner-marquee-rtl var(--marquee-duration, 7s) linear forwards;
}
.banner-marquee__chunk {
    flex: none;
    display: block;
    width: max-content;
    font-family: Poppins, sans-serif;
    color: rgba(255, 255, 255, 0.26);
    font-size: clamp(2rem, 11vw, 150px);
    font-weight: 800;
    line-height: 1.05;
    text-transform: uppercase;
    white-space: pre-line;
    letter-spacing: -0.02em;
    text-align: start;
    -webkit-font-smoothing: antialiased;
}
@keyframes banner-marquee-rtl {
    from { transform: translate3d(100vw, 0, 0); }
    to { transform: translate3d(-100%, 0, 0); }
}

/* ==========================================================================
   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;
    }
}
