:root {
    --primary-color: #1A73E8;
    --primary-hover: #1557b0;
    --primary-color-rgb: 26, 115, 232;
    --text-light: #4b5563;
    --text-dark: #1f2937;
    /* Matches the main website's navbar min-height (68px). --navbar-height is
       set at runtime from the bar's measured height and drives the mobile
       backdrop offset and the collapse panel's max-height. */
    --min-navbar-height: 68px;

    /* Typography scale — mirrors the main website's src/index.css so the
       server-rendered pages and the React app share one set of steps.
       Keep the two in sync. */
    --text-xs: 0.75rem;    /* 12px — labels, tags */
    --text-sm: 0.875rem;   /* 14px — secondary body */
    --text-base: 1rem;     /* 16px — primary body */
    --text-lg: 1.125rem;   /* 18px — large body / subheadings */
    --text-xl: 1.375rem;   /* 22px — card titles */
    --text-2xl: clamp(1.4rem, 1.05rem + 1.6vw, 1.75rem);   /* 22.4 → 28px */
    --text-3xl: clamp(1.6rem, 1.1rem + 2.2vw, 2.25rem);    /* 25.6 → 36px */
    --text-4xl: clamp(1.9rem, 4vw, 2.75rem);               /* hero-level */
}

/* Metric-matched local fallback for Montserrat. The Google Fonts stylesheet
   uses font-display: swap, so before the webfont arrives text is painted with
   the fallback and then reflows when it swaps — a Cumulative Layout Shift.
   Matching the fallback's metrics (here Arial, computed from Montserrat's
   units: size-adjust 113.55%, ascent 85.25%, descent 22.10%) keeps the line
   boxes the same size during the swap. */
@font-face {
    font-family: "Montserrat Fallback";
    src: local("Arial"), local("Helvetica Neue"), local("Roboto"), local("Liberation Sans");
    size-adjust: 113.55%;
    ascent-override: 85.25%;
    descent-override: 22.10%;
    line-gap-override: 0%;
}

body {
    font-family: "Montserrat", "Montserrat Fallback", sans-serif;
}

/* CLS: reserve space for the scholarship hero banner before its (remote,
   variably-sized) image loads. 16:9 matches the observed banner ratios; the
   image is contained (letterboxed, never cropped). Shadow/rounding live on the
   wrapper so the clipping doesn't cut the shadow off. */
.sch-hero-banner {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 800px;
    overflow: hidden;
    border-radius: 0.375rem;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
    background: #f3f4f6;
}

.sch-hero-banner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* CLS: same reservation for the 16:9 blog feature image. */
.blog-feature-banner {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 0.375rem;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
    background: #f3f4f6;
}

.blog-feature-banner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* CLS: the followers count is swapped in by htmx on load; reserve room so the
   appearing number doesn't nudge the meta row. */
.sch-follower-count {
    display: inline-block;
    min-width: 1.5rem;
    text-align: right;
}

/* CLS: Google Translate injects a banner iframe and offsets <body> after load.
   The custom language dropdown drives translation, so neutralise the injected
   banner/offset so it can't shift the page. */
body {
    top: 0 !important;
}

.goog-te-banner-frame,
iframe.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate {
    display: none !important;
}

.goog-tooltip,
.goog-tooltip:hover {
    display: none !important;
}

.goog-text-highlight {
    background: none !important;
    box-shadow: none !important;
}

.scrollToTopButton {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: white;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border: none;
    transition: background-color 0.3s, transform 0.2s;
}

.scrollToTopButton:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
}

.applyButton {
    border: none;
    font-size: 18px !important;
    padding: 10px 20px;
    cursor: pointer;
    color: white;
}

.applyButton:hover {
    transform: scale(1.1);
    transition: transform 0.1s;
    text-decoration: underline;
}

/* Markdown tables can carry more columns than a phone can show. Making the
   table its own scroll container keeps the overflow local — otherwise a wide
   table widens the layout viewport and the browser zooms the whole page out. */
.sch-content table,
.blog-content table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.sch-content table th,
.blog-content table th {
    border: 1px solid #ddd;
    padding: 8px;
    background-color: #e5e5e5;
    font-weight: bold;
    text-align: left;
}

.sch-content table td,
.blog-content table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}


.sch-content,
.blog-content {
    font-size: var(--text-base);
    line-height: 1.6;
    overflow-wrap: break-word;
}

/* Editor-pasted media carries intrinsic width/height attributes, which push the
   page wider than the viewport on small screens. Reset height alongside
   max-width so the aspect ratio survives the clamp. */
.sch-content img,
.sch-content video,
.sch-content iframe,
.blog-content img,
.blog-content video,
.blog-content iframe {
    max-width: 100%;
    height: auto;
}

/* NAVBAR */
/* Ported from the main website's
   src/components/front-page/navbar/navbar.module.css. The CSS-module class
   names (navList, navActions, navbarToggler, hamburgerBar, navBackdrop …) are
   kept verbatim so the two files stay diffable — keep them in sync.
   Rules that would otherwise hit the page-level CTAs are scoped under .navbar:
   e.html/s.html reuse the bare .loginButton class for their Apply buttons. */

/* Logo sizing lives here and in the three width overrides at the end of the
   navbar block (1199.98px / 768px / 360px) — one rule per breakpoint, nothing
   else in the file touches it. Keep desktop height under ~52px: the mark is
   ~4.6:1, so extra height costs a lot of width and crowds the nav links. */
.logo {
    width: auto;
    height: 48px;
    max-height: 48px;
    aspect-ratio: 345 / 75;
    object-fit: contain;
    cursor: pointer;
    /* Allow shrinking on tight desktop widths (1200-1240px) so the centered
       link list can't push the actions past the right edge. The mobile
       overrides below re-pin it with min-width so it never collapses there. */
    min-width: 0;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.02);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    min-height: var(--min-navbar-height);
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid #f3f4f6;
    box-shadow: none !important;
}

nav ul {
    display: flex;
    gap: clamp(0.5rem, 1vw, 1rem);
    list-style: none;
    white-space: nowrap;
    padding-left: 0;
    margin: 0;
}

nav li a {
    font-family: "Montserrat", "Montserrat Fallback", sans-serif;
    font-size: 0.875rem !important;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 1;
    color: var(--text-light) !important;
}

.navLink {
    position: relative;
    font-weight: 500;
    transition: color 0.2s ease, background-color 0.2s ease;
    padding: 8px 12px;
    border-radius: 6px;
}

.navLink:hover {
    color: var(--primary-color) !important;
    background-color: rgba(26, 115, 232, 0.06);
}

.navLinkActive {
    font-weight: 600;
    color: var(--primary-color) !important;
}

/* Bold underline indicator, inset to the text rather than the padding box */
.navLinkActive::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 12px;
    right: 12px;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 2px 2px 0 0;
}

/* Page-level CTA button (e.html / s.html Apply buttons use .loginButton and
   .loginButton--prominent). The navbar's own Sign In button overrides these
   below under .navbar, matching the main website's navbar-scoped module. */
.loginButton {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white !important;
    border: none;
    border-radius: 50px !important;
    padding: 0.5rem 1.5rem !important;
    font-weight: 600;
    box-shadow: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.loginButton::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.loginButton:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: none;
}

.loginButton:hover::before {
    left: 100%;
}

.loginButton--prominent {
    padding: 0.7rem 2.25rem !important;
    font-size: var(--text-base) !important;
    letter-spacing: 0.03em;
    box-shadow: 0 4px 18px rgba(var(--primary-color-rgb), 0.35) !important;
}

.loginButton--prominent:hover {
    box-shadow: 0 6px 24px rgba(var(--primary-color-rgb), 0.45) !important;
    transform: translateY(-3px);
}

.navbar .loginButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    height: 38px;
    padding: 0 18px !important;
    background: var(--primary-color);
    color: white !important;
    border: none;
    border-radius: 12px !important;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* The page-level .loginButton keeps a sweep highlight on ::before; the navbar
   button has no such layer, so make sure none is inherited here. */
.navbar .loginButton::before {
    content: none;
}

.loginButtonLabel {
    line-height: 1;
}

.loginButtonIcon {
    font-size: 1rem;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar .loginButton:hover .loginButtonIcon {
    transform: translateX(3px);
}

/* Visible keyboard focus ring (the flat fill alone gives no focus affordance).
   Needs to out-specify Bootstrap's own .btn:focus-visible shadow reset. */
.navbar .loginButton.loginButton:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.35), 0 2px 6px rgba(26, 115, 232, 0.24) !important;
}

.navbar .loginButton:active {
    background: var(--primary-hover);
    box-shadow: inset 0 1px 3px rgba(16, 24, 40, 0.18);
}

.loginButtonCompact {
    height: 34px;
    padding: 0 0.85rem !important;
    font-size: 0.82rem;
}

.navbar .loginButton:hover {
    background: var(--primary-hover);
    color: white !important;
    transform: none;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.32);
}

/* Center the links in the bar. Gap stays tight so the group reads as one
   cluster rather than stretching edge-to-edge. */
.navList {
    margin-left: auto;
    margin-right: auto;
    gap: 0.35rem;
}

.navbar-nav {
    flex-wrap: nowrap;
    align-items: center;
}

/* Thin rule separating the language switcher + CTA from the nav links */
@media (min-width: 1200px) {
    .navActions {
        position: relative;
        padding-left: 1rem;
        padding-right: 0.25rem;
        gap: 0.6rem !important;
    }

    .navActions::before {
        content: "";
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 1px;
        height: 24px;
        background-color: rgba(15, 23, 42, 0.12);
    }
}

.compactNav {
    gap: 0.5rem;
}

/* Desktop nav is wide (logo + 8 links + actions ≈ 1330px at full size).
   Tighten spacing on narrower desktops so the actions never overflow. */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    /* Links must be allowed to shrink here, otherwise the list pushes the
       actions past the right edge between 1200-1240px. Auto margins collapse
       to zero when space runs out, so centering never causes that overflow. */
    .navList {
        margin-left: auto;
        margin-right: auto;
        gap: 0;
        min-width: 0;
    }

    nav ul {
        gap: 0;
    }

    .navLink {
        padding: 0.5rem 0.35rem;
    }

    nav li a {
        font-size: 0.9rem !important;
    }

    .navbar .loginButton {
        height: 38px;
        padding: 0 1rem !important;
        font-size: 0.88rem;
    }

    .loginButtonIcon {
        display: none;
    }
}

/* Open the dropdown on hover for pointer devices. Click still works (Bootstrap
   handles it), and touch devices keep click-only since they have no hover. */
@media (min-width: 1200px) and (hover: hover) {
    .nav-item.dropdown:hover .dropdown-menu {
        display: block !important;
    }

    /* Bridge the gap between link and menu so the pointer can travel down
       without the menu closing. */
    .nav-item.dropdown::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        height: 10px;
    }
}

.nav-item.dropdown {
    position: relative;
}

.nav-item.dropdown .dropdown-menu {
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    padding: 0.5rem 0;
    min-width: 200px;
    overflow: hidden;
}

.dropdown-menu .dropdown-item {
    padding: 0.65rem 1.1rem;
    border-radius: 0;
    font-weight: 500;
    font-size: 14px;
    color: #333;
    transition: all 0.15s ease;
    margin: 0;
    border-left: 3px solid transparent;
}

.dropdown-menu .dropdown-item:hover {
    background-color: #f0f7ff;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.dropdown-menu .dropdown-item:active {
    background-color: #e8f0fe;
    color: var(--primary-color);
}

.navbarToggler {
    border: none;
    box-shadow: none !important;
    outline: none;
}

.navbarToggler:focus {
    box-shadow: none !important;
}

/* Mouse clicks stay ring-free (rules above), but keyboard focus must be
   visible. Placed after the :focus reset so its !important wins. */
.navbarToggler:focus-visible {
    outline: none;
    border-radius: 8px;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.35) !important;
}

.navBackdrop {
    display: none;
}

.hamburgerBox {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
}

.hamburgerBar {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background-color: var(--text-dark, #1f2937);
    transition: transform 0.3s ease, opacity 0.2s ease;
    transform-origin: center;
}

.navbarToggler[aria-expanded="true"] .hamburgerBar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.navbarToggler[aria-expanded="true"] .hamburgerBar:nth-child(2) {
    opacity: 0;
}

.navbarToggler[aria-expanded="true"] .hamburgerBar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* Google Translate Custom Dropdown Styles */
.translateWrapper {
    position: relative;
    display: inline-block;
    z-index: 1000;
}

/* Bridge the 8px gap between button and menu so hovering across it
   doesn't close the dropdown. */
.translateWrapper::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 10px;
}

/* Custom Dropdown Button */
/* Matches the navbar control scale: 36px tall, 0.875rem/500, 6px radius —
   same as the Sign In button and nav links. */
.dropdownButton {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 36px;
    background: transparent;
    border: 1px solid transparent;
    padding: 0 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    color: var(--text-light, #4b5563);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.dropdownButton:hover {
    background: rgba(26, 115, 232, 0.06);
    border-color: transparent;
    color: var(--primary-color, #1A73E8);
}

.dropdownButton:hover i.bi-globe2,
.dropdownButton:hover .chevron {
    color: var(--primary-color, #1A73E8);
}

.dropdownButton:focus-visible {
    outline: none;
    border-color: var(--primary-color, #1A73E8);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.25);
}

.dropdownButton i.bi-globe2 {
    font-size: 16px;
    color: #6b7280;
    transition: color 0.2s ease;
}

.langName {
    display: none;
}

@media (min-width: 768px) {
    .langName {
        display: inline;
    }
}

.chevron {
    font-size: 12px;
    transition: transform 0.2s ease;
    color: #666;
}

/* Dropdown Menu */
.dropdownMenu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    animation: dropdownSlide 0.2s ease;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menuContent {
    display: contents;
}

.menuHeader {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.menuList {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 0;
}

.menuList::-webkit-scrollbar {
    width: 6px;
}

.menuList::-webkit-scrollbar-track {
    background: transparent;
}

.menuList::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.menuList::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Menu Items */
.menuItem {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.menuItem:hover {
    background: #f0f7ff;
    border-left-color: var(--primary-color);
}

.menuItemActive {
    background: #e8f0fe;
    border-left-color: var(--primary-color);
}

.menuItemActive .langEnglish {
    color: var(--primary-color);
    font-weight: 600;
}

.langEnglish {
    font-size: 1.2rem;
    color: #333;
    font-weight: 500;
}

.langNative {
    font-size: 1.1rem;
    color: #888;
}

/* Hide Google Translate elements */
.goog-te-banner-frame {
    display: none !important;
}

.VIpgJd-ZVi9od-ORHb-OEVmcd {
    display: none !important;
}

.VIpgJd-ZVi9od-l4eHX-hSRGPd {
    display: none !important;
}

body {
    top: 0 !important;
    position: static !important;
}

iframe[id=":1.container"] {
    display: none !important;
}

.skiptranslate {
    display: none !important;
}

#google_translate_element_hidden {
    display: none !important;
}

/* Mobile styles for language selector */
@media (max-width: 991px) {
    .translateWrapper {
        position: static;
    }

    .dropdownButton {
        padding: 8px 10px;
        background: transparent;
        border-radius: 8px;
    }

    .dropdownButton i.bi-globe2 {
        font-size: 18px;
    }

    .chevron {
        font-size: 10px;
    }

    .dropdownMenu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        z-index: 99999;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        background: rgba(0, 0, 0, 0.5);
        animation: fadeIn 0.2s ease;
        box-shadow: none;
        border: none;
    }

    .menuContent {
        background: #ffffff;
        border-radius: 20px 20px 0 0;
        animation: slideUp 0.3s ease;
        overflow: hidden;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }

    .menuHeader {
        padding: 20px 16px;
        font-size: 14px;
        text-align: center;
        border-bottom: 1px solid #eee;
    }

    .menuList {
        max-height: 60vh;
        padding: 12px 0 32px;
        background: #ffffff;
        border-radius: 0 0 0 0;
    }

    .menuItem {
        padding: 16px 20px;
        border-radius: 0;
        margin: 0;
        border-left: none;
        border-bottom: 1px solid #f5f5f5;
    }

    .menuItem:last-child {
        border-bottom: none;
    }

    .menuItem:hover,
    .menuItemActive {
        background: #f0f7ff;
        border-left: none;
    }

    .langEnglish {
        font-size: 16px;
    }

    .langNative {
        font-size: 14px;
    }
}

/* ── Navbar responsive block (ported from navbar.module.css) ──
   Ordered widest → narrowest so the cascade resolves narrower-screen rules
   over wider ones without specificity tricks. */

@media (max-width: 1199.98px) {
    nav ul {
        gap: 0.5rem;
    }
}

/* Mobile: keep actions + hamburger on the top row, menu drops below */
@media (max-width: 1199.98px) {
    .navActions {
        order: 2;
        margin-left: auto !important;
        flex: 0 0 auto;
        gap: 0.25rem !important;
    }

    .navbar .loginButton {
        height: 36px;
        padding: 0 1rem !important;
        font-size: 0.85rem !important;
    }

    .navbarToggler {
        order: 3;
        flex: 0 0 auto;
        margin-left: 0.4rem !important;
        padding: 0.35rem;
        border: none;
        box-shadow: none !important;
    }

    /* Overlay the open menu so it doesn't grow the navbar height */
    .navbar.fixed-top .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08);
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
        padding: 0.5rem 1rem 1rem;
        z-index: 1021;
    }

    /* The panel hangs off a fixed navbar, so the page cannot scroll it into
       view. Cap it to the space below the bar and let it scroll internally,
       otherwise the last links are unreachable in landscape. */
    .navbar.fixed-top .navbar-collapse.show,
    .navbar.fixed-top .navbar-collapse.collapsing {
        max-height: calc(100vh - var(--navbar-height, 70px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .navbar-nav {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        text-align: center;
    }

    .navList {
        margin-left: 0;
        margin-right: 0;
    }

    .navbar-nav .nav-item {
        width: 100%;
    }

    /* 44px minimum tap target (iOS/WCAG floor) */
    .navbar-nav .navLink {
        display: block;
        padding: 0.7rem 0.5rem;
    }

    .navLinkActive::after {
        content: none;
    }

    .navBackdrop {
        display: block;
        position: fixed;
        top: var(--navbar-height, 70px);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 1019;
    }

    .navBackdropOpen {
        opacity: 1;
        visibility: visible;
    }

    /* Keep navbar content above the backdrop */
    .navbar.fixed-top > .container-fluid {
        position: relative;
        z-index: 1021;
    }
}

@media (max-width: 768px) {
    nav ul {
        gap: 16px;
        align-items: center;
    }

    .navbar.fixed-top {
        padding-top: 0.75rem !important;
        padding-bottom: 0.5rem !important;
    }

    .navbar {
        padding: 12px 16px;
    }

    .navbar .loginButton {
        height: 38px;
        padding: 0 16px !important;
        font-size: 0.9rem !important;
        margin-right: 0;
    }

    .navLink {
        padding: 8px;
    }
}

/* Very small phones: drop the arrow so the label keeps its full tap target */
@media (max-width: 400px) {
    .loginButtonIcon {
        display: none;
    }

    .navbar .loginButton {
        padding: 0 0.85rem !important;
    }
}

/* Logo width per breakpoint. These live together, last in the navbar block, so
   the cascade resolves narrower-screen rules over wider ones with no
   specificity tricks. max-height keeps the mark inside the navbar height. */
@media (max-width: 1199.98px) {
    .logo {
        width: 170px;
        min-width: 135px;
        height: auto;
        max-height: 46px;
    }
}

/* Phones: cap below the tablet size so the mark never touches the
   language/Sign In/hamburger cluster. */
@media (max-width: 768px) {
    .logo {
        width: 132px;
        min-width: 132px;
        max-height: 44px;
    }
}

/* Very small phones: step the logo down further and trim the actions
   cluster, otherwise the top row overflows ~6px at 320px. */
@media (max-width: 360px) {
    .logo {
        width: 112px;
        min-width: 112px;
    }

    .navbarToggler {
        margin-left: 0 !important;
        padding: 0.25rem;
    }

    .navbar .loginButton {
        padding: 0 0.7rem !important;
    }
}


/* ── Org page scholarship cards (mirrors card.module.css) ── */
.sch-card {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
  height: 315px;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.sch-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  border-color: var(--primary-color);
}

.sch-card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 0;
  min-height: 35px;
}

.sch-status-badge {
  font-size: 0.7rem;
  padding: 5px 10px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.sch-deadline-container {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  background: #f8f9fa;
  padding: 4px 10px;
  border-radius: 20px;
}

.sch-deadline-label {
  color: #6c757d;
  font-weight: 500;
}

.sch-deadline-date {
  font-weight: 700;
  color: #dc3545;
}

.sch-logo-container {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  margin: 4px 0;
}

.sch-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.sch-logo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sch-card:hover .sch-logo {
  transform: scale(1.05);
}

.sch-card-body {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
}

.sch-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 2.5rem;
}

.sch-info-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sch-info-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  color: #6c757d;
}

.sch-info-icon {
  color: var(--primary-color);
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1.4;
}

.sch-info-text {
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  height: 2.4rem;
}

.sch-card-footer {
  padding: 8px 16px 16px;
  background: white;
  margin-top: auto;
}

.sch-apply-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white !important;
  border: none;
  border-radius: 50px !important;
  padding: 0.5rem 1.5rem !important;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.sch-apply-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.sch-apply-btn:hover {
  transform: translateY(-2px);
  color: white;
}

.sch-apply-btn:hover::before {
  left: 100%;
}

@media (max-width: 768px) {
  .sch-card {
    height: auto;
    min-height: 360px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  }

  .sch-card-title {
    font-size: 1.1rem;
    height: auto;
    -webkit-line-clamp: 2;
  }

  .sch-info-row {
    font-size: 0.9rem;
  }

  .sch-info-text {
    height: 2.7rem;
    line-height: 1.5;
  }

  .sch-apply-btn {
    font-size: 1rem;
  }
}

/* ── Org page header ── */
.org-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.org-page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 4px;
  line-height: 1.2;
}

.org-page-desc {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 0;
  max-width: 600px;
}

.org-count-badge {
  flex-shrink: 0;
  background: rgba(var(--primary-color-rgb), 0.08);
  color: var(--primary-color);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-top: 6px;
}

.org-divider {
  border-color: rgba(var(--primary-color-rgb), 0.15);
  margin-top: 12px;
  margin-bottom: 0;
}

/* ── Scholarship detail page (s.html / e.html) ──
   Full-width page on the main website's type scale (src/index.css), matching
   the React detail page (sch-details.module.css): section headings
   --text-2xl, primary body --text-base, secondary text --text-sm, labels
   --text-xs. Heading steps are fluid clamps, so they scale with the viewport.
   Line height: 1.6 for reading text (the site's long-form value), 1.2-1.3
   for headings, 1.4 for short labels/values. Don't add
   Bootstrap fs-* utilities inside .sch-page; size text here instead. */
.sch-page {
    --sch-border: #e5e7eb;
    --sch-muted: #6b7280;
    --sch-surface: #f8fafc;
    --sch-text: #000;
    padding: 1.5rem 1rem 3rem;
    font-size: var(--text-base);
    color: var(--sch-text);
}

@media (min-width: 768px) {
    .sch-page {
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

/* Hero stacks on phones; from 768px the Apply button sits beside the title
   and the facts run in a single row, so the content starts higher up.
   Grid areas keep the DOM order (title, meta, facts, CTA) for mobile. */
.sch-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "title"
        "meta"
        "facts"
        "cta";
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--sch-border);
}

.sch-title      { grid-area: title; }
.sch-meta       { grid-area: meta; }
.sch-facts      { grid-area: facts; }
.sch-hero-cta   { grid-area: cta; }

@media (min-width: 768px) {
    .sch-hero {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "title cta"
            "meta  cta"
            "facts facts";
        column-gap: 2rem;
    }

    .sch-hero-cta {
        align-self: center;
        margin-bottom: 1.25rem;
    }

    .sch-hero .sch-facts {
        margin-bottom: 0;
    }
}

.sch-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--sch-text);
    margin-bottom: 0.5rem;
    text-wrap: balance;
}

/* Slug + followers line under the title (the React detail page also shows
   the slug here, as muted text). */
.sch-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    font-size: var(--text-sm);
    color: var(--sch-muted);
    margin-bottom: 1.25rem;
}

.sch-slug {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem 0.15rem 0.4rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--sch-text);
    background: var(--sch-surface);
    border: 1px solid var(--sch-border);
    border-radius: 6px;
}

.sch-slug .bi {
    color: var(--sch-muted);
}

.sch-followers {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.sch-followers .bi {
    color: var(--primary-color);
}

/* Key facts: one card. The 1px gap over a border-coloured background draws
   the dividers; items grow to fill each row, so wrapping never leaves an
   empty grey cell. */
.sch-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    background: var(--sch-border);
    border: 1px solid var(--sch-border);
    border-radius: 12px;
    overflow: hidden;
    margin: 0 0 1.25rem;
}

.sch-fact {
    flex: 1 1 180px;
    background: #fff;
    padding: 1rem 1.25rem;
}

/* "Who can apply" is free text, so it takes a wider column in the same row */
.sch-fact--wide {
    flex: 2 1 320px;
}

.sch-fact dt {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--sch-muted);
    margin-bottom: 0.25rem;
}

.sch-fact dt .bi {
    color: var(--primary-color);
}

.sch-fact dd {
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

.sch-fact--wide dd {
    font-size: var(--text-base);
    font-weight: 500;
}

.sch-section {
    padding: 2rem 0 0;
    scroll-margin-top: calc(var(--min-navbar-height) + 1rem);
}

.sch-section + .sch-section {
    border-top: 1px solid var(--sch-border);
    margin-top: 1.5rem;
}

.sch-section-heading {
    font-size: var(--text-2xl);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--sch-text);
    border-left: 4px solid var(--primary-color);
    padding-left: 0.75rem;
    margin-bottom: 1rem;
}

/* Admin-entered markdown: normalise everything it can produce to the page's
   scale so no section reads larger or smaller than its neighbours. */
.sch-page .sch-content {
    font-size: var(--text-base);
    color: var(--sch-text);
}

.sch-content > :last-child {
    margin-bottom: 0;
}

.sch-content p,
.sch-content ul,
.sch-content ol {
    margin: 0 0 0.6em;
}

.sch-content ul,
.sch-content ol {
    padding-left: 1.4rem;
}

.sch-content li {
    margin-bottom: 0.25em;
}

.sch-content li::marker {
    color: var(--primary-color);
}

.sch-content h1,
.sch-content h2,
.sch-content h3,
.sch-content h4,
.sch-content h5,
.sch-content h6 {
    font-size: var(--text-lg);
    font-weight: 600;
    line-height: 1.4;
    color: var(--sch-text);
    margin: 1.25em 0 0.4em;
}

/* Markdown **bold** and pasted <b> must look the same, and as heavy as
   before the rework (Bootstrap's bolder = 700). */
.sch-content strong,
.sch-content b {
    font-weight: 700;
    color: var(--sch-text);
}

.sch-content a {
    color: var(--primary-color);
    text-underline-offset: 2px;
}

.sch-hero-cta .loginButton,
.sch-apply-final .loginButton {
    display: inline-flex;
    align-items: center;
}

.sch-apply-final {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem 1.25rem;
    background: rgba(var(--primary-color-rgb), 0.05);
    border: 1px solid rgba(var(--primary-color-rgb), 0.12);
    border-radius: 14px;
}

.sch-apply-final-title {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.sch-apply-final-note {
    color: var(--sch-muted);
    margin-bottom: 1.25rem;
}

.sch-apply-final-title + .loginButton {
    margin-top: 0.85rem;
}

.sch-share {
    text-align: center;
    margin-top: 2.5rem;
}

.sch-share-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--sch-muted);
    margin-bottom: 0.9rem;
}

.sch-share-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.sch-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 40px;
    padding: 0 1rem;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-dark);
    background: #fff;
    border: 1px solid var(--sch-border);
    border-radius: 999px;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.sch-share-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.04);
}

.sch-share-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.3);
}

.sch-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 2.5rem;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
}

.sch-back-link:hover {
    text-decoration: underline;
}

/* Resources: one row per file, stacks on phones */
.sch-assets {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid var(--sch-border);
    border-radius: 12px;
    overflow: hidden;
}

.sch-asset {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1rem;
}

.sch-asset + .sch-asset {
    border-top: 1px solid var(--sch-border);
}

.sch-asset-icon {
    font-size: 1.4rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.sch-asset-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1;
}

.sch-asset .asset-title {
    font-weight: 600;
}

.sch-asset .asset-description,
.sch-asset .asset-size {
    font-size: var(--text-sm);
    color: var(--sch-muted);
}

.sch-asset-btn {
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .sch-fact {
        padding: 0.85rem 1rem;
    }

    .sch-fact:not(.sch-fact--wide) {
        flex-basis: 140px;
    }

    .sch-fact--wide {
        flex-basis: 100%;
    }

    .sch-hero-cta .loginButton {
        width: 100%;
        justify-content: center;
    }

    .sch-asset {
        flex-wrap: wrap;
    }

    .sch-asset-btn {
        margin-left: calc(1.4rem + 0.9rem);
    }
}

.sch-toc-card {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.sch-toc-header {
  padding: 10px 14px;
  background: #f8f9fa;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  font-size: 1.1rem;
  font-weight: 700;
  color: #2c3e50;
}

.sch-toc-body {
  padding: 6px 0;
}

.toc-link {
  display: block;
  padding: 7px 14px;
  font-size: 1.05rem;
  color: #495057;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}

.toc-link:hover {
  color: var(--primary-color);
  border-left-color: var(--primary-color);
  background: rgba(var(--primary-color-rgb), 0.04);
}

/* External scholarship apply modal (visitor capture + OTP) */
.applyModal {
  border: none;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.applyModal .modal-title {
  font-weight: 600;
}

.applyModal .form-label {
  font-weight: 500;
  font-size: 0.95rem;
}

.applyModal .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.15);
}

.applyModal .form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.apply-otp-digit {
  width: 56px;
  height: 60px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  padding: 0;
}

.apply-otp-digit:disabled {
  background-color: #f1f3f5;
}

@media (max-width: 400px) {
  .apply-otp-digit {
    width: 48px;
    height: 52px;
    font-size: 1.25rem;
  }
}


/* Popup modal (site_popups) - ported from the React site's popup-modal.module.css.
   Sits below .dropdownMenu's 99999 so the mobile language menu opens over it. */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-modal {
  position: relative;
  max-width: 520px;
  width: 90%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: popupPopIn 0.25s ease;
}

@keyframes popupPopIn {
  from { transform: scale(0.88); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.popup-image {
  display: block;
  width: 100%;
  cursor: pointer;
}

.popup-close-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background 0.15s;
}

.popup-close-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Scholarship FAQ (components/faq.html) */
.sch-faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sch-faq-item {
    background: #fff;
    border: 1.5px solid rgba(13, 110, 253, 0.08);
    border-radius: 12px;
    padding: 0.9rem 1.15rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

.sch-faq-q {
    font-weight: 600;
    font-size: var(--text-lg);
    cursor: pointer;
    list-style: none;
}

/* Swap the native disclosure marker for a chevron that flips when open */
.sch-faq-q::-webkit-details-marker {
    display: none;
}

.sch-faq-q::after {
    content: "\f282"; /* bootstrap-icons chevron-down */
    font-family: "bootstrap-icons";
    float: right;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.sch-faq-item[open] .sch-faq-q::after {
    transform: rotate(180deg);
}

.sch-faq-a {
    font-size: var(--text-base);
    margin: 0.6rem 0 0;
    line-height: 1.6;
}
