/* ============================================================
   Tilla to Talim — HOME PAGE
   All colors driven by design tokens (css/base.css :root).
   Action accents = brand blue; decorative premium accents = warm gold.
   ============================================================ */

/* ───── HERO SLIDER ───── */
.hero-carousel {
    position: relative;
}

/* The hero photo is not set here: index.php renders one slide per
   config/config.php → hero_slides[].img as an inline background-image
   (images/-relative, through img_path()), so swapping a hero photo is a
   config edit. This rule only carries the layout. */
.slide-item {
    min-height: 78vh;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
}

.slide-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--overlay-slide);
}

.slide-content {
    position: relative;
    z-index: 2;
    color: var(--text-on-dark);
    padding: 60px 0;
    max-width: 620px;
}

.slide-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--color-icon-on-dark);
    background: var(--gold-tint-150);
    border: 1px solid var(--gold-tint-400);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.slide-title {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 62px);
    font-weight: 700;
    line-height: 1.12;
    margin-bottom: 18px;
    color: var(--text-on-dark);
}

.slide-title em,
.slide-title span {
    font-style: italic;
    color: var(--color-icon-on-dark);
}

.slide-desc {
    font-size: 16px;
    opacity: 0.88;
    line-height: 1.85;
    margin-bottom: 36px;
}

/* Slider Controls
   The slide text sits in `.slide-content`, which carries z-index 2 — above
   Bootstrap's controls (z-index 1) and level with the indicators, which are
   earlier in the DOM and so lose the paint order too. The dots and arrows are
   still *visible* (nothing opaque covers them) but the hit test went to the
   text box: on phones the dots were dead, and at ~1200px the prev arrow was.
   Lifting both above z-index 2 makes them clickable again; nothing about how
   they look changes. */
.hero-carousel .carousel-indicators {
    z-index: 4;
}

.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
    z-index: 3;
    width: 52px;
    height: 52px;
    background: var(--white-tint-150);
    border: 1.5px solid var(--white-tint-400);
    border-radius: 50%;
    top: auto;
    bottom: 32px;
    transform: none;
    opacity: 1;
    margin: 0;
    backdrop-filter: blur(4px);
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

/* Arrows used to sit vertically centred on the window edges, which put the prev
   button on top of the left-aligned slide copy: at 768–1200px it covered the
   first characters of the lead, and at 1440px it clipped the eyebrow pill. They
   now sit side by side in the hero's bottom-right corner, above the indicators
   and clear of the text column at every width. */
.hero-carousel .carousel-control-prev {
    left: auto;
    right: 92px;
}

.hero-carousel .carousel-control-next {
    left: auto;
    right: 28px;
}

.hero-carousel .carousel-control-prev:hover,
.hero-carousel .carousel-control-next:hover {
    background: var(--gold-tint-400);
    border-color: var(--color-gold-light);
}

.hero-carousel .carousel-control-prev-icon,
.hero-carousel .carousel-control-next-icon {
    width: 18px;
    height: 18px;
}

.hero-carousel .carousel-indicators [data-bs-target] {
    width: 28px;
    height: 3px;
    border-radius: var(--radius-sm);
    background: var(--white-tint-400);
    border: none;
    position: relative;
    transition: width 0.3s ease, background 0.3s ease;
}

/* The dot is 3px tall — far too small to tap with a thumb. The pseudo-element
   adds a 25px-tall hit area without changing how the dot looks. */
.hero-carousel .carousel-indicators [data-bs-target]::before {
    content: "";
    position: absolute;
    inset: -11px 0;
}

.hero-carousel .carousel-indicators .active {
    background: var(--gradient-gold);
    width: 44px;
}

/* Stats bar inside hero */
.hero-stats {
    display: flex;
    gap: 40px;
    padding-top: 32px;
    margin-top: 32px;
    border-top: 1px solid var(--white-tint-200);
    flex-wrap: wrap;
}

.stat-num {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--color-icon-on-dark);
}

.stat-label {
    font-size: 12px;
    opacity: 0.75;
    margin-top: 2px;
}

/* ───── MARQUEE ───── */
.marquee-strip {
    /* Scroll speed. The row is duplicated by index.php and travels exactly half
       its own width per cycle, so the speed is (half width / duration) — not a
       number CSS can work out by itself. At the current 56 items that half is
       ~7 583px, so 100s ≈ 76px/s, inside the readable 40–80px/s band for small
       text (the old 24s ≈ 316px/s was too fast to read). If the item count
       changes a lot, re-measure the half width and set duration = halfPx / 76. */
    --marquee-duration: 100s;
    background: var(--gradient-band);
    border-top: 2px solid var(--color-gold);
    padding: 12px 0;
    overflow: hidden;
    white-space: nowrap;
}

/* The row is rendered twice by index.php and shifted by -50%, so it must loop
   seamlessly. The gap therefore lives on the item as a right margin, not as
   `gap` on the row: a container gap would add one extra gap at the seam and
   make the two halves 24px unequal, which shows as a jump every loop. */
.marquee-inner {
    display: inline-flex;
    animation: marquee var(--marquee-duration) linear infinite;
}

.marquee-item {
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-on-dark);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-right: 48px;
}

.marquee-dot {
    width: 4px;
    height: 4px;
    background: var(--color-gold-light);
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

@keyframes marquee {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .marquee-inner {
        animation: none;
    }
}


/* ───── WHY US ───── */
.why-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface-card);
    transition: border-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}

.why-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.why-img {
    height: 140px;
    overflow: hidden;
}

.why-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.why-card:hover .why-img img {
    transform: scale(1.06);
}

/* ───── REVIEWS ───── */
.review-card {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px 24px 24px;
    height: 100%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top accent bar */
.review-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--royal-blue), var(--bright-blue));
}

.review-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent-tint-120);
    border-color: var(--bright-blue);
}

.review-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-body);
    margin-bottom: 20px;
    flex: 1;
}

.review-author {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-soft);
}

.review-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2.5px solid var(--color-accent-soft);
    transition: border-color var(--transition-base);
}

.review-card:hover .review-avatar {
    border-color: var(--bright-blue);
}

.review-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-name {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 2px;
}

.review-role {
    font-size: 12px;
    color: var(--text-soft);
}

.stars {
    color: var(--color-gold);
    letter-spacing: 2px;
    font-size: 14px;
    margin-bottom: 12px;
}

/* ───── REVIEWS SLIDER (center mode) ───── */
/* One review sits in the middle; the previous/next cards peek in from both
   sides, faded and slightly scaled down. Built on a scroll-snap track rather
   than the Bootstrap carousel, because Bootstrap only ever renders one slide —
   it cannot show the neighbours. Every card sits on the same flex row, so the
   section height is fixed by the tallest review and never jumps.
   --slide-w drives the card width AND the centring spacers, so the two can
   never disagree: the spacers are (100% - card) / 2, which puts the narrowest
   viewport's card exactly in the middle too. */
.review-slider {
    position: relative;
    --slide-w: clamp(280px, 52%, 660px);
}

.review-track {
    display: flex;
    align-items: stretch;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* old Edge/IE */
    /* the peeking cards dissolve into the section background instead of
       being chopped off at the edge */
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}

.review-track::-webkit-scrollbar {
    display: none;
}

/* Half-width spacers so the first and last card can reach the centre. They are
   real flex items (not padding) so the scroll area always includes them. */
.review-track::before,
.review-track::after {
    content: '';
    flex: 0 0 calc((100% - var(--slide-w)) / 2);
}

.review-slide {
    flex: 0 0 var(--slide-w);
    width: var(--slide-w);
    scroll-snap-align: center;
    opacity: 0.3;
    transform: scale(0.93);
    transition: opacity var(--transition-base), transform var(--transition-base);
}

.review-slide.is-active {
    opacity: 1;
    transform: scale(1);
}

/* Side cards are a preview: keep them flat so only the centre card reacts */
.review-slide:not(.is-active) .review-card:hover {
    transform: none;
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* Arrows — same blue circles as the hero slider */
.review-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--text-on-dark);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    opacity: 0.9;
    transition: background var(--transition-base), box-shadow var(--transition-base), opacity var(--transition-base);
}

.review-nav--prev { left: -8px; }
.review-nav--next { right: -8px; }

.review-nav:hover,
.review-nav:focus-visible {
    background: var(--color-primary-deep);
    box-shadow: 0 4px 14px rgba(42, 53, 31, 0.3);
    opacity: 1;
}

/* Desktop only: a single centred card reads as a thin strip at the base
   padding, so give it a little more room — deeper padding, looser line
   spacing, and a min-height to keep every review the same size. Phones and
   tablets keep the base card so the section stays compact there. */
@media (min-width: 992px) {
    .review-slider .review-card {
        min-height: 280px;
        padding: 36px 34px 30px;
    }

    .review-slider .review-text {
        line-height: 1.95;
    }

    .review-slider .review-author {
        padding-top: 20px;
    }
}

/* Dots — one per review */
.review-dots {
    display: flex;
    justify-content: center;
    /* 14px, not 8px: it keeps the enlarged (24px) hit areas from overlapping. */
    gap: 14px;
    margin-top: 24px;
}

.review-dots button {
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--color-accent-soft);
    opacity: 0.55;
    cursor: pointer;
    position: relative;
    transition: background var(--transition-base), opacity var(--transition-base), transform var(--transition-base);
}

/* A 10px dot is not a tap target — give it a 24px one. */
.review-dots button::before {
    content: "";
    position: absolute;
    inset: -7px;
}

.review-dots button:hover {
    opacity: 0.85;
}

.review-dots button.is-active {
    background: var(--color-primary);
    opacity: 1;
    transform: scale(1.3);
}
