/* Homepage hero — professional layout (loads after index inline hero rules) */
/* Default palette: USL navy & blue (no gold/yellow on hero) */
.hero-section {
    --usl-accent: #93c5fd;
    --usl-accent-dark: #2563eb;
    --usl-hero-cta-bg: #2563eb;
    --usl-hero-cta-text: #ffffff;
    --usl-hero-cta-gradient: linear-gradient(135deg, #3b82f6, #1e40af);
    --usl-btn-shadow: none;
    /* Zoom-in: video needs more scale than poster (video often letterboxes / looks zoomed out) */
    --usl-hero-poster-zoom: 1.12;
    --usl-hero-video-zoom: 1.28;
    position: relative;
    min-height: min(92vh, 900px);
    isolation: isolate;
    overflow: hidden;
}

/* Smooth slide crossfade + subtle lift */
.hero-section .hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 5.5rem 1.25rem 6.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.99);
    pointer-events: none;
    z-index: 1;
    transition:
        opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.9s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.9s step-end;
    will-change: opacity, transform;
}

.hero-section .hero-slide.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    z-index: 5;
    transition:
        opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.9s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s step-start;
}

.hero-section .hero-slide.active .hero-content-panel {
    animation: heroSlideContentIn 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes heroSlideContentIn {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade child controls instead of snapping hidden */
.hero-section .hero-slide:not(.active) .slide-buttons,
.hero-section .hero-slide:not(.active) .apply-button-container,
.hero-section .hero-slide:not(.active) .hero-actions,
.hero-section .hero-slide:not(.active) .hero-stats {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.45s ease, visibility 0.45s ease !important;
}

.hero-section .hero-slide:not(.active) .btn-slide,
.hero-section .hero-slide:not(.active) .apply-now-button {
    display: inline-flex !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.hero-section .hero-slide.active .slide-buttons,
.hero-section .hero-slide.active .apply-button-container,
.hero-section .hero-slide.active .hero-actions,
.hero-section .hero-slide.active .hero-stats {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition: opacity 0.65s ease 0.2s, visibility 0s ease 0.2s !important;
}

/* Hero background — full-bleed, hi-res sources + minimal GPU blur */
.hero-section .hero-media-stack {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.hero-section .hero-poster,
.hero-section .hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: none;
    max-height: none;
    transform-origin: center center;
    object-fit: cover;
    object-position: center center;
    pointer-events: none;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: high-quality;
}

.hero-section .hero-poster {
    z-index: 0;
    width: 100%;
    height: 100%;
    transform: translate3d(-50%, -50%, 0) scale(var(--usl-hero-poster-zoom, 1.12));
    filter: contrast(1.06) saturate(1.08) brightness(1.02);
}

.hero-section .hero-video {
    z-index: 1;
    width: auto;
    height: auto;
    min-width: 100%;
    min-height: 100%;
    transform: translate3d(-50%, -50%, 0) scale(var(--usl-hero-video-zoom, 1.28));
    filter: contrast(1.04) saturate(1.05);
}

.hero-section .hero-media-stack--video.video-playing .hero-poster {
    opacity: 0;
    transition: opacity 0.4s ease;
}

@media (max-width: 767px) {
    .hero-section {
        --usl-hero-poster-zoom: 1.08;
        --usl-hero-video-zoom: 1.18;
    }
}

.hero-section .hero-media-stack .hero-overlay {
    /* Background set by CMS (inline + #usl-theme-runtime); fallback uses CSS variables */
    background: linear-gradient(
        var(--usl-hero-overlay-angle, 115deg),
        var(--usl-hero-overlay-1, rgba(15, 23, 42, 0.92)) 0%,
        var(--usl-hero-overlay-2, rgba(30, 58, 138, 0.62)) 42%,
        var(--usl-hero-overlay-3, rgba(15, 23, 42, 0.82)) 100%
    );
    z-index: 2;
}

/* Crisper hero typography & controls */
.hero-section .slide-heading .slide-title,
.hero-section .slide-text h1 .slide-title,
.hero-section .welcome-subtext,
.hero-section .slide-subtext,
.hero-section .hero-btn,
.hero-section .btn-slide {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.hero-section .slide-content {
    max-width: 56rem;
    padding: 0 1rem;
}

.hero-content-panel {
    will-change: opacity, transform;
}

@keyframes heroFadeUp {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide title — shared by welcome slide and all other slides */
.hero-slide .slide-heading {
    margin: 0;
    padding: 0;
    text-align: center;
}

.hero-slide .slide-heading.hero-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
    background: none;
    animation: none;
    -webkit-text-fill-color: unset;
}

.hero-slide .slide-heading .slide-title,
.hero-slide .slide-text h1 .slide-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 0;
    display: block;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    background: var(--usl-hero-title-gradient, linear-gradient(90deg, #ffffff, #a5b4fc, #ffffff));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: heroTextShine 3s linear infinite, heroFadeUp 1s ease-out;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
}

.hero-slide .slide-heading.hero-title .welcome-line {
    font-size: 3.25rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.welcome-container {
    width: 100%;
    max-width: 100%;
    text-align: center;
    container-type: inline-size;
    container-name: hero-welcome;
    overflow-x: clip;
}

/* University name — always one line, scales to fit container width */
.hero-slide .slide-heading.hero-title .university-line,
.hero-slide .slide-heading.hero-title .slide-title.university-line {
    white-space: nowrap !important;
    word-wrap: normal !important;
    overflow-wrap: normal !important;
    word-break: keep-all !important;
    hyphens: none !important;
    display: block;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    font-weight: 800;
    font-size: clamp(0.65rem, 3.4vw, 4rem);
    font-size: min(4rem, max(0.65rem, 6.5cqi));
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.1;
}

@keyframes heroTextShine {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.hero-slide .welcome-subtext,
.hero-slide .slide-subtext {
    font-size: 1.5rem;
    margin: 1.5rem auto;
    max-width: 800px;
    line-height: 1.4;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    animation: heroFadeUp 1s ease 0.2s both;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.hero-stat {
    min-width: 6.5rem;
    padding: 0.75rem 1.1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0.85rem;
    backdrop-filter: blur(10px);
}

.hero-stat strong {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--usl-accent, #93c5fd);
    line-height: 1.2;
}

.hero-stat span {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--usl-btn-radius, 0.65rem);
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    box-shadow: none;
}

.hero-btn--primary {
    color: var(--usl-hero-cta-text, #ffffff);
    background: var(--usl-hero-cta-gradient, linear-gradient(135deg, #3b82f6, #1e40af));
    box-shadow: none;
    border: none;
}

.hero-btn--primary:hover {
    color: var(--usl-hero-cta-text, #ffffff);
    transform: translateY(-2px);
    box-shadow: none;
}

.hero-btn--outline {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--usl-hero-outline-border-rgba, rgba(255, 255, 255, 0.35));
    backdrop-filter: blur(6px);
}

.hero-btn--outline:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
    box-shadow: none;
}

.hero-section .btn-slide {
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--usl-btn-radius, 0.65rem);
    color: var(--usl-primary, #1e3a8a);
    background: #fff;
    border: none;
    text-decoration: none;
    box-shadow: none;
}

.hero-section .btn-slide:hover {
    color: var(--usl-primary, #1e3a8a);
    transform: translateY(-2px);
    box-shadow: none;
}

.hero-section .btn-slide.primary {
    color: #fff;
    background: var(--usl-primary-gradient, linear-gradient(135deg, #1e40af, #1e3a8a));
}

.hero-section .apply-now-button {
    padding: 0.8rem 1.75rem !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    border-radius: var(--usl-btn-radius, 0.65rem) !important;
    color: var(--usl-hero-cta-text, #ffffff) !important;
    background: var(--usl-hero-cta-gradient, linear-gradient(135deg, #3b82f6, #1e40af)) !important;
    box-shadow: none;
}

.hero-section .apply-now-button:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

/* No drop shadows on any hero CTA buttons (overrides theme runtime) */
.hero-section .hero-actions .hero-btn,
.hero-section .hero-actions .apply-now-button,
.hero-section .slide-buttons .btn-slide,
.hero-section .apply-button-container .apply-now-button {
    box-shadow: none !important;
    filter: none;
}

.hero-section .apply-now-button .absolute {
    display: none;
}

.hero-section .slider-dots {
    bottom: 4.5rem;
    gap: 0.5rem;
}

.hero-section .dot {
    width: 2.25rem;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    transition: background 0.45s ease, width 0.45s cubic-bezier(0.4, 0, 0.2, 1), transform 0.45s ease;
}

.hero-section .dot::after {
    display: none;
}

.hero-section .dot.active {
    background: var(--usl-accent, #60a5fa);
    transform: none;
    width: 2.75rem;
}

.hero-scroll-cue {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    animation: heroScrollBounce 2.5s ease-in-out infinite;
}

.hero-scroll-cue i {
    font-size: 1rem;
    opacity: 0.85;
}

@keyframes heroScrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(6px); }
}

.hero-section .scroll-indicator {
    display: none;
}

@media (max-width: 767px) {
    .hero-section {
        min-height: min(88vh, 720px);
    }

    .hero-section .hero-slide {
        padding: 4rem 0.65rem 5rem;
    }

    .hero-section .slide-content {
        padding: 0 0.5rem !important;
        max-width: 100%;
    }

    .hero-slide .slide-heading.hero-title {
        gap: 0.25rem;
        margin-bottom: 1rem;
        padding: 0 0.25rem;
    }

    /* Fluid titles for welcome line + other slides (not university name) */
    .hero-slide .slide-heading .slide-title:not(.university-line),
    .hero-slide .slide-heading.hero-title .slide-title.welcome-line {
        font-size: clamp(1.65rem, 6.2vw, 2.2rem) !important;
        font-weight: 900 !important;
        line-height: 1.15 !important;
        letter-spacing: 0.02em !important;
        text-shadow:
            0 1px 0 #000,
            0 2px 8px rgba(0, 0, 0, 0.9),
            0 0 15px rgba(255, 255, 255, 0.6) !important;
        background: var(--usl-hero-title-gradient, linear-gradient(90deg, #ffffff, #a5b4fc, #ffffff)) !important;
        background-size: 200% auto !important;
        -webkit-background-clip: text !important;
        background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
        animation: heroTextShine 3s linear infinite !important;
        padding: 0 0.15rem !important;
        max-width: 100%;
    }

    .hero-slide .slide-heading.hero-title .slide-title.university-line {
        font-size: clamp(0.65rem, 3.4vw, 2.75rem) !important;
        font-size: min(2.75rem, max(0.65rem, 6.5cqi)) !important;
        white-space: nowrap !important;
        overflow-wrap: normal !important;
        word-break: keep-all !important;
        letter-spacing: 0.01em !important;
        padding: 0 !important;
    }

    .hero-slide .slide-heading.hero-title .slide-title.welcome-line {
        margin-bottom: 0.35rem !important;
    }

    .hero-slide .welcome-subtext,
    .hero-slide .slide-subtext {
        font-size: clamp(1rem, 4vw, 1.2rem) !important;
        line-height: 1.45 !important;
        max-width: 95%;
        text-shadow:
            0 1px 0 #000,
            0 2px 4px rgba(0, 0, 0, 0.8) !important;
        font-weight: 500;
    }

    .hero-stats {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .hero-stat {
        min-width: 5.5rem;
        padding: 0.6rem 0.85rem;
    }

    .hero-stat strong {
        font-size: 1.15rem;
    }

    .hero-section .slider-dots {
        bottom: 3.75rem;
    }
}

@media (max-width: 767px) and (orientation: landscape) {
    .hero-section .hero-slide {
        padding: 3rem 0.5rem 3.5rem;
    }

    .hero-slide .slide-heading .slide-title:not(.university-line),
    .hero-slide .slide-heading.hero-title .slide-title.welcome-line {
        font-size: clamp(1.35rem, 4.8vw, 1.75rem) !important;
        line-height: 1.1 !important;
    }

    .hero-slide .slide-heading.hero-title .slide-title.university-line {
        font-size: clamp(0.6rem, 3vw, 2rem) !important;
        font-size: min(2rem, max(0.6rem, 6cqi)) !important;
        white-space: nowrap !important;
    }

    .hero-slide .welcome-subtext,
    .hero-slide .slide-subtext {
        font-size: clamp(0.9rem, 3.2vw, 1.05rem) !important;
        margin: 0.35rem auto !important;
    }
}

@media (max-width: 380px) {
    .hero-slide .slide-heading .slide-title:not(.university-line),
    .hero-slide .slide-heading.hero-title .slide-title.welcome-line {
        font-size: clamp(1.5rem, 7vw, 1.95rem) !important;
    }

    .hero-slide .slide-heading.hero-title .slide-title.university-line {
        font-size: clamp(0.58rem, 2.9vw, 1.85rem) !important;
        font-size: min(1.85rem, max(0.58rem, 6cqi)) !important;
        letter-spacing: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-content-panel,
    .hero-scroll-cue,
    .hero-slide .slide-text h1.hero-title,
    .hero-slide .slide-heading .slide-title,
    .hero-section .hero-slide {
        animation: none !important;
        transition: opacity 0.3s ease !important;
        transform: none !important;
    }

    .hero-section .hero-slide.active .hero-content-panel {
        animation: none !important;
    }
}
