/* ============================================================
   African Village Project — Education Support Centre
   Stylesheet
   ============================================================ */

:root {
  /* AVP brand palette — dark blue primary
     (variable names kept as --green-* so the whole site re-themes from here) */
  --green-900: #0d2747;  /* deep navy — dark sections */
  --green-700: #16467a;  /* primary dark blue */
  --green-600: #2563a8;  /* brighter blue accent */
  --green-100: #e7eef7;  /* pale blue tint */
  --earth-700: #b5762f;  /* warm secondary accent */
  --earth-500: #d59440;
  --sun: #f4b53f;        /* gold highlight */
  --ink: #182230;
  --ink-soft: #4a5664;
  --paper: #f8fafc;
  --paper-2: #eef2f7;
  --white: #ffffff;
  --line: #dde4ec;
  --shadow: 0 18px 50px -24px rgba(13, 39, 71, 0.45);
  --radius: 16px;
  --maxw: 1140px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'Fraunces', Georgia, serif; line-height: 1.12; font-weight: 600; color: var(--ink); }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.3rem; }

a { color: var(--green-700); text-decoration: none; transition: color .2s; }
a:hover { color: var(--green-900); }

img { display: block; max-width: 100%; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--green-600);
  margin-bottom: .6rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: .85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .98rem;
  transition: transform .15s, box-shadow .2s, background .2s;
  cursor: pointer;
  border: 2px solid transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { position: relative; overflow: hidden; background: var(--green-700); color: var(--white); box-shadow: var(--shadow); }
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -120%;
  width: 60%; height: 100%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  transition: left .6s ease;
}
.btn-primary:hover::after { left: 130%; }
.btn-primary:hover { background: var(--green-900); color: #fff; }
.btn-ghost { border-color: var(--green-700); color: var(--green-700); }
.btn-ghost:hover { background: var(--green-700); color: #fff; }
.btn-ghost-light { border-color: rgba(255,255,255,.7); color: #fff; }
.btn-ghost-light:hover { background: #fff; color: var(--green-900); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(248, 250, 252, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s, background .3s;
}
.site-header.scrolled { box-shadow: 0 8px 30px -18px rgba(13,39,71,.45); background: rgba(248,250,252,.97); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); }
.brand-mark {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--green-700); color: #fff;
  font-family: 'Fraunces', serif; font-weight: 700; font-size: 1.05rem;
  letter-spacing: .02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1rem; }
.brand-text small { color: var(--ink-soft); font-size: .76rem; }

.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav a { color: var(--ink-soft); font-weight: 500; font-size: .95rem; position: relative; }
.site-nav a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 100%; height: 2px; background: var(--green-700);
  transform: scaleX(0); transform-origin: left; transition: transform .28s ease;
}
.site-nav a:not(.nav-cta):hover::after { transform: scaleX(1); }
.site-nav a:hover { color: var(--green-900); }
.brand-mark { transition: transform .3s; }
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }
.nav-cta {
  background: var(--green-700); color: #fff !important;
  padding: .55rem 1.1rem; border-radius: 999px;
}
.nav-cta:hover { background: var(--green-900); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 26px; height: 3px; background: var(--ink); border-radius: 2px; transition: .25s; }

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; isolation: isolate; overflow: hidden; }
.hero-slider { position: absolute; inset: 0; z-index: -1; }
.hero-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transform: scale(1.08);
  transition: opacity 1.4s ease;
}
.hero-slide.is-active {
  opacity: 1;
  animation: kenburns 7s ease-out forwards;
}
@keyframes kenburns {
  from { transform: scale(1.12); }
  to   { transform: scale(1.0); }
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(13,39,71,.92) 0%, rgba(13,39,71,.7) 45%, rgba(13,39,71,.4) 100%);
}
.hero-inner { padding: clamp(4.5rem, 11vw, 9rem) 22px clamp(4.5rem, 9vw, 8rem); max-width: 760px; }
.hero .eyebrow { color: var(--sun); }
.hero h1 { color: #fff; margin-bottom: 1.1rem; }
.hero-lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: rgba(255,255,255,.94); margin-bottom: 1.8rem; }
.hero-lead strong { color: #fff; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; }

/* Hero entrance animation (staggered) */
.hero-anim { opacity: 0; transform: translateY(26px); animation: heroUp .9s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: var(--d, 0s); }
@keyframes heroUp { to { opacity: 1; transform: none; } }

/* Hero slide caption */
.hero-caption {
  position: absolute; left: 22px; bottom: 22px; z-index: 2;
  max-width: 60%; padding: .45rem .9rem; border-radius: 999px;
  background: rgba(13,39,71,.55); backdrop-filter: blur(4px);
  color: #fff; font-size: .85rem; font-weight: 500;
  opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s;
}
.hero-caption.show { opacity: 1; transform: none; }
@media (max-width: 720px){ .hero-caption { display: none; } }

/* Hero slide dots */
.hero-dots { position: absolute; left: 0; right: 0; bottom: 26px; display: flex; gap: 10px; justify-content: center; z-index: 2; }
.hero-dots button {
  width: 11px; height: 11px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: rgba(255,255,255,.45); transition: background .25s, transform .25s, width .25s;
}
.hero-dots button:hover { background: rgba(255,255,255,.8); }
.hero-dots button.active { background: var(--sun); width: 26px; border-radius: 6px; }

/* Hero scroll cue */
.hero-scroll { position: absolute; left: 50%; bottom: 54px; transform: translateX(-50%); z-index: 2; width: 26px; height: 42px; border: 2px solid rgba(255,255,255,.6); border-radius: 14px; display: grid; place-items: start center; }
.hero-scroll span { width: 4px; height: 8px; margin-top: 7px; background: #fff; border-radius: 2px; animation: scrollDot 1.6s infinite; }
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 80%,100% { opacity: 0; transform: translateY(12px); } }
@media (max-width: 720px){ .hero-scroll { display: none; } }

/* ---------- Stats ---------- */
.stats { background: var(--green-900); color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: 2.4rem 22px; }
.stat { text-align: center; padding: .4rem; }
.stat-num { display: block; font-family: 'Fraunces', serif; font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 700; color: var(--sun); }
.stat-label { display: block; font-size: .9rem; color: rgba(255,255,255,.85); margin-top: .25rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-tint { background: var(--paper-2); }
.section-head { max-width: 720px; margin-bottom: 2.6rem; }
.section-sub { color: var(--ink-soft); font-size: 1.08rem; margin-top: .5rem; }

.two-col { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.col-text p { color: var(--ink-soft); margin-bottom: 1rem; }
.col-media img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; aspect-ratio: 4/3; object-fit: cover; }

.tick-list { list-style: none; margin-top: 1.2rem; display: grid; gap: .6rem; }
.tick-list li { position: relative; padding-left: 1.9rem; color: var(--ink); }
.tick-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--green-100); color: var(--green-700);
  display: grid; place-items: center; font-size: .8rem; font-weight: 700;
}

/* ---------- Cards ---------- */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.8rem;
  box-shadow: 0 10px 30px -22px rgba(0,0,0,.3);
}
.card h3 { margin-bottom: .6rem; color: var(--green-900); }
.card p { color: var(--ink-soft); }

.callout {
  margin-top: 2.4rem; padding: 1.6rem 1.8rem;
  border-left: 5px solid var(--sun);
  background: var(--white); border-radius: 12px;
  font-size: 1.08rem; color: var(--ink);
  box-shadow: 0 10px 30px -24px rgba(0,0,0,.3);
}

/* ---------- Programmes ---------- */
.program-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.program { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 12px 34px -26px rgba(0,0,0,.4); transition: transform .2s; }
.program:hover { transform: translateY(-4px); }
.program-media { aspect-ratio: 3/2; overflow: hidden; }
.program-media img { width: 100%; height: 100%; object-fit: cover; }
.program-body { padding: 1.4rem 1.5rem 1.7rem; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--earth-700); background: #f6e8da; padding: .3rem .7rem; border-radius: 999px; margin-bottom: .8rem; }
.program-body h3 { margin-bottom: .5rem; }
.program-body p { color: var(--ink-soft); font-size: .98rem; }

/* ---------- Schedule (dark) ---------- */
.section-dark { background: var(--green-900); color: #fff; }
.section-dark h2, .section-dark .section-sub { color: #fff; }
.section-dark .section-sub { color: rgba(255,255,255,.82); }
.section-dark .eyebrow { color: var(--sun); }
.timeline { display: grid; gap: .9rem; max-width: 760px; }
.t-item { display: grid; grid-template-columns: 130px 1fr; gap: 1.2rem; align-items: start; padding: 1.1rem 1.3rem; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; }
.t-time { font-family: 'Fraunces', serif; font-weight: 700; color: var(--sun); font-size: 1.05rem; }
.t-body h4 { color: #fff; font-size: 1.1rem; margin-bottom: .2rem; }
.t-body p { color: rgba(255,255,255,.82); font-size: .95rem; }

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; gap: 14px; }
.g-item { overflow: hidden; border-radius: 14px; box-shadow: 0 10px 28px -22px rgba(0,0,0,.4); }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.g-item:hover img { transform: scale(1.07); }
.g-tall { grid-row: span 2; }
.g-wide { grid-column: span 2; }

/* ---------- CTA ---------- */
.section-cta { background: linear-gradient(120deg, var(--earth-700), var(--earth-500)); color: #fff; text-align: center; }
.section-cta h2 { color: #fff; }
.cta-inner { max-width: 680px; margin-inline: auto; }
.cta-inner p { color: rgba(255,255,255,.92); font-size: 1.1rem; margin: 1rem 0 1.8rem; }
.cta-actions { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }
.section-cta .btn-primary { background: #fff; color: var(--earth-700); }
.section-cta .btn-primary:hover { background: var(--ink); color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.78); padding-top: 3.5rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 2rem; padding-bottom: 2.5rem; }
.footer-brand .brand-mark { margin-bottom: .9rem; }
.footer-brand p { margin-bottom: .4rem; color: #fff; }
.footer-brand .muted { color: rgba(255,255,255,.6); font-weight: 400; }
.muted { color: rgba(255,255,255,.6); }
.footer-col h4 { color: #fff; font-size: .95rem; margin-bottom: .9rem; font-family: 'Inter', sans-serif; letter-spacing: .03em; text-transform: uppercase; }
.footer-col a { display: block; color: rgba(255,255,255,.72); margin-bottom: .5rem; font-size: .95rem; }
.footer-col a:hover { color: var(--sun); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem; padding: 1.3rem 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: .88rem; }
.to-top { color: rgba(255,255,255,.72); }
.to-top:hover { color: var(--sun); }

/* ---------- Nav active state ---------- */
.site-nav a.active { color: var(--green-900); font-weight: 600; }

/* ---------- Page hero (interior pages) ---------- */
.page-hero {
  background: linear-gradient(120deg, var(--green-900), var(--green-700));
  color: #fff;
  padding: clamp(3rem, 8vw, 5.5rem) 0;
}
.page-hero .eyebrow { color: var(--sun); }
.page-hero h1 { color: #fff; margin-bottom: .8rem; }
.page-hero-lead { color: rgba(255,255,255,.92); font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 640px; }

/* ---------- Featured story ---------- */
.feature-story {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 0;
  align-items: stretch; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.feature-story > * { min-width: 0; } /* prevent the image column from overflowing */
.feature-media { position: relative; overflow: hidden; min-height: 320px; }
.feature-media img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; }
.feature-body {
  position: relative; z-index: 1; background: var(--white);
  padding: clamp(1.6rem, 3vw, 2.8rem);
  display: flex; flex-direction: column; justify-content: center;
}
.feature-body h2 { margin: .3rem 0 .4rem; }
.story-meta { color: var(--green-600); font-size: .88rem; font-weight: 600; margin-bottom: .8rem; }
.feature-body p { color: var(--ink-soft); margin-bottom: 1rem; }
.read-more { font-weight: 600; }

/* ---------- Story grid ---------- */
.story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.story-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 12px 34px -26px rgba(0,0,0,.4); transition: transform .2s;
  display: flex; flex-direction: column;
}
.story-card:hover { transform: translateY(-4px); }
.story-card-media { aspect-ratio: 3/2; overflow: hidden; }
.story-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.story-card:hover .story-card-media img { transform: scale(1.06); }
.story-card-body { padding: 1.3rem 1.4rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.story-card-body h3 { margin: .2rem 0 .5rem; }
.story-card-body p { color: var(--ink-soft); font-size: .96rem; margin-bottom: 1rem; flex: 1; }
.stories-note { margin-top: 2.4rem; text-align: center; color: var(--ink-soft); }
.stories-note code { background: var(--paper-2); padding: .1rem .4rem; border-radius: 5px; font-size: .9em; }

/* ---------- Contact section ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 1rem; }
.contact-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.7rem; text-align: center;
  box-shadow: 0 10px 30px -24px rgba(0,0,0,.3);
}
.contact-icon {
  width: 52px; height: 52px; margin: 0 auto .9rem;
  display: grid; place-items: center; border-radius: 14px;
  background: var(--green-100); color: var(--green-700); font-size: 1.5rem;
}
.contact-card h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.contact-card p, .contact-card a { color: var(--ink-soft); font-size: .98rem; line-height: 1.5; }
.contact-card a { display: block; }
.contact-card a:hover { color: var(--green-900); }

/* ---------- Lightbox ---------- */
.gallery-grid .g-item, .story-card-media, .feature-media { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,18,33,.92); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .3s;
  padding: 4vw;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 92vw; max-height: 86vh; border-radius: 10px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.7);
  transform: scale(.96); transition: transform .3s;
}
.lightbox.open img { transform: scale(1); }
.lb-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.14); color: #fff; font-size: 1.6rem; line-height: 1;
  display: grid; place-items: center; transition: background .2s;
}
.lb-btn:hover { background: rgba(255,255,255,.3); }
.lb-prev { left: 3vw; }
.lb-next { right: 3vw; }
.lb-close { top: 3vh; right: 3vw; transform: none; width: 46px; height: 46px; font-size: 1.4rem; }
.lb-count { position: absolute; bottom: 3vh; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.8); font-size: .9rem; }
@media (max-width: 560px){ .lb-prev{ left: 8px; } .lb-next{ right: 8px; } .lb-btn{ width: 44px; height: 44px; } }

/* ---------- Image placeholder (fallback) ---------- */
.img-placeholder {
  width: 100%; height: 100%; min-height: 180px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .4rem; text-align: center; padding: 1rem;
  background:
    radial-gradient(120% 120% at 0% 0%, var(--green-600), var(--green-900));
  color: #fff;
}
.img-placeholder span { font-family: 'Fraunces', serif; font-weight: 700; font-size: 1.6rem; letter-spacing: .04em; opacity: .95; }
.img-placeholder small { font-size: .8rem; color: rgba(255,255,255,.78); max-width: 26ch; line-height: 1.4; }
.col-media .img-placeholder, .program-media .img-placeholder, .g-item .img-placeholder { border-radius: inherit; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 940px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1.6rem; }
  .cards-3, .program-grid, .story-grid, .contact-grid { grid-template-columns: 1fr; }
  .feature-story { grid-template-columns: 1fr; }
  .feature-media { aspect-ratio: 16/9; }
  .two-col { grid-template-columns: 1fr; }
  .col-media { order: -1; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 72px; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: .5rem 22px 1.2rem;
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: .22s;
  }
  .site-nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .site-nav a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .nav-cta { text-align: center; margin-top: .6rem; }
}

@media (max-width: 520px) {
  .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: 220px; }
  .g-wide { grid-column: span 1; }
  .g-tall { grid-row: span 1; }
  .t-item { grid-template-columns: 1fr; gap: .3rem; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .hero-anim { opacity: 1 !important; transform: none !important; }
  .hero-slide.is-active { animation: none; }
}
