/* ==========================================================================
   home-premium.css
   Home-only premium UI foundations.
   Loaded ONLY by Views/Home/Index.cshtml — safe to add page-only rules here
   without affecting the rest of the site.

   Conventions:
   - Brand tokens: --moe-navy / --moe-gold (mirrors style-new.css palette).
   - Animate ONLY transform & opacity.
   - Wrap hover-only effects in @media (hover: hover) and (pointer: fine).
   - Wrap continuous animations in @media (prefers-reduced-motion: no-preference).
   - This Phase 1 file ships ONLY the foundations: tokens, reveal classes,
     fluid type helpers, and reduced-motion guards. Visual styling per section
     is added in later phases.
   ========================================================================== */

:root {
    --moe-navy:        #14254A;
    --moe-navy-2:      #0b1530;
    --moe-gold:        #FFCD35;
    --moe-gold-soft:   rgba(255, 205, 53, 0.18);
    --moe-line:        rgba(20, 37, 74, 0.10);

    /* Fluid type scale (used by later phases). */
    --fs-eyebrow: clamp(0.78rem, 0.2vw + 0.72rem, 0.92rem);
    --fs-h2:      clamp(1.4rem, 1.2vw + 1rem, 2.25rem);
    --fs-h3:      clamp(1.1rem, 0.6vw + 0.95rem, 1.5rem);
    --fs-body:    clamp(0.95rem, 0.15vw + 0.9rem, 1.05rem);

    /* Motion tokens. */
    --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
    --rev-distance: 24px;
    --rev-duration: 700ms;
}

/* ==========================================================================
   Reveal-on-scroll utility
   Used by home-reveal.js — element starts hidden, gets .is-in-view when it
   enters the viewport. Stagger child reveals with --i.
   ========================================================================== */

.reveal {
    opacity: 0;
    transform: translate3d(0, var(--rev-distance), 0);
    will-change: transform, opacity;
    transition:
        opacity   var(--rev-duration) var(--ease-out-quint),
        transform var(--rev-duration) var(--ease-out-quint);
    transition-delay: calc(var(--i, 0) * 80ms);
}

.reveal.is-in-view {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.reveal-left { transform: translate3d(calc(var(--rev-distance) * -1), 0, 0); }
.reveal-right { transform: translate3d(var(--rev-distance), 0, 0); }
.reveal-fade { transform: none; }

.reveal-left.is-in-view,
.reveal-right.is-in-view,
.reveal-fade.is-in-view {
    transform: translate3d(0, 0, 0);
}

/* When JS hasn't run yet (no-js or async-load failure), show content. */
.no-js .reveal,
html:not(.has-reveal) .reveal {
    opacity: 1;
    transform: none;
}

/* ==========================================================================
   Counter helper
   The JS counter looks for [data-counter-target] and animates from 0.
   ========================================================================== */

[data-counter-target] {
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Home news ticker
   Eager section placed between the menu and the main banner.
   ========================================================================== */

.home-news-ticker {
    position: relative;
    z-index: 3;
    background:
        linear-gradient(90deg, rgba(255, 205, 53, 0.10), transparent 32%),
        linear-gradient(135deg, var(--moe-navy-2), var(--moe-navy));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(20, 37, 74, 0.16);
}

.home-news-ticker__inner {
    display: flex;
    align-items: center;
    min-height: 58px;
    gap: 0;
    overflow: hidden;
}

.home-news-ticker__label,
.home-news-ticker__all {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    white-space: nowrap;
    font-weight: 800;
}

.home-news-ticker__label {
    color: var(--moe-navy);
    background-color: var(--moe-gold);
    background-image: linear-gradient(
        120deg,
        #f2bf24 0%,
        #ffd95c 34%,
        #ffed9c 50%,
        #ffd95c 66%,
        #f2bf24 100%
    );
    background-size: 220% 100%;
    animation: moeLabelGlow 3.2s linear infinite;
    padding: 0 18px;
    border-radius: 0 10px 10px 0;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
}

.home-news-ticker__label i {
    font-size: 1rem;
}

.home-news-ticker__viewport {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    direction: ltr;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}


.home-news-ticker__track {
    display: flex;
    width: max-content;
    animation: moeTickerScroll 25s linear infinite;
    will-change: transform;
}
.home-news-ticker__group {
    display: flex;
    align-items: center;
    gap: 48px;
    flex-shrink: 0;
    padding-inline: 20px;
}

.home-news-ticker__item {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: #fff;
    direction: rtl;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
    transition: color 220ms var(--ease-out-quint);
    font-size: 19px;
}

.home-news-ticker__item::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-left: 12px;
    border-radius: 50%;
    background: var(--moe-gold);
    box-shadow: 0 0 0 5px var(--moe-gold-soft);
}

.home-news-ticker__item:hover,
.home-news-ticker__item:focus-visible {
    color: var(--moe-gold);
}

/* Last-2-days news — highlighted in a distinct accent colour */
.home-news-ticker__item--recent {
    color: var(--moe-gold);
}

    .home-news-ticker__item--recent::before {
        background: #87c8f3;
        box-shadow: 0 0 0 5px rgb(193 218 235 / 28%);
    }

    .home-news-ticker__item--recent:hover,
    .home-news-ticker__item--recent:focus-visible {
        color: #abd5f1;
    }

.home-news-ticker__all {
    color: #fff;
    min-width: 108px;
    padding: 0 18px;
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    text-decoration: none;
    transition: color 220ms var(--ease-out-quint), background-color 220ms var(--ease-out-quint);
    color: var(--moe-navy);
    background-color: var(--moe-gold);
    background-image: linear-gradient(120deg, #f2bf24 0%, #ffd95c 34%, #ffed9c 50%, #ffd95c 66%, #f2bf24 100%);
    background-size: 220% 100%;
    animation: moeLabelGlow 3.2s linear infinite;
    padding: 0 18px;
    border-radius: 10px 0px 0px 10px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);

}

.home-news-ticker__all:hover,
.home-news-ticker__all:focus-visible {
    color: var(--moe-navy);
    background: var(--moe-gold);
}

/* Pause-on-hover is limited to real mouse pointers. Without this guard,
   touch/hybrid browsers keep a "sticky" :hover after a tap or scroll, which
   permanently freezes the marquee (the ticker shows but never scrolls). */
@media (hover: hover) and (pointer: fine) {
    .home-news-ticker:hover .home-news-ticker__track {
        animation-play-state: paused;
    }
}

@keyframes moeTickerScroll {
    from {
        transform: translateX(-50%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes moeLabelGlow {
    from { background-position: 180% 0; }
    to { background-position: -180% 0; }
}

@media (max-width: 767.98px) {
    .home-news-ticker__inner {
        min-height: 52px;
    }

    .home-news-ticker__label {
        padding: 0 12px;
        border-radius: 0 8px 8px 0;
    }

    .home-news-ticker__label span,
    .home-news-ticker__all {
        display: none;
    }

    .home-news-ticker__group {
        gap: 22px;
        padding-inline: 0;
    }

    .home-news-ticker__item {
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   Magnetic CTA helper (desktop only — JS guards this too)
   ========================================================================== */

@media (hover: hover) and (pointer: fine) {
    .magnetic {
        transition: transform 320ms var(--ease-out-quint);
        will-change: transform;
    }
}

/* ==========================================================================
   Reduced-motion guard — kills all premium motion on user request.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-fade {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .magnetic {
        transform: none !important;
    }

    /* The marquee MUST keep scrolling even when the OS requests reduced motion.
       On Windows Server (and any machine with "animation effects" turned off)
       Edge reports prefers-reduced-motion: reduce, which previously froze the
       ticker: it showed from the left but never moved. We keep the seamless
       two-group scroll here and only stop the decorative gold label shimmer. */
    .home-news-ticker__label {
        animation: none !important;
        background-position: 50% 0;
    }
}

