/* ---------------------------------------------------------------------------
   Operations Academia — the Universities map (assets/oa-uni-map.js).

   Follows _MOBILE-STANDARDS.md the same way oa-list.css does: the component
   owns its side gutter on phones (the site grid cancels its own), inputs are
   16px+ so iOS never zoom-locks, and touch targets are 40px+.
   --------------------------------------------------------------------------- */

.oa-uni {
  font-family: Roboto, 'Source Sans Pro', Helvetica, sans-serif;
}

.oa-uni-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.oa-uni-bar label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  /* Follows the page's own ink: this label sits on the PAGE background, which
     is near-black in dark mode, so a fixed dark grey would be nearly invisible
     there. Near-black in light mode, near-white in dark, and the fallback
     covers a page that does not load the theme's variables at all. */
  color: var(--ink, #22303c);
}

.oa-uni-bar input[type='search'] {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 280px;
  max-width: 100%;
  height: 38px;
  padding: 6px 12px;
  border: 1px solid #c9d1d9;
  border-radius: 8px;
  background: #fff;
  color: #22303c;
  font: inherit;
  font-size: 14px;
}

.oa-uni-bar input[type='search']:focus {
  outline: 2px solid #81c0f2;
  outline-offset: 1px;
}

.oa-uni-count {
  /* on the page background too — see the note on .oa-uni-bar label */
  color: var(--ink, #22303c);
  font-size: 13px;
}

.oa-uni-map {
  height: 600px;
  max-height: 78vh;
  border: 1px solid #d7dde3;
  border-radius: 8px;
  background: #e8edf1;
  /* the site's CSS reset must not leak into Leaflet's controls */
  z-index: 0;
}

.oa-uni-map.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #22303c;
  text-align: center;
  font-size: 15px;
}

/* the popup, matching the vendor tooltip's little table */
.oa-uni-pop h3 {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.35;
  color: #22303c;
}

.oa-uni-pop table {
  border-collapse: collapse;
  margin: 0;
}

/* EVERY WORD ON THE POPUP IS BLACK, and that is not a style preference but a
   consequence of what the popup IS. Leaflet's card is white in both themes —
   nothing in this repository restyles it — so text on it can never take its
   colour from the page, which is near-black in dark mode. The label grey and
   the link colour below were both chosen for a light page and were what made
   this card read as washed out. */
.oa-uni-pop td {
  padding: 2px 10px 2px 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #22303c;
  vertical-align: top;
  border: 0;
}

.oa-uni-pop .oa-uni-poplabel {
  color: #22303c;
  white-space: nowrap;
}

/* THE LINKS NEED THE EXTRA SPECIFICITY, which is the whole reason this card
   went grey. The redesign sets `body.v3 a { color: var(--brand) }` — one class
   and two elements — which outweighs a bare `.oa-uni-pop a`, so in dark mode
   every "link" on this white card was painted --brand #c6ccd4: a pale grey
   meant for a near-black page. `.leaflet-popup .oa-uni-pop a` is two classes
   and wins on either theme.

   Underlined deliberately: black and undecorated, these would be
   indistinguishable from the plain text beside them — body.v3 a also clears
   the underline, so it has to be put back here or the affordance goes with
   the colour. */
.leaflet-popup .oa-uni-pop a,
.oa-uni-pop a {
  color: #22303c;
  text-decoration: underline;
}

/* Leaflet inherits the site's global img rule (max-width: 100%) which
   distorts tile positioning — Leaflet's own reset handles its panes, but the
   marker images inside popup-less clusters are safest pinned too. */
.oa-uni-map img {
  max-width: none;
}

@media screen and (max-width: 640px) {
  /* the site grid cancels its own gutter on phones — own it here, exactly as
     .oa-list does (rule 1 of _MOBILE-STANDARDS.md) */
  .oa-uni {
    padding: 0 14px;
  }

  /* 16px is the iOS no-zoom floor; 42px is a thumb target (rules 2 and 3) */
  .oa-uni-bar input[type='search'] {
    width: 100%;
    height: 42px;
    font-size: 16px;
  }

  .oa-uni-map {
    height: 65vh;
    max-height: 480px;
  }
}

/* ------------------------------------------- the maintainer's popup controls

   universities.html does not load oa-list.css (it is a map, not a card list),
   so the Edit / Take down pills the rest of the site uses are restated here —
   deliberately identical to `.oa-jobbtn` in oa-list.css, so one control looks
   the same wherever it appears. Keep the two in step.

   The one difference is opacity: on a card the pills are held back until the
   pointer is on it, because 94 of them would be the loudest thing on the page.
   A popup shows one school and is already a deliberate click, so they are at
   full strength — and there is no `.oa-card` here to lift them anyway.        */
.oa-uni-admin {
  display: flex;
  gap: 6px;
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid #e5e9ee;
}

.oa-uni-admin .oa-jobbtn {
  padding: 4px 10px;
  border: 1px solid #d3d9df;
  border-radius: 4px;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease-out;
}

.oa-uni-admin .oa-jobbtn-edit { color: var(--brand-2); }
.oa-uni-admin .oa-jobbtn-edit:hover { background: var(--brand-soft); border-color: var(--line); }
.oa-uni-admin .oa-jobbtn-del { color: #a3364a; }
.oa-uni-admin .oa-jobbtn-del:hover { background: #fdf0f2; border-color: #e2aab4; }
.oa-uni-admin .oa-jobbtn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.oa-uni-admin .oa-jobbtn[disabled] { opacity: 0.5; cursor: default; }

@media (max-width: 640px) {
  /* the mobile tap target the rest of the site uses (_MOBILE-STANDARDS.md) */
  .oa-uni-admin .oa-jobbtn { padding: 8px 14px; font-size: 13px; border-radius: 6px; }
}

@media print { .oa-uni-admin { display: none; } }

/* A pin the maintainer has taken down. Only they can see it — the overlay
   filters it out for every other visitor — so it says so, and its control
   reads Restore. */
.oa-uni-gone {
  display: block;
  margin: 10px 0 0;
  color: #a3364a;
  font-size: 12px;
}

/* ------------------------------------------------- the map's own chrome

   THE MAP'S SURFACES STAY LIGHT IN BOTH THEMES, and deliberately so: the tiles
   are light, so the popup card is light and its text is fixed dark (the rules
   above, and the guard in page-test that pins them). These two Leaflet-owned
   controls were the only ones not following that rule.

   The attribution box keeps Leaflet's near-white ground, so the fix is its
   INK: our own `a` colour flips to near-white with the page and was landing on
   that white box at 1.6:1. It is pinned dark, exactly like the popup.

   The cluster badge writes its count in white on a 60%-opacity green, yellow
   or orange circle — 1.53:1, 1.36:1 and 2.24:1, i.e. unreadable in EITHER
   theme, not just dark. Near-black on those same three reads at 10.8, 12.2
   and 7.4, so the label darkens rather than the badge changing colour, which
   would lose the small/medium/large signal.

   Both live HERE and not in oa-ui.css: Leaflet's own rule for the attribution
   box is `.leaflet-container .leaflet-control-attribution` — the SAME
   specificity an override would have — and leaflet.css loads after oa-ui.css,
   so an override there lost on order and silently did nothing. This file
   loads after all three Leaflet stylesheets. */
.leaflet-container .leaflet-control-attribution,
.leaflet-container .leaflet-control-attribution a { color: #22303c; }

.leaflet-container .marker-cluster div { color: #1b1f24; }
