/* ========================================
   GENERIC MAP CARD LAYOUT
   ======================================== */

/* Card wrapper: map + controls */
.map-card {
  margin: 24px 0 32px;
  padding: 12px 20px;
  border-radius: 16px;

  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}


/* Title above the map */
.map-card__title {
  font-family: "ConsolasBold", monospace;
  font-size: 24px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f2f3f4;
  margin-bottom: 12px;
}

/* ========================================
   MAP AREA
   ======================================== */

/* Container where D3 injects the SVG */
.map-card__map {
  width: 100%;
  height: auto;
}

/* Responsive SVG */
.map-card__map svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  overflow: hidden;
}

.overview-map__error {
  color: #ffb3b3;
  font-size: 14px;
  font-style: italic;
  margin: 8px 0 0;
}

/* ========================================
   CONTROLS BELOW THE MAP
   ======================================== */

.map-card__controls {
  margin-top: 16px;
  max-width: 180px;

  font-family: var(--font-sans, system-ui, -apple-system, BlinkMacSystemFont,
                   "Segoe UI", Roboto, sans-serif);
  color: #f2f3f4;
}

/* Group of radio buttons */
.map-card__controls fieldset {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 10px 14px 12px;
  margin: 0;

  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Legend/title of the controls block */
.map-card__controls legend {
  font-family: "ConsolasBold", monospace;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 4px;
  color: #f2f3f4;
}

/* Row: radio input + label text */
.map-card__controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

/* Radio input styling */
.map-card__controls input[type="radio"] {
  cursor: pointer;
  accent-color: #1ad15b;
}

/* Hover feedback on label text */
.map-card__controls label:hover {
  color: #1ad15b;
}

.isochrone-card {
  position: relative;
}

.isochrone-card .map-card__controls {
  position: absolute;
  top: 118px;
  right: 20px;
  margin-top: 0;
}

.isochrone-card .map-card__controls fieldset {
  margin: 0;
}

.overview-map__legend-item:hover text {
  fill: #1ad15b;
}

.overview-map__legend-box {
  fill: rgba(12, 12, 12, 0.7);
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.borough-map__borough {
  stroke: #0a0a0a;
  stroke-width: 0.9;
  opacity: 0.95;
  transition: fill 0.15s ease, stroke 0.15s ease;
}

.borough-map__borough.is-hovered {
  stroke: #f2f3f4;
  stroke-width: 1.8;
}

.borough-map__legend text {
  font-size: 11px;
  fill: #f2f3f4;
}

.borough-map__legend-box {
  fill: rgba(12, 12, 12, 0.7);
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.borough-map__error {
  color: #ffb3b3;
  font-size: 14px;
  font-style: italic;
  margin: 8px 0 0;
}

.borough-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0 24px;
}

.borough-note {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 12, 12, 0.7);
  font-size: 14px;
  line-height: 1.4;
  color: #f2f3f4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.borough-note__title {
  margin: 0 0 6px;
  text-align: center;
  font-size: 16px;
  font-family: "ConsolasBold", monospace;
  color: #f2f3f4;
}

.borough-note__text {
  margin: 0;
  text-align: center;
}

.borough-note.is-active {
  border-color: rgba(26, 209, 91, 0.7);
  box-shadow: 0 0 0 1px rgba(26, 209, 91, 0.45);
}

.boroughs-layout {
  display: flex;
  gap: 24px;
  align-items: stretch;
}

.boroughs-card {
  flex: 0 0 75%;
  max-width: 75%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 12, 12, 0.7);
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-height: 0;
}

.boroughs-card .map-card__map {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.boroughs-card .map-card__map svg {
  height: 100%;
}

.boroughs-layout .borough-notes {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  flex: 1 1 auto;
  align-self: stretch;
  min-height: 0;
}

.boroughs-layout .borough-note {
  flex: 1 1 0;
}

/* On small screens, let the controls use full width */
@media (max-width: 900px) {
  .map-card__controls {
    max-width: 100%;
  }

  .boroughs-layout {
    flex-direction: column;
  }

  .boroughs-card {
    max-width: 100%;
  }
}
