/* country-popup-max-991.css */
.country-popup__postioned {
  position: fixed;
  /* !important on both - js/monitoring-results-impact.js's
     alignPopupToMap() sets top/height as an INLINE style (aligning the
     popup to the map's own on-screen position/height, for the >=992px
     side-by-side layout), which beats any plain CSS rule regardless of
     specificity. It still runs at this width too (also fires on window
     resize), so only !important can actually win here - 100vh instead of
     whatever the map's own height happened to be, so the card centers
     against the real viewport instead. */
  top: 0 !important;
  height: 100vh !important;
  right: 0 !important;
  left: 0;
  margin: 0 auto;
  width: calc(100% - 30px);
  opacity: 0;
  pointer-events: none;
  justify-content: center;
  /* header.navbar (components/header/css/header.css) is z-index:10000
     (up to 100001 on some of its own narrower-width states) - this
     breakpoint's full-viewport popup+backdrop sat behind it instead of
     over it (reported, screenshot). A full-screen modal is expected to
     cover the header too, same as it covers the rest of the page -
     scoped to this file only; the >=992px layout never needs this
     (popup sits beside the map there, never under the header). */
  z-index: 10001 !important;
}

/* Full-viewport dark backdrop behind the popup card - a pseudo-element,
   not new markup, so it rides the exact same opacity/pointer-events
   open/close toggle below with zero extra JS. inset:0 (not tied to this
   element's own inset-30px width) so it reaches the real viewport edges
   regardless of the popup card's own narrower width. z-index:-1 keeps it
   behind the popup card (a later sibling in the same stacking context)
   without needing to raise the card's own z-index to compensate.
   Clicking it already closes the popup for free: it registers as a click
   on .country-popup__postioned itself, which the existing "click
   outside" handler (monitoring-results-impact.js) already treats as
   outside the inner .country-popup card. */
.country-popup__postioned::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

.globe-popup.opened {
  opacity: 1;
  pointer-events: unset;
}

.country-popup {
  max-width: 100%;
  padding-left: var(--sp8);
  padding-right: var(--sp8);
  padding-top: 22px;
  box-shadow: 0 0px 4px 0px rgba(0, 0, 0, 0.1);
  /* .country-popup has no max-height/overflow at any width (base
     country-popup.css) - harmless at >=992px (card sits inline beside
     the map, never taller than its own content needs). Here the card is
     position:fixed + centered in a flex box with no scroll mechanism of
     its own, so a tall card (trend chart + footer buttons) simply
     overflowed past BOTH viewport edges - the clipped top portion is
     what read as "goes behind the header" (reported). 20px top/bottom
     breathing room, matching the 15px-per-side horizontal inset already
     used on .country-popup__postioned's own width. */
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.country-popup__close-wrap {
  top: 5px;
  right: 5px;
}
