/* Palette/fonts follow the IP/IPI style guide's Education pillar color and
   the font substitution used on the other embedded lookup tools (Geared
   Slab/Tofino are commercial fonts, not available via public CDN - Oswald/
   Inter are the house fallback; see school-board-lookup/index.html). */
:root {
  --navy: #23323f;
  --gray: #97a4af;
  --education: #567a8d;
  --education-dark: #435f6d;
  --education-tint: #e8eef1;
  --paper: #f6f7f8;
  --white: #ffffff;
  --line: #d9dee2;
  /* White-on-dark tokens for the education-blue card body. --on-dark-* are
     light tones that sit on --education; --line-on-dark is a translucent
     white so borders read against the blue without a new hue. */
  --on-dark: #ffffff;
  --on-dark-muted: #d5e2e8;
  --line-on-dark: rgba(255, 255, 255, 0.32);

  --font-header: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

/* No internal page scrollbar - this tool is meant to sit in an
   auto-resizing iframe (see resize-parent.js). The map and sidebar each
   scroll/pan within their own fixed-height box instead. */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--navy);
}

/* Single narrow column (lookup form/results on top, map below) at every
   width, rather than a wide two-column layout that only collapses on
   mobile - matches the other embedded lookup tools' sidebar-width footprint
   so this reads the same whether it's dropped into a wide post body or a
   narrow mobile viewport. */
#widget {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 650px;
  margin: 0 auto;
  border: 1px solid var(--education-dark);
  background: var(--education);
}

/* Title on the left, logo on the right. The logo never shrinks; the title
   wraps onto a second line first on narrow screens. */
.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.title-row h1 {
  margin: 0;
  min-width: 0;
}

.title-row .logo {
  height: 28px;
  width: auto;
  flex: 0 0 auto;
}

#sidebar {
  width: 100%;
  padding: 20px 20px 16px;
  background: var(--education);
  border-bottom: 1px solid var(--line-on-dark);
  display: flex;
  flex-direction: column;
}

#map {
  width: 100%;
  height: 360px;
  cursor: pointer; /* signal that clicking the map looks up that district */
}

h1 {
  font-family: var(--font-header);
  font-weight: 600;
  font-size: 1.2rem;
  margin: 0 0 8px;
  color: var(--on-dark);
}

.subtitle {
  font-size: 0.85rem;
  color: var(--on-dark-muted);
  margin: 0 0 16px;
}

#search-form {
  display: flex;
  gap: 6px;
}

#address-input {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  border: 1px solid var(--line);
  border-radius: 4px;
}

/* Button sits on the blue body, so use navy (darker) rather than the pillar
   blue (which would vanish) for contrast. */
#search-form button {
  padding: 8px 14px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  font-weight: 600;
  border: none;
  border-radius: 4px;
  background: var(--navy);
  color: var(--white);
  cursor: pointer;
}

#search-form button:hover {
  background: var(--education-dark);
}

/* Results sit below the map so the map never shifts when cards come and go. */
#results {
  padding: 20px;
  background: var(--education);
  border-top: 1px solid var(--line-on-dark);
}

.msg {
  font-size: 0.85rem;
  color: var(--on-dark-muted);
}

.msg.error {
  color: #ffd9de;
}

/* Cards stay in the dark scheme: a slightly deeper blue than the body so
   they read as raised panels, not the old white-on-gray cards. */
.district-card {
  background: var(--education-dark);
  border: 1px solid var(--line-on-dark);
  border-left: 4px solid var(--on-dark);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.district-card h3 {
  font-family: var(--font-header);
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--on-dark);
}

.district-card .meta {
  font-size: 0.78rem;
  color: var(--on-dark-muted);
  margin-bottom: 8px;
}

.district-card .salary {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--on-dark);
}

.district-card .salary .year {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--on-dark-muted);
}

.district-card .supt {
  font-size: 0.85rem;
  color: var(--on-dark);
}

.district-card .size {
  font-size: 0.8rem;
  color: var(--on-dark-muted);
  margin-top: 2px;
}

.footnote {
  font-size: 0.7rem;
  color: var(--on-dark-muted);
  padding-top: 12px;
}

/* --- Compensation breakdown (horizontal bars) --- */
.comp-breakdown {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-on-dark);
}

.comp-breakdown-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--on-dark-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.comp-row {
  display: grid;
  grid-template-columns: 108px 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.comp-label {
  font-size: 0.72rem;
  color: var(--on-dark-muted);
  line-height: 1.1;
}

.comp-track {
  height: 12px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 3px;
  overflow: hidden;
}

.comp-bar {
  height: 100%;
  background: var(--on-dark-muted);
  border-radius: 3px 0 0 3px;
}

/* Base salary is the anchor piece, so it reads as solid white while the
   benefit components are the lighter muted tone. */
.comp-bar-base {
  background: var(--on-dark);
}

.comp-amount {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--on-dark);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.comp-total {
  font-size: 0.78rem;
  color: var(--on-dark);
  font-weight: 600;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-on-dark);
  display: flex;
  justify-content: space-between;
}

.comp-total span {
  font-variant-numeric: tabular-nums;
}

/* Small label that appears when hovering a school dot. */
.school-popup .maplibregl-popup-content {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  color: var(--navy);
  border-radius: 4px;
}

@media (max-width: 380px) {
  #sidebar, #results {
    padding: 14px;
  }
  .title-row .logo {
    height: 22px;
  }
  #map {
    height: 300px;
  }
}
