/* ============================================================
   MANOVIKAS / MIHE — Design System
   Plain CSS. No framework. No plugins. Self-hostable.
   Brand from the approved Branding Framework.
   ============================================================ */

/* ---- Design tokens ---------------------------------------- */
:root {
  /* Brand */
  --blue:    #163A70;   /* Academic Blue  - primary */
  --navy:    #0D1B2A;   /* Deep Navy      - authority */
  --teal:    #2A9D8F;   /* Inclusive Teal - accessibility/action */
  --gold:    #E9C46A;   /* Development Gold - accent only */
  --paper:   #F8FAFC;   /* Soft White     - background */
  --ink:     #1F2937;   /* Charcoal       - body text */

  /* Support */
  --teal-dk: #1f7d72;
  --blue-dk: #0f2a52;
  --line:    #e2e8f0;
  --muted:   #5b6573;
  --card:    #ffffff;
  --gold-dk: #b8860b;

  /* Type */
  --display: "Merriweather", Georgia, "Times New Roman", serif;
  --body:    "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Scale */
  --maxw: 1140px;
  --gap: 1.5rem;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(13,27,42,.06), 0 2px 6px rgba(13,27,42,.05);
  --shadow:    0 6px 20px rgba(13,27,42,.08);
  --shadow-lg: 0 18px 50px rgba(13,27,42,.14);

  --fs-step: 0;          /* bumped by the accessibility text-size control */
  --base: calc(1.0625rem + (var(--fs-step) * 0.125rem));
  --lh: 1.65;
  --measure: 68ch;
}

/* ---- Reset ------------------------------------------------- */
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce){
  html { scroll-behavior: auto; }
  *,*::before,*::after { animation-duration:.001ms !important; transition-duration:.001ms !important; }
}
body {
  margin: 0;
  font-family: var(--body);
  font-size: var(--base);
  line-height: var(--lh);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); }
h1,h2,h3,h4 { font-family: var(--display); color: var(--navy); line-height: 1.18; font-weight: 700; }
p { max-width: var(--measure); }

/* ---- Accessibility helpers -------------------------------- */
.skip {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--gold); color: var(--navy); padding: .8rem 1.2rem;
  border-radius: 0 0 10px 0; font-weight: 700; text-decoration: none;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* High-contrast mode (toggled by a11y bar) */
body.contrast {
  --paper: #ffffff; --ink: #000000; --navy: #000000; --blue: #002b6b;
  --muted: #1a1a1a; --line: #000000; --card: #ffffff;
}
body.contrast .card,
body.contrast .panel { border: 2px solid #000; }

/* Easy-read mode: bigger text, short lines, calmer layout */
body.easyread {
  --base: 1.3rem; --lh: 1.9; --measure: 46ch;
}
body.easyread .complex-only { display: none; }
.easy-only { display: none; }
body.easyread .easy-only { display: block; }
body.easyread .grid-3,
body.easyread .grid-2,
body.easyread .grid-4 { grid-template-columns: 1fr; }

/* ---- Layout ------------------------------------------------ */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.25rem; }
.section { padding-block: clamp(3rem, 6vw, 5.5rem); }
.section--tint { background:
    linear-gradient(180deg, #eef3fb 0%, var(--paper) 100%); }
.section--navy { background: var(--navy); color: #dbe4f0; }
.section--navy h2, .section--navy h3 { color: #fff; }
.center { text-align: center; }
.lead { font-size: 1.18em; color: var(--muted); max-width: 60ch; }
.center .lead { margin-inline: auto; }
.eyebrow {
  display: inline-block; font-family: var(--body); font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; font-size: .74rem;
  color: var(--teal-dk); margin-bottom: .6rem;
}
.section--navy .eyebrow { color: var(--gold); }

.grid-2,.grid-3,.grid-4 { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2,1fr); }
.grid-3 { grid-template-columns: repeat(3,1fr); }
.grid-4 { grid-template-columns: repeat(4,1fr); }
@media (max-width: 900px){ .grid-3,.grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 620px){ .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; } }

/* ---- Buttons ----------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--body); font-weight: 600; font-size: 1rem;
  padding: .8rem 1.4rem; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; min-height: 48px; line-height: 1;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--gold  { background: var(--gold); color: var(--navy); box-shadow: var(--shadow-sm); }
.btn--gold:hover { background: #f1d488; }
.btn--teal  { background: var(--teal); color: #fff; }
.btn--teal:hover { background: var(--teal-dk); }
.btn--ghost { background: transparent; color: var(--blue); border-color: var(--blue); }
.section--navy .btn--ghost { color:#fff; border-color: rgba(255,255,255,.6); }
.btn--lg { font-size: 1.08rem; padding: 1rem 1.7rem; }

/* ---- Header / nav ------------------------------------------ */
.topbar {
  background: var(--navy); color: #cdd8e8; font-size: .85rem;
}
.topbar .wrap { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center;
  justify-content: space-between; padding-block: .45rem; }
.topbar a { color: #cdd8e8; text-decoration: none; }
.topbar a:hover { color: #fff; text-decoration: underline; }
.topbar .tb-links { display: flex; gap: 1.1rem; flex-wrap: wrap; }

.masthead {
  position: sticky; top: 0; z-index: 100; background: rgba(248,250,252,.92);
  backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--line);
}
.masthead .wrap { display: flex; align-items: center; gap: 1.5rem; padding-block: .7rem; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand .mark {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  background: radial-gradient(120% 120% at 30% 20%, var(--teal) 0%, var(--blue) 70%);
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.brand .mark svg { width: 26px; height: 26px; }
.brand b { font-family: var(--display); color: var(--navy); font-size: 1.25rem; letter-spacing: .01em; }
.brand span { display: block; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-dk); font-weight: 700; }

.mainnav { margin-left: auto; }
.mainnav ul { list-style: none; display: flex; gap: .3rem; margin: 0; padding: 0; }
.mainnav a {
  display: block; padding: .55rem .75rem; border-radius: 8px; text-decoration: none;
  color: var(--navy); font-weight: 500; font-size: .97rem;
}
.mainnav a:hover, .mainnav a[aria-current="page"] { background: #e7eefb; color: var(--blue); }
.nav-cta { display: flex; gap: .5rem; align-items: center; }

.navtoggle { display: none; }
@media (max-width: 980px){
  .mainnav { display: none; width: 100%; margin: 0; }
  .mainnav.open { display: block; }
  .mainnav ul { flex-direction: column; }
  .masthead .wrap { flex-wrap: wrap; }
  .navtoggle { display: inline-flex; margin-left: auto; }
}

/* ---- Accessibility toolbar -------------------------------- */
.a11ybar {
  background: var(--teal); color: #fff;
}
.a11ybar .wrap { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center;
  justify-content: center; padding-block: .4rem; }
.a11ybar span.lbl { font-weight: 700; font-size: .8rem; letter-spacing: .04em; }
.a11ybar button {
  font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
  background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.4);
  padding: .3rem .7rem; border-radius: 999px; min-height: 34px;
}
.a11ybar button:hover { background: rgba(255,255,255,.3); }
.a11ybar button[aria-pressed="true"] { background:#fff; color: var(--teal-dk); }

/* ---- Hero -------------------------------------------------- */
.hero { position: relative; overflow: hidden; background: var(--navy); color: #e7eefb; }
.hero::before {
  content:""; position:absolute; inset:0;
  background:
    radial-gradient(60% 80% at 80% 10%, rgba(42,157,143,.45) 0%, transparent 60%),
    radial-gradient(50% 70% at 10% 90%, rgba(22,58,112,.7) 0%, transparent 60%),
    linear-gradient(160deg, #0d1b2a 0%, #143257 100%);
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.1fr .9fr;
  gap: 2.5rem; align-items: center; padding-block: clamp(3rem,7vw,6rem); }
@media (max-width: 900px){ .hero .wrap { grid-template-columns: 1fr; } }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 5vw, 3.4rem); margin: .2rem 0 1rem; }
.hero p { color: #cdd9ec; font-size: 1.18rem; max-width: 52ch; }
.hero .cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }
.hero-figure {
  border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg);
  aspect-ratio: 4/3; position: relative;
}

/* Image placeholder system (swap for real photos) */
.ph {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, var(--blue) 0%, var(--teal) 100%);
  color: #fff; display: grid; place-items: center; text-align: center;
  font-size: .82rem; padding: 1rem; gap:.3rem; aspect-ratio: 4/3;
}
.ph small { opacity: .85; font-size: .72rem; max-width: 26ch; }
.ph svg { width: 40px; height: 40px; opacity: .9; }

/* ---- Stat / KPI cards -------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
@media (max-width: 760px){ .stats { grid-template-columns: repeat(2,1fr); } }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem; text-align: center; box-shadow: var(--shadow-sm);
}
.stat .num { font-family: var(--display); font-size: 2.2rem; color: var(--blue); font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: .9rem; margin-top: .2rem; }
.stat .trend { font-size: .78rem; font-weight: 700; color: var(--teal-dk); margin-top:.35rem; }

/* ---- Generic card ----------------------------------------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s;
  display: flex; flex-direction: column; gap: .6rem; height: 100%;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .ico {
  width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center;
  background: #e7f4f2; color: var(--teal-dk); margin-bottom: .3rem;
}
.card .ico svg { width: 28px; height: 28px; }
.card h3 { font-size: 1.18rem; margin: 0; }
.card p { font-size: .96rem; color: var(--muted); margin: 0; }
.card .more { margin-top: auto; font-weight: 600; color: var(--blue); text-decoration: none; display: inline-flex; gap: .3rem; }
.card .more:hover { text-decoration: underline; }

/* School cards get a colour spine */
.card--school { border-top: 5px solid var(--teal); }
.tag { display:inline-block; font-size:.72rem; font-weight:700; letter-spacing:.06em;
  text-transform:uppercase; color:var(--teal-dk); background:#e7f4f2; padding:.2rem .55rem; border-radius:6px; }

/* ---- Credibility strip ------------------------------------ */
.cred { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; }
.cred .chip {
  border: 1px solid var(--line); background: var(--card); border-radius: 10px;
  padding: .55rem 1rem; font-weight: 600; font-size: .9rem; color: var(--navy);
  box-shadow: var(--shadow-sm);
}

/* ---- Continuum / steps ------------------------------------ */
.steps { display: grid; grid-template-columns: repeat(5,1fr); gap: 1rem; counter-reset: s; }
@media (max-width: 900px){ .steps { grid-template-columns: 1fr; } }
.step { position: relative; background: var(--card); border:1px solid var(--line);
  border-radius: var(--radius); padding: 1.3rem 1.1rem; box-shadow: var(--shadow-sm); }
.step::before {
  counter-increment: s; content: counter(s);
  font-family: var(--display); font-weight: 700; color: #fff; background: var(--blue);
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1rem; margin-bottom: .6rem;
}
.step h4 { margin: 0 0 .2rem; font-size: 1.02rem; }
.step p { font-size: .88rem; color: var(--muted); margin: 0; }

/* ---- Callout / donate band -------------------------------- */
.band {
  background: linear-gradient(135deg, var(--blue) 0%, var(--teal-dk) 100%);
  color: #fff; border-radius: 20px; padding: clamp(1.8rem,4vw,3rem);
  display: grid; grid-template-columns: 1.4fr .9fr; gap: 2rem; align-items: center;
  box-shadow: var(--shadow-lg);
}
@media (max-width: 800px){ .band { grid-template-columns: 1fr; } }
.band h2 { color: #fff; }
.band p { color: #e6f3f1; }

/* ---- Forms (apply / engage) ------------------------------- */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; color: var(--navy); }
.field .hint { font-size: .82rem; color: var(--muted); margin: 0 0 .35rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; padding: .7rem .8rem; border: 2px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink); min-height: 48px;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); outline: none; }
.field .err { color: #b91c1c; font-size: .85rem; font-weight: 600; }

/* ---- Tables (dashboard) ----------------------------------- */
.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.table th, .table td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line); font-size: .94rem; }
.table th { background: #eef3fb; color: var(--navy); font-family: var(--body); font-weight: 700; }
.bar { height: 10px; border-radius: 6px; background: var(--teal); }

/* ---- Footer ------------------------------------------------ */
.foot { background: var(--navy); color: #aebcd0; padding-block: 3rem 1.5rem; font-size: .92rem; }
.foot a { color: #cdd8e8; text-decoration: none; }
.foot a:hover { color:#fff; text-decoration: underline; }
.foot h4 { color: #fff; font-family: var(--body); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 .8rem; }
.foot .cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
@media (max-width: 820px){ .foot .cols { grid-template-columns: 1fr 1fr; } }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.foot .legal { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2rem; padding-top: 1.2rem;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-size: .82rem; }

/* ---- Reveal on load --------------------------------------- */
.reveal { opacity: 0; transform: translateY(14px); animation: rise .7s ease forwards; }
.reveal:nth-child(2){ animation-delay:.08s } .reveal:nth-child(3){ animation-delay:.16s }
.reveal:nth-child(4){ animation-delay:.24s } .reveal:nth-child(5){ animation-delay:.32s }
@keyframes rise { to { opacity: 1; transform: none; } }

/* breadcrumb */
.crumb { font-size: .85rem; color: var(--muted); padding-block: 1rem 0; }
.crumb a { color: var(--blue); text-decoration: none; }

/* ---- Real logo image (replaces the SVG mark) ---------------- */
.brand img.logo { height: 52px; width: auto; display: block; }
.foot .brand img.logo { height: 56px; }
@media (max-width: 600px){ .brand img.logo { height: 44px; } }
/* school icon sizing when used as <img> */
.card .ico img, .ico img.school-ico { width: 100%; height: 100%; }
.card .ico.bare { background: transparent; padding: 0; }
.hero-figure img { width:100%; height:100%; object-fit: cover; }
.photo { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.photo img { width:100%; height:100%; object-fit: cover; aspect-ratio: 4/3; }
