/**
 * Eaglewood Polytechnic — Tablet & Mobile responsive layer
 * Desktop (1025px+) is unchanged. All rules scoped to max-width breakpoints.
 */

/* ── Global: prevent horizontal scroll ─────────────────────────────────── */

@media (max-width: 1024px) {
    html,
    body {
        overflow-x: clip;
        max-width: 100%;
    }

    img,
    video,
    svg,
    iframe {
        max-width: 100%;
        height: auto;
    }

    .container,
    .eaglewood-home .container,
    .premium-topbar .container {
        width: min(var(--container, 1200px), calc(100% - 32px));
    }
}

/* ── Navbar: sticky blur + mobile menu ─────────────────────────────────── */

@media (max-width: 1080px) {
    .site-header {
        position: sticky;
        top: 0;
        z-index: 200;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(18px) saturate(1.2);
        -webkit-backdrop-filter: blur(18px) saturate(1.2);
        border-bottom: 1px solid rgba(0, 91, 91, 0.1);
        transition: box-shadow 0.25s ease, background 0.25s ease;
    }

    .header-scrolled .site-header,
    .home-page.header-scrolled .site-header {
        box-shadow: 0 12px 40px rgba(15, 45, 55, 0.1);
    }

    .navbar {
        position: relative;
        min-height: 72px;
        height: auto;
        padding: 8px 0;
        gap: 12px;
    }

    .brand {
        min-width: 0;
        flex: 1 1 auto;
        gap: 10px;
    }

    .brand img {
        width: clamp(44px, 12vw, 56px);
        height: clamp(42px, 11vw, 52px);
        flex-shrink: 0;
        border-radius: 10px;
    }

    .brand strong {
        font-size: clamp(0.72rem, 2.8vw, 0.88rem);
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .brand em {
        font-size: clamp(0.5rem, 2vw, 0.58rem);
    }

    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 4px;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid rgba(0, 91, 91, 0.12);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.9);
        cursor: pointer;
        transition: transform 0.2s ease, background 0.2s ease;
        flex-shrink: 0;
        margin-left: auto;
    }

    .nav-toggle span {
        display: block;
        width: 5px;
        height: 5px;
        margin: 0;
        border-radius: 50%;
        background: var(--teal-3, #063f43);
        transition: transform 0.28s ease, opacity 0.2s ease, width 0.2s ease, height 0.2s ease;
    }

    .nav-toggle.open span {
        width: 18px;
        height: 2px;
        border-radius: 2px;
        margin: 0;
    }

    .nav-toggle.open span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .nav-toggle.open span:nth-child(2) {
        opacity: 0;
        transform: scale(0);
    }

    .nav-toggle.open span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .nav-apply,
    .ask-ai-item,
    .ask-ai-nav {
        display: none !important;
    }

    .nav-links:not(.open) {
        display: none !important;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .nav-links.open {
        display: grid !important;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    .nav-links {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        left: 0;
        width: 100%;
        max-height: min(70vh, 520px);
        overflow-y: auto;
        overscroll-behavior: contain;
        margin: 0;
        padding: 10px;
        gap: 4px;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid rgba(0, 91, 91, 0.1);
        border-radius: 16px;
        box-shadow: 0 24px 60px rgba(15, 45, 55, 0.14);
        transform: translateY(-8px) scale(0.98);
        transform-origin: top right;
        transition:
            opacity 0.28s ease,
            transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
            visibility 0.28s;
    }

    .nav-links a,
    .nav-links .ask-ai-nav {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 10px 14px;
        border-radius: 10px;
        font-weight: 600;
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(0, 91, 91, 0.08);
    }

    .ask-ai-item {
        width: 100%;
    }

    .ask-ai-nav {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }
}

/* ── Homepage hero (mobile/tablet fix) ─────────────────────────────────── */

@media (max-width: 1024px) {
    body[data-home] .premium-hero,
    body[data-home] .hero-slider-shell {
        min-height: clamp(560px, 90svh, 720px);
    }

    body[data-home] .premium-slide img {
        object-fit: cover;
        object-position: center 32%;
        transform: none !important;
    }

    body[data-home] .premium-slide.active img {
        transform: none !important;
    }

    body[data-home] .premium-slide:after {
        background: linear-gradient(180deg, rgba(5, 22, 24, 0.55) 0%, rgba(5, 22, 24, 0.42) 38%, rgba(5, 22, 24, 0.72) 100%);
    }

    body[data-home] .hero-copy {
        width: calc(100% - 32px) !important;
        margin: 0 auto !important;
        padding: clamp(20px, 5vh, 36px) 0 clamp(24px, 6vh, 40px) !important;
    }

    body[data-home] .premium-slide.active img {
        transform: none !important;
    }

    body[data-home] .premium-slide:after {
        background: linear-gradient(180deg, rgba(5, 22, 24, 0.82) 0%, rgba(5, 22, 24, 0.52) 42%, rgba(5, 22, 24, 0.68) 100%);
    }

    body[data-home] .premium-hero,
    body[data-home] .hero-slider-shell {
        min-height: clamp(520px, 88svh, 680px) !important;
    }

    body[data-home] .gov-swiper {
        padding: 6px 40px 54px;
        margin-inline: 0;
        overflow: hidden;
        width: 100%;
        max-width: 100%;
    }

    body[data-home] .gov-swiper .swiper-slide {
        height: auto;
        box-sizing: border-box;
    }

    body[data-home] .gov-update-card,
    body[data-home] .gov-notice-card {
        width: 100%;
        min-height: 0;
        max-width: 100%;
    }

    .gov-slider-dots.swiper-pagination {
        position: relative;
        bottom: auto;
        margin-top: 8px;
    }

    .gov-slider-dots .swiper-pagination-bullet {
        width: 9px;
        height: 9px;
        opacity: 1;
        background: rgba(15, 118, 110, 0.22);
    }

    .gov-slider-dots .swiper-pagination-bullet-active {
        width: 34px;
        border-radius: 999px;
        background: linear-gradient(90deg, var(--epi-primary, #0f766e), var(--epi-gold, #d4a017));
    }

    body[data-home] .hero-copy {
        width: calc(100% - 40px);
        max-width: 640px;
        padding-top: clamp(100px, 18vh, 140px);
        padding-bottom: 24px;
    }

    body[data-home] .premium-slide h1 {
        font-size: clamp(2rem, 7.5vw, 3.25rem);
        line-height: 1.05;
        letter-spacing: -0.02em;
        margin-bottom: 12px;
    }

    body[data-home] .animated-subtitle {
        font-size: clamp(0.95rem, 3.2vw, 1.05rem);
        line-height: 1.6;
        margin-bottom: 20px;
    }

    body[data-home] .hero-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    body[data-home] .hero-trust-badges {
        flex-wrap: wrap;
        gap: 8px;
    }

    body[data-home] .hero-trust-badges span {
        font-size: 11px;
        padding: 6px 10px;
    }

    body[data-home] .hero-float-grid {
        position: static;
        left: auto;
        right: auto;
        bottom: auto;
        width: calc(100% - 40px);
        margin: 20px auto 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        z-index: 5;
    }

    body[data-home] .hero-float-card {
        padding: 14px 12px;
        border-radius: 16px;
        min-height: 72px;
    }

    body[data-home] .hero-float-card strong {
        font-size: clamp(1.1rem, 4.5vw, 1.4rem);
        line-height: 1.1;
    }

    body[data-home] .hero-float-card span {
        font-size: 10px;
        line-height: 1.3;
    }

    body[data-home] .stats-band {
        margin-top: 0;
        padding-top: 24px;
    }

    body[data-home] .slide-dots {
        bottom: 24px;
    }

    body[data-home] .slide-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    body[data-home] .premium-hero,
    body[data-home] .hero-slider-shell {
        min-height: auto;
    }

    body[data-home] .hero-copy {
        padding-top: clamp(88px, 16vh, 120px);
    }

    body[data-home] .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    body[data-home] .hero-actions .btn {
        width: 100%;
        min-height: 48px;
        justify-content: center;
    }

    body[data-home] .hero-float-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 16px;
        margin-bottom: 8px;
    }

    body[data-home] .eaglewood-home .premium-section {
        padding: clamp(56px, 12vw, 72px) 0;
    }

    body[data-home] .section-head-pro {
        margin-bottom: 28px;
    }

    body[data-home] .section-head-pro h2 {
        font-size: clamp(1.65rem, 6.5vw, 2.1rem);
        line-height: 1.12;
    }

    body[data-home] .section-head-pro p {
        font-size: 0.95rem;
        line-height: 1.65;
    }
}

@media (max-width: 480px) {
    body[data-home] .premium-slide h1 {
        font-size: clamp(1.75rem, 8.5vw, 2.35rem);
    }

    body[data-home] .hero-float-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: calc(100% - 32px);
    }

    body[data-home] .hero-float-card {
        padding: 12px 10px;
    }

    body[data-home] .hero-badge {
        font-size: 11px;
        padding: 6px 12px;
    }
}

/* ── Homepage sections: cards, grids, spacing ──────────────────────────── */

@media (max-width: 1024px) {
    body[data-home] .gov-swiper,
    body[data-home] .dept-swiper-shell,
    body[data-home] .programs-swiper-shell {
        overflow: hidden;
        padding-bottom: 8px;
    }

    body[data-home] .glass-card,
    body[data-home] .gov-update-card,
    body[data-home] .gov-notice-card,
    body[data-home] .gov-course-card,
    body[data-home] .gov-dept-card,
    body[data-home] .premium-gallery-tile {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
    }

    body[data-home] .gov-update-body,
    body[data-home] .gov-course-card .gov-course-body,
    body[data-home] .gov-dept-body {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
    }

    body[data-home] .gov-swiper .swiper-slide {
        flex: none;
        width: auto;
        max-width: 100%;
    }

    body[data-home] .gov-update-media img,
    body[data-home] .gov-course-card img,
    body[data-home] .gov-dept-media img,
    body[data-home] .premium-gallery-tile img {
        aspect-ratio: 16 / 10;
        object-fit: cover;
        width: 100%;
    }

    body[data-home] .gov-principal-card {
        padding: clamp(20px, 4vw, 28px);
    }

    body[data-home] .gov-principal-portrait {
        width: min(220px, 70vw);
        height: min(220px, 70vw);
        margin-inline: auto;
    }

    body[data-home] .premium-form,
    body[data-home] .form-glass {
        padding: clamp(16px, 4vw, 22px);
    }

    body[data-home] .inquiry-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    body[data-home] .swiper-slide {
        height: auto;
    }

    body[data-home] .gov-update-card,
    body[data-home] .gov-notice-card {
        min-height: 0;
    }

    body[data-home] .premium-gallery-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    body[data-home] .premium-cta .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        text-align: left;
    }

    body[data-home] .premium-cta .hero-actions {
        width: 100%;
    }
}

/* ── Inner pages: sections, grids, typography ─────────────────────────── */

@media (max-width: 1080px) {
    .section {
        padding: clamp(64px, 10vw, 88px) 0;
    }

    .section-sm {
        padding: clamp(48px, 8vw, 64px) 0;
    }

    .grid-2,
    .grid-3,
    .grid-4,
    .course-strip,
    .dept-grid,
    .facility-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .page-hero h1,
    .hero h1 {
        font-size: clamp(1.75rem, 5.5vw, 2.5rem);
        line-height: 1.12;
    }

    .page-hero p,
    .hero p {
        font-size: clamp(0.95rem, 2.8vw, 1.05rem);
        line-height: 1.65;
    }
}

@media (max-width: 760px) {
    .section {
        padding: 56px 0;
    }

    .grid-2,
    .grid-3,
    .grid-4,
    .course-strip,
    .dept-grid,
    .facility-grid,
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card,
    .course-card,
    .dept-card,
    .facility-card,
    .gallery-card {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .card img,
    .course-card img,
    .dept-card img {
        aspect-ratio: 16 / 10;
        object-fit: cover;
    }

    .btn,
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
        padding: 10px 18px;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 430px) {
    .container {
        width: min(var(--container, 1200px), calc(100% - 24px));
    }

    .brand strong {
        max-width: 168px;
    }
}

/* ── Footer responsive ─────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .gov-footer-main,
    .footer-grid,
    .footer-grid-minimal {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .gov-footer-brand,
    .footer-about {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .gov-footer-main,
    .footer-grid,
    .footer-grid-minimal {
        grid-template-columns: 1fr;
    }

    .gov-footer-cta-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }

    .gov-footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        text-align: left;
    }
}

/* ── Floating controls: safe area stacking ─────────────────────────────── */

@media (max-width: 560px) {
    .whatsapp {
        bottom: max(88px, calc(env(safe-area-inset-bottom) + 88px));
        right: max(16px, env(safe-area-inset-right));
    }

    .back-top {
        bottom: max(148px, calc(env(safe-area-inset-bottom) + 148px));
        right: max(16px, env(safe-area-inset-right));
    }
}

/* ── Accessibility: touch targets & focus ──────────────────────────────── */

@media (max-width: 1024px) {
    .nav-toggle,
    .nav-links a,
    .nav-links .ask-ai-nav,
    .btn,
    .btn-primary,
    .btn-secondary,
    .ew-ai__fab,
    .ew-ai__send,
    .ew-ai__tool,
    .ew-ai__close,
    .ew-ai__chips button,
    .slide-dots button {
        min-height: 44px;
    }

    .nav-toggle {
        min-width: 44px;
    }

    :focus-visible {
        outline: 3px solid rgba(0, 91, 91, 0.45);
        outline-offset: 2px;
    }
}

/* ── Landscape phones ────────────────────────────────────────────────────── */

@media (max-width: 900px) and (orientation: landscape) {
    body[data-home] .premium-hero,
    body[data-home] .hero-slider-shell {
        min-height: auto;
    }

    body[data-home] .hero-copy {
        padding-top: 72px;
        padding-bottom: 12px;
    }

    body[data-home] .hero-float-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        margin-top: 12px;
    }

    .ew-ai__panel.ew-ai__panel--mobile-full {
        height: 100dvh;
        max-height: 100dvh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-links,
    .nav-toggle span,
    .premium-reveal,
    .ew-ai__panel,
    .ew-ai__fab-wrap {
        animation: none;
        transition-duration: 0.01ms;
    }
}

/* ── Homepage: override home.css legacy mobile conflicts ───────────────── */

@media (max-width: 1024px) {
    body[data-home] .premium-hero,
    body[data-home] .hero-slider-shell {
        min-height: min(92svh, 780px) !important;
    }

    body[data-home] .hero-copy {
        width: calc(100% - 40px) !important;
        margin: 0 auto !important;
        padding-top: clamp(100px, 18vh, 140px) !important;
        padding-bottom: 24px !important;
    }

    body[data-home] .hero-float-grid {
        position: static !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        margin: 20px auto 0 !important;
        width: calc(100% - 40px) !important;
    }

    body[data-home] .stats-band {
        margin-top: 0 !important;
        padding-bottom: clamp(32px, 6vw, 54px) !important;
    }

    body[data-home] .section-split-head {
        display: grid;
        gap: 16px;
        align-items: start;
    }

    body[data-home] .gov-swiper {
        padding: 6px 0 54px;
        margin-inline: 0;
    }

    body[data-home] .dept-swiper-shell,
    body[data-home] .programs-swiper-shell {
        padding-inline: 0;
    }

    body[data-home] .stats-premium-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    body[data-home] .premium-hero,
    body[data-home] .hero-slider-shell {
        min-height: clamp(560px, 90svh, 720px) !important;
    }

    body[data-home] .gov-swiper {
        padding-inline: 36px;
    }

    body[data-home] .premium-slide h1 {
        font-size: clamp(2rem, 7.5vw, 3.25rem) !important;
        line-height: 1.05 !important;
    }

    body[data-home] .animated-subtitle {
        font-size: clamp(0.95rem, 3.2vw, 1.05rem) !important;
        line-height: 1.6 !important;
    }

    body[data-home] .hero-float-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        margin: 16px auto 8px !important;
    }

    body[data-home] .hero-float-card {
        padding: 14px 12px !important;
        border-radius: 16px !important;
    }

    body[data-home] .hero-float-card strong {
        font-size: clamp(1.1rem, 4.5vw, 1.4rem) !important;
    }

    body[data-home] .slide-dots {
        bottom: 24px !important;
    }

    body[data-home] .gov-highlight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body[data-home] .hero-float-grid.hero-float-grid--duo {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        max-width: min(100%, 520px);
        margin-inline: auto !important;
    }

    body[data-home] .hero-float-card.hero-float-card--duo {
        min-height: 88px;
        padding: 16px 14px !important;
    }

    body[data-home] .gov-principals-grid {
        grid-template-columns: 1fr;
    }

    body[data-home] .stats-premium-grid.stats-premium-grid--four {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 480px) {
    body[data-home] .hero-float-grid {
        position: static !important;
        left: auto !important;
        right: auto !important;
        width: calc(100% - 32px) !important;
        margin: 12px auto 8px !important;
    }

    body[data-home] .premium-slide h1 {
        font-size: clamp(1.75rem, 8.5vw, 2.35rem) !important;
    }

    body[data-home] .gov-highlight-grid {
        grid-template-columns: 1fr;
    }

    body[data-home] .stats-premium-grid.stats-premium-grid--four {
        grid-template-columns: 1fr !important;
    }
}

/* ── Inner pages: additional grids & forms ─────────────────────────────── */

@media (max-width: 1080px) {
    .admission-heading,
    .section-head,
    .section-split-head {
        display: grid;
        gap: 16px;
        align-items: start;
    }

    .admission-heading-action,
    .section-view-all {
        justify-self: start;
    }

    .admission-steps,
    .dept-support-grid,
    .contact-grid,
    .gallery-grid,
    .faculty-grid,
    .sitemap-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .media-panel,
    .content-copy {
        min-width: 0;
    }
}

@media (max-width: 760px) {
    .admission-heading-action .btn,
    .section-view-all {
        width: 100%;
        justify-content: center;
    }

    .admission-steps,
    .dept-support-grid,
    .contact-grid,
    .gallery-grid,
    .faculty-grid,
    .sitemap-grid,
    .placement-story,
    .fact-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .gallery-filters,
    .home-gallery-filters {
        width: 100%;
        border-radius: 20px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .gallery-filters button,
    .home-gallery-filters button {
        flex-shrink: 0;
        min-height: 44px;
    }

    .gallery-item,
    .gallery-item.wide,
    .gallery-item.tall {
        grid-column: auto;
        grid-row: auto;
        min-height: 220px;
    }

    .gallery-item img {
        aspect-ratio: 16 / 10;
        object-fit: cover;
        width: 100%;
        height: 100%;
    }

    .contact-form,
    .premium-form,
    .form-glass {
        padding: clamp(16px, 4vw, 22px);
    }

    .page-title {
        padding-top: clamp(40px, 8vw, 56px);
    }
}

@media (max-width: 430px) {
    .admission-step,
    .dept-support-card,
    .scholar-card,
    .fact-panel {
        padding: 18px 16px;
    }
}

/* ── Production mobile polish (public site) ─────────────────────────────── */

@media (max-width: 1080px) {
    .brand {
        min-width: 0 !important;
        flex: 1 1 auto;
        max-width: calc(100% - 56px);
    }

    .brand > span {
        display: block;
        min-width: 0;
    }

    .brand strong,
    .brand small,
    .brand em {
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .navbar {
        min-height: 64px;
        height: auto;
        padding: 8px 0;
        align-items: center;
        gap: 10px;
    }

    .nav-links {
        z-index: 220;
    }

    .home-page .site-header {
        position: sticky !important;
        top: 0 !important;
    }

    body[data-home] .premium-topbar {
        position: relative;
        z-index: 116;
        display: block;
        background: linear-gradient(180deg, #063f43, #0a4f52);
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        color: #fff;
    }

    body[data-home] .top-mobile-info {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    body[data-home] .top-mobile-meta,
    body[data-home] .top-mobile-contact {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        width: 100%;
    }

    body[data-home] .top-mobile-meta span,
    body[data-home] .top-mobile-contact a {
        display: block;
        width: 100%;
        font-size: 11px;
        line-height: 1.45;
        overflow-wrap: anywhere;
        white-space: normal;
        color: rgba(255, 255, 255, 0.92);
    }

    body[data-home] .top-mobile-contact a:hover {
        color: #ffba7d;
    }

    body[data-home] .premium-topbar .top-inner {
        padding: 12px 0;
        min-height: auto;
    }

    .topbar {
        font-size: 0.72rem;
    }

    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 8px 0;
        min-height: auto;
    }

    .topbar-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        width: 100%;
    }

    .topbar-inner > span,
    .topbar-affiliation {
        display: block;
        overflow-wrap: anywhere;
        line-height: 1.4;
    }

    .page-title,
    .hero-content {
        padding-top: clamp(24px, 4vw, 40px);
    }

    main,
    #main {
        min-width: 0;
    }

    .media-panel,
    .content-copy,
    .card,
    .glass-card,
    .gov-highlight-card,
    .gov-course-card,
    .gov-dept-card {
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    body[data-home] .stats-premium-grid {
        border-radius: 20px;
    }

    body[data-home] .stats-premium-grid div {
        padding: 18px 14px !important;
    }

    body[data-home] .stats-premium-grid strong {
        font-size: clamp(1.45rem, 6.8vw, 1.9rem) !important;
        line-height: 1.05 !important;
    }

    body[data-home] .stats-premium-grid span {
        font-size: 10px !important;
        letter-spacing: .08em !important;
        line-height: 1.35 !important;
    }

    body[data-home] .stats-band {
        margin-top: 0 !important;
        padding: 20px 0 clamp(28px, 5vw, 44px) !important;
    }

    body[data-home] .gov-highlight-card {
        min-height: 0;
        padding: 18px 16px;
    }

    body[data-home] .gov-highlight-value {
        font-size: clamp(1.35rem, 5.5vw, 1.75rem);
    }

    body[data-home] .gov-highlight-label {
        font-size: 11px;
        line-height: 1.35;
    }

    body[data-home] .gov-highlight-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    body[data-home] .premium-hero .hero-copy {
        width: calc(100% - 32px) !important;
        max-width: none;
        padding-top: clamp(72px, 12vh, 96px) !important;
        padding-bottom: 12px !important;
    }

    body[data-home] .premium-slide h1 {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    body[data-home] .hero-trust-badges span {
        max-width: 100%;
        white-space: normal;
        text-align: center;
        line-height: 1.35;
    }

    body[data-home] .stats-premium-grid.stats-premium-grid--four {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    #main,
    main {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .epi-ft-wa {
        left: max(14px, env(safe-area-inset-left));
        bottom: max(16px, env(safe-area-inset-bottom));
    }

    .ew-ai {
        right: max(14px, env(safe-area-inset-right));
        bottom: max(16px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 480px) {
    .brand strong {
        max-width: none;
        font-size: clamp(0.68rem, 3.2vw, 0.82rem) !important;
    }

    .brand em {
        font-size: clamp(0.48rem, 2.2vw, 0.56rem);
    }

    body[data-home] .stats-premium-grid.stats-premium-grid--four {
        grid-template-columns: 1fr !important;
    }

    body[data-home] .gov-highlight-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .topbar {
        font-size: 0.68rem;
    }

    .topbar-inner {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        padding: 6px 0;
        min-height: auto;
    }

    .section-title {
        font-size: clamp(1.65rem, 7vw, 2.15rem) !important;
    }

    .page-title h1 {
        font-size: clamp(1.55rem, 7vw, 2rem);
    }

    .dept-swiper-shell,
    .programs-swiper-shell,
    .facilities-swiper-shell,
    .placements-swiper-shell {
        padding-inline: 0;
    }

    .dept-swiper-shell .programs-swiper-prev,
    .dept-swiper-shell .programs-swiper-next,
    .programs-swiper-shell .programs-swiper-prev,
    .programs-swiper-shell .programs-swiper-next {
        display: none;
    }
}

@media (max-width: 360px) {
    .container,
    .eaglewood-home .container,
    .premium-topbar .container {
        width: min(var(--container, 1200px), calc(100% - 24px));
    }

    body[data-home] .hero-actions .btn {
        font-size: 0.82rem;
        padding-inline: 14px;
    }
}

@media (max-width: 760px) {
    #top-bar,
    body[data-home] #top-bar,
    body[data-home] .premium-topbar,
    .premium-topbar,
    .topbar {
        display: none !important;
    }

    .site-header,
    .home-page .site-header,
    body[data-home] .site-header {
        position: sticky !important;
        top: 0 !important;
        background: #fff !important;
        border-bottom: 1px solid rgba(0, 91, 91, 0.1) !important;
        box-shadow: 0 4px 18px rgba(15, 45, 55, 0.06) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .navbar {
        min-height: 60px;
        height: 60px;
        padding: 0;
        gap: 12px;
        align-items: center;
        justify-content: space-between;
    }

    .home-page .navbar {
        height: 60px;
        min-height: 60px;
    }

    .brand {
        flex: 0 0 auto !important;
        max-width: none !important;
        min-width: 0 !important;
        gap: 0;
    }

    .brand > span {
        display: none !important;
    }

    .brand img {
        width: 48px;
        height: 44px;
        border-radius: 10px;
    }

    .nav-toggle {
        display: flex !important;
        flex-shrink: 0;
        margin-left: auto;
        border: 1px solid rgba(0, 91, 91, 0.14);
        border-radius: 12px;
        background: #fff;
    }

    .nav-toggle span,
    .home-page:not(.header-scrolled) .nav-toggle span {
        background: var(--teal-3, #063f43) !important;
    }

    .nav-apply,
    .ask-ai-item,
    .ask-ai-nav,
    .navbar > .ask-ai-nav {
        display: none !important;
    }

    .nav-links:not(.open) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .nav-links.open {
        display: grid !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}
