:root {
  --red: #E62136;
  --red-dark: #C4182B;
  --icy: #EFF9FF;
  --white: #FFFFFF;
  --turq: #20B8E5;
  --turq-light: #C7EDFA;
  --turq-soft: #E5F6FD;
  --ink: #202C32;
  --muted: #52636C;
  --border: #CBE4F0;
  --border-soft: #DCEEF7;
  --green-bg: #D7F5E5;
  --green-tx: #145A32;
  --amber-bg: #FFF3CD;
  --amber-tx: #7A4B00;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 3px 12px rgba(32, 44, 50, 0.06);
  --shadow-hover: 0 8px 22px rgba(32, 184, 229, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--icy);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  min-height: 100vh;
}

h1, h2, h3, .brand {
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.015em;
}

a { color: #0B789B; text-decoration: none; }
a:hover { color: var(--red); text-decoration: underline; }

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

.staging-banner {
  background: #FFF7D6;
  color: var(--ink);
  border-bottom: 1px solid #F3DC86;
  font-size: 0.84rem;
  text-align: center;
  padding: 6px 12px;
}

/* Full-width Bright Red Header */
.site-header {
  background: var(--red);
  color: var(--white);
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 2px 10px rgba(230, 33, 54, 0.22);
}
.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.brand {
  font-size: 1.38rem;
  color: var(--white);
  line-height: 1.1;
}
.brand:hover { color: var(--white); text-decoration: none; opacity: 0.94; }

.header-search {
  flex: 1;
  min-width: 220px;
  max-width: 480px;
  display: flex;
  gap: 8px;
}
.header-search input {
  flex: 1;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.94rem;
}
.header-search input::placeholder { color: var(--muted); }
.header-search button {
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid var(--white);
  background: transparent;
  color: var(--white);
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
}
.header-search button:hover {
  background: var(--white);
  color: var(--red);
}

.header-nav {
  margin-left: auto;
  display: flex;
  gap: 22px;
  align-items: center;
}
.header-nav .nav-link {
  color: var(--white);
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 1rem;
  padding: 6px 2px;
  border-bottom: 3px solid transparent;
}
.header-nav .nav-link:hover,
.header-nav .nav-link.active {
  color: var(--white);
  text-decoration: none;
  border-bottom-color: var(--turq);
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.breadcrumbs {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-weight: 600;
}

/* Homepage Hero */
.hero {
  background: linear-gradient(135deg, var(--red) 0%, #F03B4E 65%, #FF6170 100%);
  color: var(--white);
  border-radius: 20px;
  padding: 40px 36px;
  margin-bottom: 28px;
  box-shadow: 0 10px 28px rgba(230, 33, 54, 0.22);
}
.hero h1 {
  margin: 0 0 10px;
  font-size: 2.25rem;
  line-height: 1.15;
  color: var(--white);
}
.hero p {
  margin: 0 0 22px;
  max-width: 700px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.08rem;
}
.hero-search {
  display: flex;
  gap: 10px;
  max-width: 650px;
  flex-wrap: wrap;
}
.hero-search input {
  flex: 1;
  min-width: 240px;
  padding: 13px 18px;
  border-radius: 999px;
  border: 0;
  font-size: 1rem;
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(32, 44, 50, 0.12);
}
.hero-search button {
  padding: 13px 24px;
  border-radius: 999px;
  border: 0;
  background: var(--turq);
  color: var(--ink);
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(32, 44, 50, 0.14);
}
.hero-search button:hover { background: #43C8EF; }

/* Cards */
.card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card h1 { margin: 0 0 8px; font-size: 1.85rem; line-height: 1.2; }
.card h2 { margin-top: 0; font-size: 1.28rem; }
.card h3 { margin-top: 0; font-size: 1.06rem; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }

/* Calendar + Upcoming Hero Split (Desktop: wide Calendar left + narrower Upcoming right) */
.cal-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(290px, 1fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}
@media (max-width: 920px) {
  .cal-hero-grid { grid-template-columns: 1fr; }
}
.cal-hero-grid .card { margin-bottom: 0; }

/* Monthly Calendar Grid */
.cal-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.cal-month-title {
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--ink);
  margin: 0;
}
.cal-nav-btns { display: flex; gap: 6px; align-items: center; }
.cal-icon-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--ink);
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
}
.cal-icon-btn:hover { background: var(--turq-soft); border-color: var(--turq); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--border-soft);
  gap: 1px;
}
.cal-dow {
  background: var(--icy);
  text-align: center;
  padding: 8px 4px;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cal-cell {
  background: var(--white);
  min-height: 82px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-cell.is-empty { background: #F7FBFE; }
.cal-cell.is-weekend { background: #FAFDFF; }
.cal-day-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.cal-day-num {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}
.cal-day-num.is-today {
  background: var(--turq);
  color: var(--ink);
  font-weight: 800;
}
.cal-today-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--turq-light);
  padding: 1px 6px;
  border-radius: 999px;
}
.cal-ev-chip {
  font-size: 0.73rem;
  line-height: 1.25;
  padding: 3px 6px;
  border-radius: 6px;
  font-weight: 700;
  color: var(--ink);
  background: var(--turq-light);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cal-ev-chip.kind-teacher { background: #EDF2F7; color: var(--ink); }
.cal-ev-chip.kind-event { background: #FFE4E8; color: #8A1020; }

.cal-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}
.cal-legend-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  margin-right: 5px;
  vertical-align: middle;
}

/* Mobile list fallback for narrow screens */
.cal-mobile-list { display: none; }
@media (max-width: 700px) {
  .cal-grid { display: none; }
  .cal-mobile-list { display: flex; flex-direction: column; gap: 8px; }
  .cal-mobile-item {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--white);
  }
}

/* Upcoming Card (Right Column) */
.upcoming-panel-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.upcoming-panel-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--icy);
  border: 1px solid var(--border-soft);
}
.upcoming-panel-title {
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--ink);
  margin: 0 0 3px;
}
.upcoming-panel-date {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

/* Badges & Pills */
.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
  background: var(--turq-light);
  color: var(--ink);
  margin: 0 4px 4px 0;
}
.badge-green { background: var(--green-bg); color: var(--green-tx); }
.badge-amber { background: var(--amber-bg); color: var(--amber-tx); }
.badge-gray { background: #E9F1F6; color: var(--ink); }

.pill-link {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  background: var(--icy);
  color: var(--ink);
  border: 1.5px solid var(--border);
  margin: 0 6px 6px 0;
  transition: background 0.15s, border-color 0.15s;
}
.pill-link:hover {
  background: var(--turq-light);
  border-color: var(--turq);
  color: var(--ink);
  text-decoration: none;
}

.facts-dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 14px 18px;
  margin: 0;
}
.facts-dl dt {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}
.facts-dl dd {
  margin: 3px 0 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
}

/* Buttons — Bright Red Primary with White Text */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
  border: 2px solid var(--red);
  background: var(--red);
  color: var(--white);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); color: var(--white); text-decoration: none; }
.btn-outline { background: var(--white); color: var(--ink); border-color: var(--border); }
.btn-outline:hover { background: var(--turq-light); border-color: var(--turq); color: var(--ink); }
.btn-turq { background: var(--turq); border-color: var(--turq); color: var(--white); }
.btn-turq:hover { background: #14A3CE; border-color: #14A3CE; color: var(--white); }
.btn-green { background: #16B34C; border-color: #16B34C; color: var(--white); }
.btn-green:hover { background: #12963F; border-color: #12963F; color: var(--white); }
.btn-sm { padding: 6px 14px; font-size: 0.84rem; }
.school-header-actions {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 8px;
  align-items: stretch;
}
.school-header-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  white-space: nowrap;
}

/* State Explorer layout */
.explorer-layout {
  display: grid;
  grid-template-columns: 285px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .explorer-layout { grid-template-columns: 1fr; }
}
.sidebar {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 78px;
  max-height: calc(100vh - 98px);
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.sidebar details {
  border-top: 1px solid var(--border-soft);
  padding: 11px 0;
}
.sidebar summary {
  cursor: pointer;
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 0.94rem;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
}
.facet-list { margin-top: 8px; display: flex; flex-direction: column; gap: 7px; }
.facet-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--ink);
}
.facet-item input[type="checkbox"] { accent-color: var(--red); width: 15px; height: 15px; }
.facet-count { margin-left: auto; color: var(--muted); font-size: 0.8rem; font-weight: 700; }

.school-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.school-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--turq);
}
.school-card h3 { margin: 0; font-size: 1.06rem; line-height: 1.28; }
.school-meta { font-size: 0.86rem; color: var(--muted); }
.school-snippet { font-size: 0.9rem; color: var(--ink); margin: 0; }

.pagination {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 26px;
}

/* Full Chronological Events Table */
.cal-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 14px;
}
.cal-filter-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--ink);
  font-family: "Nunito", sans-serif;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}
.cal-filter-btn.active, .cal-filter-btn:hover {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.cal-table-wrap {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
}
.cal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  margin: 0;
}
.cal-table th, .cal-table td {
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.cal-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  background: var(--icy);
  font-weight: 700;
}
.cal-table tbody tr:nth-child(even) { background: #F9FDFF; }
.cal-table tbody tr:hover { background: var(--turq-soft); }
.cal-table tbody tr:last-child td { border-bottom: 0; }
.cal-date-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink);
  width: 220px;
}
.cal-type-cell {
  text-align: right !important;
  width: 170px;
}
.cal-type-cell .badge { margin: 0; }

/* Campus Aerial / Street View */
.tile-filler {
  margin-top: auto;
  padding-top: 16px;
}
.tile-filler-box {
  background: var(--icy);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px 16px;
}
.tile-filler-title {
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--ink);
  margin: 0 0 10px;
}
.tile-filler-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tile-filler-btns .btn {
  flex: 1 1 160px;
  padding: 9px 14px;
  font-size: 0.85rem;
}

.perf-callout {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #FFF7E6;
  border: 1.5px solid #F7D58B;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.perf-callout.is-strong {
  background: var(--green-bg);
  border-color: #9EE2BD;
}
.perf-callout-text {
  flex: 1 1 320px;
  font-size: 0.94rem;
  color: var(--ink);
  margin: 0;
}
.perf-callout-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.campus-visual {
  margin-top: 16px;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--icy);
}
.campus-visual img,
.campus-visual iframe {
  display: block;
  width: 100%;
  height: 220px;
  border: 0;
  object-fit: cover;
}
.campus-caption {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 8px 12px;
  background: var(--white);
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-footer {
  border-top: 1.5px solid var(--border);
  background: var(--white);
  padding: 26px 20px;
  color: var(--muted);
  font-size: 0.88rem;
}
.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
