/* t2030-family-planning - SRHR "Family planning" section body: one white
   panel holding the "Growth in modern contraceptive users" bar chart + the
   insights aside, and the TRANSFORM 2030 delivery-target band with its
   key-figure grid. Section header and the dark navy backdrop are rendered
   by the master twig.

   Design colors matched to tokens where exact: #4D4D4D --clr-gray-dark,
   #DBDBDB --clr-gray-light, #21568C --clr-blue, #1FA29C --clr-teal-500,
   #F8B323 --clr-yellow-orange. No token for the rest - scoped below. */
.t2030-family-planning {
  --fp-ink: var(--clr-gray-dark, #4d4d4d);
  --fp-muted: #6b6b6b;
  --fp-border: var(--clr-gray-light, #dbdbdb);
  --fp-grid: #f3f5f7;
  --fp-navy: var(--clr-blue, #21568c);
  --fp-teal: var(--clr-teal-500, #1fa29c);
  --fp-gold: var(--clr-yellow-orange, #f8b323);
  --fp-title: #15766f;
  --fp-tint: #eef2f6;
  --fp-row-hover: #edf5f5;
  --fp-lw: 220px;
  --fp-val-w: 72px;
  --fp-row-h: 72px;
  --fp-bar-h: 34px;
  --fp-th-bg: #efefef;

  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  font-family: var(--primary-ff, 'Poppins', sans-serif);
  color: var(--fp-ink);
}

.t2030-family-planning [hidden] {
  display: none !important;
}

/* ---------- white panel ---------- */
.t2030-family-planning__panel {
  background: var(--clr-white, #fff);
  border-radius: 0 24px 0 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-sizing: border-box;
}

/* ---------- top download (sits on the section's own backdrop, NOT inside
   .panel above - see the twig's own comment) ---------- */
.t2030-family-planning__toolbar-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 33px;
}

/* Site visualisation.css positions every .share-download-options absolutely
   (align-top: top -40px, right 0), which lifts the bar up and out of the
   panel on Drupal pages. Keep it in flow here. */
.t2030-family-planning__toolbar-top .share-download-options {
  position: static;
  inset: auto;
  padding: 0;
}

/* Site download chrome (share-download-options) is styled by the site; only
   the hover/focus reveal is needed for it to function standalone. Icon/
   label colour is NOT set here - reusing the exact same .icon--download/
   .text-icon-clr1 markup as MNCH (mnch/death, mnch/mortality) means the
   master twig's own section wrapper (.odd-even-style,
   base/odd-even-styles/odd-even-styles.css + elements/icons/icons.css)
   already supplies the right colour per section, light or dark, with no
   per-component override needed. */
.t2030-family-planning .options-field {
  position: relative;
}

.t2030-family-planning .maximize-popup,
.t2030-family-planning .icon--download {
  cursor: pointer;
}

.t2030-family-planning .options-field-list {
  display: none;
  /* Site chrome positions this flush against the download icon (top:100%,
     no gap) - adds visible space between them. */
  margin-top: var(--sp2, 8px);
}

.t2030-family-planning .options-field:hover .options-field-list,
.t2030-family-planning .options-field:focus-within .options-field-list {
  display: block;
}

.t2030-family-planning__growth {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.t2030-family-planning__body {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}

/* ---------- insights aside ---------- */
.t2030-family-planning__aside {
  flex: 1 1 280px;
  max-width: 380px;
  align-self: stretch;
  background: var(--fp-tint);
  border-radius: 24px 0 24px 0;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

.t2030-family-planning__aside-title {
  margin: 0;
  font-size: var(--fs-18, 18px);
  line-height: 1.35;
  font-weight: var(--fw-bold, 700);
  color: var(--fp-ink);
}

.t2030-family-planning__aside-close {
  padding-top: 14px;
  border-top: 1px solid var(--fp-border);
  font-size: var(--fs-14, 14px);
  line-height: 1.6;
}

.t2030-family-planning__aside-close > * {
  margin: 0;
}

.t2030-family-planning__aside-close > * + * {
  margin-top: 10px;
}

/* ---------- key figures (aside + target band) ---------- */
.t2030-family-planning__figs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.t2030-family-planning__fig {
  margin: 0;
  padding-left: 18px;
  border-left: 3px solid var(--fp-gold);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.t2030-family-planning__fig-value {
  font-size: var(--fs-34, 34px);
  line-height: 1.05;
  font-weight: var(--fw-bold, 700);
  color: var(--fp-navy);
}

.t2030-family-planning__fig-label {
  font-size: var(--fs-15, 15px);
  line-height: 1.55;
  color: var(--fp-ink);
}

/* ---------- delivery-target band ---------- */
.t2030-family-planning__target {
  background: var(--fp-tint);
  border-radius: 0 24px 0 24px;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  box-sizing: border-box;
  color: var(--fp-ink);
}

.t2030-family-planning__target-text {
  flex: 1 1 380px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.t2030-family-planning__target-title {
  margin: 0;
  font-size: var(--fs-20, 20px);
  line-height: 1.3;
  font-weight: var(--fw-bold, 700);
  color: var(--fp-ink);
}

.t2030-family-planning__target-lead {
  margin: 0;
  font-size: var(--fs-18, 18px);
  line-height: 1.45;
  font-weight: var(--fw-bold, 700);
  color: var(--fp-ink);
}

.t2030-family-planning__target-body {
  font-size: var(--fs-15, 15px);
  line-height: 1.65;
}

.t2030-family-planning__target-body > * {
  margin: 0;
}

.t2030-family-planning__target-body > * + * {
  margin-top: 10px;
}

.t2030-family-planning__figs--grid {
  flex: 1 1 380px;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

/* ---------- chart card heading ---------- */
.t2030-family-planning__title-row {
  display: flex;
  /* nowrap - see gender.css's own comment on this exact rule: a wrapping
     outer row can strand .card-actions alone on its own line, where
     justify-content:space-between collapses it to the start (left)
     instead of staying pinned right. .title-group wraps title/sub
     internally instead. */
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.t2030-family-planning__title-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  min-width: 0;
}

.t2030-family-planning__card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

/* Site visualisation.css (loaded on Drupal pages) positions every
   .visualization-actions-block absolutely (top/right of its card). Here the
   Enlarge button sits in the title-row flex row, so keep it in flow. */
.t2030-family-planning__card-actions .visualization-actions-block {
  position: static;
  inset: auto;
}

.t2030-family-planning__divider {
  width: 1px;
  height: 30px;
  background: var(--fp-teal);
}

.t2030-family-planning__title {
  margin: 0;
  font-size: var(--fs-20, 20px);
  line-height: 1.35;
  font-weight: var(--fw-bold, 700);
  color: var(--fp-title);
}

.t2030-family-planning__sub {
  margin: 0 0 0 16px;
  padding-left: 16px;
  border-left: 2px solid var(--fp-teal);
  font-size: var(--fs-14, 14px);
  line-height: 1.5;
  color: var(--fp-ink);
}

.t2030-family-planning__chart-col {
  flex: 2 1 460px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  container-type: inline-size;
}

/* ---------- bar chart (design bars() builder) ---------- */
.t2030-family-planning__chart {
  border: 1px solid var(--fp-border);
  border-radius: 8px;
  padding: 12px 8px 0 0;
  background: var(--clr-white, #fff);
}

.t2030-family-planning__chart-inner {
  position: relative;
}

.t2030-family-planning__grid {
  position: absolute;
  top: 0;
  bottom: 26px;
  left: var(--fp-lw);
  right: var(--fp-val-w);
  pointer-events: none;
}

.t2030-family-planning__grid-line {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--fp-grid);
}

.t2030-family-planning__rows {
  position: relative;
  display: flex;
  flex-direction: column;
}

.t2030-family-planning__row {
  display: flex;
  align-items: center;
  height: var(--fp-row-h);
  border-radius: 4px;
  cursor: default;
}

.t2030-family-planning__row:hover,
.t2030-family-planning__row:focus-visible {
  background: var(--fp-row-hover);
}

.t2030-family-planning__row:focus-visible {
  outline: 2px solid var(--fp-navy);
  outline-offset: 1px;
}

.t2030-family-planning__label {
  flex: 0 0 var(--fp-lw);
  padding-right: 12px;
  box-sizing: border-box;
  text-align: right;
  font-size: var(--fs-13, 13px);
  line-height: 1.3;
  color: var(--fp-ink);
}

.t2030-family-planning__track {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
}

.t2030-family-planning__bar {
  display: block;
  height: var(--fp-bar-h);
  border-radius: 0 4px 4px 0;
  transition: width 0.25s ease;
}

.t2030-family-planning__val {
  flex: 0 0 var(--fp-val-w);
  text-align: right;
  font-size: var(--fs-13, 13px);
  font-weight: var(--fw-bold, 700);
  color: var(--fp-ink);
}

.t2030-family-planning__axis {
  display: flex;
  height: 26px;
  margin-top: 4px;
}

.t2030-family-planning__axis-pad {
  flex: 0 0 var(--fp-lw);
}

.t2030-family-planning__axis-pad--val {
  flex-basis: var(--fp-val-w);
}

.t2030-family-planning__axis-track {
  position: relative;
  flex: 1 1 auto;
  border-top: 1px solid var(--fp-border);
}

.t2030-family-planning__tick {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  font-size: var(--fs-11, 11px);
  color: var(--fp-ink);
  white-space: nowrap;
}

.t2030-family-planning__source {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--fp-border);
  font-size: var(--fs-13, 13px);
  line-height: 1.55;
  color: var(--fp-ink);
}

/* ---------- table ---------- */
.t2030-family-planning__table-wrap {
  overflow: auto;
  /* border: 1px solid var(--fp-border); */
  /* border-radius: 8px; */
}

.t2030-family-planning__table {
  width: 100%;
  border-collapse: collapse;
}

.t2030-family-planning__table th,
.t2030-family-planning__table td {
  text-align: left;
}

.t2030-family-planning__table thead th {
  position: sticky;
  top: 0;
}

.t2030-family-planning__table .is-num {
  text-align: right;
}

/* ---------- enlarge popup (site chrome; only functional rules here) ---------- */
.t2030-family-planning__popup {
  display: none;
}

.t2030-family-planning__popup.is-active {
  display: flex;
}

.t2030-family-planning__popup .popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 35, 0.55);
  z-index: 55;
}

.t2030-family-planning__popup .popup-tab-content {
  display: none;
}

.t2030-family-planning__popup .popup-tab-content.is-active {
  display: block;
}

.t2030-family-planning__popup .custom-modal-close-field {
  cursor: pointer;
}

body.family-planning-lock-scroll {
  overflow: hidden;
}

/* ---------- tooltip ---------- */
.t2030-family-planning__tip {
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
  max-width: 280px;
  padding: 8px 12px;
  background: var(--clr-white, #fff);
  border: 1px solid var(--fp-border);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(30, 50, 80, 0.18);
  font-size: var(--fs-12, 12px);
  line-height: 1.45;
  color: var(--fp-ink);
  pointer-events: none;
}

.t2030-family-planning__tip-name {
  font-size: var(--fs-13, 13px);
  margin-bottom: 2px;
}

.t2030-family-planning__tip-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.t2030-family-planning__tip-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: none;
}

.t2030-family-planning__tip-note {
  color: var(--fp-muted);
}

/* ---------- responsive ---------- */
@media (min-width: 901px) {
  .t2030-family-planning__aside {
    position: sticky;
    top: 96px;
    align-self: flex-start;
  }
}

@media (max-width: 1000px) {
  .t2030-family-planning__sub {
    border-left: 0;
    padding-left: 0;
    margin-left: 0;
  }
}

@media (max-width: 900px) {
  .t2030-family-planning__aside {
    max-width: none;
  }
}

@media (max-width: 767px) {
  .t2030-family-planning {
    --fp-val-w: 56px;
  }
}

@media (max-width: 600px) {
  .t2030-family-planning__panel {
    padding: 18px 14px;
  }

  .t2030-family-planning__target,
  .t2030-family-planning__aside {
    padding: 20px 16px;
  }

  .t2030-family-planning__figs--grid {
    gap: 20px 16px;
  }

  .t2030-family-planning__fig-value {
    font-size: var(--fs-28, 28px);
  }

  .t2030-family-planning__divider {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .t2030-family-planning__bar {
    transition: none;
  }
}
