/* ================================
   WRAPPER + ZOOM CONTAINER
   ================================ */

.uk-map-wrapper {
  position: relative;
  width: 100%;
  height: 90vh; /* Map occupies 90% of the screen height */
  padding-bottom: 10vh; /* Ensures 10% space below the map */
  box-sizing: border-box;
  margin: 0 auto;
}

.map-zoom-container {
  width: 100%;
  height: 100%;
  overflow: hidden; /* Removes scrollbars */
}

#uk-map-container svg {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Scales the map proportionally */
  display: block;
}

================================
  REGION
  BASE
  STYLING
  ================================
  */
  .region
  path {
  cursor: pointer;
  stroke: #ffffff;
  stroke-width: 1;
  transition: fill 0.25s ease;
  pointer-events: all;
}

.region:hover path {
  stroke: inherit; /* keeps the region’s original stroke */
  stroke-width: inherit;
  fill-opacity: 0.8; /* or any value you prefer */
}

/* ================================
   REGION COLOUR THEMES
   ================================ */

.region-scotland path {
  fill: #4a90e2;
  stroke: #2c5fa8;
}

.region-northern-ireland path {
  fill: #e6e6e6;
  stroke: #999;
}

.region-north path {
  fill: #f5d547;
  stroke: #b89c1f;
}

.region-midlands path {
  fill: #6f9c76;
  stroke: #4f7254;
}

.region-west path,
.region-south-west path {
  fill: #9b59b6;
  stroke: #6d3f82;
}

.region-south-east path {
  fill: #e74c3c;
  stroke: #a83228;
}

.region-london path {
  fill: #f39c12;
  stroke: #b06f0c;
}

.region-wales path {
  fill: #1abc9c;
  stroke: #12806e;
}

/* ================================
   LABELS
   ================================ */

.region-label {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 16px;
  fill: #222222;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  pointer-events: none;
}

/* ================================
   POPOUT CARD
   ================================ */

.map-popout {
  position: absolute;
  min-width: 240px;
  max-width: 260px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.4;
  z-index: 999;
  display: none;
  opacity: 0;
  transform: translateY(5px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  pointer-events: none;
}

.map-popout.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.map-popout img {
  width: 100%;
  max-width: 120px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.close-popout {
  float: right;
  cursor: pointer;
  font-size: 14px;
  color: #888;
}

.map-popout h4 {
  margin: 0 0 6px;
  font-size: 16px;
}

.map-popout .role {
  font-weight: 600;
  margin-bottom: 6px;
}

/* ================================
   MOBILE POPOUT
   ================================ */

@media (max-width: 600px) {
  .map-popout {
    left: 0 !important;
    right: 0 !important;
    top: 10px !important;
    margin: 0 auto;
    width: calc(100% - 30px);
    max-width: none;
    position: fixed;
    transform: translateY(-10px);
  }

  .map-popout.visible {
    transform: translateY(0);
  }
}

/* The container MUST be relative and NOT hide overflow */
.uk-map-wrapper {
  position: relative;
  overflow: visible !important;
  width: fit-content;
  margin: 0 auto;
}

/* The popout MUST be absolute */
#map-popout {
  position: absolute;
  z-index: 999;
  display: none; /* Controlled by JS */
  width: 250px; /* Set a fixed width to make the math consistent */
  pointer-events: auto;
  background: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
@media (max-width: 600px) {
  #map-popout {
    width: 90% !important; /* Take up most of the screen width */
    max-width: 320px; /* But don't get huge on small tablets */
    position: absolute;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); /* Stronger shadow for mobile depth */
    transition:
      top 0.3s ease,
      left 0.3s ease; /* Smooth movement */
  }
}
