/* ==========================================================================
   Office maps (OpenStreetMap tiles drawn with Leaflet), used on Contact, About, Rwanda and Uganda.
   The tiles stay as OpenStreetMap draws them, slightly dimmed so they sit calmly in the dark page;
   pins, popups, controls and the attribution follow the site's panels.
   ========================================================================== */
.office-map { position: relative; }
.office-map-frame {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--radius-lg); border: 1px solid var(--slate-800); box-shadow: var(--shadow-panel);
  background: var(--ink-900) var(--grid-lines); background-size: 32px 32px;
}
.office-map-canvas { position: relative; z-index: 0; width: 100%; height: 460px; background: transparent; }
.office-map.is-single .office-map-canvas { height: 400px; }
.office-map-canvas:focus-visible { outline: 2px solid var(--signal-400); outline-offset: -2px; }
/* a light dimming of the map tiles only (labels stay readable); markers, popups and controls are untouched */
.office-map .leaflet-tile-pane { filter: brightness(.86) saturate(.85) contrast(1.04); }
.office-map .leaflet-container { background: var(--ink-900); }

/* Address list shown until the map is ready (and again if it cannot load) */
.office-map-fallback {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; justify-content: center; gap: 12px;
  padding: 28px; background: rgba(13, 30, 70, .94); color: var(--slate-300);
}
.office-map.is-ready .office-map-fallback { display: none; }
.office-map-fallback-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; font-weight: 600; color: #fff; }
.office-map-fallback-title .icon { color: var(--red); font-size: 20px; }
.office-map-fallback ul { list-style: none; display: grid; gap: 12px; margin: 0; }
.office-map-fallback li { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.office-map-fallback strong { color: #fff; }
.office-map-links, .office-map-caption-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.office-map-links a, .office-map-caption-links a {
  color: var(--signal-400); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(77, 149, 214, .45); text-underline-offset: 3px;
}
.office-map-links a:hover, .office-map-caption-links a:hover { color: #fff; text-decoration-color: var(--red); }
.office-map-status { margin: 0; font-size: 14px; color: var(--slate-300); }
.office-map-status:empty { display: none; }
.office-map.is-failed .office-map-status { color: #fca5a5; font-weight: 600; }
.office-map.is-loading .office-map-fallback::after {
  content: ""; position: absolute; top: 18px; right: 18px; width: 18px; height: 18px;
  border: 2px solid var(--signal-400); border-right-color: transparent; border-radius: 50%;
  animation: office-map-spin .8s linear infinite;
}
@keyframes office-map-spin { to { transform: rotate(360deg); } }

/* Caption under a single-office map */
.office-map-caption { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 14px 0 0; font-size: 14px; color: var(--slate-300); }
.office-map-caption > .icon { color: var(--red); font-size: 18px; }
.office-map-caption em { font-style: normal; color: var(--slate-400); }
.office-map-caption-links { margin-left: auto; }

/* Pins and popups */
.office-pin { background: none; border: 0; }
.office-pin svg { display: block; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .55)); transition: transform .2s var(--ease); transform-origin: 50% 100%; }
.office-pin:hover svg, .office-pin:focus svg { transform: scale(1.12); }
.office-pin:focus { outline: none; }
.office-pin:focus-visible svg { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 3px var(--signal-400)) drop-shadow(0 0 2px var(--signal-400)); }
.office-map .leaflet-container { font-family: var(--f-sans); font-size: 13px; }
.office-map .leaflet-popup-content-wrapper {
  border-radius: var(--radius); border: 1px solid rgba(51, 65, 85, .8); background: rgba(13, 30, 70, .97); color: var(--slate-300);
  box-shadow: var(--shadow-panel), 0 18px 40px -16px rgba(0, 0, 0, .7);
}
.office-map .leaflet-popup-tip { background: rgba(13, 30, 70, .97); border: 1px solid rgba(51, 65, 85, .8); box-shadow: none; }
.office-map .leaflet-popup-content { margin: 16px 18px; line-height: 1.5; }
.office-map .leaflet-popup-close-button { color: var(--slate-400) !important; }
.office-map .leaflet-popup-close-button:hover { color: #fff !important; }
.office-popup p { margin: 0 0 8px; }
.office-popup p:last-child { margin: 0; }
.office-popup-kicker { font-family: var(--f-mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--signal-400); }
.office-popup-title { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: -.01em; }
.office-popup-title:focus { outline: none; }
.office-popup-address { color: var(--slate-300); }
.office-popup-note { font-size: 12px; color: var(--slate-400); font-style: italic; }
.office-popup-contact a { font-weight: 600; color: var(--signal-400) !important; }
.office-popup-contact a:hover { color: #fff !important; }
.office-popup-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.office-popup-actions a {
  display: inline-flex; padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--red); color: #fff !important; font-weight: 600; font-size: 12px;
}
.office-popup-actions a + a { background: transparent; border: 1px solid var(--slate-700); }
.office-popup-actions a:hover { background: var(--red-hover); }
.office-popup-actions a + a:hover { background: transparent; border-color: var(--signal-400); color: var(--signal-400) !important; }

/* Zoom buttons and attribution (kept visible) */
.office-map .office-map-canvas .leaflet-bar { border: 1px solid rgba(51, 65, 85, .9); border-radius: 8px; box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .7); overflow: hidden; }
.office-map .office-map-canvas .leaflet-bar a {
  width: 32px; height: 32px; line-height: 30px; background: rgba(13, 30, 70, .95); color: var(--slate-200); border-bottom-color: rgba(51, 65, 85, .9); cursor: pointer;
}
.office-map .office-map-canvas .leaflet-bar a:hover { background: var(--ink-700); color: #fff; }
.office-map .office-map-canvas .leaflet-bar a.leaflet-disabled { background: rgba(13, 30, 70, .95); color: var(--slate-600); }
.office-map .office-map-canvas .leaflet-bar a:focus-visible { outline: 2px solid var(--signal-400); outline-offset: -2px; }
.office-map .office-map-canvas .leaflet-control-attribution {
  font-size: 11px; line-height: 1.5; padding: 2px 8px; border-top-left-radius: 6px;
  background: rgba(8, 22, 52, .82); color: var(--slate-300);
}
.office-map .office-map-canvas .leaflet-control-attribution a { color: #a9cdee; }
.office-map .office-map-canvas .leaflet-control-attribution a:hover { color: #fff; }

@media (max-width: 1023px) {
  .office-map-canvas { height: 400px; }
  .office-map.is-single .office-map-canvas { height: 340px; }
}
@media (max-width: 767px) {
  .office-map-canvas, .office-map.is-single .office-map-canvas { height: 340px; }
  .office-map-fallback { padding: 18px; justify-content: flex-start; overflow-y: auto; }
  .office-map-caption-links { margin-left: 0; }
}

/* Reduced motion: the loading spinner turns slowly instead of stopping (it still shows that the map is loading); the pin does not grow. */
@media (prefers-reduced-motion: reduce) {
  .office-map.is-loading .office-map-fallback::after { animation-duration: 2.4s; }
  .office-pin:hover svg, .office-pin:focus svg { transform: none; }
}
