/**
 * EIASM Graduate Stories — Homepage Featured Slider (Refined)
 *
 * Exact token match:
 *   Card: #FFFFFF, border #E2E8F0, radius 24px
 *   Portrait: 180px, 3px teal ring, 6px #EAF7FA halo
 *   Nav: 40px outlined circles, quiet hover
 *   Progress: 28×3px animated segments inside card
 */

.eiasm-slider {
    max-width: 960px;
    margin: 0 auto;
}

/* ═══ CARD SHELL ════════════════════════════════════════════════════ */

.eiasm-slider__card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(11, 18, 32, 0.04);
    padding: 44px 48px;
    /* Opacity-based transitions — all slides stacked in .eiasm-slider__track */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    z-index: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 400ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.eiasm-slider__card--active {
    position: relative; /* Active slide is in flow for height calculation */
    opacity: 1;
    z-index: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateY(0);
}

.eiasm-slider__card--active:hover {
    box-shadow: 0 8px 24px rgba(11, 18, 32, 0.06);
    transform: translateY(-2px);
}

/* ═══ TRACK — stacking context for slides ══════════════════════════ */

.eiasm-slider__track {
    position: relative;
    transition: height 400ms ease;
}

/* ═══ NAV BAR — shared navigation above the track ══════════════════ */

.eiasm-slider__nav-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

/* ═══ LAYOUT: Portrait Left, Content Right ═════════════════════════ */

.eiasm-slider__layout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 40px;
    align-items: start;
}

/* ═══ PORTRAIT ══════════════════════════════════════════════════════ */

.eiasm-slider__portrait-col {
    padding-top: 8px;
}

.eiasm-slider__portrait {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid #1587A8;
    box-shadow: 0 0 0 6px #EAF7FA;
    background: #F8FAFC;
}

.eiasm-slider__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    border-radius: 50%;
}

.eiasm-slider__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0b8c4;
    background: #F8FAFC;
    border-radius: 50%;
}

/* ═══ CONTENT COLUMN ═══════════════════════════════════════════════ */

.eiasm-slider__content {
    min-width: 0;
}

/* ── Top Row: Chips + Nav ──────────────────────────────────────── */

.eiasm-slider__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.eiasm-slider__chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.eiasm-slider__chip {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1.3;
}

/* Study Level chip — primary, teal */
.eiasm-slider__chip--level {
    color: #1587A8;
    background: #EAF7FA;
    border: 1px solid #EAF7FA;
}

/* Programme chip — secondary, quiet */
.eiasm-slider__chip--programme {
    color: #475569;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Navigation Cluster ────────────────────────────────────────── */

.eiasm-slider__nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.eiasm-slider__arrow {
    width: 40px !important;
    height: 40px !important;
    border-radius: 999px !important;
    border: 1px solid #E2E8F0 !important;
    background: #FFFFFF !important;
    color: #475569 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    padding: 0 !important;
    box-shadow: none !important;
    transform: none;
    transition: border-color 160ms ease, color 160ms ease, transform 120ms ease;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.eiasm-slider__arrow:hover {
    border-color: #1587A8 !important;
    color: #1587A8 !important;
    background: #FFFFFF !important;
    box-shadow: none !important;
}

.eiasm-slider__arrow:active {
    transform: scale(0.95);
    background: #FFFFFF !important;
}

.eiasm-slider__arrow:focus-visible {
    outline: 2px solid #1587A8 !important;
    outline-offset: 2px !important;
    background: #FFFFFF !important;
    box-shadow: none !important;
}

.eiasm-slider__counter {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    min-width: 28px;
    text-align: center;
    white-space: nowrap;
}

/* ── Headline ──────────────────────────────────────────────────── */

.eiasm-slider__headline {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #0B1220;
    margin: 0 0 16px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* ── Testimonial Body — FULL TEXT, no clamp ────────────────────── */

.eiasm-slider__body {
    margin-bottom: 24px;
}

.eiasm-slider__body p {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.85;
    color: #475569;
    margin: 0;
}

/* ── Divider ───────────────────────────────────────────────────── */

.eiasm-slider__divider {
    height: 1px;
    background: #E2E8F0;
    margin-bottom: 20px;
}

/* ── Attribution ───────────────────────────────────────────────── */

.eiasm-slider__attribution {
    margin-bottom: 24px;
}

.eiasm-slider__name {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #0B1220;
    margin: 0 0 2px;
    line-height: 1.3;
}

.eiasm-slider__meta {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 13px;
    color: #475569;
    margin: 0;
    line-height: 1.4;
}

/* ═══ PROGRESS TIMER — Animated segments below the track ═════════════ */

.eiasm-slider__progress {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 20px;
    justify-content: center;
}

.eiasm-slider__segment {
    width: 28px;
    height: 3px;
    border-radius: 999px;
    background: #E2E8F0;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: opacity 120ms ease;
}

.eiasm-slider__segment:hover {
    opacity: 0.8;
}

.eiasm-slider__segment-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: #1587A8;
    transition: width 0.1s linear;
}

/* Completed segments: fully filled */
.eiasm-slider__segment--done .eiasm-slider__segment-fill {
    width: 100%;
    transition: none;
}

/* Current segment: fill animated via JS */
.eiasm-slider__segment--current .eiasm-slider__segment-fill {
    /* Width set by JS via inline style or animation */
}

/* Future segments: empty (default) */

/* ═══ RESPONSIVE ═══════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .eiasm-slider__card {
        padding: 28px 24px;
    }

    .eiasm-slider__layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .eiasm-slider__portrait-col {
        display: flex;
        justify-content: center;
        padding-top: 0;
    }

    .eiasm-slider__portrait {
        width: 140px;
        height: 140px;
    }

    .eiasm-slider__headline {
        font-size: 22px;
    }

    .eiasm-slider__body p {
        font-size: 14px;
    }

    .eiasm-slider__top {
        flex-wrap: wrap;
    }

    .eiasm-slider__nav-bar {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .eiasm-slider__card {
        padding: 24px 18px;
        border-radius: 18px;
    }

    .eiasm-slider__portrait {
        width: 120px;
        height: 120px;
    }

    .eiasm-slider__headline {
        font-size: 19px;
    }

    .eiasm-slider__arrow {
        width: 36px !important;
        height: 36px !important;
    }
}

/* ═══ REDUCED MOTION ═══════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .eiasm-slider, .eiasm-slider *, .eiasm-slider *::before, .eiasm-slider *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
