/* ============================================================
   Charsutra — Hero Promo Slider  (v2)
   Loaded AFTER themes/default/assets/css/style.css, so these rules
   intentionally override the base .promo-* rules in style.css.
   style.css itself is never edited.

   Desktop / tablet : continuous horizontal auto-scroll (marquee),
                      STOPS while the cursor is over the row.
   Mobile (<768px)  : exactly ONE tile per view, snap-scrolled,
                      auto-advances one slide at a time.
   ============================================================ */

/* --- Track -------------------------------------------------- */
.promo-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    cursor: grab;
    /* base state; each mode below sets what it needs */
    scroll-snap-type: none;
    scroll-behavior: auto;
}

.promo-grid::-webkit-scrollbar {
    display: none;
}

/* Continuous-scroll mode (desktop). scroll-behavior MUST stay auto:
   the JS writes scrollLeft on every animation frame, and CSS smooth
   scrolling would fight it and leave the row stuttering or frozen. */
.promo-grid.promo-grid--marquee {
    scroll-snap-type: none;
    scroll-behavior: auto;
}

/* Step mode (mobile, and desktop when autoplay is off) */
.promo-grid.promo-grid--step {
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

/* While the user drags the row with the mouse */
.promo-grid.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    scroll-snap-type: none;
    user-select: none;
}

.promo-grid.is-dragging .promo-tile {
    pointer-events: none;
}

/* --- Tiles -------------------------------------------------- */
.promo-tile {
    flex: 0 0 auto;
    width: 320px;
}

.promo-grid--step .promo-tile {
    scroll-snap-align: start;
}

/* --- Arrows ------------------------------------------------- */
.promo-scroll-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .25s ease, background-color .25s ease;
}

.promo-scroll-outer:hover .promo-scroll-arrow,
.promo-scroll-arrow:focus-visible {
    opacity: 1;
}

.promo-scroll-arrow[disabled] {
    opacity: 0 !important;
    pointer-events: none;
}

/* --- Dots (mobile pager) ------------------------------------ */
.promo-scroll-dots {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
}

.promo-scroll-dots button {
    width: 7px;
    height: 7px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: rgba(15, 30, 51, .25);
    transition: width .25s ease, background-color .25s ease;
}

.promo-scroll-dots button.is-active {
    width: 22px;
    border-radius: 4px;
    background-color: #A9825A;
}

/* --- Mobile: ONE slide per view ----------------------------- */
@media (max-width: 767.98px) {
    .promo-grid-wrapper {
        padding: 16px 0;
        overflow-x: hidden;
    }

    .promo-grid {
        gap: 12px;
        padding-left: 0;
        cursor: auto;
    }

    .promo-tile,
    .promo-grid--step .promo-tile,
    .promo-grid--marquee .promo-tile {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        scroll-snap-align: center;
    }

    /* Height, not aspect ratio.
       A full-width tile at 4/5 is ~125% of the viewport WIDTH tall, which
       on a 720px-wide phone is a ~900px image — plus the caption band, the
       hero alone was more than a screen and a half. Capping the media
       against viewport HEIGHT keeps the whole tile inside one screen on
       every device, and `cover` crops rather than squashing. */
    .promo-tile-media {
        aspect-ratio: auto;
        height: 42vh;
        max-height: 380px;
        min-height: 220px;
    }

    .promo-tile-media img {
        height: 100%;
        object-fit: cover;
        object-position: center 22%;
    }

    /* Caption band tightened to match */
    .promo-tile-content {
        padding: 13px 15px 15px;
    }

    .promo-tile-title {
        font-size: 16px;
        margin-bottom: 4px;
    }

    .promo-tile-desc {
        font-size: 12px;
        line-height: 1.45;
        margin-bottom: 9px;
        /* two lines is enough of a teaser on a phone */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .promo-tile-cta {
        font-size: 11.5px;
    }

    .promo-scroll-arrow {
        display: none;
    }

    .promo-scroll-dots {
        display: flex;
    }
}

/* --- Accessibility ----------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .promo-grid {
        scroll-behavior: auto;
    }
}

/* --- Small phones ------------------------------------------- */
@media (max-width: 480px) {
    .promo-tile-media {
        height: 38vh;
        min-height: 200px;
    }

    .promo-tile-content {
        padding: 11px 13px 13px;
    }

    .promo-tile-title { font-size: 15px; }
    .promo-tile-desc { font-size: 11.5px; }
}

/* --- Short/landscape screens: never let the hero fill the screen --- */
@media (max-width: 991.98px) and (max-height: 560px) {
    .promo-tile-media {
        height: 46vh;
        min-height: 160px;
    }
}
