:root {
  --sand: #fff8ec;
  --cream: #f5ead7;
  --paper: #ffffff;
  --ink: #17261f;
  --muted: #5d6c63;
  --line: #e1d4be;
  --green: #1f5c42;
  --green-2: #113a2a;
  --gold: #d39a2a;
  --clay: #a95731;
  --leaf: #77a86a;
  --shadow: 0 22px 70px rgba(36, 55, 45, .12);
  --radius: 26px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--sand);
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--green-2);
  color: #fff;
  padding: .75rem 1rem;
  border-radius: .75rem;
}
.skip-link:focus { top: 1rem; }

.container {
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 248, 236, .92);
  border-bottom: 1px solid rgba(225, 212, 190, .8);
  backdrop-filter: blur(14px);
}
.nav-shell {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 900;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: radial-gradient(circle at 30% 25%, var(--gold), var(--green) 66%);
  font-size: .82rem;
  letter-spacing: -.03em;
  box-shadow: 0 10px 24px rgba(31, 92, 66, .22);
}
.brand-text { font-size: 1.16rem; letter-spacing: -.03em; }
.brand-text span { color: var(--green); }

.primary-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: .96rem;
}
.primary-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 720;
}
.primary-nav a:hover { color: var(--green-2); }
.nav-cta {
  color: #fff !important;
  background: var(--green);
  padding: .7rem 1.05rem;
  border-radius: 999px;
}
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 10px;
}
.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--green-2);
}

.section { padding: 82px 0; }
.section-light {
  background:
    radial-gradient(circle at 10% 10%, rgba(211, 154, 42, .28), transparent 28%),
    radial-gradient(circle at 88% 26%, rgba(119, 168, 106, .22), transparent 34%),
    var(--sand);
}
.section-cream { background: var(--cream); }
.section-green {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(17,58,42,.96), rgba(31,92,66,.94)),
    url('/assets/img/pattern-africa.svg');
  background-size: auto, 360px;
}
.section-values {
  background: linear-gradient(180deg, #fff8ec, #f1e4cf);
}

.hero { padding: 90px 0 70px; }
.hero-grid,
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: clamp(32px, 6vw, 70px);
  align-items: center;
}
.align-start { align-items: start; }
.hero-copy { max-width: 760px; }
.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 0 0 18px;
  padding: .45rem .78rem;
  border-radius: 999px;
  background: rgba(211, 154, 42, .16);
  color: var(--green-2);
  font-weight: 850;
  font-size: .88rem;
  letter-spacing: .01em;
}
.section-kicker.light { background: rgba(255,255,255,.12); color: #fff; }
h1, h2, h3 { margin: 0; line-height: 1.04; letter-spacing: -.045em; }
h1 {
  font-size: clamp(2.75rem, 7vw, 6.15rem);
  max-width: 850px;
}
h2 { font-size: clamp(2rem, 4vw, 3.55rem); }
h3 { font-size: 1.32rem; letter-spacing: -.025em; }
p { margin: 0 0 18px; color: var(--muted); font-size: 1.055rem; }
.lead { font-size: clamp(1.16rem, 2vw, 1.42rem); color: #304238; max-width: 760px; margin-top: 22px; }
.section-green p { color: rgba(255,255,255,.82); }
.trust-note { margin-top: 18px; font-size: .94rem; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.cta-row.center { justify-content: center; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 21px;
  border-radius: 999px;
  font-weight: 850;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(24, 54, 41, .14); }
.button-primary { background: var(--green); color: #fff; }
.button-secondary { background: transparent; color: var(--green-2); border-color: var(--green); }
.button-white { background: #fff; color: var(--green-2); }
.button-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }

.hero-art {
  margin: 0;
  background: rgba(255,255,255,.45);
  border: 1px solid rgba(225, 212, 190, .8);
  border-radius: 38px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.section-art {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 36px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.ticker {
  overflow: hidden;
  background: var(--green-2);
  color: #fff;
}
.ticker-track {
  display: flex;
  gap: 8px;
  width: max-content;
  min-width: 100%;
  justify-content: center;
  flex-wrap: wrap;
  padding: 12px 18px;
}
.ticker a {
  text-decoration: none;
  font-weight: 760;
  opacity: .94;
  padding: .25rem .7rem;
}
.ticker a:not(:last-child)::after {
  content: "•";
  margin-left: 1rem;
  color: var(--gold);
}

.feature-panel,
.action-card,
.schools-preview,
.knowledge-list,
.language-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 16px 50px rgba(36, 55, 45, .08);
}
.africa-focus { border-top: 6px solid var(--gold); }
.section-head { margin-bottom: 34px; }
.section-head.narrow { max-width: 820px; }
.action-cards,
.topic-grid,
.school-grid,
.values-grid {
  display: grid;
  gap: 18px;
}
.action-cards.three { grid-template-columns: repeat(3, 1fr); }
.action-card { position: relative; overflow: hidden; }
.action-card::after {
  content: "";
  position: absolute;
  right: -50px;
  top: -50px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(211,154,42,.12);
}
.icon-badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  margin-bottom: 20px;
}
.action-card a,
.card-link {
  color: var(--green-2);
  font-weight: 850;
  text-decoration: none;
}
.action-card a:hover,
.card-link:hover { text-decoration: underline; }

.schools-preview { margin-top: 30px; background: rgba(255,255,255,.74); }
.preview-head { display: flex; gap: 18px; justify-content: space-between; align-items: end; margin-bottom: 18px; }
.preview-head p { max-width: 520px; font-size: .96rem; }
.school-grid { grid-template-columns: repeat(3, 1fr); }
.school-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
}
.school-card .meta { color: var(--clay); font-weight: 800; font-size: .92rem; margin-bottom: 8px; }
.school-card h4 { margin: 0 0 9px; font-size: 1.15rem; letter-spacing: -.02em; }
.school-card p { font-size: .96rem; }
.school-card.empty { text-align: center; grid-column: 1 / -1; }

.knowledge-list { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); box-shadow: none; }
.knowledge-list h3 { margin-bottom: 18px; }
.knowledge-list ul { margin: 0; padding-left: 1.1rem; }
.knowledge-list li { margin: .55rem 0; color: rgba(255,255,255,.86); }

.topic-grid { grid-template-columns: repeat(4, 1fr); }
.topic-card {
  min-height: 150px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 14px 40px rgba(36, 55, 45, .06);
}
.topic-card span { color: var(--green-2); font-weight: 900; font-size: 1.1rem; letter-spacing: -.02em; }
.topic-card small { color: var(--muted); font-size: .94rem; }
.topic-card:hover { border-color: var(--gold); transform: translateY(-2px); }

.values-shell { text-align: center; }
.values-shell .section-head { margin-inline: auto; }
.values-grid { grid-template-columns: repeat(4, 1fr); margin-top: 26px; }
.values-grid span {
  padding: .84rem .9rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 850;
  color: var(--green-2);
}
blockquote {
  margin: 34px auto 0;
  max-width: 780px;
  padding: 26px;
  border-left: 6px solid var(--gold);
  background: rgba(255,255,255,.65);
  border-radius: 20px;
  text-align: left;
}
blockquote p { margin: 0; color: #344238; font-size: 1.16rem; }

.language-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.language-list a {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .55rem .8rem;
  background: #fff;
  color: var(--green-2);
  font-weight: 850;
}
.small-note { font-size: .92rem; margin-top: 16px; }

.final-cta {
  background:
    linear-gradient(135deg, rgba(31,92,66,.96), rgba(169,87,49,.9)),
    url('/assets/img/pattern-africa.svg');
  background-size: auto, 420px;
  color: #fff;
  text-align: center;
}
.final-shell { max-width: 920px; }
.final-cta p { color: rgba(255,255,255,.83); font-size: 1.18rem; }

.site-footer {
  padding: 46px 0;
  background: #102d22;
  color: rgba(255,255,255,.76);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr .7fr .8fr;
  gap: 28px;
}
.site-footer p { color: rgba(255,255,255,.66); max-width: 520px; }
.site-footer h3 { color: #fff; font-size: 1rem; margin-bottom: 10px; }
.site-footer a { display: block; color: rgba(255,255,255,.78); text-decoration: none; margin: 8px 0; }
.footer-brand .brand-text { color: #fff; }

@media (max-width: 980px) {
  .hero-grid, .two-col { grid-template-columns: 1fr; }
  .action-cards.three, .school-grid { grid-template-columns: 1fr; }
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .values-grid { grid-template-columns: repeat(2, 1fr); }
  .reverse-mobile .section-art { order: 2; }
}
@media (max-width: 780px) {
  .menu-toggle { display: inline-block; }
  .primary-nav {
    position: absolute;
    top: 72px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav a { padding: 12px; }
  .nav-cta { text-align: center; }
  .section { padding: 58px 0; }
  .hero { padding: 58px 0 44px; }
  .hero-art { border-radius: 24px; }
  .preview-head { display: block; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .container { width: min(100% - 24px, var(--max)); }
  .brand-text { font-size: 1rem; }
  h1 { font-size: 2.65rem; }
  .cta-row .button { width: 100%; }
  .topic-grid, .values-grid { grid-template-columns: 1fr; }
  .ticker-track { justify-content: flex-start; }
}


/* Africa country-directory JSON cards */
.school-grid.africa-country-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.school-card.country-card {
  display: flex;
  flex-direction: column;
  min-height: 190px;
}
.school-card.country-card .count-badge {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(31,92,66,.09);
  color: var(--green-2);
  font-weight: 900;
  font-size: .88rem;
}
.school-card.country-card .card-link {
  margin-top: auto;
}
.school-card.main-directory-card {
  border-top: 6px solid var(--gold);
}
.school-card .generated-note {
  color: var(--muted);
  font-size: .88rem;
  margin-top: 10px;
}

/* Africa country directory cards */
.country-card .country-count,.count-tag{font-weight:850;}
.country-directory-note{margin-top:12px;color:#5d6f63;font-size:.95rem;}


/* Final Africa country cards: same behavior as Montessori Thailand province cards */
.school-grid.africa-country-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.school-card.country-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
}
.school-card.country-card h3 {
  margin-top: 12px;
  margin-bottom: 10px;
}
.school-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.tag {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(31, 92, 66, .09);
  color: var(--green-2);
  font-size: .82rem;
  font-weight: 850;
  line-height: 1;
}
.count-tag,
.country-count {
  background: rgba(211, 154, 42, .20);
  color: #6d4318;
  font-weight: 950;
}
.main-directory-card {
  border-top: 6px solid var(--gold);
}
.country-card .card-link {
  margin-top: auto;
}

/* Emergency fix: always show Africa country counts */
.school-grid .school-meta,
.africa-country-grid .school-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
    margin-bottom: 14px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.school-grid .tag,
.africa-country-grid .tag,
.school-grid .count-tag,
.africa-country-grid .count-tag,
.school-grid .country-count,
.africa-country-grid .country-count {
    display: inline-flex !important;
    align-items: center !important;
    width: auto !important;
    height: auto !important;
    padding: 6px 10px !important;
    border-radius: 999px !important;
    background: #f3e7cf !important;
    color: #3a2615 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.school-grid .count-tag,
.africa-country-grid .count-tag,
.school-grid .country-count,
.africa-country-grid .country-count {
    background: #1f5c42 !important;
    color: #ffffff !important;
}

.school-grid .main-directory-card,
.africa-country-grid .main-directory-card {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    grid-column: 1 / -1;
}

/* Extra fallback: show the number even if an old style hides the span */
.country-card[data-count]::after {
    content: attr(data-count) " spaces";
    display: inline-flex !important;
    margin-top: 12px !important;
    padding: 6px 10px !important;
    border-radius: 999px !important;
    background: #1f5c42 !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 800 !important;
}

.country-card[data-count="1"]::after {
    content: "1 space";
}
