/* ============================================================
   Where the Class of 2026 is headed — The Marblehead Independent
   Brand: Shell White ground, Georgia throughout, typographic-first.
   Tokens match marbleheadindependent.com house style.
   ============================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --red: #C2261D;            /* Independent Red */
  --black: #1E1F21;          /* Harbor Black */
  --white: #FDF9F4;          /* Shell White */
  --blue: #375E97;           /* Slate Blue */
  --font: Georgia, 'Times New Roman', serif;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FAF7F2;
  --bg-expanded: #F7F4EF;
  --border: #E8E2D9;
  --text-secondary: #4A4A4A;
  --text-muted: #6B655C;
  --accent-light: #F9E8E7;
  --blue-light: #EBF0F7;
  --blue-mid: #C5D3E8;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden; /* guard against accidental horizontal scroll on phones */
}

a { color: var(--blue); }

.wrap { max-width: 1140px; margin: 0 auto; padding: 20px 20px 0; }

/* ── Announcement bar ── */
.announce {
  display: flex; align-items: center; justify-content: center; gap: 8px 18px;
  flex-wrap: wrap;
  background: var(--black); color: var(--white);
  font-size: 13px; letter-spacing: 0.3px;
  padding: 9px 16px; text-align: center;
}
.announce span { font-style: italic; }
.announce a {
  color: var(--white); font-weight: 700; text-decoration: none;
  text-transform: uppercase; letter-spacing: 1.2px; font-size: 11px;
  border-bottom: 2px solid var(--red); padding-bottom: 1px;
}
.announce a:hover { color: #fff; border-color: var(--white); }

/* ── Masthead ── */
.masthead-top-wrap { text-align: center; margin-top: 18px; }
.masthead-kicker {
  font-size: 13px; font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; color: var(--red); margin-bottom: 10px;
}
.masthead-logo-link { display: inline-block; margin: 2px 0 18px; }
.masthead-logo { display: block; width: 100%; max-width: 560px; height: auto; }
.masthead-title {
  font-size: 40px; font-weight: 700; color: var(--black);
  line-height: 1.12; letter-spacing: -0.5px; max-width: 880px;
  margin: 0 auto;
}
.masthead-byline {
  font-size: 11px; color: var(--black); font-weight: 700;
  text-align: center; margin-top: 16px; letter-spacing: 1.5px;
  text-transform: uppercase;
}
.masthead-rule { height: 2px; background: var(--black); margin: 18px 0 28px; }

/* ── Header / dek ── */
.header { border-bottom: 2px solid var(--black); padding: 16px 0 16px; margin-bottom: 22px; }
.header-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--red); margin-bottom: 8px;
}
.header-sub {
  font-size: 17px; color: var(--text-secondary); font-style: italic;
  line-height: 1.6; max-width: 820px;
}

/* ── Intro prose (Features voice) ── */
.intro { max-width: 720px; margin: 0 auto 30px; }
.intro p { font-size: 18px; line-height: 1.72; margin-bottom: 16px; color: var(--black); }
.intro p:last-child { margin-bottom: 0; }
.dropcap::first-letter {
  float: left; font-size: 58px; line-height: 0.78; font-weight: 700;
  padding: 6px 10px 0 0; color: var(--red);
}

/* ── Section labels ── */
.section-label {
  font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--red); margin: 0 0 4px;
}
.section-head { margin: 36px 0 16px; }
.section-head h2 { font-size: 26px; font-weight: 700; line-height: 1.2; color: var(--black); }
.section-head p { font-size: 14px; color: var(--text-muted); font-style: italic; margin-top: 4px; }

/* ── Stats ── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 30px; }
.stat {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px;
  padding: 16px 12px; text-align: center; border-top: 3px solid var(--red);
}
.stat__num { font-size: 34px; font-weight: 700; line-height: 1; color: var(--black); font-variant-numeric: tabular-nums; }
.stat__label { font-size: 10.5px; color: var(--text-muted); margin-top: 7px; text-transform: uppercase; letter-spacing: 0.8px; }

/* ── Controls ── */
.controls { margin-bottom: 14px; }
.controls__search { margin-bottom: 10px; }
#searchInput {
  width: 100%; padding: 11px 14px; font-family: var(--font);
  font-size: 16px; font-style: italic; color: var(--black);
  border: 1px solid var(--border); border-radius: 4px; background: var(--bg-card);
  outline: none; -webkit-appearance: none; appearance: none;
}
#searchInput:focus { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-light); }
#searchInput::placeholder { color: var(--text-muted); font-style: italic; }

.controls__row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.controls__filters { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; font-family: var(--font); font-size: 13px; font-weight: 700;
  letter-spacing: 0.4px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg-card); color: var(--black); cursor: pointer;
  user-select: none; transition: background 0.12s ease;
}
.chip:hover { background: var(--bg-card-hover); }
.chip__dot { width: 11px; height: 11px; border-radius: 50%; flex: none; border: 1px solid rgba(0,0,0,.15); }
.chip__count { color: var(--text-muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="false"] { opacity: 0.42; }
.chip[aria-pressed="false"] .chip__label { text-decoration: line-through; }

.spacer { margin-left: auto; }
.toggle-btn {
  padding: 8px 13px; font-family: var(--font); font-size: 13px; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase; border: 1px solid var(--border);
  border-radius: 4px; background: var(--bg-card); color: var(--black); cursor: pointer;
}
.toggle-btn:hover { background: var(--bg-card-hover); }
.toggle-btn:active { transform: translateY(1px); }
.toggle-btn[aria-pressed="true"] { background: var(--red); color: #fff; border-color: var(--red); }

/* ── Landscape tip (phones in portrait only) ── */
.rotate-tip {
  display: none;
  margin: 0 0 12px;
  padding: 10px 14px;
  background: var(--blue-light);
  border: 1px solid var(--blue-mid);
  border-left: 4px solid var(--blue);
  border-radius: 4px;
  font-size: 13px;
  font-style: italic;
  color: var(--black);
  text-align: center;
}
@media (max-width: 760px) and (orientation: portrait) {
  .rotate-tip { display: block; }
}

/* ── Map ── */
#map {
  height: clamp(440px, 62vh, 640px); width: 100%;
  border: 1px solid var(--border); border-radius: 4px; background: #eee; z-index: 0;
}
.map-note {
  font-size: 12px; color: var(--text-muted); margin: 10px 0 0; text-align: center;
  line-height: 1.6; letter-spacing: 0.2px;
}

/* Map pins (divIcon) — the icon box is an enlarged transparent tap target,
   with the visible dot centered inside it. */
.pin-icon { display: flex; align-items: center; justify-content: center; background: none; border: none; }
.pin {
  display: block; width: 13px; height: 13px; border-radius: 50%;
  background: currentColor; border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(30,31,33,0.4);
}
.pin--four_year { color: #375E97; }
.pin--arts      { color: #8E4585; }
.pin--community { color: #3F7A4F; }
.pin--service   { color: #C2261D; }
.pin--path      { color: #B07A2E; }

.pin-origin {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--red); border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--red), 0 1px 4px rgba(0,0,0,0.4);
}
.origin-label {
  background: var(--black); color: #fff; border: none; box-shadow: none;
  font-family: var(--font); font-weight: 700; font-size: 11px;
  letter-spacing: 0.4px; padding: 3px 7px; border-radius: 3px;
}
.origin-label::before { border-right-color: var(--black) !important; }

/* Leaflet popup */
.leaflet-popup-content-wrapper {
  background: var(--bg-card); color: var(--black);
  border: 1px solid var(--border); border-radius: 4px;
  box-shadow: 0 6px 22px rgba(30,31,33,0.18);
}
.leaflet-popup-tip { background: var(--bg-card); border: 1px solid var(--border); }
.leaflet-popup-content { margin: 12px 14px; font-family: var(--font); }
.popup__name { font-size: 16px; font-weight: 700; line-height: 1.25; color: var(--black); }
.popup__loc { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; font-style: italic; }
.popup__tag {
  display: inline-block; margin-top: 9px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px; color: #fff;
  padding: 3px 8px; border-radius: 3px;
}
.leaflet-container { font-family: var(--font); }
.leaflet-bar a { background: var(--bg-card); color: var(--black); }
.leaflet-bar a:hover { background: var(--bg-card-hover); }

/* Marker clusters */
.marker-cluster { background: rgba(194,38,29,0.14); }
.marker-cluster div {
  background: var(--bg-card); border: 1.5px solid var(--red); color: var(--black);
  font-family: var(--font); font-weight: 700;
}

/* ── Legend ── */
.legend {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  font-size: 11px; color: var(--text-muted); margin: 14px 0 0;
}
.legend-title { font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }

/* ── Roll call grid ── */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(244px, 1fr));
  gap: 10px;
}
.card {
  position: relative; text-align: left; padding: 13px 14px 13px 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--font); color: var(--black); cursor: pointer; overflow: hidden;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent, var(--blue));
}
.card:hover { background: var(--bg-card-hover); border-color: var(--accent, var(--blue)); }
.card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.card[hidden] { display: none; }
.card__name { font-size: 15px; font-weight: 700; line-height: 1.3; }
.card__loc { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; font-style: italic; }
.card__tag {
  display: inline-block; margin-top: 8px; font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px; color: var(--accent, var(--blue));
}
.card--nomap { cursor: default; }
.card--nomap:hover { background: var(--bg-card); border-color: var(--border); }
.grid__empty { padding: 30px; text-align: center; color: var(--text-muted); font-style: italic; }

/* ── Commencement fact box ── */
.factbox {
  margin: 38px 0 8px; padding: 20px 22px; background: var(--bg-card);
  border: 1px solid var(--border); border-left: 5px solid var(--blue);
}
.factbox .fb-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--red); margin-bottom: 10px;
}
.factbox p { font-size: 15px; line-height: 1.7; margin: 0 0 10px; }
.factbox p:last-child { margin-bottom: 0; }
.factbox .fb-leaders { color: var(--text-secondary); }
.factbox strong { color: var(--black); }

/* ── Support callout ── */
.support-callout {
  margin: 38px 0 22px; padding: 22px 24px; background: var(--bg-expanded);
  border: 1px solid var(--border); border-left: 5px solid var(--red);
}
.support-callout .sc-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--red); margin-bottom: 8px;
}
.support-callout p { font-size: 16px; line-height: 1.7; margin: 0; }
.support-callout a { color: var(--black); font-weight: 700; text-decoration: underline; }

/* ── Source line ── */
.source-line {
  font-size: 11px; color: var(--text-muted); margin-top: 18px; text-align: center;
  line-height: 1.6; letter-spacing: 0.2px; max-width: 760px; margin-left: auto; margin-right: auto;
}

/* ── Footer nameplate ── */
.footer-nameplate { text-align: center; margin-top: 48px; }
.footer-nameplate a { text-decoration: none; display: inline-block; }
.footer-nameplate .fn-top { font-size: 34px; color: var(--black); letter-spacing: 0.5px; line-height: 1; }
.footer-nameplate .fn-bottom {
  font-size: 42px; font-weight: 800; color: var(--red); letter-spacing: 3px;
  text-transform: uppercase; line-height: 1;
}
.footer-links {
  text-align: center; margin: 14px 0 40px; font-size: 12px; color: var(--text-muted);
  letter-spacing: 0.3px;
}
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--red); text-decoration: underline; }
.footer-links .sep { margin: 0 8px; color: var(--border); }

/* ── Responsive ── */
@media (max-width: 760px) {
  .wrap { padding: 16px 14px 0; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat__num { font-size: 30px; }
  .masthead-title { font-size: 27px; }
  .masthead-logo { max-width: 330px; }
  .header-sub { font-size: 15px; }
  .section-head h2 { font-size: 21px; }
  .intro p { font-size: 16px; }
  .dropcap::first-letter { font-size: 46px; padding-right: 8px; }

  /* Map: shorter on phones so it isn't a scroll-trap, with room above and below */
  #map { height: 56vh; min-height: 330px; max-height: 440px; }

  /* Comfortable ~44px tap targets */
  .spacer { margin-left: 0; width: 100%; height: 0; }
  .controls__row { gap: 8px; }
  .chip { padding: 13px 14px; font-size: 14px; }
  .toggle-btn { padding: 13px 16px; font-size: 13px; flex: 1 1 auto; text-align: center; }
  .card { padding: 14px 14px 14px 17px; }
}
@media (max-width: 420px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .masthead-title { font-size: 23px; }
  .footer-nameplate .fn-top { font-size: 24px; }
  .footer-nameplate .fn-bottom { font-size: 30px; }
}

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