/* ==========================================================
   TASPO – Tanzania Student Plan Organisation
   Main stylesheet
   ========================================================== */

:root {
  --ink: #1f3b4d;
  --ink-deep: #16303f;
  --ink-soft: #4a6272;
  --sand: #faf6ef;
  --sand-deep: #f2eadc;
  --ochre: #e8a33d;
  --ochre-deep: #b8741a;
  --leaf: #2f7d5b;
  --line: #e6ddcf;
  --white: #ffffff;
  --radius: 18px;
  --shadow: 0 14px 34px rgba(31, 59, 77, 0.10);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--sand);
  color: var(--ink);
  line-height: 1.7;
  font-size: 17px;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--ink); }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 246, 239, 0.94);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-logo { width: 48px; height: 48px; flex: none; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 21px; letter-spacing: 0.04em; line-height: 1.1; display: block; }
.brand-sub { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink-soft); letter-spacing: 0.02em; }

.nav { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav a {
  text-decoration: none; font-size: 15px; font-weight: 500; color: var(--ink);
  padding: 8px 14px; border-radius: 8px; transition: background .15s ease; white-space: nowrap;
}
.nav a:hover { background: var(--sand-deep); }
.nav a[aria-current="page"] { color: var(--ochre-deep); }
.nav .nav-cta { background: var(--ochre); color: var(--ink-deep); font-weight: 600; margin-left: 8px; }
.nav .nav-cta:hover { background: #f0b458; color: var(--ink-deep); }
.nav .nav-cta-dark { background: var(--ink); color: var(--white); white-space: nowrap; }
.nav .nav-cta-dark:hover { background: var(--ink-deep); color: var(--white); }
.nav .nav-cta-donate, .nav .nav-cta-donate[aria-current="page"] { background: var(--leaf); color: var(--white); }
.nav .nav-cta-donate:hover { background: #256a4c; color: var(--white); }
.nav .has-sub { position: relative; }
.nav .caret { font-size: .75em; margin-left: 2px; }
.nav .has-sub:has([aria-current="page"]) > a { color: var(--ochre-deep); }
.subnav {
  list-style: none; position: absolute; top: 100%; left: 0; z-index: 60; min-width: 180px;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 6px; display: none;
}
.has-sub:hover .subnav, .has-sub:focus-within .subnav { display: block; }
.subnav a { display: block; }

.menu-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; border-radius: 10px; color: var(--ink);
}
.menu-toggle svg { margin: 0 auto; }

@media (max-width: 1060px) {
  .menu-toggle { display: block; }
  .nav {
    position: absolute; top: 76px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--sand); border-bottom: 1px solid var(--line);
    padding: 8px 16px 20px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { display: block; padding: 14px 12px; font-size: 17px; }
  .nav .nav-cta { margin: 10px 0 0; text-align: center; }
  .subnav { display: block; position: static; min-width: 0; background: none; border: 0; box-shadow: none; padding: 0 0 0 16px; }
  .nav .caret { display: none; }
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.3rem, 5.5vw, 3.9rem); }
h2 { font-size: clamp(1.8rem, 3.8vw, 2.6rem); }
h3 { font-size: 1.35rem; }
.eyebrow {
  display: inline-block; font-size: 12.5px; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--ochre-deep); background: rgba(232, 163, 61, 0.14); padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}
.lead { font-size: clamp(1.07rem, 2vw, 1.22rem); color: var(--ink-soft); max-width: 60ch; }
.muted { color: var(--ink-soft); }
em.accent { font-style: normal; color: var(--ochre-deep); }

/* ---------- Buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 600; font-size: 15.5px; font-family: var(--sans);
  padding: 14px 26px; border-radius: 10px; border: 1.5px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: var(--ink-deep); }
.btn-ochre { background: var(--ochre); color: var(--ink-deep); }
.btn-ochre:hover { background: #f0b458; }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--white); }
.btn-light { border-color: rgba(255,255,255,.6); color: var(--white); background: transparent; }
.btn-light:hover { background: var(--white); color: var(--ink); }
.text-link { font-weight: 600; color: var(--ochre-deep); text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* ---------- Sections ---------- */
section { padding: 88px 0; }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head p { margin-top: 16px; }
.center { text-align: center; margin-left: auto; margin-right: auto; }
.bg-white { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bg-ink { background: var(--ink); color: var(--white); }
.bg-ink .lead, .bg-ink .muted { color: #c9d6de; }
.bg-ink .eyebrow { background: rgba(232,163,61,.18); color: var(--ochre); }

/* ---------- Hero ---------- */
.hero { padding: 80px 0 88px; }
.hero .wrap { display: grid; grid-template-columns: 1fr; gap: 56px; align-items: center; }
.hero .hero-photo-wrap { margin-top: 56px; }
.hero h1 { max-width: 14ch; }
.hero .lead { max-width: 62ch; margin-top: 24px; }

.page-hero { padding: 72px 0 56px; border-bottom: 1px solid var(--line); }
.page-hero h1 { max-width: 18ch; }
.page-hero .lead { margin-top: 20px; }

/* ---------- Illustrations ---------- */
.illustration {
  background: var(--white); border: 1px solid var(--line); border-radius: 24px;
  padding: 28px; box-shadow: var(--shadow);
}

/* ---------- Grids & cards ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid-2, .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; display: flex; flex-direction: column;
}
.card h3 { margin: 18px 0 10px; }
.card p { color: var(--ink-soft); }
.card .text-link { margin-top: auto; padding-top: 18px; }
.icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(232, 163, 61, 0.14); color: var(--ochre-deep);
}
.icon.leaf { background: rgba(47, 125, 91, 0.12); color: var(--leaf); }
.icon.ink { background: rgba(31, 59, 77, 0.08); color: var(--ink); }

/* Split feature */
.split { display: grid; grid-template-columns: 1fr; gap: 48px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } .split.reverse > :first-child { order: 2; } }
.split p + p { margin-top: 14px; }
.split p { color: var(--ink-soft); }
.split-photo { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.bg-ink .split p { color: #c9d6de; }

.checklist { list-style: none; margin-top: 22px; }
.checklist li { position: relative; padding-left: 34px; margin-top: 12px; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 5px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--leaf) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
}

/* Steps */
.steps { counter-reset: step; }
.step { position: relative; padding-top: 12px; }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--serif); font-weight: 700; font-size: 2.4rem; color: var(--ochre);
  display: block; line-height: 1; margin-bottom: 14px;
}
.step h3 { font-size: 1.2rem; margin-bottom: 8px; }
.step p { color: #c9d6de; font-size: 16px; }

/* Values */
.value { border-top: 3px solid var(--ochre); padding-top: 20px; }
.value h3 { font-size: 1.2rem; margin-bottom: 8px; }
.value p { color: var(--ink-soft); font-size: 16px; }

/* Team */
.person { text-align: left; }
.avatar {
  width: 72px; height: 72px; border-radius: 50%; background: var(--ink); color: var(--ochre);
  display: grid; place-items: center; font-family: var(--serif); font-size: 24px; font-weight: 700; margin-bottom: 16px;
}
.person h3 { font-size: 1.15rem; margin: 0; }
.person .role { color: var(--ochre-deep); font-weight: 600; font-size: 14px; margin: 4px 0 10px; }

/* Status badge */
.badge {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: rgba(47,125,91,.12); color: var(--leaf);
}
.badge.soon { background: rgba(232,163,61,.16); color: var(--ochre-deep); }

/* CTA band */
.cta-band { background: var(--ink); color: var(--white); border-radius: 26px; padding: clamp(36px, 6vw, 64px); text-align: center; }
.cta-band h2 { max-width: 22ch; margin: 0 auto; }
.cta-band p { color: #c9d6de; max-width: 56ch; margin: 18px auto 0; }
.cta-band .btn-row { justify-content: center; }

/* FAQ */
.faq details { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 20px 24px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--ochre-deep); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 12px; color: var(--ink-soft); }

/* Contact */
.contact-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.contact-card h3 { font-size: 1.15rem; margin-bottom: 6px; }
.contact-card p { color: var(--ink-soft); font-size: 16px; }
.contact-card a { font-weight: 600; }

/* ---------- Donate ---------- */
.donate-panel {
  max-width: 40rem; margin: 0 auto; padding: 40px 36px;
  background: var(--white); border: 6px solid #cfd6db; border-radius: var(--radius);
}
.donate-panel h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 14px 0 18px; }
.donate-panel p { color: var(--ink-soft); }
.donate-panel p + p { margin-top: 14px; }
.donate-button { margin: 28px 0 24px; min-height: 48px; font-size: 1.05rem; }
.donate-button:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; }
.donate-panel .donate-note { font-size: 15.5px; }
.donate-note a { color: var(--ochre-deep); font-weight: 600; }
@media (max-width: 480px) {
  .donate-panel { padding: 28px 20px; }
  .donate-button { display: block; width: 100%; text-align: center; }
}

/* ---------- Licences ---------- */
.licence-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.licence-card {
  display: flex; flex-direction: column; width: 100%; padding: 0; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.licence-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.licence-card:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; }
.licence-card img {
  width: 100%; height: 240px; object-fit: contain; background: var(--sand-deep); padding: 14px;
  -webkit-user-drag: none; user-select: none; pointer-events: none;
}
.licence-card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.licence-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.licence-card p { color: var(--ink-soft); font-size: 15.5px; }
.licence-card .more { margin-top: auto; padding-top: 14px; font-weight: 600; color: var(--ochre-deep); }
.licence-lightbox { position: fixed; inset: 0; z-index: 200; align-items: center; justify-content: center; padding: 24px; }
.licence-lightbox[hidden] { display: none; }
.licence-lightbox:not([hidden]) { display: flex; }
.licence-lightbox-backdrop { position: absolute; inset: 0; background: rgba(22, 48, 63, 0.85); }
.licence-lightbox-panel {
  position: relative; background: var(--white); border-radius: 16px; max-width: min(860px, 100%); max-height: 100%;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.licence-lightbox-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.licence-lightbox-head h3 { font-size: 1.1rem; }
.licence-lightbox-close { background: none; border: 0; font-size: 1.2rem; line-height: 1; color: var(--ink-soft); cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.licence-lightbox-close:hover { background: var(--sand-deep); color: var(--ink); }
.licence-lightbox-body { overflow: auto; background: var(--sand-deep); display: flex; align-items: center; justify-content: center; min-height: 200px; }
.licence-lightbox-body img { max-width: 100%; max-height: 70vh; -webkit-user-drag: none; user-select: none; pointer-events: none; }
.licence-lightbox-note { padding: 14px 22px 18px; font-size: 14.5px; color: var(--ink-soft); border-top: 1px solid var(--line); }
.licence-lightbox-note a { color: var(--ochre-deep); font-weight: 600; }

/* ---------- Team overview (homepage) ---------- */
.team-grid { list-style: none; display: grid; gap: 28px 20px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .team-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .team-grid { grid-template-columns: repeat(4, 1fr); } }
.team-grid a { display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; color: var(--ink); }
.team-grid img { width: 112px; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; margin-bottom: 14px; transition: transform .2s ease, box-shadow .2s ease; }
.team-grid a:hover img { transform: translateY(-3px); box-shadow: var(--shadow); }
.team-name { font-weight: 600; line-height: 1.35; }
.team-grid a:hover .team-name { text-decoration: underline; }
.team-role { font-size: 14.5px; line-height: 1.45; color: var(--ink-soft); margin-top: 4px; max-width: 24ch; }

/* ---------- Team bios ---------- */
.bio-list { display: grid; gap: 24px; }
.bio {
  display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 22px;
}
@media (min-width: 720px) { .bio { grid-template-columns: 180px 1fr; gap: 40px; padding: 36px; } }
.bio-photo { width: 120px; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; }
@media (min-width: 720px) { .bio-photo { width: 100%; } }
.bio h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 10px 0 4px; }
.bio-role { font-weight: 600; color: var(--ochre-deep); margin-bottom: 14px; }
.bio-body p { color: var(--ink-soft); }
.bio-body p + p { margin-top: 12px; }
.bio-more summary {
  cursor: pointer; list-style: none; display: inline-block; margin-top: 16px;
  font-weight: 600; color: var(--ink); border-bottom: 2px solid var(--ochre);
}
.bio-more summary::-webkit-details-marker { display: none; }
.bio-more summary::after { content: " +"; color: var(--ochre-deep); }
.bio-more[open] summary::after { content: " –"; }
.bio-more[open] summary { margin-bottom: 16px; }
.bio-more h4 { font-family: var(--serif); font-size: 1.1rem; margin: 24px 0 8px; }
.bio-more blockquote, .bio-more .tag-line {
  margin: 20px 0; padding: 16px 20px; background: var(--sand); border-left: 4px solid var(--ochre);
  border-radius: 0 12px 12px 0; font-family: var(--serif); font-style: italic; color: var(--ink);
}

/* ---------- Blog ---------- */
.post-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); transition: transform .2s ease, box-shadow .2s ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-thumb { aspect-ratio: 16 / 9; display: grid; place-items: center; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-photo { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 22px; margin-bottom: 48px; }
.post-thumb.t1 { background: linear-gradient(135deg, #1f3b4d, #2c5670); }
.post-thumb.t2 { background: linear-gradient(135deg, #e8a33d, #d48a22); }
.post-thumb.t3 { background: linear-gradient(135deg, #2f7d5b, #3f9a72); }
.post-body { padding: 26px; display: flex; flex-direction: column; flex: 1; }
.post-meta { font-size: 13.5px; color: var(--ink-soft); display: flex; gap: 10px; flex-wrap: wrap; }
.post-meta .cat { color: var(--ochre-deep); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.post-card h3 { margin: 10px 0 10px; font-size: 1.3rem; }
.post-card p { color: var(--ink-soft); font-size: 16px; }
.post-card .more { margin-top: auto; padding-top: 16px; font-weight: 600; color: var(--ochre-deep); }

.article-hero { padding: 64px 0 40px; }
.article-hero h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); margin-top: 14px; }
.article-hero .lead { margin-top: 18px; }
.back { font-size: 15px; text-decoration: none; font-weight: 600; color: var(--ink-soft); }
.back:hover { color: var(--ochre-deep); }
.article-banner { aspect-ratio: 21 / 9; border-radius: 22px; display: grid; place-items: center; margin-bottom: 48px; }
.prose { padding-bottom: 72px; }
.prose h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin: 44px 0 14px; }
.prose h3 { margin: 30px 0 10px; }
.prose p { margin-top: 16px; }
.prose ul, .prose ol { margin: 16px 0 0 22px; }
.prose li { margin-top: 8px; }
.prose blockquote {
  margin: 32px 0; padding: 22px 26px; border-left: 4px solid var(--ochre);
  background: var(--white); border-radius: 0 14px 14px 0; font-family: var(--serif); font-size: 1.2rem; line-height: 1.5;
}
.prose .note { background: var(--sand-deep); border-radius: 14px; padding: 20px 24px; margin-top: 28px; font-size: 15.5px; color: var(--ink-soft); }
.prose a { color: var(--ochre-deep); font-weight: 600; }
.prose .btn-primary { color: var(--white); }
.prose .video { margin: 28px 0 8px; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: var(--ink); box-shadow: var(--shadow); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video figcaption { margin-top: 10px; font-size: 14.5px; color: var(--ink-soft); }
.author-box { display: flex; gap: 16px; align-items: center; border-top: 1px solid var(--line); padding-top: 28px; margin-top: 48px; }
.author-box .avatar { margin: 0; width: 56px; height: 56px; font-size: 20px; }
.author-box p { margin: 0; font-size: 15px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-deep); color: #c9d6de; padding: 64px 0 32px; font-size: 15.5px; }
.footer-grid { display: grid; gap: 36px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1.2fr; } }
.site-footer .brand { color: var(--white); }
.site-footer .brand-logo { width: 56px; height: 56px; padding: 5px; background: var(--white); border-radius: 14px; }
.site-footer .brand-sub { color: #9fb3c0; }
.site-footer h4 { font-family: var(--sans); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--white); margin-bottom: 14px; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #c9d6de; text-decoration: none; }
.site-footer a:hover { color: var(--ochre); }
.site-footer .social-link { display: inline-flex; align-items: center; gap: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 48px; padding-top: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 14px; color: #9fb3c0; }

/* ---------- Utilities ---------- */
.mt-0 { margin-top: 0 !important; }
.mt-s { margin-top: 12px; }
.mt-m { margin-top: 28px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--white); padding: 10px 16px; border-radius: 8px; z-index: 100; }
