/* t2030-feeding - Nutrition "Feeding and care" section body: wealth chart
   card + delivery-target and anemia key-figure cards. Section header and
   the light #EEF2F6 backdrop are rendered by the master twig.

   Design colors matched to tokens where exact: #4D4D4D --clr-gray-dark,
   #DBDBDB --clr-gray-light, #1FA29C --clr-teal-500, #F8B323
   --clr-yellow-orange. No token for the rest - scoped below. */
.t2030-feeding {
  --fd-ink: var(--clr-gray-dark, #4d4d4d);
  --fd-border: var(--clr-gray-light, #dbdbdb);
  --fd-grid: #f3f5f7;
  --fd-title: #15766f;
  --fd-poorest: #ed6e68;
  --fd-wealthiest: var(--clr-teal-500, #1fa29c);
  --fd-median: #d5e9e8;
  --fd-gap: #b3b3b3;
  --fd-gold: var(--clr-yellow-orange, #f8b323);
  --fd-row-hover: #f7f9fa;
  --fd-label-w: 190px;
  --fd-val-w: 112px;
  --fd-th-bg: #efefef;
  /* Download bar height above the main card; the side column starts this
     far down (+ the main gap) so both columns' cards line up. */
  --fd-toolbar-h: 33px;
  --fd-main-gap: 6px;

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

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

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

/* ---------- top download (light section backdrop) ---------- */
.t2030-feeding__toolbar-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: var(--fd-toolbar-h);
}

/* Site visualisation.css positions every .share-download-options absolutely
   (align-top: top -40px, right 0), which drops the bar out of the column and
   breaks the side-column alignment on Drupal pages. Keep it in flow here. */
.t2030-feeding__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) 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-feeding .options-field {
  position: relative;
}

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

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

/* ---------- chart card ---------- */
.t2030-feeding__card {
  /* .t2030-feeding (row) stretches .t2030-feeding__main's height to match
     the taller .t2030-feeding__side; without this, .main's column gives
     that extra height only to itself (flex children default to
     flex-grow:0), so the gap shows as bare page background below the
     card instead of the card itself growing to meet it. */
  flex: 1 1 auto;
  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-feeding__card-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.t2030-feeding__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-feeding__card-actions .visualization-actions-block {
  position: static;
  inset: auto;
}

.t2030-feeding__divider {
  width: 1px;
  height: 30px;
  background: var(--fd-wealthiest);
}

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

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

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

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

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

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

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

.t2030-feeding__swatch {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.t2030-feeding__swatch--poorest {
  background: var(--fd-poorest);
}

.t2030-feeding__swatch--wealthiest {
  background: var(--fd-wealthiest);
}

.t2030-feeding__swatch--median {
  width: 16px;
  border-radius: 2px;
  background: var(--fd-median);
}

/* ---------- chart ---------- */
.t2030-feeding__chart {
  position: relative;
  min-width: 0;
}

.t2030-feeding__row {
  display: flex;
  align-items: center;
  height: 56px;
  border-bottom: 1px solid var(--fd-grid);
  outline: none;
}

.t2030-feeding__row:hover,
.t2030-feeding__row:focus-visible {
  background: var(--fd-row-hover);
}

.t2030-feeding__row:focus-visible {
  box-shadow: inset 0 0 0 2px var(--fd-ink);
}

.t2030-feeding__label {
  flex: 0 0 var(--fd-label-w);
  padding-right: 16px;
  box-sizing: border-box;
  text-align: right;
  font-size: var(--fs-13, 13px);
  line-height: 1.3;
  color: var(--fd-ink);
}

.t2030-feeding__label-short {
  display: none;
}

.t2030-feeding__track {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 56px;
}

.t2030-feeding__median {
  position: absolute;
  top: 19px;
  left: 0;
  height: 18px;
  border-radius: 3px;
  background: var(--fd-median);
}

.t2030-feeding__gap {
  position: absolute;
  top: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--fd-gap);
}

.t2030-feeding__mark {
  position: absolute;
  top: 21px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 999px;
  border: 2px solid var(--clr-white, #fff);
  box-sizing: border-box;
}

.t2030-feeding__mark--poorest {
  background: var(--fd-poorest);
}

.t2030-feeding__mark--wealthiest {
  background: var(--fd-wealthiest);
}

.t2030-feeding__val {
  flex: 0 0 var(--fd-val-w);
  box-sizing: border-box;
  text-align: right;
  font-size: var(--fs-13, 13px);
  font-weight: var(--fw-bold, 700);
  color: var(--fd-ink);
}

.t2030-feeding__axis {
  display: flex;
  height: 26px;
}

.t2030-feeding__axis-pad {
  flex: 0 0 var(--fd-label-w);
}

.t2030-feeding__axis-pad--val {
  flex-basis: var(--fd-val-w);
}

.t2030-feeding__axis-track {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  border-top: 1px solid var(--fd-border);
}

.t2030-feeding__tick {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  font-size: var(--fs-11, 11px);
  color: var(--fd-ink);
}

.t2030-feeding__chart.is-narrow {
  --fd-label-w: 104px;
  --fd-val-w: 64px;
}

.t2030-feeding__chart.is-narrow .t2030-feeding__label {
  padding-right: 10px;
  font-size: var(--fs-12, 12px);
}

.t2030-feeding__chart.is-narrow .t2030-feeding__label-full {
  display: none;
}

.t2030-feeding__chart.is-narrow .t2030-feeding__label-short {
  display: inline;
}

.t2030-feeding__chart.is-narrow .t2030-feeding__val {
  padding-left: 8px;
  font-size: var(--fs-12, 12px);
  line-height: 1.25;
}

.t2030-feeding__source {
  margin: 0;
  /* .t2030-feeding (row) stretches this card's column to match
     .t2030-feeding__side's taller key-figure cards. Pin the source line
     to the bottom of that extra height instead of leaving it floating
     right after the chart with dead space below it - same pattern as
     mnch/continuum, mnch/equity and mnch/mortality's own .X__source. */
  padding-top: 14px;
  border-top: 1px solid var(--fd-border);
  font-size: var(--fs-13, 13px);
  line-height: 1.55;
  color: var(--fd-ink);
}

/* ---------- key-figure cards ---------- */
.t2030-feeding__side {
  flex: 2 1 380px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  /* Lines up with the chart card's own top, below the download bar added
     to .t2030-feeding__main above. */
  padding-top: calc(var(--fd-toolbar-h) + var(--fd-main-gap));
}

.t2030-feeding__fig-card {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  padding: 24px;
  background: var(--clr-white, #fff);
  border-radius: 24px 0 24px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--fd-ink);
}

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

.t2030-feeding__figs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.t2030-feeding__fig {
  padding-left: 18px;
  border-left: 3px solid var(--fd-gold);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.t2030-feeding__fig-value {
  font-size: 34px;
  line-height: 1.05;
  font-weight: var(--fw-bold, 700);
  color: var(--fd-ink);
}

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

.t2030-feeding__fig-text {
  font-size: var(--fs-15, 15px);
  line-height: 1.65;
  color: var(--fd-ink);
}

.t2030-feeding__fig-text>* {
  margin: 0;
}

.t2030-feeding__fig-text>*+* {
  margin-top: 12px;
}

/* ---------- tooltip ---------- */
.t2030-feeding__tip {
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 190px;
  max-width: 280px;
  padding: 8px 12px;
  background: var(--clr-white, #fff);
  border: 1px solid var(--fd-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(--fd-ink);
  pointer-events: none;
}

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

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

.t2030-feeding__tip-swatch {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.t2030-feeding__tip-swatch--poorest {
  background: var(--fd-poorest);
}

.t2030-feeding__tip-swatch--median {
  background: var(--fd-median);
  border-radius: 2px;
}

.t2030-feeding__tip-swatch--wealthiest {
  background: var(--fd-wealthiest);
}

.t2030-feeding__tip-label {
  flex: 1 1 auto;
}

.t2030-feeding__tip-val {
  font-weight: var(--fw-bold, 700);
}

.t2030-feeding__tip-note {
  margin-top: 4px;
  color: #6b6b6b;
}

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

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

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

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

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

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

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

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

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

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

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

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

@media (max-width: 559px) {

  .t2030-feeding__card,
  .t2030-feeding__fig-card {
    padding: 20px 16px;
  }

  .t2030-feeding__fig-value {
    font-size: 30px;
  }
}

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