/* =========================
   HEADER BASE
========================= */
header {
    width: 100%;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* =========================
   HEADER CONTENT
========================= */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 16px;
    padding: 10px 0;
    min-width: 0; /* allow flex children to shrink instead of overflowing */
}

/* =========================
   LOGO
========================= */
.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo img {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
}

.logo h1 {
    font-size: clamp(12px, 1.1vw, 15px);
    line-height: 1.25;
    color: #0d3b66;
    font-weight: 700;
    letter-spacing: 0.2px;
    margin: 0;
    white-space: nowrap;
}

/* =========================
   NAVIGATION
========================= */
.nav-list {
    display: flex;
    list-style: none;
    gap: clamp(8px, 1.4vw, 25px);
    flex-wrap: nowrap;
    white-space: nowrap;
    min-width: 0;
}

.nav-list li {
    flex-shrink: 0;
}

.nav-list li a {
    text-decoration: none;
    color: #333;
    font-size: clamp(13px, 1.1vw, 17px);
    font-weight: 700;
    transition: 0.3s;
    position: relative;
    white-space: nowrap;
}

.nav-list li a:hover {
    color: #007bff;
}

.nav-list li a.active {
    color: #007bff;
    font-weight: 700;
}

/* =========================
   LANGUAGE SELECTOR
========================= */
.language-selector {
    flex-shrink: 0;
}

.language-selector select {
    padding: 6px 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 14px;
    cursor: pointer;
    background: #fff;
}

/* Mobile copy of the language selector lives inside the slide-out nav
   and stays hidden until the nav switches to hamburger mode */
.language-selector.mobile-lang {
    display: none;
}

/* =========================
   HAMBURGER MENU
========================= */
.menu-toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
    z-index: 1100; /* ensure above mobile menu */
}

.menu-toggle span {
    width: 24px;
    height: 3px;
    background: #333;
    margin: 0;
    border-radius: 2px;
    transition: 0.3s;
}

/* Hamburger animation */
.menu-toggle.is-open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.is-open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* =========================
   HERO / PAGE HEADER
========================= */
.page-header {
    background-color: #1e3a8a; /* blue */
    padding: 80px 20px 60px; /* top padding reduced */
    text-align: center;
    color: #ffffff;
    position: relative;
    z-index: 1;
    min-height: 300px; /* ensures hero height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(30, 58, 138, 0.85);
    z-index: -1;
}

.page-header .container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
}

.page-header h1 {
    font-size: 48px;
    margin-bottom: 15px;
    font-weight: 700;
    color: #ffffff;
    z-index: 2;
}

.page-header p {
    font-size: 20px;
    margin: 0;
    color: #ffffff;
    font-weight: 400;
    z-index: 2;
}

/* =========================
   RESPONSIVE: TABLET & MOBILE
   (nav switches to hamburger here,
   before items run out of room)
========================= */
@media (max-width: 1024px) {
    .page-header {
        padding: 60px 20px 40px;
    }
    .page-header h1 {
        font-size: 32px;
    }
    .page-header p {
        font-size: 16px;
    }

    .nav-list {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 25px;
        background: #fff;
        z-index: 1050;
        overflow-y: auto;
    }

    .nav-list.active {
        display: flex;
    }

    .nav-list li a {
        font-size: 18px;
    }

    .language-selector.mobile-lang {
        display: block;
        margin-top: 10px;
    }

    .language-selector.mobile-lang select {
        padding: 8px 14px;
        font-size: 15px;
    }

    /* Desktop language selector no longer needs to share the collapsed
       header row - it's shown inside the slide-out menu instead */
    .language-selector.desktop-lang {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }
}

/* =========================
   RESPONSIVE: SMALL MOBILE
========================= */
@media (max-width: 576px) {
    .page-header {
        padding: 50px 15px 30px;
    }
    .page-header h1 {
        font-size: 28px;
    }
    .page-header p {
        font-size: 14px;
    }

    header .container {
        padding: 0 16px;
    }

    .header-content {
        gap: 10px;
    }

    .logo img {
        width: 32px;
        height: 32px;
    }

    .language-selector select {
        padding: 5px 6px;
        font-size: 12px;
    }
}

/* =========================
   RESPONSIVE: VERY SMALL MOBILE
   (keep the full 2-line school name, just
   shrink it further so it still fits next
   to the icon and toggle button)
========================= */
@media (max-width: 400px) {
    .logo img {
        width: 28px;
        height: 28px;
    }
    .logo a {
        gap: 6px;
    }
    .logo h1 {
        font-size: 11px;
        line-height: 1.2;
    }
    .header-content {
        gap: 6px;
    }
}

@media (max-width: 340px) {
    .logo h1 {
        font-size: 10px;
    }
}

/* =========================
   SMOOTH TRANSITIONS
========================= */
.nav-list, .menu-toggle span {
    transition: all 0.3s ease-in-out;
}