/* Scolavia — one stylesheet. The only script is theme.js, the light and dark switch. Colours are tokens so both themes stay in step. */
/* Inter, served from this site (SIL Open Font License, fonts/Inter-LICENSE.txt). "optional": shown when it arrives in
   time (it is preloaded), otherwise the page keeps the size-matched fallback below, so text never reflows. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: optional; src: url(/fonts/inter-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: optional; src: url(/fonts/inter-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Arial sized to Inter's metrics: the page keeps its line breaks while Inter loads. */
@font-face { font-family: "Inter Fallback"; src: local("Arial"), local("Helvetica"); size-adjust: 107.12%; ascent-override: 90.44%; descent-override: 22.52%; line-gap-override: 0%; }
:root {
  /* Plum and amber. Plum is the brand; amber marks what matters most on a page:
     a deadline that is near, and the one main action. */
  --bg: #faf7fb; --surface: #ffffff; --ink: #241a2b; --muted: #6a5f70; --line: #e8dfec;
  --brand: #5b2a6e; --brand-ink: #ffffff; --link: #6b2f84;
  --accent: #f2a900; --accent-ink: #2a1c00; --accent-deep: #8a5a00;
  --open-bg: #e2f4ea; --open-ink: #17603a; --soon-bg: #fdefc8; --soon-ink: #7a5200; --closed-bg: #eeebf0; --closed-ink: #5f5866;
  --full-bg: #efe3f4; --full-ink: #5b2a6e; --err-bg: #fde7e7; --err-ink: #8f1d1d;
  --radius: 12px; --shadow: 0 1px 2px rgba(36, 26, 43, .06), 0 4px 14px rgba(36, 26, 43, .05);
  /* Depth: fields sit a step below the card they are in, controls get a firmer outline, cards lift on hover. */
  --field: #ffffff; --line-strong: #cfc3d6; --surface-hover: #fdfbfe; --tint: #f6eef9; --top: #ffffff;
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236a5f70' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --font: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --head: var(--font);
  color-scheme: light;
}
/* Dark theme. Light is what everyone sees by default; this applies only when the footer switch is set to Dark, or to
   Auto on a dark device (theme.js sets data-theme="dark"). Built the way Bidavia's is: a soft dim page with lighter
   cards, crisp near-white text, brand and accent kept strong, and tags as a translucent tint with bright text. */
:root[data-theme="dark"] {
  --bg: #1f1a29; --surface: #2a2337; --ink: #f8f7fb; --muted: #c3bacf; --line: #40364f;
  --brand: #8747a8; --brand-ink: #ffffff; --link: #d9b8f7;
  --accent: #f5a70a; --accent-ink: #2a1c00; --accent-deep: #fcd34d;
  --open-bg: rgba(16, 185, 129, .16); --open-ink: #6ee7b7; --soon-bg: rgba(245, 158, 11, .18); --soon-ink: #fcd34d;
  --closed-bg: rgba(255, 255, 255, .08); --closed-ink: #c3bacf;
  --full-bg: rgba(167, 139, 250, .2); --full-ink: #dccbff; --err-bg: rgba(248, 113, 113, .16); --err-ink: #fca5a5;
  --shadow: 0 24px 50px -34px rgba(0, 0, 0, .6);
  --field: #221c2e; --line-strong: #5d5072; --surface-hover: #30283f; --tint: #2f2640; --top: #1a1522;
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23c3bacf' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16.5px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--head); letter-spacing: -0.02em; line-height: 1.2; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.7rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.small { font-size: .88rem; color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 5; }
.skip:focus { left: 8px; }

.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 9px; font: 750 1.28rem var(--head); letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.mark { flex: none; display: block; }
.mark-bg { fill: var(--brand); }
.mark-s { fill: none; stroke: var(--brand-ink); stroke-width: 3.1; stroke-linecap: round; stroke-linejoin: round; }
.mark-dot { fill: var(--accent); }
.brand .via { color: var(--link); }
.top nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; font-size: .95rem; }
.top nav a { text-decoration: none; color: var(--ink); }
.top nav a:hover { text-decoration: underline; }
.top nav .lang { border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; }

::placeholder { color: var(--muted); opacity: .85; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hero { padding: 26px 0 8px; }
.hero h1 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); margin-bottom: .25em; }
.lead { font-size: 1.02rem; color: var(--muted); max-width: 64ch; }
label { display: block; font-size: .9rem; font-weight: 600; }
input[type="search"], input[type="email"], input[type="text"], select {
  display: block; width: 100%; padding: 11px 12px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-height: 46px;
}
label > input, label > select { margin-top: 5px; }
.search label > input, .search label > select { margin-top: 0; }
button, .btn {
  display: inline-block; font: 600 1rem/1 var(--font); padding: 14px 20px; min-height: 46px; border-radius: 10px;
  border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none;
}
button:hover, .btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--link); border-color: var(--line); }
/* The one main action on a page: the official link on a scholarship page, and "Alert me". */
.btn.main, .alert button { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.hero h1::after { content: ""; display: block; width: 56px; height: 4px; border-radius: 2px; background: var(--accent); margin-top: 10px; }
.row.soon { box-shadow: inset 4px 0 0 var(--accent), var(--shadow); }
.row.soon .when .day { color: var(--accent-deep); }
.strip.soon .key time { color: var(--accent-deep); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline-color: var(--accent); }
.search { display: grid; grid-template-columns: 1fr 180px 180px auto; gap: 10px; margin-top: 14px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: .95rem; }
.check input { width: 18px; height: 18px; margin-top: 3px; flex: none; }

.list { padding: 14px 0 46px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.chip { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); text-decoration: none; font-size: .92rem; font-weight: 600; white-space: nowrap; }
.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chips.fields { margin-top: -8px; }
.chips.fields .chip { font-weight: 400; padding: 5px 12px; font-size: .88rem; }
.tags .warn { color: var(--soon-ink); font-weight: 600; }
.alert { margin: 14px 0 0; padding: 14px 16px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.alert h3 { font: 700 1rem/1.3 var(--font); margin: 0 0 10px; }
.alert .line { display: flex; gap: 10px; max-width: 520px; }
.alert .line .grow { flex: 1; }
.alert .line input { margin-top: 0; }
.alert .check { margin-top: 10px; font-size: .88rem; color: var(--muted); }
.alert .notice { margin: 0; }
.chips .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.list h2 { font-size: 1.25rem; margin-bottom: .2em; }
.list h2 .sub { font: 400 1rem var(--font); color: var(--muted); white-space: nowrap; }
.list h2 .clear { font: 400 .92rem var(--font); margin-left: 10px; }
.group { margin-top: 22px; }
.group > h3, .group summary h3 { font: 700 .82rem var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.group .n { font-weight: 400; }
.group summary { cursor: pointer; padding: 6px 0; }
.group summary h3 { display: inline; }
/* Each scholarship is its own card, with space between them. */
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.row { display: grid; grid-template-columns: 132px 1fr; gap: 16px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.when { display: flex; flex-direction: column; line-height: 1.2; }
.when .day { font: 700 1.6rem var(--head); }
.when .my { font-size: .88rem; color: var(--muted); }
.when .left { margin-top: 5px; font-size: .78rem; font-weight: 600; color: var(--open-ink); }
.row.soon .when .left, .strip.soon .left { color: var(--soon-ink); background: var(--soon-bg); }
.row.soon .when .left { align-self: flex-start; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.row.past .when, .row.past .when .left { color: var(--closed-ink); }
.row.tba .when .my { font-weight: 600; font-size: .85rem; color: var(--muted); }
.strip .tba-v { font-weight: 700; color: var(--muted); }
.what { min-width: 0; }
.what h4 { font: 700 1.05rem/1.3 var(--head); margin: 0 0 3px; }
.what h4 a { color: var(--ink); text-decoration: none; }
.what h4 a:hover { text-decoration: underline; color: var(--link); }
.what .sum { color: var(--muted); font-size: .92rem; margin: 0 0 7px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; margin: 0; font-size: .86rem; color: var(--muted); }
.cov { font-size: .8rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--line); color: var(--muted); }
.cov-full { background: var(--full-bg); color: var(--full-ink); border-color: transparent; }
dt { color: var(--muted); }
dd { margin: 0; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 26px; text-align: center; margin-top: 18px; }

.prog { padding: 24px 0 50px; }
.prog h1 { font-size: clamp(1.5rem, 3.8vw, 2.1rem); }
.prog h2 { margin-top: 1.6em; font-size: 1.15rem; }
.crumb { font-size: .95rem; }
.crumb a { text-decoration: none; }
.short { color: var(--muted); font-weight: 400; }
.strip { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.3fr; margin: 18px 0 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.strip > div { padding: 14px 16px; border-left: 1px solid var(--line); min-width: 0; }
.strip > div:first-child { border-left: 0; }
.strip dt { font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 4px; }
.strip dd { font-weight: 600; overflow-wrap: anywhere; }
.strip .key time { display: block; font: 700 1.2rem var(--head); }
.strip .left { display: inline-block; margin-top: 5px; font-size: .8rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--open-bg); color: var(--open-ink); }
.strip.past .left { background: var(--closed-bg); color: var(--closed-ink); }
.facts { margin: 10px 0 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.facts div { display: grid; grid-template-columns: 200px 1fr; gap: 14px; padding: 13px 18px; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; }
.facts dd { overflow-wrap: anywhere; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0 22px; }

.waitlist { background: var(--surface); border-top: 1px solid var(--line); padding: 44px 0; }
.waitlist form { display: grid; gap: 14px; margin-top: 18px; }
.waitlist .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.waitlist button { justify-self: start; }
.opt { font-weight: 400; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 12px 14px; border-radius: 10px; font-weight: 600; }
.notice.ok { background: var(--open-bg); color: var(--open-ink); }
.notice.err { background: var(--err-bg); color: var(--err-ink); }

.foot { border-top: 1px solid var(--line); padding: 26px 0 40px; font-size: .88rem; color: var(--muted); }

/* ---- Polish: fields, controls and depth. Written with tokens so both themes get it. ---- */
.top { background: var(--top); }
input[type="search"], input[type="email"], input[type="text"], select {
  background-color: var(--field); border-color: var(--line-strong); transition: border-color .15s, box-shadow .15s;
}
input[type="search"]:hover, input[type="email"]:hover, select:hover { border-color: var(--muted); }
input[type="search"]:focus, input[type="email"]:focus, input[type="text"]:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: var(--arrow); background-repeat: no-repeat; background-position: right 13px center; }
input[type="checkbox"] { accent-color: var(--brand); }
.check input { appearance: none; -webkit-appearance: none; border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--field); display: inline-grid; place-content: center; }
.check input:checked { background: var(--brand); border-color: var(--brand); }
.check input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--brand-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translateY(-1px); }
.check input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button, .btn { transition: filter .15s, transform .05s; }
button:active, .btn:active { transform: translateY(1px); }
.chip { transition: border-color .15s, background-color .15s; }
.chip:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.chip.on:hover { background: var(--brand); border-color: var(--brand); filter: brightness(1.08); }
.row { transition: border-color .15s, background-color .15s; }
.row:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.cov { border-color: var(--line-strong); }
.alert { border: 1px solid var(--line); background: var(--tint); }
.waitlist { background: var(--top); }
.group summary { border-radius: 8px; }
.group summary:hover h3 { color: var(--ink); }
.empty { border-color: var(--line-strong); }
.top nav .lang { border-color: var(--line-strong); }
.top nav .lang:hover { background: var(--surface-hover); text-decoration: none; }

/* Light / Dark / Auto switch in the footer (theme.js fills it; hidden when scripts are off). */
.theme-sw { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--field); margin-top: 6px; }
.theme-sw button { min-height: 0; padding: 6px 13px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 600 .82rem/1 var(--font); }
.theme-sw button:hover { color: var(--ink); filter: none; }
.theme-sw button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }

@media (max-width: 700px) {
  body { font-size: 16px; }
  .hero { padding: 18px 0 4px; }
  .lead { display: none; }
  .prog .lead { display: block; }
  /* Search box and button share the first line; the two country lists share the second. */
  .search { display: flex; flex-wrap: wrap; gap: 8px; }
  .search .grow { flex: 1 1 55%; min-width: 0; order: 1; }
  .search button { order: 2; flex: 0 0 auto; padding: 14px 16px; }
  .search label:not(.grow) { order: 3; flex: 1 1 calc(50% - 4px); min-width: 0; }
  .chips.fields { margin-top: -6px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px; scrollbar-width: none; }
  /* The date moves above the name, on one line, so long names get the full width. */
  .row { grid-template-columns: 1fr; gap: 4px; padding: 14px; }
  .rows { gap: 10px; }
  .when { flex-direction: row; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .when .day { font-size: 1.15rem; }
  .when .left { margin-top: 0; font-size: .8rem; }
  .row.soon .when .left { padding: 1px 8px; }
  .what h4 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .what .sum { -webkit-line-clamp: 2; }
  .strip { grid-template-columns: 1fr 1fr; }
  .strip > div { border-left: 0; border-top: 1px solid var(--line); }
  .strip > div:nth-child(-n+2) { border-top: 0; }
  .strip > div:nth-child(even) { border-left: 1px solid var(--line); }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
  .waitlist .pair { grid-template-columns: 1fr; }
  .actions .btn { flex: 1 1 100%; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
