/* t2030-survival - Nutrition "Nutrition and survival" section body: scatter
   card + "One package of care" text card. 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.
   No token for the rest - scoped below. */
.t2030-survival {
  --sv-ink: var(--clr-gray-dark, #4d4d4d);
  --sv-border: var(--clr-gray-light, #dbdbdb);
  --sv-grid: #f3f5f7;
  --sv-navy: var(--clr-blue, #21568c);
  --sv-teal: var(--clr-teal-500, #1fa29c);
  --sv-title: #15766f;
  --sv-th-bg: #efefef;
  /* Download bar height above the main card; the aside starts this far
     down (+ the main gap) so both columns' cards line up. */
  --sv-toolbar-h: 33px;
  --sv-main-gap: 6px;

  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  min-width: 0;
  font-family: var(--primary-ff, 'Poppins', sans-serif);
  color: var(--sv-ink);
}

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

.t2030-survival__main {
  flex: 3 1 560px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sv-main-gap);
}

/* ---------- top download (dark navy section backdrop) ---------- */
.t2030-survival__toolbar-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: var(--sv-toolbar-h);
}

/* Site visualisation.css positions every .share-download-options absolutely
   (align-top: top -40px, right 0), which lifts the bar into the section
   header and the card up under it on Drupal pages. Keep it in flow here. */
.t2030-survival__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 colour (white on this dark navy backdrop) 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:nth-child(even), base/odd-even-styles/odd-even-styles.css)
   already flips --section-icon-text-clr + the icon's --icon/--icon-hover
   to the white variant automatically (elements/icons/icons.css's own
   `.odd-even-style:nth-child(even) .icon--download` rule) - no per-component
   override needed, same as every other key-theme chart. */
.t2030-survival .options-field {
  position: relative;
}

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

.t2030-survival .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-survival .options-field:hover .options-field-list,
.t2030-survival .options-field:focus-within .options-field-list {
  display: block;
}

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

.t2030-survival__card-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.t2030-survival__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 card-head flex row, so keep it in flow. */
.t2030-survival__card-actions .visualization-actions-block {
  position: static;
  inset: auto;
}

.t2030-survival__divider {
  width: 1px;
  height: 30px;
  background: var(--sv-teal);
}

.t2030-survival__card-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.t2030-survival__viz {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.t2030-survival__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

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

.t2030-survival__sub {
  margin: 0;
  font-size: var(--fs-14, 14px);
  line-height: 1.5;
  color: var(--sv-ink);
}

.t2030-survival__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: var(--fs-13, 13px);
  color: var(--sv-ink);
}

.t2030-survival__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.t2030-survival__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--sv-navy);
}

.t2030-survival__dot--fcv {
  background: var(--sv-teal);
}

.t2030-survival__trend-swatch {
  width: 18px;
  height: 0;
  border-top: 2px dashed var(--sv-ink);
}

/* ---------- plot ---------- */
.t2030-survival__chart {
  min-width: 0;
}

.t2030-survival__plot {
  position: relative;
  height: 300px;
  margin: 6px 8px 46px 56px;
  border-left: 1px solid var(--sv-border);
  border-bottom: 1px solid var(--sv-border);
}

.t2030-survival__ygrid {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--sv-grid);
}

.t2030-survival__ytick {
  position: absolute;
  left: -46px;
  width: 38px;
  top: -8px;
  text-align: right;
  font-size: var(--fs-11, 11px);
  color: var(--sv-ink);
}

.t2030-survival__xtick {
  position: absolute;
  bottom: -20px;
  transform: translateX(-50%);
  font-size: var(--fs-11, 11px);
  color: var(--sv-ink);
}

.t2030-survival__trend {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.t2030-survival__trend line {
  stroke: var(--sv-ink);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  opacity: 0.8;
}

.t2030-survival__pts {
  position: absolute;
  inset: 0;
}

.t2030-survival__pt {
  position: absolute;
  width: 11px;
  height: 11px;
  margin: 0 0 -5.5px -5.5px;
  border-radius: 999px;
  background: var(--sv-navy);
  border: 1.5px solid var(--clr-white, #fff);
  box-sizing: border-box;
  cursor: default;
  z-index: 2;
  transition: transform 0.12s ease;
}

.t2030-survival__pt--fcv {
  background: var(--sv-teal);
}

.t2030-survival__pt:hover,
.t2030-survival__pt:focus-visible {
  transform: scale(1.35);
  z-index: 3;
}

.t2030-survival__pt:focus-visible {
  outline: 2px solid var(--sv-ink);
  outline-offset: 1px;
}

.t2030-survival__pt-label {
  position: absolute;
  transform: translate(8px, 50%);
  font-size: 11.5px;
  font-weight: var(--fw-semibold, 600);
  color: var(--sv-ink);
  white-space: nowrap;
  pointer-events: none;
}

.t2030-survival__pt-label.is-left {
  transform: translate(calc(-100% - 8px), 50%);
}

.t2030-survival__xl {
  position: absolute;
  left: 50%;
  bottom: -42px;
  transform: translateX(-50%);
  font-size: var(--fs-12, 12px);
  font-weight: var(--fw-semibold, 600);
  color: var(--sv-ink);
  white-space: nowrap;
}

.t2030-survival__yl {
  position: absolute;
  left: -50px;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  font-size: var(--fs-12, 12px);
  font-weight: var(--fw-semibold, 600);
  color: var(--sv-ink);
  white-space: nowrap;
}

.t2030-survival__chart.is-narrow .t2030-survival__plot {
  margin-left: 50px;
  margin-right: 4px;
}

.t2030-survival__chart.is-narrow .t2030-survival__yl {
  left: -44px;
}

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

/* ---------- text card ---------- */
.t2030-survival__aside {
  flex: 2 1 380px;
  min-width: 0;
  align-self: flex-start;
  box-sizing: border-box;
  padding: 24px;
  background: var(--clr-white, #fff);
  border-radius: 24px 0 24px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* Lines up with the chart card's own top, below the download bar added
     to .t2030-survival__main above. */
  margin-top: calc(var(--sv-toolbar-h) + var(--sv-main-gap));
}

@media (min-width: 901px) {
  .t2030-survival__aside {
    position: sticky;
    top: 96px;
  }
}

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

.t2030-survival__aside-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: var(--fs-15, 15px);
  line-height: 1.65;
  color: var(--sv-ink);
}

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

/* ---------- tooltip ---------- */
.t2030-survival__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(--sv-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(--sv-ink);
  pointer-events: none;
}

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

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

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

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

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

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

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

.t2030-survival__popup.is-active {
  display: flex;
}

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

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

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

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

body.survival-lock-scroll {
  overflow: hidden;
}

@media (max-width: 559px) {
  .t2030-survival__card,
  .t2030-survival__aside {
    padding: 20px 16px;
  }
}

@media (max-width: 600px) {
  .t2030-survival__divider {
    display: none;
  }
}

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