/* Speed hump map, themed to the 6th Ward site like the CSB map
   (navy #032673, red #c70f2e, yellow #f3db11, cream #f2f2ee). */

:root {
  --navy: #032673;
  --red: #c70f2e;
  --yellow: #f3db11;
  --gold: #8f6c00;
  --ink: #032673;
  --muted: #4a5878;
  --line: #d9dce4;
  --soft: #f2f2ee;
  font-family: "Galano", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { display: flex; flex-direction: column; min-height: 420px; }
button { font: inherit; }

/* ------------------------------------------------------------ header */
.bar {
  flex: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--navy); color: #fff; padding: 10px 16px;
  border-bottom: 5px solid var(--yellow);
}
.bar-title { flex: 1; min-width: 180px; }
.bar h1 { margin: 0; font-size: 17px; font-weight: 900; text-transform: uppercase; letter-spacing: .02em; line-height: 1.2; }
.sub { margin: 3px 0 0; font-size: 12px; color: #d6dcef; }
.seg { display: flex; border: 2px solid var(--yellow); border-radius: 4px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: #fff; padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--yellow); color: var(--navy); }
.seg button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }

/* --------------------------------------------------------------- map */
.mapwrap { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; background: #eef0f2; }
.leaflet-container { font: inherit; }
.leaflet-container .leaflet-control-attribution { font-size: 11px; }

/* ------------------------------------------------------------ legend */
.legend {
  position: absolute; left: 10px; bottom: 22px; z-index: 600; max-width: 240px;
  background: #fff; border-top: 4px solid var(--red); box-shadow: 0 2px 10px rgba(0,0,0,.22);
  font-size: 13px;
}
.legend-toggle {
  display: none; width: 100%; text-align: left; border: 0; background: #fff; color: var(--navy);
  padding: 8px 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: 12px; cursor: pointer;
}
.legend-body { padding: 8px 10px 10px; }
.legend-head { margin: 0 0 6px; font-size: 11px; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: .05em; }
.legend-item {
  display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; color: var(--ink);
  padding: 3px 2px; cursor: pointer; text-align: left; font-size: 13px;
}
.legend-item .sw { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.legend-item .n { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.legend-item[aria-pressed="false"] { opacity: .4; }
.legend-item[aria-pressed="false"] .sw { background: transparent !important; }
.legend-item:focus-visible { outline: 2px solid var(--navy); }
.legend-note { margin: 6px 0 0; font-size: 11px; color: var(--muted); line-height: 1.35; }
.disclaimer { padding-top: 6px; border-top: 1px solid var(--line); color: var(--navy); }

/* --------------------------------------------------------------- cta */
.cta {
  position: absolute; right: 10px; bottom: 22px; z-index: 600;
  background: var(--yellow); color: var(--navy); text-decoration: none; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; font-size: 13px; padding: 10px 14px;
  border-radius: 0 4px; box-shadow: 0 2px 10px rgba(0,0,0,.22);
}
.cta:hover { background: var(--navy); color: #fff; }

/* ------------------------------------------------------------ popups */
.pop h3 { margin: 0 0 4px; font-size: 14px; font-weight: 800; color: var(--navy); }
.pop .meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.pop dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 13px; }
.pop dt { color: var(--muted); }
.pop dd { margin: 0; }
.pop a { color: var(--red); font-weight: 700; }
.pop .note { margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.35; }
.pop .tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 4px; background: var(--soft); color: var(--navy); }

/* ------------------------------------------------------------ narrow */
@media (max-width: 600px) {
  .bar { padding: 8px 12px; gap: 8px; }
  .bar h1 { font-size: 15px; }
  .seg button { padding: 5px 9px; font-size: 12px; }
  .legend { left: 8px; bottom: 40px; max-width: 190px; }
  .legend-toggle { display: block; }
  .legend.collapsed .legend-body { display: none; }
  .cta { right: 8px; bottom: 40px; font-size: 12px; padding: 9px 11px; }
}
