/* ==========================================================================
   t2030-banner - Transform 2030 key-theme banner (shared by all key themes).
   Colourways follow the design's THEMES table; --t2030b-* props are set per
   theme modifier, everything else reads them.
   ========================================================================== */

/* One look for every key theme (old MNCH "navy" design): navy card, white
   ink, dark brand-curve pattern. Only the icon tile changes per theme -
   theme_1 = MNCH (default), theme_2 = Nutrition, theme_3 = SRHR,
   theme_4 = Adolescents, set from the node's theme_type field. Drupal's
   clean_class outputs theme-N (hyphen); theme_N kept for the stories. */
.t2030-banner {
  --t2030b-bg: #21568C;
  --t2030b-ink: #FFFFFF;
  --t2030b-ink2: rgba(255, 255, 255, 0.92);
  --t2030b-accent: #F8B323;
  --t2030b-panel: rgba(6, 26, 56, 0.42);
  --t2030b-line: rgba(255, 255, 255, 0.26);
  --t2030b-hover: rgba(255, 255, 255, 0.12);
  --t2030b-icon-bg: var(--t2030-theme1-clr, #BEE9E6);
  --t2030b-teal: #1FA29C;
  --t2030b-yellow: #F8B323;
  --t2030b-nav-bg: rgba(28, 30, 34, 0.72);

  font-family: var(--primary-ff, "Poppins", sans-serif);
}

/* Icon tile colour per theme - site tokens from
   components/redesign/base/color/color.css (hex = fallback for Storybook) */
.t2030-banner--theme-1,
.t2030-banner--theme_1 {
  --t2030b-icon-bg: var(--t2030-theme1-clr, #BEE9E6); /* MNCH */
}

.t2030-banner--theme-2,
.t2030-banner--theme_2 {
  --t2030b-icon-bg: var(--t2030-theme2-clr, #C3DBF1); /* Nutrition */
}

.t2030-banner--theme-3,
.t2030-banner--theme_3 {
  --t2030b-icon-bg: var(--t2030-theme3-clr, #FFE2D9); /* SRHR */
}

.t2030-banner--theme-4,
.t2030-banner--theme_4 {
  --t2030b-icon-bg: var(--t2030-theme4-clr, #E5C9E2); /* Adolescents */
}

/* Card. Carries .hero-banner only so explore-link.js can move the Explore
   nav back into it - neutralise the old hero sizing here. Full width of the
   page container, like the .page-main-chapter section boxes below it. */
.t2030-banner__card,
.t2030-banner__card.hero-banner {
  position: relative;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 400px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  overflow: visible;
  background: var(--t2030b-bg);
  color: var(--t2030b-ink);
}

/* Brand pattern (NEW_FINALS design): the GFF tile pattern covering the whole
   card, anchored right-centre (like the design's xMaxYMid slice), fading in
   from the left - transparent up to 38% of the width, full from 78%.
   Default image is img/banner-pattern.svg (path relative to this CSS file);
   a CMS upload (banner_pattern) replaces it, same framing and fade. */
.t2030-banner__pattern {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  overflow: hidden;
  pointer-events: none;
  background: url("/themes/custom/gff/templates/components/transform2030-page/shared-components/banner/css/../img/banner-pattern.svg") no-repeat right center / cover;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, transparent 38%, #000 78%);
  mask-image: linear-gradient(90deg, transparent 0, transparent 38%, #000 78%);
}

/* CMS-uploaded pattern replaces the default */
.t2030-banner__pattern--custom {
  background: none;
}

.t2030-banner__pattern-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}

/* Content row */
.t2030-banner__content {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 32px 56px;
  /* Full width of the card, with the sections' side padding (--sp14, from
     .p-styl-1) - no max-width. */
  --t2030b-px: var(--sp14, 70px);
  padding-block: 48px 40px;
  padding-inline: var(--t2030b-px);
  box-sizing: border-box;
}

@media (max-width: 576px) {
  .t2030-banner__content {
    --t2030b-px: 20px; /* .p-styl-1 at this width */
  }
}

.t2030-banner__intro {
  flex: 1 1 480px;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.t2030-banner__heading {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.4vw, 16px);
}

.t2030-banner__icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(60px, 6vw, 76px);
  height: clamp(60px, 6vw, 76px);
  border-radius: 0 22px 0 22px;
  background: var(--t2030b-icon-bg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.t2030-banner__icon img {
  display: block;
  height: calc(64% + 10px);
  width: auto;
  max-width: calc(66% + 10px);
  filter: brightness(0);
}

.t2030-banner__title {
  margin: 0;
  font-size: clamp(32px, 3.2vw, 42px);
  line-height: 1.2;
  font-weight: 700;
  color: inherit;
}

.t2030-banner__body {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 640px;
  font-size: 18px;
  line-height: 1.6;
  color: inherit;
}

.t2030-banner__body p {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.t2030-banner__body strong,
.t2030-banner__body b {
  font-weight: 700;
}

.t2030-banner__body a {
  color: inherit;
  text-decoration: underline;
}

/* Key figures panel */
.t2030-banner__figures-wrap {
  flex: 0 1 560px;
  min-width: 0;
}

.t2030-banner__figures {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  background: var(--t2030b-panel);
  border: 1px solid var(--t2030b-line);
  border-radius: 0 24px 0 24px;
  overflow: hidden;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.t2030-banner__figure {
  display: flex;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.t2030-banner__figure:nth-child(odd) {
  border-right: 1px solid var(--t2030b-line);
}

.t2030-banner__figure:nth-child(-n+2) {
  border-bottom: 1px solid var(--t2030b-line);
}

.t2030-banner__figure-link {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
  /* QC 452640: was 24px 50px - in a ~240px tile that left ~140px for the
     value, so e.g. "233.4M" overflowed into the right padding and ran
     under the hover arrow. Top stays 24px, so the value shares a line with
     the arrow (top-right, 12px + 16px icon = 28px from the right edge);
     44px right padding keeps a 16px gap between them. 32px left. */
  padding: 24px 44px 24px 32px;
  text-decoration: none;
  color: var(--t2030b-ink);
  transition: background-color 0.2s ease;
}

.t2030-banner__figure-link:hover,
.t2030-banner__figure-link:focus-visible {
  background-color: var(--t2030b-hover);
  color: var(--t2030b-ink);
  text-decoration: none;
}

.t2030-banner__figure-link:focus-visible {
  outline: 2px solid var(--t2030b-accent);
  outline-offset: -2px;
}

.t2030-banner__figure-value {
  display: flex;
  align-items: baseline;
  gap: 3px;
  /* Keeps the original tile/panel height: the number shrank from
     clamp(40px, 4.2vw, 56px) to clamp(36px, 3.4vw, 56px) (QC 452640) -
     add the difference back as space above it (also more arrow clearance). */
  padding-top: calc(clamp(40px, 4.2vw, 56px) - clamp(36px, 3.4vw, 56px));
  line-height: 1;
  letter-spacing: -0.02em;
}

/* 3.4vw (was 4.2vw): reaches the 56px cap only at ~1650px+, so long values
   ("233.4M", ~3.3em wide) still fit the ~164px content box of the ~240px
   tiles in the 1200-1366px band (QC 452640). */
.t2030-banner__figure-num {
  font-size: clamp(36px, 3.4vw, 56px);
  font-weight: 700;
}

.t2030-banner__figure-unit {
  font-size: clamp(22px, 2.3vw, 30px);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--t2030b-accent);
}

/* padding-right 24px: the link's side padding went 50+50 -> 32+44 (QC
   452640) to give the VALUE room; this keeps the LABEL at its original
   width (tile - 100px) so it wraps onto the same lines as before and the
   tile/panel height is unchanged. */
.t2030-banner__figure-label {
  padding-right: 24px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--t2030b-ink2);
}

.t2030-banner__figure-arrow {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.t2030-banner__figure-link:hover .t2030-banner__figure-arrow,
.t2030-banner__figure-link:focus-visible .t2030-banner__figure-arrow {
  opacity: 0.9;
  transform: none;
}

/* Figures without a link (no field_url / field_link in the CMS) get the
   same hover highlight as linked ones; no arrow, default cursor. */
.t2030-banner__figure-link--static {
  cursor: default;
}

@media (hover: none) {
  .t2030-banner__figure-arrow {
    opacity: 0.7;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .t2030-banner__figure-link,
  .t2030-banner__figure-arrow {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Explore links (site markup, in-banner state only - once explore-link.js
   makes it sticky it moves out of .t2030-banner and uses the site styling).
   -------------------------------------------------------------------------- */
.t2030-banner .explore-links-module {
  position: relative;
  align-self: center;
  justify-content: center;
  width: auto;
  max-width: calc(100% - 32px);
  border: 0;
}

.t2030-banner .explore-links-inner {
  max-width: 100%;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  padding: 0 28px;
  border: 0;
  border-radius: 22px 22px 0 0;
  background: var(--t2030b-nav-bg);
  color: #FFFFFF;
}

.t2030-banner .explore-label {
  flex-shrink: 0;
  padding: 12px 28px 12px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #FFFFFF;
}

.t2030-banner .explore-links-item {
  padding: 0;
  border: 0;
}

.t2030-banner .explore-links-item + .explore-links-item {
  border-left: 1px solid var(--t2030b-teal);
}

.t2030-banner .explore-links-item .explore-link {
  display: block;
  margin: 8px 0;
  padding: 4px 20px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  color: #FFFFFF;
}

.t2030-banner .explore-links-item .explore-link:hover,
.t2030-banner .explore-links-item .explore-link:focus-visible {
  color: var(--t2030b-yellow);
}

/* "More" dropdown injected by explore-link.js */
.t2030-banner .jump-drop-down-wrap {
  display: flex;
  align-items: center;
  margin: 6px 0 6px 4px;
  padding-left: 16px;
  border-left: 1px solid var(--t2030b-teal);
}

.t2030-banner .explore-links-all-hide.jump-drop-down-wrap {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}

.t2030-banner .jump-label {
  min-height: 34px;
  padding: 0 12px 0 14px;
  border: 0;
  border-radius: 2px;
  background: #FFFFFF;
  color: #1A1A1A;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.t2030-banner .jump-drop-down-wrap.opend .jump-label {
  background: var(--t2030b-yellow);
}

.t2030-banner .jump-dropdown {
  top: calc(100% + 6px);
  right: 0;
  z-index: 45;
  min-width: 260px;
  padding: 8px 0;
  border-radius: 4px;
  background: #FFFFFF;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.t2030-banner .jump-dropdown .explore-links-item {
  display: block;
  margin: 0;
  border: 0;
}

.t2030-banner .jump-dropdown .explore-link {
  margin: 0;
  padding: 12px 20px;
  font-size: 13px;
  line-height: 1.4;
  color: #4D4D4D;
  white-space: normal;
}

.t2030-banner .jump-dropdown .explore-link:hover,
.t2030-banner .jump-dropdown .explore-link:focus-visible {
  color: var(--t2030b-accent);
  background: #F3F5F7;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) {
  .t2030-banner__figures-wrap {
    flex: 1 1 100%;
  }
}

/* 1200-1366px: __intro (flex-basis 480, max-width 600) + __figures-wrap
   (flex-basis 560) + the 56px row gap need ~1096px of content-box width
   before flex-wrap's line-breaking even considers shrinking them - below
   that it wraps __figures-wrap onto its own row instead, but keeps full
   desktop padding/gap, which is what read as "broken" (a big empty
   decorative gap next to a full-width stacked panel) rather than either
   a real two-column desktop layout or the >=1199px block's intentional
   stacked-for-tablet one. Tightening the gap/basis here keeps the SAME
   side-by-side desktop arrangement (not the stacked one above) while
   actually fitting in this narrower desktop band; reverts to the full
   values again above 1366px where they fit with room to spare. */
@media (min-width: 1200px) and (max-width: 1366px) {
  .t2030-banner__content {
    gap: 24px 32px;
  }

  .t2030-banner__intro {
    flex-basis: 420px;
  }

  .t2030-banner__figures-wrap {
    flex-basis: 480px;
  }
}

@media (max-width: 767px) {
  .t2030-banner__card,
  .t2030-banner__card.hero-banner {
    min-height: 0;
    border-radius: 20px;
  }

  .t2030-banner__pattern {
    border-radius: 20px;
  }

  .t2030-banner__content {
    padding-block: 32px 28px;
    gap: 24px;
  }

  .t2030-banner__intro {
    flex-basis: 100%;
    gap: 16px;
  }

  .t2030-banner__body {
    gap: 16px;
    font-size: 16px;
  }

  /* Right 40px: on touch screens the arrow is always shown (hover: none
     block), so keep the value clear of it, as on desktop. */
  .t2030-banner__figure-link {
    padding: 20px 40px 20px 20px;
  }

  /* Original mobile label width was tile - 40px; link is now 20+40, so pull
     the label back out by 20px (arrow sits only beside the value row). */
  .t2030-banner__figure-label {
    padding-right: 0;
    margin-right: -20px;
  }

  .t2030-banner .explore-links-inner {
    padding: 0 16px;
  }
}

@media (max-width: 479px) {
  .t2030-banner__figures {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: auto;
  }

  .t2030-banner__figure:nth-child(odd) {
    border-right: 0;
  }

  .t2030-banner__figure:not(:last-child) {
    border-bottom: 1px solid var(--t2030b-line);
  }
}
