/* =========================================================
   Impact Installations Map — Styles (organized)
   ========================================================= */

/* ----------------------------
   Wrapper
---------------------------- */
.impact-map-wrapper {
  position: relative;
}

/* ----------------------------
   Filter bar (full width)
---------------------------- */
.impact-map-filters {
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  padding: 14px 16px;
  margin: 0 0 14px 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.impact-map-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
}

.impact-map-filter label {
  display: block;
  font-size: 13px;
  color: #334155;
  margin: 0 0 6px 0;
  font-weight: 600;
}

.impact-map-filter select {
  min-width: 260px;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #fff;
  color: #0f172a;
  font-size: 14px;
}

.impact-filter-reset {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #1f2a44;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}
.impact-filter-reset:hover { filter: brightness(1.05); }

.impact-map-count {
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 860px) {
  .impact-map-filters {
    align-items: flex-start;
    flex-direction: column;
  }
  .impact-map-count { width: 100%; }
  .impact-map-filter select { min-width: 220px; }
}

/* ----------------------------
   Marker dots
---------------------------- */
.impact-dot-icon { background: transparent; border: none; }
.impact-dot {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 999px;
}

/* ----------------------------
   Legend
---------------------------- */
.impact-legend {
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  min-width: 180px;
}

.impact-legend-title {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 8px;
}

.impact-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.impact-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.impact-legend-label {
  font-size: 13px;
  color: #0f172a;
  font-weight: 600;
}

/* ----------------------------
   Cluster styling (neutral gray)
   NOTE: this assumes your JS uses a DivIcon with these classes:
   - icon class: "impact-cluster-icon"
   - inner bubble: "impact-cluster-bubble"
---------------------------- */
.impact-cluster-icon {
  background: transparent !important;
  border: none !important;
}

.impact-cluster-bubble {
  background: #1f2a44;              /* neutral deep gray/navy */
  border: 2px solid rgba(255,255,255,0.9);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
}

.impact-cluster-bubble span {
  color: #ffffff;
  font-weight: 900;
  font-size: 14px;
  line-height: 1;
}

/* ----------------------------
   Modal (overlay + card + internal scroll)
   CRITICAL FIXES:
   - overlay z-index high
   - card is flex-column + max-height
   - scroll container is #impact-map-modal-content (not the page)
   - min-height:0 enables overflow in flex children
---------------------------- */
#impact-map-modal.impact-map-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  display: none;
  background: rgba(15, 23, 42, 0.55);
  padding: 24px 16px;
  align-items: center;
  justify-content: center;
}

#impact-map-modal.impact-map-modal.is-open {
  display: flex !important;
}

/* Prevent background scroll when modal open */
html.impact-modal-open,
body.impact-modal-open {
  overflow: hidden !important;
}

/* Modal card */
#impact-map-modal .impact-map-modal-inner {
  width: min(980px, calc(100vw - 32px));
  max-height: min(86vh, 860px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.35);
  overflow: hidden;                 /* clip corners */
  display: flex;                    /* IMPORTANT */
  flex-direction: column;           /* IMPORTANT */
  position: relative;
}

/* IMPORTANT: allow flex children to shrink so overflow works */
#impact-map-modal .impact-map-modal-inner,
#impact-map-modal #impact-map-modal-content {
  min-height: 0;
}

/* Close button */
#impact-map-modal .impact-map-modal-close {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255,255,255,0.92);
  font-size: 26px;
  line-height: 38px;
  cursor: pointer;
  color: #0f172a;
}

/* Make the plugin’s modal content area the scroll container */
#impact-map-modal #impact-map-modal-content {
  flex: 1 1 auto;                   /* IMPORTANT */
  overflow-y: auto;                 /* IMPORTANT */
  -webkit-overflow-scrolling: touch;
  padding: 0;                       /* we pad inside sections below */
}

/* Modal sections (your JS/HTML should be outputting these classes) */
#impact-map-modal .impact-modal-header {
  padding: 18px 22px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
}

#impact-map-modal .impact-modal-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
}

#impact-map-modal .impact-modal-meta {
  padding: 12px 22px 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}

@media (max-width: 760px) {
  #impact-map-modal .impact-modal-meta { grid-template-columns: 1fr; }
}

.impact-kv .k {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}
.impact-kv .v {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

/* Uniform image height */
#impact-map-modal .impact-modal-image {
  height: 320px;                    /* adjust once */
  background: #0b1220;
}
#impact-map-modal .impact-modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Body padding + readability (scroll happens on #impact-map-modal-content) */
#impact-map-modal .impact-modal-body {
  padding: 18px 22px 22px;
}

/* Full description: no clamp/truncation */
#impact-map-modal .impact-modal-description {
  color: #111827;
  font-size: 16px;
  line-height: 1.65;
  margin: 0 0 14px 0;
  overflow: visible;
  max-height: none;
}

/* Buttons */
#impact-map-modal .impact-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 16px 0;
}

#impact-map-modal .impact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;                  /* readability bump */
  background: #2b4f88;
  color: #ffffff;
}

#impact-map-modal .impact-btn:hover { filter: brightness(1.05); }

#impact-map-modal .impact-btn-secondary {
  background: #e2e8f0;
  color: #0f172a;
}

#impact-map-modal .impact-modal-contact {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 12px;
  color: #0f172a;
}

#impact-map-modal .impact-modal-contact-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 8px;
}
