/* GradeYourSchool.org — school report-card feel: navy, white, gold, apple red */
:root {
  --navy: #0b1f3a;
  --navy-mid: #16325c;
  --ink: #1a2332;
  --muted: #5a6a7e;
  --paper: #f7f4ef;
  --white: #ffffff;
  --gold: #d4a017;
  --gold-soft: #f5e6b8;
  --apple: #c41e3a;
  --apple-dark: #9e1830;
  --line: #d9e0ea;
  --ok: #1f7a4c;
  --shadow: 0 8px 24px rgba(11, 31, 58, 0.12);
  --radius: 12px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  font-size: 18px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--gold); color: var(--navy);
  padding: 0.5rem 1rem; z-index: 100; font-weight: 700;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* Header */
.site-header {
  background: var(--navy);
  color: var(--white);
  padding: 1rem 1.25rem 1.15rem;
  border-bottom: 4px solid var(--gold);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}
.brand { flex: 1 1 280px; min-width: 0; }
.logo {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.logo-svg {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}
.logo-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.logo-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.logo-tagline {
  font-size: 0.95rem;
  color: var(--gold-soft);
  font-weight: 600;
  line-height: 1.25;
}
.logo-accountability {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.72);
  font-weight: 500;
  font-style: italic;
  margin-top: 0.1rem;
}

.search-form {
  display: flex;
  flex: 1 1 320px;
  max-width: 480px;
  gap: 0.4rem;
}
.search-form input[type="search"] {
  flex: 1;
  min-width: 0;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  font-size: 1rem;
  background: var(--white);
  color: var(--ink);
  outline: none;
}
.search-form input[type="search"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,160,23,0.35);
}
.search-btn {
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  background: var(--apple);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
.search-btn:hover { background: var(--apple-dark); }
.search-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Tabs */
.tabs {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1.25rem;
  gap: 0.35rem;
  margin-top: -1px;
  position: relative;
  z-index: 2;
}
.tab {
  flex: 1;
  max-width: 280px;
  border: 2px solid var(--navy);
  border-bottom: none;
  background: var(--navy-mid);
  color: rgba(255,255,255,0.85);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-radius: 12px 12px 0 0;
  cursor: pointer;
  font-family: inherit;
}
.tab:hover { background: #1c3d6e; color: white; }
.tab.active {
  background: var(--paper);
  color: var(--navy);
  border-color: var(--line);
  border-bottom: 2px solid var(--paper);
  box-shadow: none;
}
.tab:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.view[hidden] { display: none !important; }
.view-heading {
  margin: 0 0 0.35rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--navy);
  letter-spacing: -0.02em;
}
.view-sub { margin: 0 0 1.25rem; color: var(--muted); font-size: 1.05rem; }
.audience-line {
  text-align: center;
  margin: 1.25rem auto 0.5rem;
  max-width: 40rem;
  color: var(--navy-mid);
  font-weight: 600;
  font-size: 1.05rem;
}
.prototype-note, .school-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.35rem 0 0;
}
.sample-banner {
  display: inline-block;
  background: var(--gold-soft);
  color: #6b4e00;
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: 0.02em;
}
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  vertical-align: middle;
}
.badge.sample { background: var(--gold); color: var(--navy); }

/* Map */
.map-wrap {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.75rem;
  overflow: hidden;
}
#us-map {
  width: 100%;
  height: auto;
  display: block;
  background: linear-gradient(180deg, #eef4fb 0%, #f8fafc 100%);
  border-radius: 8px;
}
#states-layer path {
  fill: #c5d6ea;
  stroke: #fff;
  stroke-width: 1.2;
  cursor: pointer;
  transition: fill 0.15s ease;
}
#states-layer path:hover,
#states-layer path:focus {
  fill: var(--navy-mid);
  outline: none;
}
#states-layer path:focus-visible {
  fill: var(--apple);
  stroke: var(--gold);
  stroke-width: 2;
}
#states-layer path.active-state {
  fill: var(--navy);
}
.map-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--navy);
  color: white;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  transform: translate(-50%, -120%);
  white-space: nowrap;
  z-index: 5;
}
.map-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--navy);
  border-bottom: 0;
}

.crumb { margin: 0 0 0.75rem; font-size: 0.95rem; }
.crumb a { color: var(--navy-mid); font-weight: 600; text-decoration: none; }
.crumb a:hover { color: var(--apple); text-decoration: underline; }

.city-list, .school-list, .teacher-list, .search-results {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.city-list li a,
.school-list li a,
.teacher-list li button,
.search-results li a {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  text-decoration: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(11,31,58,0.06);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.city-list li a:hover,
.school-list li a:hover,
.teacher-list li button:hover,
.search-results li a:hover {
  border-color: var(--navy-mid);
  box-shadow: var(--shadow);
}
.item-title { font-weight: 800; color: var(--navy); display: block; }
.item-sub { color: var(--muted); font-size: 0.92rem; margin-top: 0.2rem; display: block; }
.empty-hint { color: var(--muted); margin-top: 1rem; }
.linkish {
  background: none; border: none; color: var(--apple); font: inherit; font-weight: 700;
  cursor: pointer; text-decoration: underline; padding: 0;
}

.school-header { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.school-meta { color: var(--muted); margin: 0.25rem 0 1rem; }
.school-actions {
  display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.25rem;
}
.btn {
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn.primary { background: var(--apple); color: white; }
.btn.primary:hover { background: var(--apple-dark); }
.btn.secondary { background: var(--navy); color: white; }
.btn.secondary:hover { background: var(--navy-mid); }
.btn.ghost {
  background: transparent;
  border-color: var(--navy-mid);
  color: var(--navy);
}
.btn.ghost:hover { background: var(--gold-soft); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
.card h2 {
  margin: 0 0 0.5rem;
  color: var(--navy);
  font-size: 1.25rem;
}
.hint { color: var(--muted); font-size: 0.95rem; margin: 0 0 1rem; }
.level-pick {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1.15rem;
  max-width: 280px;
}
.level-pick select {
  font: inherit;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.criteria { display: grid; gap: 0.75rem; }
.criterion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0.9rem;
  background: var(--paper);
  border-radius: 10px;
  border: 1px solid var(--line);
}
.criterion > span { font-weight: 650; color: var(--navy); flex: 1 1 180px; }
.criterion.extra-level { border-left: 4px solid var(--gold); }
.stars { display: inline-flex; gap: 0.2rem; }
.star-btn {
  width: 36px; height: 36px;
  border: none; background: transparent;
  font-size: 1.45rem; line-height: 1;
  cursor: pointer; color: #c5ccd6;
  padding: 0;
}
.star-btn.on { color: var(--gold); }
.star-btn:hover, .star-btn:focus-visible { color: #e0b52a; outline: none; transform: scale(1.08); }
.scorecard-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.25rem; }
.submit-msg {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #e7f6ee;
  color: var(--ok);
  border-radius: 8px;
  font-weight: 700;
}

.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.8);
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.9rem;
  margin-top: auto;
}
.site-footer p { margin: 0.25rem 0; }
.site-footer a { color: var(--gold-soft); }
.site-footer strong { color: white; }

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: white;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 50;
  max-width: min(90vw, 420px);
  text-align: center;
  font-weight: 650;
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .logo-svg { width: 48px; height: 48px; }
  .logo-name { font-size: 1.15rem; }
  .tabs { padding: 0 0.75rem; }
  .tab { font-size: 0.92rem; padding: 0.7rem 0.5rem; max-width: none; }
  .search-form { max-width: none; flex: 1 1 100%; }
  .criterion { flex-direction: column; align-items: flex-start; }
}

.mission-block {
  margin: 1.35rem auto 0.85rem;
  max-width: 720px;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem 1.35rem;
  text-align: left;
  border-left: 6px solid var(--gold);
  box-shadow: var(--shadow);
}
.mission-heading {
  margin: 0 0 0.65rem;
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
  color: var(--gold);
  letter-spacing: -0.02em;
  font-weight: 800;
  line-height: 1.25;
}
.mission-block p {
  margin: 0;
  font-size: clamp(0.98rem, 2vw, 1.08rem);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: rgba(255,255,255,0.95);
}
.mission-block em {
  font-style: italic;
  color: var(--gold-soft);
  font-weight: 700;
}


/* How other sites vs. us */
.compare-section {
  margin: 1.5rem auto 0.75rem;
  max-width: 52rem;
}
.compare-heading {
  margin: 0 0 1rem;
  text-align: center;
  font-size: clamp(1.15rem, 2.4vw, 1.35rem);
  color: var(--navy);
  letter-spacing: -0.02em;
}
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.compare-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem 1.2rem;
  box-shadow: var(--shadow);
}
.compare-card h3 {
  margin: 0 0 0.2rem;
  font-size: 1.1rem;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.compare-sub {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}
.compare-card p {
  margin: 0 0 0.65rem;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--ink);
}
.compare-card p:last-child { margin-bottom: 0; }
.compare-note {
  color: var(--muted) !important;
  font-size: 0.88rem !important;
}
.compare-other {
  border-top: 4px solid var(--muted);
}
.compare-ours {
  border-top: 4px solid var(--apple);
  background: linear-gradient(180deg, #fff8f9 0%, var(--white) 40%);
}
.compare-ours h3 { color: var(--apple-dark); }

@media (max-width: 640px) {
  .compare-grid { grid-template-columns: 1fr; }
}

/* Live site extras */
.loading { color: var(--muted); margin: 0.5rem 0 1rem; font-weight: 600; }
.school-website { margin: -0.5rem 0 1rem; }
.school-website a {
  color: var(--navy-mid);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--gold);
}
.school-website a:hover { color: var(--apple); }

.letter-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 0.55rem;
  border-radius: 10px;
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  background: var(--gold-soft);
  color: var(--navy);
  border: 2px solid var(--gold);
}
.letter-grade.small {
  min-width: 1.8rem;
  height: 1.8rem;
  font-size: 1.05rem;
  border-radius: 8px;
}
.letter-grade.grade-a { background: #e7f6ee; color: var(--ok); border-color: #8fd4ae; }
.letter-grade.grade-b { background: #e8f1fb; color: var(--navy-mid); border-color: #9bb8d9; }
.letter-grade.grade-c { background: var(--gold-soft); color: #6b4e00; border-color: var(--gold); }
.letter-grade.grade-d { background: #fff0e8; color: #a14a12; border-color: #f0b089; }
.letter-grade.grade-f { background: #fde8ec; color: var(--apple-dark); border-color: #f0a0ad; }

.grade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem;
}
.grade-cell {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.5rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.grade-label { grid-column: 1 / 2; font-weight: 650; color: var(--navy); font-size: 0.95rem; }
.grade-cell .letter-grade { grid-column: 2; grid-row: 1 / span 2; }
.grade-avg { grid-column: 1; color: var(--muted); font-size: 0.85rem; }

.add-teacher { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.add-teacher h3 { margin: 0 0 0.35rem; color: var(--navy); font-size: 1.05rem; }
.add-teacher-form {
  display: grid;
  gap: 0.65rem;
  max-width: 420px;
}
.add-teacher-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 700;
  color: var(--navy);
  font-size: 0.95rem;
}
.add-teacher-form input {
  font: inherit;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.submit-msg.error {
  background: #fde8ec;
  color: var(--apple-dark);
}


/* Compact city school list + level groups */
.school-list { gap: 0.4rem; }
.school-list .level-header {
  list-style: none;
  margin: 0.85rem 0 0.25rem;
  padding: 0;
}
.school-list .level-header:first-child { margin-top: 0; }
.school-list .level-header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy-mid);
  border-bottom: 2px solid var(--gold);
  padding-bottom: 0.25rem;
}
.school-list .level-count {
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}
.school-list .school-item a {
  padding: 0.55rem 0.85rem;
  box-shadow: none;
}
.school-list .school-item .item-title { font-size: 1rem; }
.school-list .school-item .item-sub { font-size: 0.85rem; margin-top: 0.1rem; }

.letter-grade.grade-none {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  min-width: auto;
  height: auto;
  padding: 0.35rem 0.65rem;
  background: var(--gold-soft);
  color: #6b4e00;
  border-color: var(--gold);
  text-transform: none;
}
.letter-grade[hidden] { display: none !important; }
