/* Fairfield Township School District — concept demo
   Navy + cream professional K–8 aesthetic. Mobile-first. */
:root {
  --navy: #1B3A5F;
  --navy-deep: #12263F;
  --navy-soft: #E8EEF5;
  --cream: #FBF8F1;
  --cream-deep: #F0EBE0;
  --ink: #1A2332;
  --ink-muted: #4A5568;
  --ink-faint: #6B7785;
  --gold: #C9A227;
  --gold-soft: #F7F0D8;
  --white: #FFFFFF;
  --rule: #E2D9C8;
  --success: #2E5A3C;
  --danger: #8B2E2E;
  --holiday: #9B2C2C;
  --early: #B86E00;
  --event: #1B3A5F;
  --break: #9B2C2C;
  --virtual: #0E7490;
  --staff: #2E5A3C;
  --shade-closed: #F8E4E4;
  --shade-early: #FFF3D6;
  --shade-virtual: #E0F4F8;
  --shade-staff: #E4F0E8;
  --shade-event: #E8EEF5;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(26, 35, 50, 0.05), 0 10px 28px rgba(26, 35, 50, 0.07);
  --max: 1100px;
  --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Libre Baskerville", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--navy-deep); }
h1, h2, h3, h4 {
  font-family: var(--display);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.55em;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.55rem); }
h2 { font-size: clamp(1.35rem, 2.8vw, 1.85rem); }
h3 { font-size: 1.12rem; font-family: var(--font); font-weight: 650; }
p { margin: 0 0 1em; color: var(--ink-muted); }
.lead { font-size: 1.125rem; color: var(--ink-muted); max-width: 40rem; }
.muted { color: var(--ink-faint); font-size: 0.95rem; }
.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Demo banner */
.demo-banner {
  background: var(--navy-deep);
  color: #F5F0E6;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.45rem 1rem;
  position: sticky;
  top: 0;
  z-index: 60;
}
.demo-banner a { color: var(--gold); }

/* Header */
.site-header {
  position: sticky; top: 1.85rem; z-index: 50;
  background: rgba(251, 248, 241, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.75rem 0; min-height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 0.7rem;
  text-decoration: none; color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; }
.brand-text {
  font-weight: 700; font-size: 0.92rem; letter-spacing: -0.01em; line-height: 1.2;
}
.brand-text span {
  display: block; font-weight: 500; font-size: 0.72rem;
  color: var(--ink-faint); letter-spacing: 0.02em; font-family: var(--font);
}

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border: 1px solid var(--rule);
  border-radius: 10px; background: var(--white); color: var(--navy); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.15rem 0.35rem; align-items: center;
}
.site-nav a {
  display: inline-block; padding: 0.45rem 0.7rem; border-radius: 8px;
  text-decoration: none; color: var(--ink-muted); font-weight: 600; font-size: 0.92rem;
}
.site-nav a:hover, .site-nav a[aria-current="page"] {
  color: var(--navy); background: var(--navy-soft);
}
.site-nav .nav-cta {
  background: var(--navy); color: var(--cream) !important; margin-left: 0.25rem;
}
.site-nav .nav-cta:hover { background: var(--navy-deep); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--cream); border-bottom: 1px solid var(--rule);
    padding: 0.75rem 1rem 1rem; box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; }
  .site-nav .nav-cta { margin-left: 0; text-align: center; }
}
@media (min-width: 861px) {
  .nav-toggle { display: none; }
  .site-nav { display: block !important; position: static; padding: 0; box-shadow: none; border: 0; background: transparent; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.7rem 1.15rem; border-radius: 10px; font-weight: 650; font-size: 0.95rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  font-family: var(--font); line-height: 1.2;
}
.btn-primary { background: var(--navy); color: var(--cream); }
.btn-primary:hover { background: var(--navy-deep); color: var(--cream); }
.btn-ghost { background: transparent; border-color: var(--rule); color: var(--navy); }
.btn-ghost:hover { background: var(--navy-soft); color: var(--navy-deep); }
.btn-gold { background: var(--gold); color: var(--navy-deep); }
.btn-gold:hover { filter: brightness(0.95); color: var(--navy-deep); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1.25rem; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; }

/* Hero */
.hero {
  padding: 2.5rem 0 2rem;
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(201, 162, 39, 0.12), transparent 55%),
    linear-gradient(180deg, var(--navy-soft) 0%, var(--cream) 100%);
  border-bottom: 1px solid var(--rule);
}
.hero-grid {
  display: grid; gap: 1.75rem; align-items: start;
}
@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1.35fr 1fr; gap: 2.5rem; }
}
.eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--navy);
  margin: 0 0 0.75rem; background: var(--gold-soft); padding: 0.3rem 0.65rem; border-radius: 999px;
}
.hero-panel {
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow);
}
.stat-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem;
}
.stat strong {
  display: block; font-size: 1.15rem; color: var(--navy); font-family: var(--display);
}
.stat span { font-size: 0.82rem; color: var(--ink-faint); }

/* Sections */
.section { padding: 2.75rem 0; }
.section-alt { background: var(--white); border-block: 1px solid var(--rule); }
.section-head { margin-bottom: 1.5rem; max-width: 40rem; }
.rule-gold {
  width: 48px; height: 3px; border: 0; background: var(--gold); margin: 0 0 0.85rem;
}

/* Cards */
.card-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.2rem; box-shadow: 0 1px 2px rgba(26,35,50,0.04);
}
.card h3 { margin-bottom: 0.35em; }
.feature-icon {
  width: 42px; height: 42px; border-radius: 10px; background: var(--navy-soft);
  display: grid; place-items: center; color: var(--navy); margin-bottom: 0.75rem;
}
.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 0.22rem 0.5rem; border-radius: 6px;
  background: var(--navy-soft); color: var(--navy); margin-bottom: 0.5rem;
}
.badge-gold { background: var(--gold-soft); color: #6B5200; }

.announce-card time { display: block; font-size: 0.82rem; color: var(--ink-faint); margin-bottom: 0.35rem; }
.announce-card h3 a { text-decoration: none; color: var(--ink); }
.announce-card h3 a:hover { color: var(--navy); }

/* Event list */
.event-list { list-style: none; margin: 0; padding: 0; }
.event-item {
  display: grid; gap: 0.2rem 1rem; padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
  grid-template-columns: 1fr;
  align-items: baseline;
}
@media (min-width: 640px) {
  .event-item { grid-template-columns: 9.5rem 1fr auto; }
}
.event-item:last-child { border-bottom: 0; }
.event-date { font-size: 0.85rem; color: var(--ink-faint); font-weight: 600; }
.event-title { font-weight: 650; color: var(--ink); }
.event-type {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem; border-radius: 6px; justify-self: start;
}
.type-holiday .event-type, .cal-pill.type-holiday { background: var(--shade-closed); color: var(--holiday); }
.type-break .event-type, .cal-pill.type-break { background: var(--shade-closed); color: var(--holiday); }
.type-early .event-type, .cal-pill.type-early { background: var(--shade-early); color: var(--early); }
.type-virtual .event-type, .cal-pill.type-virtual { background: var(--shade-virtual); color: var(--virtual); }
.type-staff .event-type, .cal-pill.type-staff { background: var(--shade-staff); color: var(--staff); }
.type-event .event-type, .cal-pill.type-event { background: var(--shade-event); color: var(--event); }

/* Full-day cell washes (official key, cleaner) */
.cal-cell.shade-closed { background: var(--shade-closed); }
.cal-cell.shade-early { background: var(--shade-early); }
.cal-cell.shade-virtual { background: var(--shade-virtual); }
.cal-cell.shade-staff { background: var(--shade-staff); }
.cal-cell.shade-event { background: var(--shade-event); }
.cal-cell.shade-closed:hover, .cal-cell.shade-closed:focus-visible { background: #F0D0D0; }
.cal-cell.shade-early:hover, .cal-cell.shade-early:focus-visible { background: #FFE8B8; }
.cal-cell.shade-virtual:hover, .cal-cell.shade-virtual:focus-visible { background: #CDEAF0; }
.cal-cell.shade-staff:hover, .cal-cell.shade-staff:focus-visible { background: #D0E6D6; }
.cal-cell.shade-event:hover, .cal-cell.shade-event:focus-visible { background: #D9E4F0; }
.cal-cell.has-events .cal-daynum { font-weight: 800; }
.cal-cell.shade-closed .cal-daynum { color: var(--holiday); }
.cal-cell.shade-early .cal-daynum { color: #8A5200; }
.cal-cell.shade-virtual .cal-daynum { color: var(--virtual); }
.cal-cell.shade-staff .cal-daynum { color: var(--staff); }
.event-item.is-flash { background: var(--gold-soft); border-radius: 8px; padding-inline: 0.5rem; }

/* Page hero (inner) */
.page-hero {
  padding: 2rem 0 1.5rem;
  background: linear-gradient(180deg, var(--navy-soft), var(--cream));
  border-bottom: 1px solid var(--rule);
}
.page-hero p { max-width: 38rem; }

/* Calendar */
.cal-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center;
  justify-content: space-between; margin-bottom: 1.25rem;
}
.cal-nav { display: flex; gap: 0.4rem; align-items: center; }
.cal-title { font-family: var(--display); font-size: 1.35rem; margin: 0; min-width: 10rem; text-align: center; }
.cal-filters {
  display: flex; flex-wrap: wrap; gap: 0.65rem 1rem; margin-bottom: 1.25rem;
  padding: 0.85rem 1rem; background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
}
.cal-filters label {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.9rem; font-weight: 600; color: var(--ink-muted); cursor: pointer;
}
.cal-layout {
  display: grid; gap: 1.5rem;
}
@media (min-width: 960px) {
  .cal-layout { grid-template-columns: 1.6fr 1fr; align-items: start; }
}
.cal-month {
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 0.75rem; overflow: hidden;
}
.cal-dow {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
  text-align: center; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--ink-faint); padding: 0.35rem 0 0.5rem;
}
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-cell {
  min-height: 72px; background: var(--cream); border-radius: 8px; padding: 0.35rem;
  cursor: pointer; transition: background 0.15s;
}
.cal-cell:hover, .cal-cell:focus-visible { background: var(--navy-soft); outline: none; }
.cal-cell.is-empty { background: transparent; cursor: default; }
.cal-cell.is-today { box-shadow: inset 0 0 0 2px var(--gold); }
.cal-daynum { font-size: 0.8rem; font-weight: 700; color: var(--ink); }
.cal-pills { display: flex; flex-direction: column; gap: 2px; margin-top: 0.25rem; }
.cal-pill {
  font-size: 0.62rem; font-weight: 650; line-height: 1.2; padding: 0.15rem 0.3rem;
  border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 640px) {
  .cal-pill { display: none; }
  .cal-cell.has-events .cal-daynum::after {
    content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: var(--navy); margin-left: 4px; vertical-align: middle;
  }
  .cal-cell.shade-closed .cal-daynum::after { background: var(--holiday); }
  .cal-cell.shade-early .cal-daynum::after { background: var(--early); }
  .cal-cell.shade-virtual .cal-daynum::after { background: var(--virtual); }
  .cal-cell.shade-staff .cal-daynum::after { background: var(--staff); }
  .cal-cell.shade-event .cal-daynum::after { background: var(--event); }
  .cal-cell { min-height: 44px; }
}
.cal-list-panel {
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1rem 1.15rem;
}
.cal-list-panel h3 { margin-top: 0; }
.cal-legend {
  display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; font-size: 0.82rem;
}
.cal-legend span::before {
  content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 0.35rem; vertical-align: middle;
}
.leg-closed::before, .leg-holiday::before, .leg-break::before {
  background: var(--shade-closed); box-shadow: inset 0 0 0 1px var(--holiday);
}
.leg-early::before { background: var(--shade-early); box-shadow: inset 0 0 0 1px var(--early); }
.leg-virtual::before { background: var(--shade-virtual); box-shadow: inset 0 0 0 1px var(--virtual); }
.leg-staff::before { background: var(--shade-staff); box-shadow: inset 0 0 0 1px var(--staff); }
.leg-event::before { background: var(--shade-event); box-shadow: inset 0 0 0 1px var(--event); }
.cal-legend {
  display: flex; flex-wrap: wrap; gap: 0.65rem 1.1rem; margin-top: 1rem;
  font-size: 0.8rem; font-weight: 650; color: var(--ink-muted);
}

/* Gallery */
.gallery-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.gallery-card {
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 1px 2px rgba(26,35,50,0.04);
}
.gallery-ph {
  aspect-ratio: 4/3; display: grid; place-items: center; color: rgba(255,255,255,0.92);
  position: relative;
}
.gallery-ph svg { width: 48px; height: 48px; opacity: 0.9; }
.gallery-card figcaption { padding: 0.85rem 1rem 1rem; }
.gallery-card figcaption strong { display: block; color: var(--ink); margin-bottom: 0.15rem; }
.gallery-card figcaption span { font-size: 0.88rem; color: var(--ink-muted); }
.gallery-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }

/* Parents / about */
.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li {
  padding: 0.85rem 0; border-bottom: 1px solid var(--rule);
  display: grid; gap: 0.25rem;
}
.info-list strong { color: var(--ink); }
.contact-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.mission-box {
  background: var(--navy); color: #F5F0E6; border-radius: var(--radius); padding: 1.5rem;
}
.mission-box p { color: rgba(245, 240, 230, 0.92); margin: 0; font-size: 1.05rem; }

/* Footer */
.site-footer {
  background: var(--navy-deep); color: rgba(245, 240, 230, 0.85);
  padding: 2.5rem 0 1.5rem; margin-top: 2rem;
}
.site-footer a { color: var(--gold); }
.footer-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 1.75rem;
}
.site-footer h3 {
  color: #F5F0E6; font-family: var(--font); font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.65rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.35rem; }
.site-footer p { color: rgba(245, 240, 230, 0.75); font-size: 0.92rem; }
.footer-bottom {
  border-top: 1px solid rgba(245, 240, 230, 0.15);
  padding-top: 1rem; font-size: 0.82rem; color: rgba(245, 240, 230, 0.55);
}

/* Admin */
.admin-shell { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.admin-login {
  max-width: 400px; margin: 2rem auto; background: var(--white);
  border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
}
.admin-login label { display: block; font-weight: 650; margin-bottom: 0.35rem; }
.admin-login input, .admin-form input, .admin-form textarea, .admin-form select {
  width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--rule); border-radius: 8px;
  font: inherit; margin-bottom: 0.85rem; background: var(--white);
}
.admin-form textarea { min-height: 90px; resize: vertical; }
.admin-tabs {
  display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 1.25rem 0;
}
.admin-tabs button {
  border: 1px solid var(--rule); background: var(--white); border-radius: 8px;
  padding: 0.5rem 0.85rem; font-weight: 650; cursor: pointer; color: var(--ink-muted);
}
.admin-tabs button.is-active { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.admin-panel { display: none; }
.admin-panel.is-active { display: block; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td {
  text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--rule); vertical-align: top;
}
.admin-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.admin-bar {
  display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; align-items: center;
}
.error-msg { color: var(--danger); font-size: 0.9rem; margin: 0.5rem 0 0; }
.success-msg { color: var(--success); font-size: 0.9rem; margin: 0.5rem 0 0; }

/* Announcements page cards */
.announce-full { margin-bottom: 1rem; }
.announce-full .body { white-space: pre-wrap; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.staff-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.72rem;
  color: rgba(245, 240, 230, 0.4);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.staff-link:hover { color: rgba(245, 240, 230, 0.7); }
