/* ==========================================================================
   CLR "What's Being Built" Zoomable Map Module Stylesheet
   Matches CLR VPA map controls and accessibility standards.
   ========================================================================== */

/* Container and box dimensions */
.map-box {
  position: relative;
  border: 1px solid var(--rule, #D3CFC2);
  margin: 22px 0 6px;
  background: repeating-linear-gradient(
    45deg,
    var(--roll-2, #F3EFE0),
    var(--roll-2, #F3EFE0) 7px,
    #D8DBE0 7px,
    #D8DBE0 8px
  );
  overflow: hidden;
}

.map-box.wb {
  height: 560px;
}

@media (max-width: 700px) {
  .map-box.wb {
    height: 440px;
  }
}

.map-box canvas {
  outline: none;
}

/* Fallback message */
.wb-note {
  font-family: "Public Sans", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--ink, #1B2E45);
  background: #FBF7EC;
}

/* Control stack: compass + zoom buttons + reset view */
.map-ctrl-stack {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

/* Compass button (matches VPA map) */
.compass {
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  display: block;
}

.compass:focus-visible {
  outline: 2px solid var(--cite, #1F6FEB);
  outline-offset: 2px;
  border-radius: 50%;
}

.compass .cmp-ring {
  fill: rgba(228, 231, 224, 0.86);
  stroke: var(--ink, #1B2E45);
  stroke-width: 1.5;
}

.compass .cmp-n {
  fill: var(--neg, #C23B22);
}

.compass .cmp-s {
  fill: var(--ink-soft, #70757D);
}

.compass .cmp-lbl {
  fill: var(--ink, #1B2E45);
  font-family: "IBM Plex Mono", monospace;
  font-size: 8px;
  font-weight: 600;
}

.compass .cmp-rose {
  transition: transform 0.15s linear;
}

@media (prefers-reduced-motion: reduce) {
  .compass .cmp-rose {
    transition: none;
  }
}

/* Zoom buttons matching .compass aesthetic */
.zoombtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  background: rgba(228, 231, 224, 0.86);
  border: 1.5px solid var(--ink, #1B2E45);
  color: var(--ink, #1B2E45);
  border-radius: 4px;
  cursor: pointer;
  font-family: "IBM Plex Mono", monospace;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.zoombtn:hover {
  background: rgba(228, 231, 224, 1);
}

.zoombtn:focus-visible {
  outline: 2px solid var(--cite, #1F6FEB);
  outline-offset: 2px;
}

/* "Reset view" text button */
.zoombtn.zoomreset {
  width: auto;
  height: auto;
  min-height: 38px;
  padding: 6px 10px;
  font-size: 10px;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Accessible hidden list for keyboard users */
.wb-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wb-project-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wb-project-btn {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  color: transparent;
  cursor: pointer;
}

/* Focusable expansion when tabbing through projects */
.wb-sr-only:focus-within {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  width: auto;
  height: auto;
  clip: auto;
  overflow: visible;
  white-space: normal;
}

.wb-project-btn:focus-visible {
  display: block;
  background: #1B2E45;
  color: #FBF7EC;
  border: 1.5px solid var(--cite, #1F6FEB);
  padding: 8px 12px;
  border-radius: 4px;
  font-family: "Public Sans", system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  outline: 2px solid var(--cite, #1F6FEB);
  outline-offset: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Tooltip styles */
.deck-tooltip,
.wb-map-tooltip {
  font-family: "Public Sans", system-ui, -apple-system, sans-serif;
  font-size: 12px;
  line-height: 1.45;
  background: rgba(27, 46, 69, 0.94);
  color: #FBF7EC;
  padding: 8px 12px;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  z-index: 1000;
  max-width: 280px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.wb-tooltip-inner b {
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 2px;
}

/* the site's .compass is absolutely positioned; inside the control stack it flows with the buttons */
.map-ctrl-stack .compass { position: static; top: auto; right: auto; }
