/* ================================================================
   MOHAR COTTAGE
   STAY SECTION
   ---------------------------------------------------------------
   Layout foundation for the GSAP scroll carousel.

   IMPORTANT:
   CSS does NOT position individual cards.
   GSAP owns card transforms.
   ================================================================ */


/* ================================================================
   SECTION
   ================================================================ */

.stay {

    position: relative;

    overflow: clip;

    background:
        var(--background-body);

    color:
        var(
            --color-text,
            #292929
        );

}


/* ================================================================
   INTRO
   ================================================================ */

.stay__intro {

    width: min(
        calc(100% - 2rem),
        900px
    );

    margin: 0 auto;

    padding:
        7rem
        0
        4rem;

    text-align: center;

}


.stay__eyebrow {

    margin: 0 0 1.25rem;

    font-family:
        var(
            --font-sans,
            "Inter",
            sans-serif
        );

    font-size: 0.75rem;

    font-weight: 700;

    line-height: 1.2;

    letter-spacing: 0.22em;

    text-transform: uppercase;

    color:
        var(
            --color-primary,
            #3f604e
        );

}


.stay__title {

    margin: 0;

    font-family:
        var(
            --font-display,
            Georgia,
            serif
        );

    font-size:
        clamp(
            3.5rem,
            7vw,
            6.5rem
        );

    font-weight: 500;

    line-height: 0.92;

    letter-spacing: -0.045em;

    color:
        var(
            --color-text,
            #292929
        );

}


.stay__description {

    width: min(
        100%,
        720px
    );

    margin:
        2.5rem
        auto
        0;

    font-family:
        var(
            --font-sans,
            "Inter",
            sans-serif
        );

    font-size:
        clamp(
            1rem,
            1.5vw,
            1.15rem
        );

    line-height: 1.75;

    color:
        var(
            --color-text-muted,
            #626262
        );

}


/* ================================================================
   SCROLL WRAPPER
   ---------------------------------------------------------------
   This is intentionally MUCH taller than the carousel.

   GSAP uses this space as the animation duration.
   ================================================================ */

.stay__scroll {

    position: relative;

    width: 100%;

    height: 550vh;

}


/* ================================================================
   CAROUSEL VIEWPORT
   ---------------------------------------------------------------
   This is the element GSAP pins.

   DO NOT animate this element itself.
   Animate .stay__track and .stay__card instead.
   ================================================================ */

.stay__carousel {

    position: relative;

    width: 100%;

    height: 100vh;

    min-height: 700px;

    overflow: hidden;

    isolation: isolate;

}


/* ================================================================
   TRACK
   ---------------------------------------------------------------
   This is the coordinate system for all cards.
   ================================================================ */

.stay__track {

    position: absolute;

    inset: 0;

    width: 100%;

    height: 100%;

    pointer-events: none;

}


/* ================================================================
   CARD
   ---------------------------------------------------------------
   GSAP will control:

   x
   y
   scale
   rotation
   opacity
   z-index
   filter
   ================================================================ */

.stay__card {

    position: absolute;

    top: 50%;
    left: 50%;

    width: min(
        550px,
        55vw
    );

    margin: 0;

    overflow: hidden;

    border-radius: 1.35rem;

    background: #ffffff;

    box-shadow:
        0 30px 70px rgba(
            28,
            35,
            30,
            0.12
        ),
        0 8px 25px rgba(
            28,
            35,
            30,
            0.08
        );

    transform-origin:
        center center;

    will-change:
        transform,
        opacity,
        filter;

}


/* ================================================================
   CARD MEDIA
   ---------------------------------------------------------------
   Landscape cards are the default.
   ================================================================ */

.stay__card-media {

    position: relative;

    width: 100%;

    aspect-ratio: 16 / 9;

    overflow: hidden;

    background: #dcd8ce;

}


.stay__card-media::after {

    content: "";

    position: absolute;

    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0) 50%,
            rgba(0, 0, 0, 0.12) 100%
        );

}


.stay__card-media img {

    display: block;

    width: 100%;

    height: 100%;

    object-fit: cover;

    object-position: center;

}


/* ================================================================
   CARD CONTENT
   ================================================================ */

.stay__card-content {

    padding:
        1.5rem
        1.65rem
        1.7rem;

    background: #ffffff;

}


.stay__card-label {

    margin:
        0
        0
        0.6rem;

    font-family:
        var(
            --font-sans,
            "Inter",
            sans-serif
        );

    font-size: 0.68rem;

    font-weight: 700;

    line-height: 1.3;

    letter-spacing: 0.18em;

    text-transform: uppercase;

    color:
        var(
            --color-primary,
            #3f604e
        );

}


.stay__card h3 {

    margin: 0;

    font-family:
        var(
            --font-display,
            Georgia,
            serif
        );

    font-size:
        clamp(
            1.50rem,
            2.1vw,
            1.5rem
        );

    font-weight: 500;

    line-height: 1.05;

    letter-spacing: -0.025em;

    color:
        var(
            --color-text,
            #292929
        );

}


/* ================================================================
   PROGRESS
   ================================================================ */

.stay__progress {

    position: absolute;

    left: 50%;

    bottom: 3.5rem;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 0.45rem;

    transform:
        translateX(-50%);

    z-index: 50;

}


.stay__progress-dot {

    display: block;

    width: 6px;

    height: 6px;

    padding: 0;

    border: 0;

    border-radius: 999px;

    background:
        rgba(
            63,
            96,
            78,
            0.25
        );

    transition:
        width 250ms ease,
        background 250ms ease,
        opacity 250ms ease;

}


.stay__progress-dot.is-active {

    width: 24px;

    background:
        var(
            --color-primary,
            #3f604e
        );

}


/* ================================================================
   TABLET
   ================================================================ */

@media (min-width: 768px)
       and (max-width: 1199px) {

    .stay__intro {

        padding:
            6rem
            0
            3rem;

    }


    .stay__scroll {

        height: 500vh;

    }


    .stay__carousel {

        min-height: 600px;

    }


    .stay__card {

        width: min(
            380px,
            42vw
        );

    }

}


/* ================================================================
   MOBILE
   ---------------------------------------------------------------
   We intentionally do NOT run the desktop hemisphere animation
   on mobile.

   The cards become a normal vertical list.
   ================================================================ */

@media (max-width: 767px) {

    .stay {

        overflow: hidden;

    }


    .stay__intro {

        width:
            calc(
                100% - 2rem
            );

        padding:
            5rem
            0
            3rem;

        text-align: left;

    }


    .stay__eyebrow {

        margin-bottom: 1rem;

    }


    .stay__title {

        font-size:
            clamp(
                3rem,
                14vw,
                4.5rem
            );

        line-height: 0.96;

    }


    .stay__description {

        margin-top: 1.5rem;

        font-size: 0.98rem;

        line-height: 1.65;

    }


    /*
     * No pinning / scroll carousel on mobile.
     */

    .stay__scroll {

        height: auto;

        padding:
            0
            1rem
            5rem;

    }


    .stay__carousel {

        height: auto;

        min-height: 0;

        overflow: visible;

    }


    .stay__track {

        position: relative;

        inset: auto;

        display: flex;

        flex-direction: column;

        gap: 1.5rem;

        height: auto;

    }


    .stay__card {

        position: relative;

        top: auto;
        left: auto;

        width: 100%;

        transform: none !important;

        opacity: 1 !important;

        filter: none !important;

        z-index: 1 !important;

        border-radius: 1rem;

    }


    .stay__card-media {

        aspect-ratio: 16 / 10;

    }


    .stay__card-content {

        padding:
            1.35rem
            1.4rem
            1.5rem;

    }


    .stay__card h3 {

        font-size: 1.55rem;

    }


    .stay__progress {

        display: none;

    }

}


/* ================================================================
   REDUCED MOTION
   ================================================================ */

@media (prefers-reduced-motion: reduce) {

    .stay__card {

        transition: none !important;

    }

    .stay__progress-dot {

        transition: none !important;

    }

}