/* Snow Angels. Town brand colours (hex column of the brand guide). Orange is not used. */
:root {
  --blue: #407CC9;
  --yellow: #F3CD00;
  --gold: #F7A700;
  --green: #00827A;
  --gray: #8A8A8C;
  --ink: #1f2a37;
  --line: #d9dde3;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: #f5f7fa;
}

a { color: #2a5ea8; }

/* header */
.site-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
  background: var(--blue);
  border-bottom: 3px solid var(--yellow);
}
.site-header .logo { height: 48px; width: auto; }
.site-header h1 { margin: 0; color: #fff; font-size: 28px; font-weight: 700; }

main { max-width: 1100px; margin: 0 auto; padding: 0 16px 24px; }

h2 { font-size: 24px; margin: 0 0 6px; }
h3 { font-size: 18px; margin: 0 0 6px; }
.small { font-size: 15px; color: #4b5563; margin: 4px 0 12px; }

/* hero */
.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 10px;
}
.hero-text { flex: 1 1 420px; }
.lead { font-size: 20px; margin: 0 0 14px; }
.totals { display: flex; flex-wrap: wrap; gap: 14px; }
.total {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 8px solid var(--gray);
  border-radius: 6px;
}
.total-waiting { border-left-color: var(--gold); }
.total-matched { border-left-color: var(--green); }
.total .num { font-size: 44px; font-weight: 700; line-height: 1; }
.total .lbl { font-size: 16px; }

.hero-action { display: flex; flex-direction: column; gap: 10px; flex: 0 1 240px; }

.btn-primary, .btn-secondary {
  display: inline-block;
  padding: 13px 20px;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.btn-primary { background: var(--green); color: #fff; border: 2px solid var(--green); }
.btn-primary:hover { background: #006a63; }
.btn-secondary { background: #fff; color: #2a5ea8; border: 2px solid #2a5ea8; }
.btn-secondary:hover { background: #eaf1fa; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* shown only when data/status.csv cannot be read or has a wrong line */
.status-error {
  margin: 0 0 12px;
  padding: 10px 14px;
  background: #fdecea;
  border: 1px solid #DF4725;
  border-left-width: 8px;
  border-radius: 6px;
  font-size: 15px;
}

/* map */
.map-section { margin-top: 14px; }
.map-wrap { position: relative; }
#map {
  height: 520px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #e8ecf0;
}
.legend {
  position: absolute;
  left: 12px;
  bottom: 24px;
  z-index: 500;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 15px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.legend div { display: flex; align-items: center; margin: 2px 0; }

.swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border: 2px solid #5b6470;
  border-radius: 3px;
  vertical-align: -3px;
}
.sw-needed { background: var(--gold); border-color: #7a5200; }
.sw-none { background: #e3e5e8; border-color: var(--gray); }

.area-label {
  background: #fff;
  border: 2px solid #7a5200;
  border-radius: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  padding: 2px 6px;
  box-shadow: none;
}
.area-label::before { display: none; }

.leaflet-popup-content { font-size: 16px; margin: 12px 16px; }
.leaflet-popup-content strong { font-size: 17px; }
.leaflet-popup-content a { font-weight: 700; }

/* lists */
.lists { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 16px; }
.lists > div { flex: 1 1 260px; }
.area-list { margin: 0; padding-left: 28px; }
.area-list li { margin: 2px 0; }
.area-list button {
  font: inherit;
  color: #2a5ea8;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}

/* cards */
.cards { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 28px; }
.card {
  flex: 1 1 320px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 5px solid var(--blue);
  border-radius: 6px;
}
.links { padding-left: 20px; margin: 8px 0 0; }

footer {
  padding: 16px 20px;
  background: #fff;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 15px;
}

@media (max-width: 600px) {
  .site-header h1 { font-size: 22px; }
  .site-header .logo { height: 38px; }
  #map { height: 400px; }
  .hero-action { flex: 1 1 100%; }
}
