/* Homepage — featured glossary terms carousel */

body.ma-neo .ma-home-gloss {
    --ma-gloss-gap: 14px;
    position: relative;
    margin: 4px 0 8px;
    padding: 28px 0 36px;
    overflow: hidden;
    isolation: isolate;
}

body.ma-neo .ma-home-gloss::before {
    content: "";
    position: absolute;
    inset: 8% -10% auto;
    height: 70%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(42rem 22rem at 72% 40%, rgba(0, 129, 129, 0.06), transparent 68%),
        radial-gradient(28rem 18rem at 18% 70%, rgba(121, 212, 212, 0.03), transparent 70%);
}

body.ma-neo .ma-home-gloss__inner {
    position: relative;
    z-index: 1;
}

body.ma-neo .ma-home-gloss__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

body.ma-neo .ma-home-gloss__nav {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

body.ma-neo .ma-home-gloss__btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    background: var(--ma-bg);
    color: var(--ma-ink);
    box-shadow: var(--ma-raise-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: box-shadow 180ms ease, transform 180ms ease, color 180ms ease;
}

body.ma-neo .ma-home-gloss__btn:hover {
    color: var(--ma-accent);
    box-shadow: var(--ma-raise);
}

body.ma-neo .ma-home-gloss__btn:active {
    transform: translateY(1px);
    box-shadow: var(--ma-inset);
}

body.ma-neo .ma-home-gloss__viewport {
    position: relative;
    margin-inline: calc(50% - 50vw);
    width: 100vw;
    padding-inline: max(24px, calc((100vw - 1180px) / 2 + 24px));
}

body.ma-neo .ma-home-gloss__rail {
    display: flex;
    gap: var(--ma-gloss-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px 4px 18px;
    cursor: grab;
    touch-action: pan-y;
    mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 40px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 40px), transparent 100%);
}

body.ma-neo .ma-home-gloss__rail::-webkit-scrollbar {
    display: none;
}

body.ma-neo .ma-home-gloss__rail.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    scroll-snap-type: none;
}

body.ma-neo .ma-home-gloss__card {
    --ma-gloss-tilt: -1.2deg;
    position: relative;
    flex: 0 0 clamp(240px, 28vw, 300px);
    min-height: 220px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px 20px 18px;
    border-radius: 22px;
    background:
        linear-gradient(165deg, rgba(121, 212, 212, 0.07) 0%, transparent 42%),
        var(--ma-bg);
    box-shadow: var(--ma-raise);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transform: rotate(var(--ma-gloss-tilt)) translateY(0);
    transition:
        transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 220ms ease,
        color 180ms ease;
}

body.ma-neo .ma-home-gloss__card:nth-child(even) {
    --ma-gloss-tilt: 1.15deg;
    margin-top: 18px;
}

body.ma-neo .ma-home-gloss__card:nth-child(3n) {
    --ma-gloss-tilt: -0.55deg;
    margin-top: 8px;
}

body.ma-neo .ma-home-gloss__card::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ma-accent), transparent);
    opacity: 0.35;
    transform: scaleX(0.35);
    transform-origin: center;
    transition: transform 360ms ease, opacity 220ms ease;
}

body.ma-neo .ma-home-gloss__card::after {
    content: "";
    position: absolute;
    inset: auto -30% -45% auto;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 129, 129, 0.22), transparent 68%);
    pointer-events: none;
    opacity: 0.55;
    transition: opacity 220ms ease, transform 360ms ease;
}

body.ma-neo .ma-home-gloss__card:hover,
body.ma-neo .ma-home-gloss__card:focus-visible {
    --ma-gloss-tilt: 0deg;
    margin-top: 0;
    transform: rotate(0deg) translateY(-6px) scale(1.02);
    box-shadow: var(--ma-raise-lg);
    color: inherit;
    outline: none;
    z-index: 2;
}

body.ma-neo .ma-home-gloss__card:hover::before,
body.ma-neo .ma-home-gloss__card:focus-visible::before {
    opacity: 1;
    transform: scaleX(1);
}

body.ma-neo .ma-home-gloss__card:hover::after,
body.ma-neo .ma-home-gloss__card:focus-visible::after {
    opacity: 1;
    transform: translate(-12px, -10px) scale(1.1);
}

body.ma-neo .ma-home-gloss__index {
    position: absolute;
    inset-inline-end: 14px;
    top: 8px;
    font-family: 'pbold', sans-serif;
    font-size: clamp(2.4rem, 4vw, 3.2rem);
    line-height: 1;
    letter-spacing: -0.04em;
    color: rgba(121, 212, 212, 0.12);
    pointer-events: none;
    transition: color 220ms ease, transform 320ms ease;
}

body.ma-neo .ma-home-gloss__card:hover .ma-home-gloss__index,
body.ma-neo .ma-home-gloss__card:focus-visible .ma-home-gloss__index {
    color: rgba(121, 212, 212, 0.28);
    transform: translateY(-2px);
}

body.ma-neo .ma-home-gloss__en {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-family: 'pmed', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ma-accent);
}

body.ma-neo .ma-home-gloss__en::before {
    content: "";
    width: 18px;
    height: 1px;
    background: currentColor;
    opacity: 0.7;
}

body.ma-neo .ma-home-gloss__fa {
    margin: 0;
    max-width: 16ch;
    font-family: 'pbold', sans-serif;
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    line-height: 1.45;
    color: var(--ma-ink);
}

body.ma-neo .ma-home-gloss__excerpt {
    margin: 0;
    flex: 1;
    font-size: 0.8125rem;
    line-height: 1.85;
    color: var(--ma-muted);
}

body.ma-neo .ma-home-gloss__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-family: 'pmed', sans-serif;
    font-size: 0.8125rem;
    color: var(--ma-accent);
}

body.ma-neo .ma-home-gloss__more svg {
    transition: transform 220ms ease;
}

body.ma-neo .ma-home-gloss__card:hover .ma-home-gloss__more svg {
    transform: translateX(-4px);
}

body.ma-neo .ma-home-gloss__progress {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
}

body.ma-neo .ma-home-gloss__foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

body.ma-neo .ma-home-gloss__dot {
    width: 7px;
    height: 7px;
    border: 0;
    border-radius: 999px;
    padding: 0;
    background: rgba(121, 212, 212, 0.22);
    cursor: pointer;
    transition: width 220ms ease, background 180ms ease;
}

body.ma-neo .ma-home-gloss__dot.is-active {
    width: 22px;
    background: var(--ma-accent);
}

@media (max-width: 991.98px) {
    body.ma-neo .ma-home-gloss {
        padding: 18px 0 28px;
    }

    body.ma-neo .ma-home-gloss__nav {
        display: none;
    }

    body.ma-neo .ma-home-gloss__viewport {
        padding-inline: 16px;
    }

    body.ma-neo .ma-home-gloss__card {
        flex-basis: 78%;
        min-height: 200px;
        margin-top: 0 !important;
        transform: none;
    }

    body.ma-neo .ma-home-gloss__card:hover,
    body.ma-neo .ma-home-gloss__card:focus-visible {
        transform: translateY(-3px);
    }

    body.ma-neo .ma-home-gloss__rail {
        mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 36px), transparent 100%);
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 36px), transparent 100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.ma-neo .ma-home-gloss__card,
    body.ma-neo .ma-home-gloss__card::before,
    body.ma-neo .ma-home-gloss__card::after,
    body.ma-neo .ma-home-gloss__index,
    body.ma-neo .ma-home-gloss__more svg,
    body.ma-neo .ma-home-gloss__dot {
        transition: none !important;
    }

    body.ma-neo .ma-home-gloss__rail {
        scroll-behavior: auto;
    }
}
