/* ============================================
   Mzansi Heights Secondary School — Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  color: hsl(220 13% 18%);
  background: hsl(0 0% 100%);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- Design Tokens --- */
:root {
  --primary: hsl(210 100% 20%);
  --primary-fg: hsl(0 0% 100%);
  --secondary: hsl(43 98% 54%);
  --secondary-fg: hsl(210 100% 20%);
  --accent: hsl(160 85% 30%);
  --accent-fg: hsl(0 0% 100%);
  --foreground: hsl(220 13% 18%);
  --muted: hsl(210 20% 96%);
  --muted-fg: hsl(215 16% 47%);
  --border: hsl(214 32% 91%);
  --ring: hsl(210 100% 20%);
  --radius: 0.5rem;
  --font-display: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* --- Utility --- */
.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 1rem; }
.text-center { text-align: center; }
.font-display { font-family: var(--font-display); }
.font-body { font-family: var(--font-body); }

/* --- Header / Navbar --- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: hsla(0,0%,100%,0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.logo { display: flex; align-items: center; gap: 0.5rem; }
.logo-icon {
  width: 40px; height: 40px; border-radius: var(--radius);
  background: var(--primary); display: flex; align-items: center; justify-content: center;
  color: var(--primary-fg); font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
}
.logo-text {
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--foreground);
}
@media (max-width: 639px) { .logo-text { display: none; } }

.desktop-nav { display: flex; align-items: center; gap: 2rem; }
.desktop-nav a.nav-link {
  position: relative; font-family: var(--font-display); font-weight: 500; font-size: 0.875rem;
  letter-spacing: 0.02em; color: var(--muted-fg); transition: color 0.2s; padding: 0.25rem 0;
}
.desktop-nav a.nav-link::after {
  content: ''; position: absolute; width: 100%; height: 2px; bottom: 0; left: 50%;
  transform: translateX(-50%) scaleX(0); transform-origin: center;
  background: var(--secondary); transition: transform 0.3s;
}
.desktop-nav a.nav-link:hover,
.desktop-nav a.nav-link.active { color: var(--primary); }
.desktop-nav a.nav-link:hover::after,
.desktop-nav a.nav-link.active::after { transform: translateX(-50%) scaleX(1); }

.btn-support {
  background: var(--secondary); color: var(--secondary-fg);
  font-family: var(--font-display); font-weight: 600; font-size: 0.875rem;
  padding: 0.5rem 1.25rem; border-radius: var(--radius); transition: filter 0.2s; border: none; cursor: pointer;
}
.btn-support:hover { filter: brightness(1.1); }

/* Mobile toggle */
.mobile-toggle {
  display: none; background: none; border: none; cursor: pointer; color: var(--foreground); padding: 4px;
}
.mobile-toggle svg { width: 24px; height: 24px; }

@media (max-width: 767px) {
  .desktop-nav { display: none; }
  .mobile-toggle { display: block; }
}

/* Mobile menu */
.mobile-nav {
  display: none; flex-direction: column; gap: 0.75rem;
  background: hsl(0 0% 100%); border-bottom: 1px solid var(--border);
  padding: 1rem; animation: fadeIn 0.3s ease-out;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-family: var(--font-display); font-weight: 500; font-size: 1rem;
  color: var(--muted-fg); padding: 0.5rem 0; transition: color 0.2s;
}
.mobile-nav a.active { color: var(--primary); }
.mobile-nav .btn-support { text-align: center; margin-top: 0.5rem; display: block; }

@media (min-width: 768px) { .mobile-nav { display: none !important; } }

/* --- Hero --- */
.hero { position: relative; min-height: 90vh; display: flex; align-items: center; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, hsla(210,100%,20%,0.85), hsla(210,100%,20%,0.5));
}
.hero-content { position: relative; max-width: 640px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.25rem, 5vw, 3.75rem); color: var(--primary-fg); line-height: 1.1; margin-bottom: 1.5rem;
}
.hero h1 span { color: var(--secondary); display: block; }
.hero p { color: hsla(0,0%,100%,0.8); font-size: 1.125rem; margin-bottom: 2rem; line-height: 1.7; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 1rem; }
.btn-primary {
  background: var(--secondary); color: var(--secondary-fg);
  font-family: var(--font-display); font-weight: 700; padding: 0.875rem 2rem;
  border-radius: var(--radius); transition: filter 0.2s; border: none; cursor: pointer; font-size: 1rem;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-outline {
  border: 2px solid hsla(0,0%,100%,0.4); color: var(--primary-fg);
  font-family: var(--font-display); font-weight: 600; padding: 0.875rem 2rem;
  border-radius: var(--radius); transition: background 0.2s; background: transparent; cursor: pointer; font-size: 1rem;
}
.btn-outline:hover { background: hsla(0,0%,100%,0.1); }

/* --- Page Hero (short) --- */
.page-hero { position: relative; height: 260px; display: flex; align-items: center; }
.page-hero-solid { background: var(--primary); padding: 4rem 0; text-align: center; }
.page-hero-solid h1 { color: var(--primary-fg); font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 0.75rem; }
.page-hero-solid p { color: hsla(0,0%,100%,0.8); font-size: 1.125rem; }
@media (min-width: 768px) { .page-hero { height: 320px; } }

/* --- Stats Bar --- */
.stats-bar { background: var(--primary); padding: 3rem 0; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-item { text-align: center; }
.stat-item svg { margin: 0 auto 0.5rem; color: var(--secondary); }
.stat-value { font-family: var(--font-display); font-weight: 800; font-size: 1.875rem; color: var(--primary-fg); }
.stat-label { color: hsla(0,0%,100%,0.7); font-size: 0.875rem; margin-top: 0.25rem; }

/* --- Sections --- */
.section { padding: 5rem 0; }
.section-muted { background: var(--muted); }
.section-bg { background: hsl(0 0% 100%); }
.section-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.875rem; color: var(--foreground); margin-bottom: 1.5rem;
}
.section-title .highlight { color: var(--primary); }

/* --- Grid Layouts --- */
.grid-2 { display: grid; gap: 3rem; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; gap: 2rem; }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.items-center { align-items: center; }

/* --- Cards --- */
.card {
  background: var(--muted); border-radius: 0.75rem; padding: 2rem; text-align: center;
}
.card-bordered {
  background: hsl(0 0% 100%); border-radius: 0.75rem; overflow: hidden;
  box-shadow: 0 4px 20px hsla(210,20%,50%,0.1); border: 1px solid var(--border);
}
.card-body { padding: 1.5rem; }
.card h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.125rem; color: var(--foreground); margin-bottom: 0.5rem; }
.card p, .card-body p { color: var(--muted-fg); font-size: 0.875rem; line-height: 1.7; }
.card-icon { margin: 0 auto 1rem; color: var(--primary); }

/* --- Image Styles --- */
.img-rounded { border-radius: 0.75rem; box-shadow: 0 8px 30px hsla(210,20%,30%,0.15); width: 100%; object-fit: cover; aspect-ratio: 16/9; }

/* --- Buttons (generic) --- */
.btn {
  display: inline-block; font-family: var(--font-display); font-weight: 600;
  padding: 0.75rem 1.5rem; border-radius: var(--radius); transition: opacity 0.2s;
  border: none; cursor: pointer; font-size: 0.9375rem; text-align: center;
}
.btn:hover { opacity: 0.9; }
.btn-dark { background: var(--primary); color: var(--primary-fg); }
.btn-gold { background: var(--secondary); color: var(--secondary-fg); font-weight: 700; }
.btn-accent { background: var(--accent); color: var(--accent-fg); }
.btn-block { display: block; width: 100%; }

/* --- Progress Bar --- */
.progress-track { width: 100%; height: 10px; background: var(--muted); border-radius: 99px; overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 99px; transition: width 1s ease-out;
  background: linear-gradient(90deg, var(--accent), hsl(160 85% 40%));
}

/* --- Impact Bar --- */
.impact-bar { background: var(--accent); padding: 2.5rem 0; }
.impact-bar .stat-item svg { color: var(--accent-fg); }
.impact-bar .stat-value { color: var(--accent-fg); }
.impact-bar .stat-label { color: hsla(0,0%,100%,0.8); }

/* --- Avatar Circle --- */
.avatar {
  width: 64px; height: 64px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 0.75rem;
  color: var(--primary-fg); font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
}

/* --- Forms --- */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--foreground); margin-bottom: 0.25rem; }
.form-input, .form-textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.625rem 1rem; font-family: var(--font-body); font-size: 0.875rem;
  color: var(--foreground); background: hsl(0 0% 100%); transition: box-shadow 0.2s;
}
.form-input:focus, .form-textarea:focus {
  outline: none; box-shadow: 0 0 0 2px var(--ring);
}
.form-textarea { resize: none; }

/* --- Info Items --- */
.info-item { display: flex; align-items: flex-start; gap: 0.75rem; font-size: 0.875rem; }
.info-item svg { color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.info-item strong { display: block; color: var(--foreground); font-weight: 500; }
.info-item span, .info-item p { color: var(--muted-fg); margin: 0; }

/* --- Map --- */
.map-frame { border-radius: 0.75rem; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 4px 15px hsla(210,20%,50%,0.1); }

/* --- Footer --- */
.site-footer { background: var(--primary); color: var(--primary-fg); padding: 3rem 0; }
.footer-grid { display: grid; gap: 2.5rem; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.site-footer h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; margin-bottom: 1rem; }
.site-footer h4 { font-family: var(--font-display); font-weight: 600; font-size: 1rem; margin-bottom: 1rem; }
.site-footer p, .site-footer a, .site-footer span { color: hsla(0,0%,100%,0.7); font-size: 0.875rem; line-height: 1.7; }
.site-footer a:hover { color: var(--secondary); }
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-contact { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-contact-item { display: flex; align-items: center; gap: 0.5rem; }
.footer-contact-item svg { color: var(--secondary); flex-shrink: 0; }
.footer-bottom {
  border-top: 1px solid hsla(0,0%,100%,0.2); margin-top: 2.5rem; padding-top: 1.5rem;
  text-align: center; font-size: 0.75rem; color: hsla(0,0%,100%,0.5);
}

/* --- Scroll Animation --- */
.fade-in-up {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-up.visible { opacity: 1; transform: translateY(0); }

/* --- Toast Notification --- */
.toast {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 100;
  background: var(--accent); color: var(--accent-fg);
  padding: 1rem 1.5rem; border-radius: var(--radius);
  font-family: var(--font-body); font-size: 0.875rem;
  box-shadow: 0 8px 30px hsla(0,0%,0%,0.15);
  transform: translateY(120%); transition: transform 0.3s ease-out;
}
.toast.show { transform: translateY(0); }

/* --- Keyframes --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Spacing utility for pt-16 (nav offset) --- */
.pt-nav { padding-top: 64px; }
