/* Portfolio map: country accordion (columns 1-3) with figures, dotted
   world map from column 5 running off the right edge. The open
   country's dots light up in copper. */

.world-map {
  position: relative;
  align-items: start;
  margin-block-start: clamp(2rem, 4.8vw, 4.5rem);
}

.world-map__countries {
  grid-column: 1 / span 4;
  width: 26.7vw;
  margin-block-start: clamp(2rem, 5.4vw, 5rem);
  margin-inline-start: 0.85vw;
  border-block-end: 1px solid var(--theme-color-border);
}

.world-map__country {
  border-block-start: 1px solid var(--theme-color-border);
}

.world-map__country-heading {
  font-size: clamp(1rem, 1.39vw, 1.25rem);
  letter-spacing: 0;
}

.world-map__toggle {
  transition: padding 0.5s var(--theme-ease-signature);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.45em 0.3em;
  text-align: start;
}

.world-map__country.is-open .world-map__toggle {
  padding-block: 0.8em 0.6em;
  font-weight: 500;
}

.world-map__toggle svg {
  width: 0.6em;
  transition: rotate var(--theme-duration) var(--theme-ease-signature);
}

.world-map__country.is-open .world-map__toggle svg {
  rotate: 90deg;
}

/* Height transition without JS measuring: the panel is a one-row grid
   animating from 0fr to 1fr, the inner wrapper clips the content. */
.world-map__panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.5s var(--theme-ease-signature),
    opacity 0.35s var(--theme-ease-signature);
}

.world-map__country.is-open .world-map__panel {
  grid-template-rows: 1fr;
  opacity: 1;
}

.world-map__panel-inner {
  min-height: 0;
  overflow: hidden;
}

.world-map__stats {
  display: grid;
  padding: 0.6rem 0.3em 1.6rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem var(--theme-gutter);
  font-size: clamp(0.75rem, 0.972vw, 0.875rem);
  line-height: 1.286;
}

/* Always dt (label) then dd (value) in the markup. The design shows the
   second line in italics: the value by default, the label when the value
   leads (total property size). */
.world-map__stat {
  display: flex;
  flex-direction: column;
}

.world-map__stat dd {
  font-style: italic;
}

.world-map__stat--value-first {
  flex-direction: column-reverse;
  justify-content: flex-end;
}

.world-map__stat--value-first dt {
  font-style: italic;
}

.world-map__stat--value-first dd {
  font-style: normal;
}

.world-map__map {
  grid-column: 5 / -1;
  margin-inline-start: 5.1vw;
  width: 68.3vw;
  max-width: none;
}

.world-map__svg {
  width: 100%;
  height: auto;
}

/* Country zones on the map: transparent hit areas over the dots, so
   small countries are easy to hover. Other dots ignore the pointer. */
.world-map__land {
  pointer-events: none;
}

.world-map__hit {
  fill: transparent;
}

.world-map__dots {
  cursor: pointer;
}

.world-map__dots:hover circle {
  fill: var(--theme-color-primary);
}

.world-map__land,
.world-map__dots circle {
  fill: var(--theme-color-text-subtle);
  transition: fill var(--theme-duration) var(--theme-ease-signature);
}

/* The countries you can hover are a step darker than the rest of the map,
   a small contrast difference that marks them as interactive. */
.world-map__dots circle {
  fill: color-mix(in srgb, var(--theme-color-text-subtle) 74%, var(--theme-color-text));
}

.world-map__map[data-map-active='nl'] [data-map-country='nl'] circle,
.world-map__map[data-map-active='be'] [data-map-country='be'] circle,
.world-map__map[data-map-active='de'] [data-map-country='de'] circle,
.world-map__map[data-map-active='us'] [data-map-country='us'] circle {
  fill: var(--theme-color-accent);
}

@media (width <= 768px) {
  .world-map__countries {
    grid-column: 1 / -1;
    width: auto;
    margin-inline-start: 0;
    grid-row: 2;
  }

  .world-map__map {
    grid-column: 1 / -1;
    width: 100%;
    margin-inline-start: 0;
  }
}
