/* Umbrella Talent · Team Weather Map
   Brand tokens lifted from umbrella-talent/site global.css */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('/fonts/fraunces-latin-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-latin-var.woff2') format('woff2');
}

:root {
  --red: #c41e3a;
  --red-light: #e8425e;
  --ink: #18181b;
  --char: #27272a;
  --black: #0a0a0a;
  --n100: #f4f4f5;
  --n300: #d4d4d8;
  --n400: #a1a1aa;
  --n500: #71717a;
  --n700: #3f3f46;
  --n800: #27272a;

  /* Weather severity — mirrors PAGASA rainfall advisory colours */
  --sev-ok: #34d399;
  --sev-yellow: #fbbf24;
  --sev-orange: #f97316;
  --sev-red: #ef4444;

  --font-serif: 'Fraunces', ui-serif, Georgia, serif;
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;

  --rail-w: 340px;
  --head-h: 58px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--black);
  color: var(--n100);
  font-family: var(--font-sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ── Masthead ─────────────────────────────── */
.masthead {
  height: var(--head-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  background: var(--ink);
  border-bottom: 1px solid var(--n800);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  font-size: 22px;
  color: var(--red-light);
  line-height: 1;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.01em;
}
.brand-sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--n400);
}
.masthead-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.legend { display: none; align-items: center; gap: 6px; font-size: 12px; color: var(--n400); }
.legend .dot { margin-left: 10px; }
.legend .dot:first-child { margin-left: 0; }
.dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 2px;
}
.dot-ok { background: var(--sev-ok); }
.dot-yellow { background: var(--sev-yellow); }
.dot-orange { background: var(--sev-orange); }
.dot-red { background: var(--sev-red); }
.updated { font-size: 12px; color: var(--n500); font-variant-numeric: tabular-nums; }

/* ── Layout ───────────────────────────────── */
.layout {
  display: flex;
  height: calc(100% - var(--head-h));
}
.rail {
  width: var(--rail-w);
  flex-shrink: 0;
  overflow-y: auto;
  background: var(--ink);
  border-right: 1px solid var(--n800);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#map {
  flex: 1;
  background: #0e0e11;
}

/* Dark-mode raster tiles: invert OSM's light tiles */
.leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) saturate(0.4) brightness(0.95) contrast(0.85);
}
.leaflet-container { font-family: var(--font-sans); }
.leaflet-control-attribution {
  background: rgba(10,10,10,0.7) !important;
  color: var(--n500) !important;
}
.leaflet-control-attribution a { color: var(--n400) !important; }

/* ── Roster cards ─────────────────────────── */
.member {
  border: 1px solid var(--n800);
  border-radius: 10px;
  background: var(--char);
  padding: 12px 12px 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.member:hover, .member.active { border-color: var(--n500); }
.member-top { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--n700);
  border: 2px solid var(--sev, var(--n500));
}
.member-id { min-width: 0; flex: 1; }
.member-name { font-weight: 600; font-size: 14px; }
.member-loc {
  font-size: 12px;
  color: var(--n400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-time {
  font-size: 12px;
  color: var(--n500);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.member-wx {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 9px;
  font-size: 12.5px;
  color: var(--n300);
}
.wx-temp { font-size: 16px; font-weight: 600; color: var(--n100); font-variant-numeric: tabular-nums; }
.wx-cond { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-rain { color: var(--n400); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.member-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.checkin-chip {
  font-size: 12px;
  color: var(--n300);
  background: var(--ink);
  border: 1px solid var(--n800);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.checkin-chip.help { border-color: var(--sev-red); color: var(--sev-red); }
.checkin-chip.none { color: var(--n500); font-style: italic; }
.btn-checkin {
  flex-shrink: 0;
  font: inherit;
  font-size: 12px;
  color: var(--n300);
  background: none;
  border: 1px solid var(--n700);
  border-radius: 6px;
  padding: 3px 10px;
  cursor: pointer;
}
.btn-checkin:hover { border-color: var(--red-light); color: #fff; }

/* ── Map markers ──────────────────────────── */
.pin { background: none; border: none; }
.pin-inner {
  width: 34px; height: 34px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: var(--char);
  border: 2.5px solid var(--sev, var(--n500));
  display: grid;
  place-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.55);
}
.pin-inner span {
  transform: rotate(45deg);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.leaflet-popup-content-wrapper {
  background: var(--ink);
  color: var(--n100);
  border: 1px solid var(--n700);
  border-radius: 10px;
  font-family: var(--font-sans);
}
.leaflet-popup-tip { background: var(--ink); border: 1px solid var(--n700); }
.leaflet-popup-content { margin: 12px 14px; font-size: 13px; line-height: 1.45; }
.popup-name { font-weight: 700; font-size: 14px; }
.popup-loc { color: var(--n400); font-size: 12px; margin-bottom: 6px; }
.popup-note { color: var(--n300); margin-top: 6px; font-style: italic; }

/* ── Check-in dialog ──────────────────────── */
dialog {
  border: 1px solid var(--n700);
  border-radius: 12px;
  background: var(--ink);
  color: var(--n100);
  padding: 22px;
  width: min(400px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(0,0,0,0.6); }
dialog h2 {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
}
.ci-name { color: var(--red-light); }
.ci-hint { margin: 0 0 14px; font-size: 13px; color: var(--n400); }
.ci-statuses { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.ci-status {
  font: inherit;
  font-size: 13px;
  text-align: left;
  background: var(--char);
  color: var(--n100);
  border: 1px solid var(--n700);
  border-radius: 8px;
  padding: 9px 10px;
  cursor: pointer;
}
.ci-status.selected { border-color: var(--red-light); background: #3a2027; }
.ci-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--n400);
  margin-bottom: 6px;
}
#ci-note {
  width: 100%;
  font: inherit;
  font-size: 13px;
  color: var(--n100);
  background: var(--char);
  border: 1px solid var(--n700);
  border-radius: 8px;
  padding: 9px 10px;
}
#ci-note:focus, .ci-status:focus-visible, .btn:focus-visible, .btn-checkin:focus-visible, .member:focus-visible {
  outline: 2px solid var(--red-light);
  outline-offset: 1px;
}
.ci-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn {
  font: inherit;
  font-size: 13px;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  border: 1px solid var(--n700);
}
.btn.ghost { background: none; color: var(--n300); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--red-light); border-color: var(--red-light); }
.btn.primary:disabled { opacity: 0.5; cursor: default; }

/* ── Responsive ───────────────────────────── */
@media (min-width: 900px) {
  .legend { display: flex; }
}
@media (max-width: 720px) {
  .layout { flex-direction: column-reverse; }
  .rail {
    width: 100%;
    height: 46%;
    border-right: none;
    border-top: 1px solid var(--n800);
  }
  #map { height: 54%; flex: none; }
  .updated { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
