/* css/layout.css */

/* ==========================================================
   NAVIGATION
   ========================================================== */
.app-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: transparent;
    transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease;
    will-change: background-color, backdrop-filter;
}

.app-bar.scrolled,
body:not(.transparent-nav-page) .app-bar {
    background-color: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05), 0 4px 24px rgba(0, 0, 0, 0.04);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 8px 16px;
    border-radius: 50px;
    display: inline-block;
    transition: color 0.3s ease, text-shadow 0.3s ease, background-color 0.4s ease, box-shadow 0.4s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 16px;
    right: 16px;
    height: 2px;
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

.nav-links a:active {
    background-color: rgba(var(--primary-rgb, 0, 178, 218), 0.1);
    transition: box-shadow 0.1s ease-out, background-color 0.1s ease-out;
}

body.transparent-nav-page .app-bar.scrolled .nav-links a,
body:not(.transparent-nav-page) .app-bar .nav-links a {
    color: var(--on-surface);
}

body.transparent-nav-page .app-bar.scrolled .nav-links a:hover,
body:not(.transparent-nav-page) .app-bar .nav-links a:hover {
    color: var(--primary);
    text-shadow: 0 0 0.65px var(--primary);
}

body.transparent-nav-page .app-bar.scrolled .nav-links a::after,
body:not(.transparent-nav-page) .app-bar .nav-links a::after {
    background-color: var(--primary);
}

body.transparent-nav-page .app-bar:not(.scrolled) .nav-links a {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

body.transparent-nav-page .app-bar:not(.scrolled) .nav-links a:hover {
    color: #ffffff;
    text-shadow: 0 0 0.65px #ffffff, 0 2px 8px rgba(0, 0, 0, 0.6);
}

body.transparent-nav-page .app-bar:not(.scrolled) .nav-links a::after {
    background-color: #ffffff;
}

body.transparent-nav-page .app-bar:not(.scrolled) .nav-links a:active {
    background-color: rgba(255, 255, 255, 0.15);
}

/* ==========================================================
   LAYOUT STRUCTURES
   ========================================================== */
section {
    padding: 100px 5%;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--on-surface);
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.section-header p {
    color: #5f6368;
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1rem;
}

.grid-container,
.course-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.grid-container>.card,
.course-grid>.card {
    flex: 1 1 300px;
    max-width: 380px;
}

.split-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 64px;
    padding: 100px 5%;
}

.split-section:nth-child(even) {
    flex-direction: row-reverse;
    background-color: #fafafa;
}

.split-content {
    flex: 1;
    min-width: 300px;
}

.split-content h2 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    color: var(--on-surface);
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.split-content h3 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 16px;
    font-weight: 500;
}

.split-content ul {
    list-style: none;
    margin: 24px 0;
}

.split-content li {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #5f6368;
}

.split-content li::before {
    content: "check_circle";
    font-family: 'Material Icons Outlined';
    color: var(--primary);
    font-size: 24px;
    margin-top: -2px;
}

/* ==========================================================
   GLOBAL ANIMATIONS & MEDIA PHYSICS
   ========================================================== */
.animate-entrance {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    transition: opacity 0.85s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.85s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

.animate-entrance.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

/* Interactive Media Cards */
.interactive-media {
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    display: block;
    width: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateZ(0);
    will-change: transform, box-shadow;
}

.interactive-media:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* Card Image Wrappers (Prevents border snapping on scale) */
.card-image-wrapper {
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
}

.card-image-wrapper img,
.card-image-wrapper video,
.info-card img,
.info-card video,
.structure-card img,
.structure-card video,
.program-card img,
.program-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateZ(0) scale(1);
    will-change: transform;
}

.card:hover .card-image-wrapper img,
.card:hover .card-image-wrapper video,
.info-card:hover img,
.info-card:hover video,
.structure-card:hover img,
.structure-card:hover video,
.program-card:hover img,
.program-card:hover video {
    transform: translateZ(0) scale(1.04);
}

/* ==========================================================
   CINEMATIC CAROUSEL
   ========================================================== */
.cinematic-showcase {
    position: relative;
    width: 100vw;
    height: 85vh;
    max-height: 900px;
    min-height: 600px;
    background-color: #000;
    overflow: hidden;
    margin-left: calc(-50vw + 50%);
}

#carousel-track {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 2;
}

.carousel-slide img,
.carousel-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.1);
    transition: transform 12s linear, opacity 1.5s ease-in-out;
    will-change: transform;
}

.carousel-slide.active img,
.carousel-slide.active video {
    transform: scale(1.0);
}

.carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 5%;
    pointer-events: none;
}

.carousel-overlay h2 {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: #ffffff;
    margin-bottom: 16px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    letter-spacing: -1px;
}

.carousel-overlay p {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: #e5e7eb;
    max-width: 700px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
}

.carousel-controls {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    gap: 12px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.carousel-dot.active {
    background-color: #ffffff;
    transform: scale(1.3);
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: transparent;
    /* Floating without a backdrop */
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.8;
    /* Always visible but softly faded */
    -webkit-tap-highlight-color: transparent;
    /* Removes default mobile browser tap flash */
}

/* Shadow appears on hover (Desktop) */
@media (hover: hover) {
    .carousel-arrow:hover {
        background-color: rgba(0, 0, 0, 0.4);
        opacity: 1;
        transform: translateY(-50%) scale(1.1);
    }
}

/* "Something More" on Click (Mobile & Desktop) */
.carousel-arrow:active {
    background-color: rgba(0, 0, 0, 0.7);
    /* Darker shadow */
    transform: translateY(-50%) scale(0.9);
    /* Squeezes down on click */
    opacity: 1;
}

.carousel-arrow.prev {
    left: 40px;
}

.carousel-arrow.next {
    right: 40px;
}

/* ==========================================================
   VIDEO UI & CONTROLS
   ========================================================== */
.hero-banner--video {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.hero-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(28, 28, 28, 0.7), rgba(28, 28, 28, 0.7));
    z-index: -1;
}

.hero-banner--video .hero-content {
    position: relative;
    z-index: 1;
}

/* ==========================================================
   PREMIUM VIDEO UI & CONTROLS (Hidden by default)
   ========================================================== */
.video-controls-group {
    position: absolute;
    bottom: 40px;
    right: 5%;
    display: flex;
    gap: 16px;
    z-index: 50;

    /* THE FIX: Hide buttons completely. They only appear if the video loads! */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* Javascript injects this class ONLY when the video is verified working */
.video-controls-group.show-controls {
    opacity: 1;
    pointer-events: auto;
}

.carousel-slide .video-controls-group {
    bottom: 32px;
    right: 5%;
}

.video-control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #ffffff;
    color: #1a1a1a;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    will-change: transform;
}

.video-control-btn:hover {
    background-color: #f8f9fa;
    transform: scale(1.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.1);
}

.video-control-btn:active {
    transform: scale(0.95);
}

/* ==========================================================
   MODERN MEDIA SPINNER & CROSSFADE (Animation Fix)
   ========================================================== */
.media-loading-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
    overflow: hidden;
}

.modern-spinner {
    position: absolute;
    width: 48px;
    height: 48px;
    animation: rotate 2s linear infinite;
    z-index: 1;
}

.modern-spinner-track {
    fill: none;
    stroke: rgba(0, 0, 0, 0.08);
    stroke-width: 4;
}

.modern-spinner-path {
    fill: none;
    stroke: var(--primary);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 200;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -35px;
    }

    100% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -124px;
    }
}

/* Base Crossfade Logic */
.media-loading-container img,
.media-loading-container video {
    opacity: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s ease, filter 0.4s ease;
}

.media-loading-container.loaded img,
.media-loading-container.loaded video {
    opacity: 1;
}

.media-loading-container.loaded .modern-spinner {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* THE FIX: Safely protects the 12-second Carousel Zoom Animation! */
.carousel-slide .media-loading-container img,
.carousel-slide .media-loading-container video {
    transform: scale(1.1);
    transition: transform 12s linear, opacity 1.5s ease-in-out;
    will-change: transform;
}

.carousel-slide.active .media-loading-container img,
.carousel-slide.active .media-loading-container video {
    transform: scale(1.0);
}

/* ==========================================================
   FLUID MASONRY GALLERY & LIGHTBOX
   ========================================================== */
.masonry-container {
    padding: 16px 5%;
    background-color: var(--surface);
    min-height: 50vh;
    column-count: 4;
    column-gap: 16px;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 16px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f3f4f6;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    transform: translateZ(0);
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    display: block;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
    transform: translateZ(0) scale(1);
}

.item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(var(--primary-rgb, 0, 178, 218), 0.6), transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 10;
}

.item-overlay .material-icons-outlined {
    color: white;
    font-size: 40px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.8);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: translateZ(0) scale(1.03);
    filter: brightness(1.05);
}

.gallery-item:hover .item-overlay {
    opacity: 1;
}

.gallery-item:hover .item-overlay .material-icons-outlined {
    transform: translateY(0) scale(1);
}

/* Lightbox UI */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 40px 80px;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(15px) scale(0.97);
    transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

.lightbox-counter {
    position: absolute;
    top: 32px;
    left: 32px;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-body);
    font-size: 1rem;
    letter-spacing: 1px;
    z-index: 10002;
    pointer-events: none;
}

.lightbox-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, border-color 0.2s ease;
    z-index: 10002;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.lb-close {
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
}

.lb-close:hover {
    transform: scale(1.05);
}

.lb-close:active {
    transform: scale(0.92);
}

.lb-nav {
    top: calc(50% - 28px);
    width: 56px;
    height: 56px;
}

.lb-nav:hover {
    transform: scale(1.05);
}

.lb-nav:active {
    transform: scale(0.92);
}

.lb-prev {
    left: 24px;
}

.lb-next {
    right: 24px;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    opacity: 0;
    z-index: 10;
    animation: fadeIn 2s ease forwards 1s;
}

.scroll-text {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.scroll-chevron {
    font-size: 32px !important;
    animation: gentleBounce 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes gentleBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(8px);
    }
}

@keyframes fadeIn {
    to {
        opacity: 0.8;
    }
}

/* ==========================================================
   MOBILE RESPONSIVENESS & UI POLISH
   ========================================================== */

/* 1. Smooth Logo & Icon Color Transitions */
#nav-logo,
.mobile-menu-btn .material-icons-outlined {
    transition: filter 0.4s ease, color 0.4s ease;
}

body.transparent-nav-page .app-bar:not(.scrolled):not(.menu-open) #nav-logo {
    filter: brightness(0) invert(1);
}

body.transparent-nav-page .app-bar:not(.scrolled):not(.menu-open) .mobile-menu-btn .material-icons-outlined {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

body.transparent-nav-page .app-bar.scrolled .mobile-menu-btn .material-icons-outlined,
body:not(.transparent-nav-page) .app-bar .mobile-menu-btn .material-icons-outlined,
.app-bar.menu-open .mobile-menu-btn .material-icons-outlined {
    color: var(--on-surface);
}

/* Hide Mobile CTA on Desktop */
.mobile-nav-cta {
    display: none;
}

/* --- FIX: Desktop Grid Spacing --- */
.grid-container,
.course-grid {
    gap: 24px;
}

.grid-container>.card,
.course-grid>.card {
    flex: 1 1 280px;
    /* Smaller base width */
    max-width: 340px;
    /* Tighter maximum width */
}

@media (max-width: 1200px) {
    .masonry-container {
        column-count: 3;
    }
}

/* --- FIX: Catch Landscape Phones & Tablets for Mobile Nav (992px) --- */
@media (max-width: 992px) {

    /* Reduce global padding */
    section,
    .split-section {
        padding: 60px 5%;
    }

    .section-header {
        margin-bottom: 40px;
    }

    .cinematic-showcase {
        height: 70vh;
        min-height: 500px;
    }

    /* Navigation shifts to Mobile UI */
    .logo,
    .mobile-menu-btn {
        position: relative;
        z-index: 10001;
    }

    .mobile-menu-btn {
        display: block !important;
    }

    .desktop-nav-cta {
        display: none !important;
    }

    .mobile-nav-cta {
        display: block;
        margin-top: 16px;
        text-align: center;
    }

    .mobile-nav-cta .btn-primary {
        display: inline-block;
        width: auto;
        min-width: 200px;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 100vh;
        background-color: #ffffff;
        flex-direction: column;
        justify-content: center;
        padding: 60px 5%;
        gap: 16px;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-10px);
        transition: opacity 0.3s ease, transform 0.3s ease;
        z-index: 10000;
    }

    .nav-links.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .nav-links a {
        font-size: 1.15rem;
        display: block;
        text-align: center;
        color: var(--on-surface) !important;
        text-shadow: none !important;
    }

    .nav-links a.btn-primary {
        color: #ffffff !important;
    }
}

/* Standard Mobile Layout Shifts */
@media (max-width: 768px) {
    .section-header h2 {
        font-size: 2rem;
    }

    .split-content h2 {
        font-size: 1.8rem;
    }

    .split-section {
        flex-direction: column !important;
        gap: 32px;
    }

    .split-section:nth-child(even) {
        flex-direction: column !important;
    }

    .carousel-controls {
        gap: 6px;
        width: 90%;
        flex-wrap: wrap;
        justify-content: center;
        bottom: 16px;
    }

    .carousel-dot {
        width: 8px;
        height: 8px;
    }

    .carousel-dot.active {
        transform: scale(1.2);
    }

    .carousel-arrow {
        width: 44px;
        height: 44px;
    }

    .masonry-container {
        column-count: 2;
    }
}

/* Small Phones */
@media (max-width: 480px) {
    .masonry-container {
        column-count: 1;
    }

    .hero-section h1 {
        font-size: 2.25rem !important;
    }

    .hero-section p {
        font-size: 1rem !important;
        margin-bottom: 24px !important;
    }

    /* Allow cards to take full width */
    .grid-container>.card,
    .course-grid>.card {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* --- FIX: Ultra-Compact Landscape Mobile Mode --- */
@media (max-height: 500px) and (orientation: landscape) {

    /* 1. Slim Header */
    .app-bar {
        padding: 8px 5% !important;
    }

    #nav-logo {
        height: 36px !important;
    }

    .nav-links {
        justify-content: flex-start;
        padding-top: 70px;
        overflow-y: auto;
    }

    /* 2. Hide Non-Essential UI to reclaim vertical space */
    .scroll-indicator {
        display: none !important;
    }

    /* 3. Shrink Hero & Section Content */
    .hero-section {
        padding-top: 60px !important;
    }

    .hero-section h1 {
        font-size: 2rem !important;
        /* Scale down massive text */
        margin-bottom: 8px !important;
    }

    .hero-section p {
        font-size: 0.95rem !important;
        margin-bottom: 16px !important;
        max-width: 90%;
    }

    .hero-section .btn-primary {
        padding: 10px 24px !important;
        /* Smaller button */
        font-size: 0.9rem !important;
    }

    /* Shrink section headers globally for landscape */
    .section-header h2,
    .split-content h2,
    .carousel-overlay h2 {
        font-size: 1.5rem !important;
        margin-bottom: 8px !important;
    }

    .carousel-overlay p {
        font-size: 0.9rem !important;
    }
}