/* country-popup */
.country-popup__postioned {
  position: absolute;
  right: -100%;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  /* 4, not 3 - tied with .section-nav-wrapper's own z-index:3 (layouts/
     section-nav/css/section-nav.css), so which one painted on top came
     down to DOM order rather than either stacking intentionally above
     the other. The right-edge section-nav dots were winning that tie,
     overlapping the open popup (reported, screenshot). One higher makes
     the popup reliably win instead, without touching section-nav.css
     (which other pages use on their own, unrelated to this popup). */
  z-index: 4;
  transition: right 0.3s linear 0s;
}

.country-popup-module.opened {
  /* Figma (13:50, in the 1600px-wide reference frame): the popup's right
     edge sits exactly at x:1600 - flush against the section's own edge, no
     gap and no bleed past it. right:0 here aligns with the true outer edge
     of the positioning parent (.monitoring-results-impact) regardless of
     its own padding - absolute-position offsets are measured from the
     padding/border edge, not inset further by the padding itself (padding
     only affects normal-flow content). */
  right: 0;
}


.country-popup {
  --popup-bg: var(--clr-white);
  --popup-width: 407px;
  background: var(--popup-bg);
  padding: var(--sp10_5) var(--sp10) var(--sp10) var(--sp10);
  display: flex;
  flex-direction: column;
  color: var(--clr-gray-dark);
  width: var(--popup-width);
  position: relative;
  font-size: var(--fs-14);
  /* explicit, not the shared radius-N + border-style-N utility combo: that
     pattern is broken by CSS load order (base.css's border-radius shorthand
     always wins over color.css's corner-zeroing, regardless of class order
     in markup) */
  border-radius: var(--radius-40) 0 var(--radius-40) 0;
  box-shadow: 0 0 15px -6px rgba(0, 0, 0, 0.3);
}

.country-popup__header {
  display: flex;
  align-items: center;
  gap: var(--sp5);
  margin-bottom: var(--sp5);
}

.country-popup__title {
  margin: 0;
  font-size: var(--fs-14);
  font-weight: var(--fw-bold);
  line-height: 1.929;
  color: var(--clr-gray-dark);
  text-transform: uppercase;
}

.country-popup__flag {
  flex-shrink: 0;
  width: 45px;
  height: 31px;
  object-fit: contain;
  border: 1px solid #dbdbdb;
}

/* country type badge */
.country-popup__type {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  padding-bottom: var(--sp5);
  margin-bottom: var(--sp5);
  border-bottom: 1px solid var(--clr-teal-400);
}

.country-popup__type.hidden {
  display: none;
}

.country-popup__type-dot {
  /* background/border set inline per-country (white/blue, partner/eligible)
     - see countryPopup()'s typeDot handling. */
  width: 12px;
  height: 12px;
  border-radius: 100%;
  flex-shrink: 0;
}

.country-popup__type-label {
  font-size: var(--fs-14);
  font-weight: var(--fw-bold);
  line-height: 1.929;
  color: var(--clr-blue);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.country-popup__indicator {
  background: var(--clr-blue08);
  padding: var(--sp8) var(--sp6);
  margin-bottom: var(--sp6_5);
  border-radius: 0 var(--radius-md) 0 var(--radius-md);
}

/* No profile link shown below (no-data country, or field_review_enabled
   turned off) - margin would just be a dead gap before the download
   button/footer. */
.country-popup__indicator.no-bottom-gap {
  margin-bottom: 0;
}

.country-popup:has(.country-popup__footer>*:not(.hidden)):not(:has(.country-popup__trend.hidden)) .country-popup__indicator {
  margin-bottom: var(--sp6_5);
}

.country-popup__indicator-label {
  font-size: var(--fs-16);
  font-weight: var(--fw-semibold);
  line-height: 1.625;
  color: var(--clr-gray-dark);
}

.country-popup__indicator-value {
  display: flex;
  align-items: center;
  gap: var(--sp4);
  margin: var(--sp4) 0;
  padding: 0;
  border-top: 1px solid var(--clr-neutral-440);
  border-bottom: 1px solid var(--clr-neutral-440);
}

/* Same specificity (0,1,0) as the rule above, and this file loads after
   base.css (where .hidden lives) - ties resolve by source order, so
   .hidden's display:none was silently losing to this rule's display:flex
   regardless of class order on the element. Compound selector bumps this
   to (0,2,0), beating it regardless of load order. */
.country-popup__indicator-value.hidden {
  display: none;
}

.country-popup__indicator-divider {
  width: 1px;
  height: 30px;
  flex-shrink: 0;
  background: var(--clr-gray-dark);
}

.country-popup__unit {
  font-size: var(--fs-16);
  font-weight: var(--fw-normal);
  line-height: 1.625;
}

.country-popup__number {
  font-size: var(--fs-40);
  font-weight: var(--fw-bold);
  line-height: 1.25;
  color: var(--clr-gray-dark);
}

.country-popup__close-wrap {
  position: absolute;
  top: var(--sp6);
  right: var(--sp6);
  width: 27px;
  height: 27px;
}

/* sdg */
.country-popup__sdg-values {
  font-size: var(--fs-16);
  align-items: baseline;
  display: flex;
  gap: var(--sp1);
}

.country-popup__sdg-field {
  margin-top: var(--sp4);
}

.country-popup__sdg-label {
  font-weight: var(--fw-normal);
}

.country-popup__sdg-value {
  font-size: inherit;
  font-weight: var(--fw-semibold);
}

/* trend */
.country-popup__trend {
  margin-bottom: var(--sp8);
}

/* .country-popup has no gap of its own - every section's spacing comes
   from its OWN margin-bottom. A hidden element (display:none) contributes
   none of its margin to the next sibling, so when there's no trend data
   AND no profile link (.country-popup__indicator.no-bottom-gap, margin
   zeroed for a different reason - see that rule's own comment), nothing
   at all separates the indicator box from the footer buttons - they sit
   flush against each other. Restores the same gap .country-popup__trend's
   own margin-bottom would have provided had it not been hidden. */
.country-popup__trend.hidden+.country-popup__footer {
  margin-top: var(--sp8);
}

.country-popup__trend-chart {
  width: 100%;
  height: 70px;
  margin-bottom: var(--sp3);
}

.country-popup__trend-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.country-popup__trend-caption {
  margin: 0;
  font-size: var(--fs-14);
  line-height: 1.857;
  color: var(--clr-black);
}

/* footer buttons */
.country-popup__footer {
  display: flex;
  flex-direction: column;
  gap: var(--sp3);
}

/* Both footer buttons keep the site's shared .btn-custom button (+
   .view-full-page-link on the profile link, which already supplies its own
   box model, hover behavior, and :after arrow icon from
   elements/buttons/buttons.css). Only the deltas Figma actually calls for
   are patched here - and patched through .btn-custom's OWN CSS variables
   (--btn-height, --btn-x-padding, --btn-primary-clr, etc.) rather than
   overriding background/border/color directly, so its existing :hover rule
   (which reads from these same variables) keeps working instead of being
   silently overridden by a same-specificity non-hover rule. */
.country-popup__footer .view-full-page-link {
  --btn-height: 36px;
  --btn-width: 100%;
  --btn-x-padding: var(--sp6);
  --btn-fs: var(--fs-12);
  --btn-border-radius: var(--radius-5);
  --btn-secondary-clr: var(--clr-neutral-900);
  text-transform: uppercase;
}

/* Same tie-by-load-order issue as .country-popup__download/
   .country-popup__indicator-value above - shared .btn-custom{display:flex}
   is also a single class and loads after base.css's .hidden. */
.view-full-page-link.hidden {
  display: none;
}

/* .btn-custom's own arrow_right_default.svg doesn't match Figma's thinner,
   non-rounded arrow (also used by .country-popup__download's own inline
   icon) - swapped to the same shape so both buttons show an identical icon.
   Set directly here instead of through --icon/--icon-hover: relative url()s
   inside a custom property resolve against the stylesheet where the var()
   is CONSUMED (buttons.css, elements/buttons/), not where the custom
   property is declared (this file, layouts/country-popup/css/) - so a path
   correct for this file's own depth breaks once substituted into
   buttons.css's .btn-custom:after rule. Overriding background-image
   directly here keeps resolution scoped to this stylesheet's own location,
   and only replaces the image - repeat/position/color from .btn-custom's
   shorthand `background` declaration are untouched.
   This is a background-image (:after), not an inline SVG, so currentColor
   inside it can't inherit the button's actual text color (background-image
   SVGs are isolated documents) - confirmed live, the icon stayed black
   through hover and nearly disappeared against the dark hover background.
   The hover variant is a separate hardcoded-yellow-orange asset instead. */
.country-popup__footer .view-full-page-link:after {
  background-image: url(/themes/custom/gff/components/redesign/layouts/country-popup/css/../img/arrow-right-thin.svg);
}

.country-popup__footer .view-full-page-link:hover:after {
  background-image: url(/themes/custom/gff/components/redesign/layouts/country-popup/css/../img/arrow-right-thin-hover.svg);
}

/* "DOWNLOAD DATA" has no matching shared outline variant (only numbered
   .btn-custom--N modifiers exist), so its colors are defined here in full -
   still via .btn-custom's variables for the same hover-safety reason. */
.country-popup__footer .country-popup__download {
  --btn-height: 36px;
  --btn-width: 100%;
  --btn-x-padding: var(--sp6);
  --btn-fs: var(--fs-12);
  --btn-border-radius: var(--radius-5);
  --btn-primary-clr: transparent;
  --btn-secondary-clr: var(--clr-gray-dark);
  --border-color: var(--clr-teal-500);
  --border-width: 1px;
  --border-hover-color: var(--clr-teal-500);
  --btn-active-bg-clr: var(--clr-teal-500);
  --btn-active-clr: var(--clr-white);
  /* !important: same real-site button.css bleed already worked around
     elsewhere in this file (.indicator-dropdown-placeholder, etc.) - on
     the real site this tie was losing to a same-specificity shared rule,
     leaving the label and arrow bunched together instead of pushed to
     opposite ends. Not reproducible in this local preview (no competing
     rule mirrored here), but the fix is harmless either way. */
  justify-content: space-between !important;
  text-transform: uppercase;
}

/* Same tie-by-load-order issue as .country-popup__indicator-value above -
   the shared .btn-custom{display:flex} (elements/buttons/buttons.css) is
   also a single class, loads after base.css's .hidden, and would win the
   display tie and keep this button visible even with .hidden applied. */
.country-popup__download.hidden {
  display: none;
}

.country-popup__footer .btn-custom:focus-visible {
  outline: 2px solid var(--clr-teal-500);
  outline-offset: 2px;
}

.country-popup__link-icon {
  display: flex;
  flex-shrink: 0;
  width: 22px;
  height: 12px;
}

.country-popup__link-icon svg {
  width: 100%;
  height: 100%;
}

body:has(.country-popup-module.opened:hover) .highcharts-tooltip-container {
  z-index: 100 !important;
}
