/* WFPF landing page
   (templates/node--wfpf-landing-page.html.twig). */

/* Hero */
.wfpf-hero .reveal {
  max-width: 870px;
}

/* Mobile: no wave accent */
@media (max-width: 767.98px) {
  .wfpf-hero.fullscreen-hero::after {
    content: none;
  }
}

@media (min-width: 768px) {
  .wfpf-hero.fullscreen-hero {
    background-position: 50% 50%;
  }

  .wfpf-hero.fullscreen-hero p {
    font-size: 20px;
    line-height: 1.5;
  }
}

@media (min-width: 1080px) {
  .wfpf-hero.fullscreen-hero {
    height: 1060px;
  }
}

/* How WFPF Works */
.wfpf-how .left img {
  aspect-ratio: 820 / 560;
}

.wfpf-how .right {
  gap: 2rem;
}

@media (min-width: 992px) {
  .wfpf-how.two-column-grid {
    gap: 40px;
  }

  .wfpf-how .right {
    gap: 2.5rem;
  }
}

@media (min-width: 1280px) {
  .wfpf-how .right {
    padding: 2.5rem 3.5rem;
  }
}

/* Member Countries Map */
@media (min-width: 1080px) {
  .wfpf-map .left,
  .wfpf-map .section-title__heading {
    max-width: 40rem;
  }
}

.wfpf-map .map-image {
  border-radius: 1.25rem;
  overflow: hidden;
  background-color: #1975A2;
}

.wfpf-map .map-image::before,
.wfpf-map .map-image::after {
  content: none;
}

.wfpf-map .map-image img {
  height: auto;
  border-radius: 0;
}

.wfpf-map .map-image > img {
  display: none !important;
}

.wfpf-map__scroller {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.wfpf-map__scroller::-webkit-scrollbar {
  display: none;
}

/* Map pins, sized in em from the list's font size */
.wfpf-map__pins {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wfpf-map__pin {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.444em;
}

.wfpf-map__pin--dot-first {
  flex-direction: row-reverse;
}

.wfpf-map__pin-name {
  padding: 0.222em 0.444em;
  border-radius: 0.667em;
  background-color: var(--brand-off-white);
  color: var(--brand-retro-black);
  font: 500 1em/1.5 var(--font-ideal-sans-medium), sans-serif;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.wfpf-map__pin-dot {
  flex: 0 0 1.556em;
  width: 1.556em;
  height: 1.556em;
  border: 0.311em solid var(--brand-off-white);
  border-radius: 50%;
}

/* Mobile: land and pins scroll under the legend and caption */
@media (max-width: 767.98px) {
  .wfpf-map .map-image {
    border-radius: 24px;
    background: #1B80B4 url("../../../images/wfpf/map-mobile-bg.webp") center / cover no-repeat;
  }

  .wfpf-map__scroller {
    position: absolute;
    inset: 0;
  }

  .wfpf-map .map-image .wfpf-map__wide {
    display: none;
  }

  .wfpf-map__layer {
    position: relative;
    width: 1279px;
    height: 844px;
    margin: 0 auto;
  }

  .wfpf-map .map-image .wfpf-map__layer img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .wfpf-map__layer .wfpf-map__pins {
    font-size: 13.5px;
  }

  /* Pin positions */
  .wfpf-map__pin--georgia {
    left: 110.7px;
    top: 121.5px;
  }

  .wfpf-map__pin--azerbaijan {
    left: 146.7px;
    top: 162px;
  }

  .wfpf-map__pin--uzbekistan {
    left: 243.4px;
    top: 111.7px;
  }

  .wfpf-map__pin--tajikistan {
    left: 274.2px;
    top: 164.2px;
  }

  .wfpf-map__pin--kyrgyz-republic {
    left: 376.2px;
    top: 108.7px;
  }

  .wfpf-map__pin--pakistan {
    left: 245.7px;
    top: 277.5px;
  }

  .wfpf-map__pin--mongolia {
    left: 526.2px;
    top: 32.2px;
  }

  .wfpf-map__pin--prc {
    left: 598.2px;
    top: 111.7px;
  }

  .wfpf-map__pin--nepal {
    left: 335.7px;
    top: 226.5px;
  }

  .wfpf-map__pin--india {
    left: 292.2px;
    top: 321.7px;
  }

  .wfpf-map__pin--sri-lanka {
    left: 276.4px;
    top: 371.2px;
  }

  .wfpf-map__pin--bangladesh {
    left: 420.4px;
    top: 267.7px;
  }

  .wfpf-map__pin--myanmar {
    left: 389.7px;
    top: 310.5px;
  }

  .wfpf-map__pin--lao-pdr {
    left: 508.2px;
    top: 308.2px;
  }

  .wfpf-map__pin--cambodia {
    left: 436.2px;
    top: 352.5px;
  }

  .wfpf-map__pin--viet-nam {
    left: 541.2px;
    top: 342px;
  }

  .wfpf-map__pin--philippines {
    left: 655.2px;
    top: 353.2px;
  }

  .wfpf-map__pin--indonesia {
    left: 561.4px;
    top: 442.5px;
  }

  .wfpf-map__pin--marshall-islands {
    left: 944.7px;
    top: 366px;
  }

  .wfpf-map__pin--kiribati {
    left: 971.7px;
    top: 410.2px;
  }

  .wfpf-map__pin--solomon-islands {
    left: 774.4px;
    top: 496.5px;
  }

  .wfpf-map__pin--samoa {
    left: 1070.7px;
    top: 506.2px;
  }

  .wfpf-map__pin--fiji {
    left: 1027.2px;
    top: 540.7px;
  }

  /* Legend and caption over the map; swipes pass through to it */
  .wfpf-map__details {
    position: relative;
    z-index: 1;
    margin-top: 423px;
    pointer-events: none;
  }
}

/* Tablet and desktop: desktop map, scrolls when the box is under 1310px */
@media (min-width: 768px) {
  .wfpf-map .map-image {
    border-radius: 2.5rem;
  }

  .wfpf-map__layer {
    display: none;
  }

  .wfpf-map__wide {
    position: relative;
    width: max(100%, 1310px);
    aspect-ratio: 1680 / 800;
    container-type: inline-size;
  }

  .wfpf-map .map-image .wfpf-map__wide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  /* 18px pins on the 1680px-wide map, scaling with it */
  .wfpf-map__wide .wfpf-map__pins {
    font-size: calc(18cqw / 16.8);
  }

  /* Pin positions */
  .wfpf-map__pin--georgia {
    left: 8.036%;
    top: 23.25%;
  }

  .wfpf-map__pin--azerbaijan {
    left: 10.893%;
    top: 30%;
  }

  .wfpf-map__pin--uzbekistan {
    left: 18.571%;
    top: 21.625%;
  }

  .wfpf-map__pin--tajikistan {
    left: 21.012%;
    top: 30.375%;
  }

  .wfpf-map__pin--kyrgyz-republic {
    left: 29.107%;
    top: 21.125%;
  }

  .wfpf-map__pin--pakistan {
    left: 18.75%;
    top: 49.25%;
  }

  .wfpf-map__pin--mongolia {
    left: 41.012%;
    top: 8.375%;
  }

  .wfpf-map__pin--prc {
    left: 46.726%;
    top: 21.625%;
  }

  .wfpf-map__pin--nepal {
    left: 25.893%;
    top: 40.75%;
  }

  .wfpf-map__pin--india {
    left: 22.44%;
    top: 56.625%;
  }

  .wfpf-map__pin--sri-lanka {
    left: 21.19%;
    top: 64.875%;
  }

  .wfpf-map__pin--bangladesh {
    left: 32.619%;
    top: 47.625%;
  }

  .wfpf-map__pin--myanmar {
    left: 30.179%;
    top: 54.75%;
  }

  .wfpf-map__pin--lao-pdr {
    left: 39.583%;
    top: 54.375%;
  }

  .wfpf-map__pin--cambodia {
    left: 33.869%;
    top: 61.75%;
  }

  .wfpf-map__pin--viet-nam {
    left: 42.202%;
    top: 60%;
  }

  .wfpf-map__pin--philippines {
    left: 51.25%;
    top: 61.875%;
  }

  .wfpf-map__pin--indonesia {
    left: 43.81%;
    top: 76.75%;
  }

  .wfpf-map__pin--marshall-islands {
    left: 74.226%;
    top: 64%;
  }

  .wfpf-map__pin--kiribati {
    left: 76.369%;
    top: 71.375%;
  }

  .wfpf-map__pin--solomon-islands {
    left: 60.714%;
    top: 85.75%;
  }

  .wfpf-map__pin--samoa {
    left: 84.226%;
    top: 87.375%;
  }

  .wfpf-map__pin--fiji {
    left: 80.774%;
    top: 93.125%;
  }
}

.wfpf-map__details {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 20px 20px;
}

.wfpf-map__legend {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-radius: 20px;
  background-color: var(--brand-off-white);
  color: var(--brand-retro-black);
}

.wfpf-map__legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wfpf-map__legend-title {
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wfpf-map__legend-total,
.wfpf-map__amount {
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.wfpf-map__legend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.wfpf-map__legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wfpf-map__region {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 400 14px/1.5 var(--font-ideal-sans-regular), sans-serif;
  letter-spacing: 0;
}

.wfpf-map__dot {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

/* Region colours */
.wfpf-map__dot--central-west-asia {
  background-color: #7755A1;
}

.wfpf-map__dot--east-asia {
  background-color: #509BAA;
}

.wfpf-map__dot--pacific {
  background-color: #7FB852;
}

.wfpf-map__dot--south-asia {
  background-color: #EC9958;
}

.wfpf-map__dot--southeast-asia {
  background-color: #D35E3F;
}

.wfpf-map__dot--inter-regional {
  background-color: #A0A0A2;
}

.wfpf-map__caption {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--brand-off-white);
}

.wfpf-map__caption p {
  font: 400 14px/1.5 var(--font-ideal-sans-regular), sans-serif;
  letter-spacing: 0;
}

.wfpf-map__note {
  opacity: 0.6;
}

/* Tablet: legend over the map, caption in a band below it */
@media (min-width: 768px) and (max-width: 1439.98px) {
  .wfpf-map .map-image {
    background-color: #1B78A6;
  }

  .wfpf-map__details {
    position: static;
    padding: 0 40px 40px;
    pointer-events: none;
  }

  .wfpf-map__legend {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 309px;
  }

  .wfpf-map__caption {
    position: relative;
    gap: 4px;
  }

  .wfpf-map__caption::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: -40px;
    right: -40px;
    height: 32px;
    background: linear-gradient(rgb(27 120 166 / 0), #1B78A6);
  }

  .wfpf-map__caption p {
    position: relative;
    font-size: 18px;
    letter-spacing: -0.01em;
  }

  .wfpf-map__caption .wfpf-map__note {
    font-size: 16px;
  }
}

/* Desktop: legend top right and caption bottom left, over the map */
@media (min-width: 1440px) {
  .wfpf-map__details {
    position: absolute;
    inset: 40px;
    padding: 0;
    pointer-events: none;
  }

  .wfpf-map__legend {
    position: absolute;
    top: 0;
    right: 0;
    width: 309px;
  }

  .wfpf-map__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    gap: 4px;
  }

  .wfpf-map__caption p {
    font-size: 18px;
    letter-spacing: -0.01em;
  }

  .wfpf-map__caption .wfpf-map__note {
    font-size: 16px;
  }
}
