/* ==================================================================
   Mrisho Gambo Secondary School — Shared Styles
   Design system: exercise-book ruled margins, brass gold + deep
   indigo, Space Grotesk headings over Source Sans body copy.
   ================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Source+Sans+3:wght@400;500;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,500;1,8..60,500&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  /* Color */
  --ink: #14213b;
  --indigo: #1b3a63;
  --indigo-deep: #0e2038;
  --gold: #e3a63e;
  --gold-deep: #b9791f;
  --leaf: #2f7a56;
  --leaf-deep: #21573d;
  --paper: #ffffff;
  --panel: #f1f5fa;
  --panel-deep: #e7edf5;
  --line: #dde3ec;
  --text: #1d2433;
  --text-muted: #5b6472;

  /* Elevation */
  --shadow-sm: 0 1px 3px rgba(14, 32, 56, 0.08);
  --shadow: 0 10px 28px -12px rgba(14, 32, 56, 0.22);
  --shadow-lg: 0 26px 60px -18px rgba(14, 32, 56, 0.3);

  /* Shape / motion */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 24px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --speed: 0.25s;

  /* Type */
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-mono: 'IBM Plex Mono', 'Consolas', monospace;
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a { color: var(--indigo); text-decoration: none; transition: color var(--speed) var(--ease); }
a:hover { color: var(--gold-deep); }

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

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); font-weight: 700; letter-spacing: -0.01em; }

/* ========== EYEBROW / LABEL ========== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 0.6rem;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ========== HEADER ========== */
.site-header {
  position: relative;
  background: var(--indigo);
  color: var(--white, #fff);
  padding: 1.5rem 1.5rem 0;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

/* Exercise-book ruled-paper texture + margin line — the site's signature motif */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, transparent calc(8% - 1px), rgba(227, 166, 62, 0.55) calc(8% - 1px), rgba(227, 166, 62, 0.55) 8%, transparent calc(8% + 1px));
  background-size: 100% 28px, 100% 100%;
  background-repeat: repeat, no-repeat;
  opacity: 0.9;
}

.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 140% at 50% -10%, rgba(227, 166, 62, 0.18), transparent 60%);
}

.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 1.6rem;
}

.school-logo {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  box-shadow: var(--shadow-lg);
  background: var(--paper);
}

.site-header h1 {
  font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0.15rem 0 0;
  color: var(--paper);
}

.site-header .tagline {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

/* ========== NAVIGATION ========== */
.main-nav {
  background: var(--indigo-deep);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.nav-brand {
  display: none;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--paper);
  font-size: 0.95rem;
  padding: 0.9rem 0;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  margin: 0.55rem 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--paper);
  border-radius: 2px;
  transition: transform var(--speed) var(--ease), opacity var(--speed) var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0 auto;
  padding: 0;
}

.main-nav a {
  position: relative;
  display: block;
  color: rgba(255, 255, 255, 0.85);
  padding: 0.95rem 1.05rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  transition: color var(--speed) var(--ease);
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 1.05rem;
  right: 1.05rem;
  bottom: 0.55rem;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--speed) var(--ease);
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--paper);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  transform: scaleX(1);
}

/* ========== MAIN CONTENT ========== */
main {
  flex: 1;
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 2.75rem 1.25rem;
}

.page-title {
  text-align: center;
  font-size: clamp(1.7rem, 1.4rem + 1.2vw, 2.3rem);
  color: var(--ink);
  margin-bottom: 0.6rem;
}

.page-subtitle {
  text-align: center;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 2.5rem;
  font-size: 1.05rem;
}

section { margin-bottom: 3rem; }
section:last-child { margin-bottom: 0; }

section > h2 {
  color: var(--ink);
  font-size: 1.5rem;
  margin-bottom: 1.1rem;
}

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

/* Reveal-on-scroll (progressive enhancement via site.js) */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.is-visible { opacity: 1; transform: none; }

/* ========== CARDS ========== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), border-color var(--speed) var(--ease);
  text-align: left;
  border: 1px solid var(--line);
  border-top: 3px solid var(--indigo);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-top-color: var(--gold);
}

.card h3 { color: var(--ink); font-size: 1.2rem; margin-bottom: 0.5rem; }
.card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.25rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--indigo);
  color: var(--paper);
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  border: none;
  cursor: pointer;
  transition: background var(--speed) var(--ease), transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.btn::after { content: "\2192"; transition: transform var(--speed) var(--ease); }
.btn:hover { background: var(--indigo-deep); color: var(--paper); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:hover::after { transform: translateX(3px); }

.btn-accent { background: var(--gold); color: var(--indigo-deep); }
.btn-accent:hover { background: var(--gold-deep); color: var(--paper); }

/* ========== LISTS ========== */
.content-list {
  list-style: none;
  max-width: 800px;
  margin: 0 auto;
}

.content-list li {
  background: var(--panel);
  padding: 0.95rem 1.25rem;
  margin-bottom: 0.65rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--indigo);
  line-height: 1.55;
}

.content-list li strong { color: var(--indigo); font-family: var(--font-display); }

/* ========== TABLES ========== */
.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--paper);
  border: 1px solid var(--line);
}

table { width: 100%; border-collapse: collapse; min-width: 600px; }

th, td { padding: 0.9rem 1rem; text-align: center; border-bottom: 1px solid var(--line); font-size: 0.94rem; }

th {
  background: var(--indigo);
  color: var(--paper);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

tr:nth-child(even) { background: var(--panel); }
tr:hover { background: var(--panel-deep); }

td:first-child { text-align: left; font-weight: 600; white-space: nowrap; color: var(--ink); }

/* ========== PROFILE / FLIP CARDS ========== */
.profile-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  margin: 1.75rem 0;
  background: var(--panel);
  padding: 1.75rem;
  border-radius: var(--radius-lg);
}

.profile-text { flex: 1; min-width: 260px; }
.profile-text p { color: var(--text-muted); line-height: 1.75; }

/* Leadership portrait — static, no interaction required to read it */
.person-card {
  width: 190px;
  flex-shrink: 0;
  text-align: center;
}

.person-photo {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 0.9rem;
  border: 3px solid var(--gold);
  box-shadow: var(--shadow);
}

.person-card h3 { font-size: 1.05rem; color: var(--ink); margin-bottom: 0.2rem; }

.person-card .person-role {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* Department cards — subject header strip + head-of-department row, always visible */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.dept-card {
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.dept-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.dept-top {
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 0.85rem 1rem;
  background: var(--indigo);
}

/* Rotate a harmonious 6-color set across department cards instead of arbitrary inline colors */
.dept-card:nth-of-type(6n+1) .dept-top { background: var(--indigo); }
.dept-card:nth-of-type(6n+2) .dept-top { background: var(--leaf); }
.dept-card:nth-of-type(6n+3) .dept-top { background: var(--gold-deep); }
.dept-card:nth-of-type(6n+4) .dept-top { background: #4a4f80; }
.dept-card:nth-of-type(6n+5) .dept-top { background: #2c6e73; }
.dept-card:nth-of-type(6n+6) .dept-top { background: #8a5a2e; }

.dept-body {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
}

.dept-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--panel);
}

.dept-body h3 { font-size: 0.94rem; color: var(--ink); margin-bottom: 0.15rem; }
.dept-body p { color: var(--text-muted); font-size: 0.78rem; }

/* ========== CONTACT CARDS ========== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.teacher-card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.85rem 1.35rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--indigo);
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.teacher-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }

.teacher-card img {
  width: 116px; height: 116px; border-radius: 50%; object-fit: cover;
  margin: 0 auto 1rem; border: 3px solid var(--panel);
}

.teacher-card h3 { color: var(--ink); font-size: 1.2rem; margin-bottom: 0.2rem; }

.teacher-card .role {
  font-family: var(--font-mono); color: var(--gold-deep); font-weight: 600;
  margin-bottom: 0.85rem; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
}

.teacher-card .contact-info { font-size: 0.9rem; color: var(--text-muted); }
.teacher-card .contact-info a { color: var(--indigo); }

/* Contact form */
.contact-form {
  background: var(--panel);
  padding: 2.25rem;
  border-radius: var(--radius-lg);
  max-width: 560px;
  margin: 2rem auto;
}

.contact-form h2 { text-align: center; margin-bottom: 1.5rem; display: block; }

.contact-form label {
  display: block; font-weight: 600; margin-bottom: 0.35rem;
  font-size: 0.85rem; color: var(--ink); font-family: var(--font-display);
}

.contact-form input, .contact-form textarea {
  width: 100%; padding: 0.75rem 1rem; margin-bottom: 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 1rem; font-family: var(--font-body); background: var(--paper);
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.contact-form input:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(27, 58, 99, 0.14);
}

.contact-form button { width: 100%; justify-content: center; padding: 0.9rem; font-size: 1rem; }

/* Map */
.map-container {
  width: 100%; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); margin: 2rem 0; background: var(--panel);
  border: 1px solid var(--line);
}

.map-container iframe { width: 100%; height: 400px; border: 0; display: block; }

/* ========== NEWS ========== */
.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.4rem;
  max-width: 1000px;
  margin: 0 auto;
}

.news-item {
  background: var(--paper);
  padding: 1.5rem 1.6rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--indigo);
  transition: box-shadow var(--speed) var(--ease), transform var(--speed) var(--ease), border-color var(--speed) var(--ease);
}

.news-item:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-left-color: var(--gold); }
.news-item h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.news-item h3 a { color: var(--ink); cursor: pointer; }
.news-item h3 a:hover { color: var(--gold-deep); }
.news-item p { color: var(--text-muted); font-size: 0.94rem; }

/* Modal */
.modal {
  display: none; position: fixed; z-index: 1000; inset: 0;
  background: rgba(14, 32, 56, 0.65); overflow-y: auto; padding: 2rem 1rem;
}

.modal-content {
  background: var(--paper); max-width: 640px; margin: 2rem auto; padding: 1.75rem;
  border-radius: var(--radius-lg); text-align: center; position: relative;
  max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}

.modal-content img { width: 100%; border-radius: var(--radius-sm); margin-bottom: 0.75rem; }
.modal-content h2 { margin-bottom: 1rem; }
.modal-content ul { text-align: left; margin: 1rem 0; padding-left: 1.2rem; }
.modal-content li { margin-bottom: 0.45rem; }

.close-btn {
  background: var(--indigo); color: var(--paper); border: none; padding: 0.6rem 1.5rem;
  border-radius: var(--radius-sm); font-family: var(--font-display); font-weight: 600;
  cursor: pointer; margin-top: 0.75rem; font-size: 0.92rem;
}

.close-btn:hover { background: var(--indigo-deep); }

/* ========== NOTES / MATERIALS ========== */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2.5rem;
}

.material-card {
  background: var(--indigo);
  color: var(--paper);
  padding: 1.6rem 1.35rem;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--speed) var(--ease), background var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.material-card:hover { transform: translateY(-4px); background: var(--indigo-deep); box-shadow: var(--shadow); }
.material-card h3 { font-size: 1.02rem; margin-bottom: 0.95rem; letter-spacing: 0.01em; color: var(--paper); }
.material-card .btn { background: var(--paper); color: var(--indigo); font-size: 0.82rem; padding: 0.55rem 1.1rem; }
.material-card .btn:hover { background: var(--gold); color: var(--indigo-deep); }

/* ========== HOME SPECIFIC ========== */
.hero {
  position: relative;
  width: 100%;
  max-height: 480px;
  overflow: hidden;
}

.hero img { width: 100%; height: 480px; object-fit: cover; }

.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(14, 32, 56, 0.88) 0%, rgba(14, 32, 56, 0.35) 55%, rgba(14, 32, 56, 0.05) 100%);
}

.hero-copy {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem 2.25rem;
  color: var(--paper);
}

.hero-copy .eyebrow { color: var(--gold); }
.hero-copy .eyebrow::before { background: var(--gold); }

.hero-copy h1 {
  font-size: clamp(1.8rem, 1.3rem + 2.4vw, 3rem);
  color: var(--paper);
  max-width: 640px;
  margin-bottom: 0.6rem;
}

.hero-copy p {
  max-width: 520px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
  margin-bottom: 1.4rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 2.5rem 0;
}

.stat-strip .stat {
  background: var(--paper);
  padding: 1.4rem 1rem;
  text-align: center;
}

.stat .stat-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--indigo);
}

.stat .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.bulletin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.notifications-box, .events-box {
  background: var(--panel);
  padding: 1.6rem 1.75rem;
  border-radius: var(--radius-lg);
}

.notifications-box h3, .events-box h3 { color: var(--ink); margin-bottom: 1rem; font-size: 1.15rem; }
.notifications-box ul, .events-box ul { list-style: none; }

.notifications-box li, .events-box li {
  position: relative;
  background: var(--paper);
  padding: 0.75rem 1rem 0.75rem 1.75rem;
  margin-bottom: 0.55rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.94rem;
  box-shadow: var(--shadow-sm);
}

.notifications-box li::before, .events-box li::before {
  content: "";
  position: absolute; left: 0.75rem; top: 1.05rem;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
}

/* Motto highlight */
.motto {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--ink);
  font-weight: 500;
  margin: 0.5rem 0 2.25rem;
}

.motto span { color: var(--gold-deep); }

/* Slideshow */
.slideshow {
  position: relative;
  height: 380px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.slideshow-teachers {
  height: 280px;
}

.slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1s ease; }
.slide.active { opacity: 1; }

.slide .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(14, 32, 56, 0.85), rgba(14, 32, 56, 0.2));
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 2rem; color: var(--paper);
}

.slide .overlay h1 { font-size: 1.8rem; margin-bottom: 0.4rem; color: var(--paper); }
.slide .overlay p { font-size: 1.05rem; opacity: 0.95; }

/* ========== TIMELINE (achievements) ========== */
.timeline {
  list-style: none;
  max-width: 720px;
  margin: 0 auto;
  border-left: 2px solid var(--line);
  padding-left: 0;
}

.timeline li {
  position: relative;
  padding: 0 0 1.5rem 1.75rem;
}

.timeline li:last-child { padding-bottom: 0; }

.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.3rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 2px var(--indigo);
}

.timeline .year {
  display: block;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--indigo);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

.timeline p { color: var(--text-muted); }

/* Icon panels (mission / vision) */
.icon-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.icon-panel {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border-top: 3px solid var(--leaf);
}

.icon-panel:nth-of-type(2) { border-top-color: var(--gold); }

.icon-panel h2 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.icon-panel p { color: var(--text-muted); line-height: 1.75; }

/* ========== FOOTER ========== */
.site-footer {
  background: var(--indigo-deep);
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding: 1.75rem 1rem;
  margin-top: auto;
  font-size: 0.88rem;
}

.site-footer p { margin: 0; }

/* ========== RESPONSIVE ========== */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-brand { display: block; }

  .main-nav ul {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding-bottom: 0.5rem;
  }

  .main-nav ul.is-open { display: flex; }

  .main-nav a {
    text-align: left;
    padding: 0.95rem 1.15rem;
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  .main-nav a::after { display: none; }
  .main-nav a.active { background: rgba(255, 255, 255, 0.08); color: var(--gold); }
}

@media (max-width: 768px) {
  body { font-size: 16px; /* prevent iOS zoom on inputs, improve readability */ }

  .site-header { padding: 1.1rem 1rem 0; }
  .site-header h1 { font-size: 1.25rem; line-height: 1.25; }
  .school-logo { width: 76px; height: 76px; }
  .site-header .tagline { font-size: 0.72rem; letter-spacing: 0.12em; }

  main { padding: 1.75rem 1rem; }

  .page-title { font-size: 1.45rem; margin-bottom: 0.45rem; }
  .page-subtitle { font-size: 0.98rem; margin-bottom: 1.75rem; line-height: 1.55; }

  .profile-row {
    flex-direction: column;
    text-align: center;
    padding: 1.35rem 1.1rem;
    gap: 1.25rem;
  }
  .person-card { width: 100%; max-width: 200px; margin: 0 auto; }
  .person-photo { width: 110px; height: 110px; }

  .hero img, .slideshow { height: 220px; }
  .hero-copy { padding: 0 1rem 1.25rem; }
  .hero-copy h1 { font-size: 1.45rem; }
  .hero-copy p { font-size: 0.95rem; margin-bottom: 1rem; }
  .hero-actions { gap: 0.65rem; }
  .hero-actions .btn { padding: 0.65rem 1.1rem; font-size: 0.85rem; }

  .map-container iframe { height: 260px; }

  /* Tables: keep scrollable, improve touch */
  .table-wrap {
    margin: 1rem -0.25rem;
    border-radius: var(--radius-sm);
    -webkit-overflow-scrolling: touch;
  }
  th, td {
    padding: 0.7rem 0.55rem;
    font-size: 0.82rem;
  }
  td:first-child { white-space: normal; min-width: 110px; }

  /* Cards & grids tighter */
  .card-grid, .dept-grid, .materials-grid, .contact-grid, .news-list {
    gap: 1rem;
  }
  .card, .teacher-card, .material-card, .news-item {
    padding: 1.25rem 1.1rem;
  }
  .dept-body { padding: 0.8rem; gap: 0.65rem; }
  .dept-avatar { width: 42px; height: 42px; }

  /* Buttons: larger touch targets */
  .btn {
    min-height: 44px;
    padding: 0.7rem 1.25rem;
  }

  /* Forms */
  .contact-form { padding: 1.5rem 1.15rem; margin: 1.5rem auto; }
  .contact-form input,
  .contact-form textarea {
    font-size: 16px; /* prevent iOS zoom */
    padding: 0.8rem 0.9rem;
  }

  /* Lists */
  .content-list li { padding: 0.85rem 1rem; font-size: 0.95rem; }

  /* Motto */
  .motto { font-size: 1.3rem; margin-bottom: 1.75rem; }

  /* Stat strip */
  .stat-strip .stat { padding: 1.1rem 0.6rem; }
  .stat .stat-num { font-size: 1.4rem; }
  .stat .stat-label { font-size: 0.72rem; }

  /* Bulletin */
  .notifications-box, .events-box { padding: 1.25rem 1.15rem; }

  /* Icon panels */
  .icon-panel { padding: 1.5rem 1.25rem; }

  /* Modal */
  .modal { padding: 1rem 0.75rem; }
  .modal-content { padding: 1.35rem 1.1rem; margin: 1rem auto; max-height: 90vh; }
}

@media (max-width: 480px) {
  .school-logo { width: 68px; height: 68px; }
  .site-header h1 { font-size: 1.15rem; }
  .page-title { font-size: 1.3rem; }
  .hero img, .slideshow { height: 190px; }
  .hero-copy h1 { font-size: 1.3rem; }
  .card-grid { grid-template-columns: 1fr; }
  .dept-grid { grid-template-columns: 1fr; }
  .materials-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .news-list { grid-template-columns: 1fr; }
  .icon-panels { grid-template-columns: 1fr; }
  .bulletin-grid { grid-template-columns: 1fr; }
  th, td { padding: 0.55rem 0.4rem; font-size: 0.78rem; }
  .btn { width: 100%; justify-content: center; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
}

/* Utility */
.text-center { text-align: center; }
.eyebrow.text-center {
  justify-content: center;
  width: 100%;
}
.mt-2 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-prose { max-width: 720px; }
.text-muted { color: var(--text-muted); }
.leading-relaxed { line-height: 1.8; }
.heading-plain { display: block; border: none; }
.img-rounded {
  max-width: 320px;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.subtitle-left {
  text-align: left;
  margin: 0 0 1.5rem;
  max-width: none;
}
.note-sm {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.75rem;
}
