/* ============================================================
   THEME: Emerald — clean academic green, high legibility
   ============================================================ */
:root {
  --font-sans: "Inter", system-ui, sans-serif;
  --font-serif: "Playfair Display", Georgia, serif;

  --primary:        #047857;
  --primary-dark:   #065f46;
  --primary-light:  #10b981;
  --primary-soft:   #d1fae5;

  --secondary:      #1e40af;
  --secondary-dark: #1e3a8a;
  --secondary-soft: #dbeafe;

  --accent: #f59e0b;

  --bg:        #f7faf8;
  --surface:   #ffffff;
  --surface-2: #eff6f3;
  --surface-3: #dcece4;

  --text:         #0f1f1a;
  --text-muted:   #5c6e67;
  --text-inverse: #fff;

  --border:        #dcece4;
  --border-strong: #b9d6c8;
  --muted:         #eff6f3;

  --sidebar-bg:          #064e3b;
  --sidebar-text:        #f0fdf4;
  --sidebar-text-muted:  rgba(240,253,244,.55);
  --sidebar-hover:       rgba(16,185,129,.14);
  --sidebar-active:      linear-gradient(135deg,#10b981,#059669);

  --topbar-bg:   #ffffff;
  --topbar-text: #0f1f1a;

  --success:#16a34a; --warning:#d97706; --danger:#dc2626; --info:#2563eb;

  --radius: .5rem; --radius-lg: .875rem; --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(4,120,87,.06);
  --shadow-md: 0 8px 22px -10px rgba(4,120,87,.16);
  --shadow-lg: 0 26px 50px -20px rgba(4,120,87,.22);

  --theme-bg-veil: .86;
  --gradient-primary:   linear-gradient(135deg,#10b981 0%,#047857 100%);
  --gradient-secondary: linear-gradient(135deg,#3b82f6 0%,#1e40af 100%);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  
  /* OPTIMIZATION: Removed background-attachment: fixed to fix scroll lag */
  /* Theme background (replaces the old grid lines). Swap the image by
     replacing assets/media/theme-bg.jpg (static image); --theme-bg-veil keeps text legible. */
  background-image:
    linear-gradient(rgba(247,250,248,var(--theme-bg-veil)), rgba(247,250,248,var(--theme-bg-veil))),
    var(--theme-bg-image, url('../media/theme-bg.jpg'));
  background-size: auto, cover;
  background-position: 0 0, center top;
  background-repeat: no-repeat, no-repeat;
}

/* Side nav */
.sidebar { background: var(--sidebar-bg); }
.sidebar .nav-link, .admin-nav-link { color: var(--sidebar-text-muted); border-radius: var(--radius); }
.sidebar .nav-link:hover, .admin-nav-link:hover { background: var(--sidebar-hover); color:#fff; }
.sidebar .nav-link.active, .admin-nav-link.active {
  background: var(--sidebar-active);
  color:#fff;
  box-shadow: inset 3px 0 0 #34d399;
}

/* Top bar */
.admin-header, .mobile-header {
  background: var(--topbar-bg);
  border-bottom: 2px solid var(--border);
}

/* Bottom tabs */
.bottom-tabs { background: #fff; border-top: 2px solid var(--border); }
.tab-item.tab-donate { color: var(--primary); }
.tab-item.tab-start .start-icon-circle {
  background: var(--gradient-primary);
  color:#fff;
  box-shadow: 0 8px 20px -6px var(--primary);
}

/* Buttons */
.btn-primary {
  background: var(--gradient-primary);
  color:#fff; border:none;
  box-shadow: 0 8px 20px -10px var(--primary);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-secondary { background: var(--gradient-secondary); color:#fff; border:none; }

/* Cards */
.card, .admin-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover, .admin-stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Progress */
.progress { background: var(--surface-3); border-radius: var(--radius-pill); overflow:hidden; }
.progress-bar { background: var(--gradient-primary); border-radius: var(--radius-pill); }

/* Forms */
input, select, textarea {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(16,185,129,.18);
  outline: none;
}

.top-tab.active {
  background: var(--gradient-primary);
  box-shadow: 0 6px 18px -8px var(--primary);
}

/* ── Buttons (emerald overrides) ──────────────────────────── */
.btn-primary {
  box-shadow: 0 8px 20px -10px var(--primary);
}
.btn-primary:hover {
  box-shadow: 0 12px 24px -10px rgba(4,120,87,.35);
}
.btn-secondary {
  background: var(--gradient-secondary);
  color:#fff; border:none;
}
.btn-secondary:hover { filter: brightness(1.05); }
.btn-outline {
  border-color: var(--border-strong);
  color: var(--text-muted);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.btn-danger {
  background: var(--danger);
  color: #fff; border: none;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  font-weight: 700;
  letter-spacing: .05em;
}
.badge-primary {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.badge-secondary {
  background: var(--secondary-soft);
  color: var(--secondary-dark);
}
.badge-muted {
  background: var(--surface-2);
  color: var(--text-muted);
}

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-lg);
  border: none;
  font-size: .875rem;
}
.alert-success {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.alert-error {
  background: #fef2f2;
  color: #991b1b;
}
.alert-info {
  background: var(--secondary-soft);
  color: var(--secondary-dark);
}

/* ── Forms (labels + focus) ───────────────────────────────── */
.form-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: .8125rem;
}
.form-control {
  border-color: var(--border-strong);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(16,185,129,.18);
}

/* ── Cards ────────────────────────────────────────────────── */
.card-img {
  background: var(--surface-2);
}

/* ── Progress ─────────────────────────────────────────────── */
.progress-bar {
  box-shadow: 0 0 12px rgba(16,185,129,.35);
}

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap {
  border-color: var(--border-strong);
}
table { background: var(--surface); }
thead { background: var(--surface-2); color: var(--text-muted); }
tbody tr:hover { background: var(--surface-2); }

/* ── Hero & page header ───────────────────────────────────── */
.page-header {
  background: var(--gradient-primary);
  color: #fff;
}
.page-header h1 { color: #fff; }
.page-header p { color: rgba(255,255,255,.85); }
.hero { background: transparent; }
.stat-num { color: var(--primary-dark); }
.stat-lbl { color: var(--text-muted); }

/* ── Section headings ─────────────────────────────────────── */
.section-header { text-align: center; }
.section-header p { color: var(--text-muted); }

/* ── Admin overrides ──────────────────────────────────────── */
.admin-sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
}
.admin-nav-link {
  color: var(--sidebar-text-muted);
}
.admin-nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.admin-nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: inset 3px 0 0 #34d399;
}
.admin-header {
  background: var(--topbar-bg);
  border-bottom: 2px solid var(--border);
  color: var(--topbar-text);
}
.admin-main { background: var(--muted); }
.admin-content { background: transparent; }
.admin-page-title { color: var(--text); }
.admin-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
}

/* ── Org chart ────────────────────────────────────────────── */
.org-box {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.org-box-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.org-box-secondary { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.org-box-light { background: var(--surface-2); color: var(--text-muted); font-weight: 500; }
.org-chart li::before, .org-chart li::after {
  border-top-color: var(--border);
  border-left-color: var(--border);
}

/* ── Mobile / start menu ──────────────────────────────────── */
.mobile-header {
  background: var(--topbar-bg);
  border-bottom: 2px solid var(--border);
}
.mobile-brand { color: var(--primary); }
.bottom-tabs { background: var(--surface); border-top: 2px solid var(--border); }
.tab-item.tab-donate { color: var(--primary); }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
}
.footer-heading { color: var(--sidebar-text); }
.footer-links a { color: var(--sidebar-text-muted); }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top-color: rgba(255,255,255,.1);
  color: rgba(240,253,244,.5);
}

/* ============================================================
   SCHOOL WEBSITE — Video Hero
   ============================================================ */
.hero-video {
  position: relative;
  width: 100%;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #04140e; /* poster fallback base */
  background-size: cover;
  background-position: center;
}
.hero-video__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero-video__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}
.hero-video__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(4, 20, 14, .55) 0%,
    rgba(4, 20, 14, .72) 55%,
    rgba(4, 20, 14, .92) 100%
  );
}
.hero-video__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  color: #fff;
}
.hero-video__eyebrow {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--primary-light);
  margin-bottom: 1rem;
}
.hero-video__title {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  line-height: 1.08;
  font-weight: 700;
  max-width: 18ch;
  margin: 0 0 1.25rem;
  text-shadow: 0 2px 24px rgba(0,0,0,.45);
}
.hero-video__lede {
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.6;
  max-width: 55ch;
  color: rgba(255,255,255,.88);
  margin: 0 0 2rem;
}
.hero-video__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .875rem;
}
.hero-video__actions .btn {
  padding: 1rem 1.75rem;
  font-size: 1rem;
}
.hero-video__actions .btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 16px 32px -16px rgba(16,185,129,.9);
}
.hero-video__actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 36px -16px rgba(16,185,129,.9);
}
.hero-video__actions .btn-ghost {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.55);
  color: #fff;
  backdrop-filter: blur(4px);
}
.hero-video__actions .btn-ghost:hover {
  background: rgba(255,255,255,.22);
  border-color: #fff;
}

/* Play / pause toggle */
.hero-video__toggle {
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem .875rem;
  font-size: .8125rem;
  font-weight: 600;
  color: #fff;
  background: rgba(4,20,14,.55);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(6px);
  transition: background .18s ease, border-color .18s ease;
}
.hero-video__toggle:hover {
  background: rgba(4,20,14,.8);
  border-color: #fff;
}
.hero-video__toggle:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 3px;
}
.hero-video__toggle svg { width: 14px; height: 14px; }

/* ============================================================
   SCHOOL WEBSITE — Bento Grid
   ============================================================ */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.bento__tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
}
.bento__tile:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

/* Featured event tile (large) */
.bento__featured {
  grid-column: span 7;
  grid-row: span 2;
  min-height: 340px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.75rem;
  background-size: cover;
  background-position: center;
}
.bento__featured::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    165deg,
    rgba(4,20,14,.05) 0%,
    rgba(4,20,14,.55) 52%,
    rgba(4,20,14,.92) 100%
  );
  z-index: 0;
}
.bento__featured > * { position: relative; z-index: 1; }
.bento__featured-kicker {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--primary-light);
  margin-bottom: .5rem;
}
.bento__featured-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.15;
  margin: 0 0 .5rem;
}
.bento__featured-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .875rem;
  color: rgba(255,255,255,.82);
  margin-bottom: 1rem;
}
.bento__countdown {
  display: flex;
  gap: .75rem;
  margin-bottom: 1rem;
}
.bento__countdown-unit {
  min-width: 3.25rem;
  padding: .5rem .375rem;
  text-align: center;
  border-radius: var(--radius);
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
}
.bento__countdown-num {
  display: block;
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1;
}
.bento__countdown-label {
  display: block;
  font-size: .6rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
  margin-top: .25rem;
}

/* Activity tiles */
.bento__activity {
  grid-column: span 4;
  min-height: 160px;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
}
.bento__activity--tall {
  grid-column: span 5;
  grid-row: span 2;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  min-height: 340px;
  color: #fff;
  background-size: cover;
  background-position: center;
}
.bento__activity--tall::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4,20,14,.05), rgba(4,20,14,.88));
  z-index: 0;
}
.bento__activity--tall > * { position: relative; z-index: 1; }
.bento__activity-icon {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.bento__activity-body { min-width: 0; }
.bento__activity-title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 .25rem;
}
.bento__activity-desc {
  font-size: .875rem;
  color: var(--text-muted);
  margin: 0;
}
.bento__activity--tall .bento__activity-title { color: #fff; }
.bento__activity--tall .bento__activity-desc { color: rgba(255,255,255,.82); }

/* Hover-to-play video preview */
.bento__activity-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .35s ease;
  z-index: 0;
}
.bento__activity--tall:hover .bento__activity-video,
.bento__activity--tall:focus-within .bento__activity-video {
  opacity: 1;
}

/* Compact news / announcement cards */
.bento__news {
  grid-column: span 5;
  padding: 1.15rem 1.25rem;
}
.bento__news-list { display: grid; gap: .75rem; }
.bento__news-item {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.bento__news-item:last-child { border-bottom: none; padding-bottom: 0; }
.bento__news-date {
  flex-shrink: 0;
  width: 3rem;
  text-align: center;
  padding: .25rem;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.bento__news-day { display: block; font-size: 1.125rem; font-weight: 800; line-height: 1; }
.bento__news-month { display: block; font-size: .6rem; text-transform: uppercase; letter-spacing: .06em; }
.bento__news-title {
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  color: var(--text);
}
.bento__news-title:hover { color: var(--primary); }

/* ============================================================
   SCHOOL WEBSITE — Masonry Gallery
   ============================================================ */
.gallery-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  margin: 0 auto 1.75rem;
  max-width: 1200px;
  padding: 0 1.5rem;
}
.gallery-filter__tab {
  padding: .55rem 1.1rem;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.gallery-filter__tab:hover { color: var(--text); border-color: var(--border-strong); }
.gallery-filter__tab.is-active {
  color: #fff;
  background: var(--gradient-primary);
  border-color: transparent;
  box-shadow: 0 8px 18px -8px var(--primary);
}
.gallery-filter__tab:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

.masonry {
  columns: 4 260px;
  column-gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}
.masonry__item {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  cursor: pointer;
  transition: box-shadow .2s ease, transform .2s ease;
}
.masonry__item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.masonry__item img,
.masonry__item video {
  display: block;
  width: 100%;
  height: auto;
}
.masonry__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: .875rem;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(4,20,14,.85));
}
.masonry__caption-title { font-size: .875rem; font-weight: 700; margin: 0 0 .15rem; }
.masonry__caption-meta { font-size: .72rem; color: rgba(255,255,255,.7); margin: 0; }
.masonry__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(4,20,14,.6);
  border: 1px solid rgba(255,255,255,.6);
  color: #fff;
  pointer-events: none;
}

/* ============================================================
   SCHOOL WEBSITE — Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1.5rem;
  background: rgba(2, 12, 8, .94);
}
.lightbox.is-open { display: flex; }
.lightbox__figure {
  position: relative;
  max-width: min(1100px, 100%);
  max-height: 100%;
  margin: 0;
}
.lightbox__media {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: block;
  margin: 0 auto;
}
.lightbox__caption {
  margin-top: .875rem;
  text-align: center;
  color: rgba(255,255,255,.85);
  font-size: .875rem;
}
.lightbox__caption strong { color: #fff; }
.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.4);
  color: #fff;
  font-size: 1.25rem;
}
.lightbox__close:hover { background: rgba(255,255,255,.24); }
.lightbox__close:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 3px;
}
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.4);
  color: #fff;
  font-size: 1.25rem;
}
.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }
.lightbox__nav:hover { background: rgba(255,255,255,.24); }
.lightbox__nav:focus-visible,
.lightbox__close:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 3px;
}

/* ============================================================
   SCHOOL WEBSITE — Loading skeletons & empty states
   ============================================================ */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--radius);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,.65),
    transparent
  );
  animation: skeletonShimmer 1.4s infinite;
}
.skeleton--text { height: .875rem; margin-bottom: .5rem; }
.skeleton--title { height: 1.5rem; width: 60%; margin-bottom: .75rem; }
.skeleton--image { aspect-ratio: 16 / 9; border-radius: var(--radius-lg); }
.skeleton--tile { min-height: 160px; border-radius: var(--radius-lg); }
@keyframes skeletonShimmer { to { transform: translateX(100%); } }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 3.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}
.empty-state__icon {
  font-size: 2.5rem;
  opacity: .7;
}
.empty-state__title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
}
.empty-state__desc {
  font-size: .875rem;
  max-width: 38ch;
}

/* ============================================================
   School sections (shared layout wrappers)
   ============================================================ */
.school-section {
  padding: 4rem 0;
}
.school-section--alt { background: var(--muted); }
.school-section__head {
  max-width: 1200px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
}
.school-section__kicker {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: .5rem;
}
.school-section__title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  margin: 0 0 .5rem;
  color: var(--text);
}
.school-section__lede {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0;
}

/* ============================================================
   Responsive collapse (mobile-first)
   ============================================================ */
@media (max-width: 1024px) {
  .bento__featured { grid-column: span 12; grid-row: auto; }
  .bento__activity { grid-column: span 6; }
  .bento__activity--tall { grid-column: span 6; grid-row: auto; min-height: 220px; }
  .bento__news { grid-column: span 12; }
  .masonry { columns: 3 220px; }
}

@media (max-width: 768px) {
  .bento { grid-template-columns: repeat(6, 1fr); }
  .bento__featured { grid-column: span 6; min-height: 280px; }
  .bento__activity { grid-column: span 3; min-height: 140px; }
  .bento__activity--tall { grid-column: span 3; min-height: 180px; }
  .bento__news { grid-column: span 6; }
  .masonry { columns: 2 160px; }
  .hero-video { min-height: 82svh; }
  .hero-video__title { max-width: 100%; }
  .hero-video__actions { flex-direction: column; align-items: stretch; }
  .hero-video__actions .btn { width: 100%; justify-content: center; }
  .hero-video__toggle { bottom: 1rem; right: 1rem; }
  .lightbox__nav { display: none; }
}

@media (max-width: 480px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento__activity { grid-column: span 2; }
  .bento__activity--tall { grid-column: span 2; }
  .bento__featured { grid-column: span 2; }
  .bento__news { grid-column: span 2; }
  .masonry { columns: 1; }
  .school-section { padding: 2.75rem 0; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .bento__tile,
  .masonry__item,
  .hero-video__actions .btn { transition: none; }
  .skeleton::after { animation: none; }
  .bento__activity-video { transition: none; }
}

/* ============================================================
   EMERALD SHELL — full-width top navigation (no sidebar)
   ============================================================ */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 3000;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  transition: top .15s ease;
}
.skip-link:focus { top: 1rem; }

.school-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.school-topbar__inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.school-brand {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.school-brand__name { overflow: hidden; text-overflow: ellipsis; }
.school-brand__logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}
.school-brand__mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--gradient-primary);
  color: #fff;
}
.school-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-left: auto;
}
.school-nav__link {
  white-space: nowrap;
  padding: .55rem .8rem;
  border-radius: var(--radius-pill);
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color .15s ease, background .15s ease;
}
.school-nav__link:hover { color: var(--primary); background: var(--primary-soft); }
.school-nav__link.is-active { color: var(--primary-dark); background: var(--primary-soft); }
.school-nav__cta { margin-left: .5rem; white-space: nowrap; }
.school-nav-toggle {
  display: none;
  margin-left: auto;
  padding: .45rem .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
}
.school-nav-toggle:focus-visible,
.school-nav__link:focus-visible,
.school-brand:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

.school-main { min-height: 60vh; }

.school-footer {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
}
.school-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 2rem;
}
.school-footer__name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin: 0 0 .35rem;
  color: #fff;
}
.school-footer__tagline {
  margin: 0;
  max-width: 36ch;
  font-size: .875rem;
  color: var(--sidebar-text-muted);
}
.school-footer .footer-heading { margin-bottom: .75rem; }
.school-footer .footer-links li { margin-bottom: .35rem; font-size: .875rem; }
.school-footer__bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: .8rem;
  color: var(--sidebar-text-muted);
}

/* Masonry items are buttons for keyboard support */
button.masonry__item {
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--surface);
  cursor: zoom-in;
}
button.masonry__item:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
.masonry__caption { display: block; }
.masonry__caption-title { display: block; }
.masonry__caption-meta { display: block; }

/* Lightbox media */
.lightbox__media-wrap { display: flex; justify-content: center; }
video.lightbox__media { background: #000; }

/* Bento news heading */
.bento__news > .bento__news-title {
  margin: 0 0 .75rem;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.bento__news .bento__news-title { font-size: .9rem; line-height: 1.35; }

@media (max-width: 1180px) {
  .school-topbar__inner { padding: .65rem 1rem; gap: 1rem; }
  .school-brand { flex-shrink: 1; min-width: 0; }
  .school-nav-toggle { display: inline-flex; flex-shrink: 0; }
  .school-nav {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(100% - .25rem);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
    margin-left: 0;
    padding: .75rem;
    max-height: calc(100vh - 6rem);
    max-height: calc(100dvh - 6rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
  }
  .school-nav.is-open { display: flex; }
  .school-nav__link { padding: .8rem 1rem; font-size: .95rem; }
  .school-nav__cta { margin: .5rem 0 0; justify-content: center; text-align: center; }
}

@media (max-width: 720px) {
  .school-footer__inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .school-footer__bottom { flex-direction: column; }
}

/* ============================================================
   EMERALD START MENU (Windows-key style)
   ============================================================ */
.school-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-muted);
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.school-menu-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}
.school-menu-btn__icon { font-size: 1rem; line-height: 1; color: var(--primary); }
.school-menu-btn, .emerald-dock { cursor: pointer; }
.school-menu-btn:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

/* Floating Windows-key dock (mobile) */
.emerald-dock {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 95;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  padding: .5rem .9rem .4rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px -18px rgba(4, 20, 14, .55);
  color: var(--primary-dark);
  transition: transform .15s ease, box-shadow .15s ease;
}
.emerald-dock:hover { box-shadow: 0 22px 44px -18px rgba(4, 20, 14, .65); }
.emerald-dock:active { transform: translateX(-50%) scale(.96); }
.emerald-dock__icon {
  font-size: 1.15rem;
  line-height: 1;
  color: var(--primary);
}
.emerald-dock__label {
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.emerald-dock:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 3px;
}

body.emerald-menu-open { overflow: hidden; }

.emerald-menu {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
}
.emerald-menu.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.emerald-menu__scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 20, 14, .62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.emerald-menu__card {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(86vh, 780px);
  max-height: min(86dvh, 780px);
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  box-shadow: 0 40px 90px -30px rgba(4, 20, 14, .6);
  transform: translateY(14px) scale(.98);
  opacity: 0;
  transition: transform .28s cubic-bezier(.2, .9, .3, 1.2), opacity .22s ease;
}
.emerald-menu.is-open .emerald-menu__card {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.emerald-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  background: linear-gradient(135deg, #065f46 0%, #047857 55%, #10b981 100%);
  color: #fff;
}
.emerald-menu__brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-width: 0;
}
.emerald-menu__logo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  color: var(--primary);
  font-size: 1.4rem;
  box-shadow: 0 10px 20px -10px rgba(0, 0, 0, .45);
}
.emerald-menu__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.emerald-menu__brandtext {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.emerald-menu__title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.emerald-menu__sub {
  margin-top: .2rem;
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
}
.emerald-menu__close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 1rem;
  transition: background .15s ease;
}
.emerald-menu__close:hover { background: rgba(255, 255, 255, .26); }
.emerald-menu__close:focus-visible,
.emerald-menu__tile:focus-visible,
.emerald-menu__admin:focus-visible,
.emerald-menu__give-link:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

.emerald-menu__search {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 1.25rem 1.4rem .25rem;
  padding: .35rem .4rem .35rem .9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
}
.emerald-menu__search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .16);
}
.emerald-menu__searchicon { color: var(--text-muted); font-size: 1.1rem; }
.emerald-menu__search input {
  flex: 1;
  min-width: 0;
  padding: .45rem 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: .9rem;
  outline: none;
}

.emerald-menu__label {
  margin: 1.1rem 1.4rem .55rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.emerald-menu__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .6rem;
  padding: 0 1.4rem;
}
.emerald-menu__tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  padding: .85rem .4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--text);
  font-size: .75rem;
  font-weight: 600;
  text-align: center;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.emerald-menu__tile:hover {
  transform: translateY(-2px);
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}
.emerald-menu__tileicon { font-size: 1.35rem; line-height: 1; }
.emerald-menu__tile, .emerald-menu__admin, .emerald-menu__give-link { cursor: pointer; }

.emerald-menu__give {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  padding: 0 1.4rem;
}
.emerald-menu__give-link {
  flex: 1;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .7rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: .85rem;
  font-weight: 700;
  transition: background .15s ease, color .15s ease;
}
.emerald-menu__give-link:hover { background: var(--primary); color: #fff; }

.emerald-menu__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.emerald-menu__admin {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem .9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: .8rem;
  font-weight: 700;
  transition: color .15s ease, border-color .15s ease;
}
.emerald-menu__admin:hover { color: var(--primary); border-color: var(--primary); }
.emerald-menu__hint { font-size: .7rem; color: var(--text-muted); }

@media (max-width: 1320px) {
  .school-menu-btn__label { display: none; }
}
@media (max-width: 1180px) {
  .school-menu-btn { display: none; }
  .emerald-dock { display: flex; }
  .school-main { padding-bottom: 5.25rem; }
  .school-footer__bottom { padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 640px) {
  .emerald-menu { align-items: flex-end; padding: .75rem; }
  .emerald-menu__card { max-height: 92vh; max-height: 92dvh; border-radius: 1.1rem; }
  .emerald-menu__head { padding: 1rem; }
  .emerald-menu__grid { grid-template-columns: repeat(2, 1fr); }
  .emerald-menu__hint { display: none; }
}