/* ==================================================================
   ANMC home page motion layer
   Loaded only by Views/HomePage.cshtml. Remove that one <link> (and the
   matching <script>) to switch everything here off.

   Nothing here hides content unless js/anmc-motion.js has run and put
   .motion-ready on <html>, so if the script fails the page looks exactly
   as it did before.
   ================================================================== */

/* ---------- Scroll reveal ---------- */
.motion-ready :is(
    .section-heading,
    .section-heading + p,
    .specialty-card,
    .coe-feature,
    .coe-card,
    .intl-feature,
    .why-choose__item,
    .season-card,
    .blog-card,
    .insurance .card-carousel) {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms),
                transform .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms);
}

.motion-ready .coe-feature {
    transform: scale(.94);
}

.motion-ready .is-in {
    opacity: 1 !important;
    transform: none !important;
}

/* Heading underline grows from the reading start */
.section-heading strong {
    background: linear-gradient(currentColor, currentColor) no-repeat right bottom / 0% 3px;
    padding-bottom: 6px;
    transition: background-size .9s cubic-bezier(.2, .7, .2, 1) .35s;
}

[dir="ltr"] .section-heading strong {
    background-position: left bottom;
}

.section-heading.is-in strong {
    background-size: 100% 3px;
}

/* Icons pop in after their card */
.motion-ready .specialty-card__icon,
.motion-ready .why-choose__icon-bg {
    transform: scale(.4);
    opacity: 0;
    transition: transform .6s cubic-bezier(.34, 1.56, .64, 1) calc(var(--d, 0ms) + .25s),
                opacity .4s calc(var(--d, 0ms) + .25s);
}

.motion-ready .is-in .specialty-card__icon,
.motion-ready .is-in .why-choose__icon-bg {
    transform: none;
    opacity: 1;
}

.specialty-card:hover .specialty-card__icon {
    animation: anmc-bob .6s ease;
}

@keyframes anmc-bob {
    40% { transform: translateY(-6px) rotate(-6deg); }
    70% { transform: translateY(1px); }
}

/* Centres of excellence: chips and button slide in one by one */
.motion-ready .coe-feature :is(.coe-chip, .coe-feature__cta) {
    opacity: 0;
    transform: translateX(24px);
    transition: opacity .5s, transform .5s cubic-bezier(.2, .7, .2, 1);
}

[dir="ltr"] .motion-ready .coe-feature :is(.coe-chip, .coe-feature__cta) {
    transform: translateX(-24px);
}

.motion-ready .coe-feature.is-in :is(.coe-chip, .coe-feature__cta) {
    opacity: 1;
    transform: none;
    transition-delay: calc(.4s + var(--i, 0) * 90ms);
}

/* ---------- Seasonal video cards: soft pulse on the play badge ---------- */
.season-card__play {
    border-radius: 50%;
    animation: anmc-pulse 2.4s ease-out infinite;
}

@keyframes anmc-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(200, 30, 45, .5); }
    100% { box-shadow: 0 0 0 16px rgba(200, 30, 45, 0); }
}

/* ---------- Floating hotline / WhatsApp: one "hello" wiggle ---------- */
.hero__floating.anmc-hello > * {
    animation: anmc-wiggle .9s ease both;
}

.hero__floating.anmc-hello > *:nth-child(2) {
    animation-delay: .15s;
}

@keyframes anmc-wiggle {
    0%, 100% { transform: none; }
    20% { transform: rotate(-12deg) scale(1.1); }
    40% { transform: rotate(10deg) scale(1.1); }
    60% { transform: rotate(-6deg); }
    80% { transform: rotate(3deg); }
}

/* ---------- "دولة نخدمها" stat: readable text, original transparent panel kept ---------- */
.intl-patient__stat .intl-patient__stat-label {
    color: var(--color-navy-900, #1f335f) !important;
    font-weight: 600;
    text-shadow: 0 1px 6px rgba(255, 255, 255, .8);
}

.intl-patient__stat .intl-patient__stat-sublabel {
    color: var(--color-navy-900, #1f335f) !important;
    text-shadow: 0 1px 6px rgba(255, 255, 255, .8);
}

/* ---------- International-patient boxes: same hover as the specialty cards ---------- */
.intl-feature {
    position: relative;
    overflow: hidden;
    transition: box-shadow .3s var(--ease-premium, ease), border-color .3s;
}

.intl-feature::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--color-navy-900, #1f335f), var(--color-red-700, #b11a18));
    opacity: 0;
    transition: opacity .3s var(--ease-premium, ease);
    pointer-events: none;
}

.intl-feature > a {
    position: relative;
    z-index: 1;
}

.intl-feature :is(.intl-feature__title, .intl-feature__text, .intl-feature__glyph) {
    transition: color .25s var(--ease-premium, ease);
}

.intl-feature:hover,
.intl-feature:focus-within {
    border-color: transparent;
    box-shadow: 0 12px 28px rgba(31, 51, 95, .22);
}

.intl-feature:hover::after,
.intl-feature:focus-within::after {
    opacity: 1;
}

.intl-feature:hover :is(.intl-feature__title, .intl-feature__text, .intl-feature__glyph),
.intl-feature:focus-within :is(.intl-feature__title, .intl-feature__text, .intl-feature__glyph) {
    color: #fff !important;
}

.intl-feature:hover .intl-feature__glyph {
    animation: anmc-bob .6s ease;
}

/* ---------- Counters: keep digits from jiggling while they count ---------- */
.hero__stat-number {
    font-variant-numeric: tabular-nums;
}

/* ---------- Respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
    .season-card__play,
    .hero__floating > *,
    .specialty-card__icon,
    .intl-feature__glyph {
        animation: none !important;
    }
}
