#main-header {
  position: sticky !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 50;
  will-change: transform, background-color;
  transition:
    background-color 0.15s ease-out,
    box-shadow 0.15s ease-out,
    border-color 0.15s ease-out;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  /* Transparent dark background by default */
  background-color: rgba(15, 23, 42, 0.7) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  /* Make the header overlap the content below it */
  margin-bottom: -80px;
}
html.is-scrolled #main-header {
  background-color: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Ensure text colors transition */
html.is-scrolled #header-school-name {
  color: #0e5ea8 !important;
}
html.is-scrolled #header-school-motto {
  color: #0e5ea8 !important;
  opacity: 0.8;
}

/* Nav link colors on scroll */
html.is-scrolled .nav-link-item {
  color: #334155 !important;
}
html.is-scrolled .nav-link-item:hover {
  color: #0e5ea8 !important;
}
html.is-scrolled .nav-link-active {
  color: #0e5ea8 !important;
}

/* Keep mobile menu toggle visible when sticky header turns white */
html.is-scrolled #mobile-menu-toggle {
  color: #0f172a;
}

html.is-scrolled #mobile-menu-toggle:hover {
  background-color: #f1f5f9;
}
