/* Infographics inside notes (components/astro/medio/Infographic.astro). Unlayered on purpose: it beats
   medio.css's components layer; only medio.css's unlayered h3 font-size pin needs a more specific !important.
   One accent (amber, from the covers), navy ink, square corners, no text under 16 px. The figure is its
   own container: below 520 px everything stacks. */
.ig {
  --ig-ink: #0f2a43;
  --ig-ink2: #33506a;
  --ig-blue: #005383;
  --ig-accent: #f2b33d;
  --ig-accent-dk: #d9962a;
  --ig-tint: #fdf1d8;
  --ig-tint-ink: #5f4205;
  --ig-panel: #f2f6f9;
  --ig-rule: #c9d9e6;
  container: ig / inline-size;
  margin: 12px 0 36px;
  padding: 26px clamp(16px, 5%, 32px) 20px;
  background: var(--ig-panel);
  border-top: 4px solid var(--ig-ink);
  font-family: var(--ui-font);
  font-size: 16px;
  line-height: 22px;
  color: var(--ig-ink);
}
:where(.ig) :where(p, ul, ol, h2, h3, h4) {
  margin: 0;
  padding: 0;
}
:where(.ig) :where(ul, ol) {
  list-style: none;
}
.ig svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Head: kicker with the amber rule of the covers, then the title */
.ig__kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ig-blue);
}
.ig__kicker::before {
  content: "";
  flex: none;
  width: 28px;
  height: 4px;
  background: var(--ig-accent);
}
html.medio-page .prose-eu .ig .ig__title {
  margin-top: 10px;
  font-size: clamp(22px, 4.7cqi, 27px) !important;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ig-ink);
  text-wrap: balance;
}

/* Blocks */
.ig-b {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--ig-rule);
}
html.medio-page .prose-eu .ig .ig-b__t {
  margin-bottom: 16px;
  font-size: 19px !important;
  line-height: 24px;
  font-weight: 700;
  color: var(--ig-ink);
}

/* Key figures */
.ig-fig {
  display: grid;
  gap: 18px;
}
.ig-fig__i {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  align-content: start;
}
/* A unit chart has no icon: on phones it keeps the text column of its neighbours */
.ig-fig__txt:only-child {
  grid-column: 2;
}
.ig-fig__ico svg {
  width: 48px;
  height: 48px;
}
.ig-fig__txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ig-fig__v {
  font-size: 26px;
  line-height: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ig-ink);
  text-wrap: balance;
}
.ig-fig__l {
  font-size: 16px;
  line-height: 22px;
  color: var(--ig-ink2);
}
.ig-fig__units svg {
  width: 196px;
  margin-bottom: 8px;
}
/* The lead stacks on phones (icon, figure, label) and sits in one row from 520 px */
.ig-fig__i--lead {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 18px;
  background: var(--ig-ink);
}
.ig-fig__i--lead .ig-fig__v {
  font-size: clamp(30px, 7.6cqi, 46px);
  line-height: 1.06;
  color: var(--ig-accent);
}
.ig-fig__i--lead .ig-fig__l {
  margin-top: 4px;
  font-size: 17px;
  line-height: 23px;
  color: #fff;
}

/* Step path: numbered discs joined by a rule */
.ig-step {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  padding-bottom: 20px;
}
.ig-step:last-child {
  padding-bottom: 0;
}
.ig-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 62px;
  bottom: 6px;
  width: 2px;
  background: var(--ig-rule);
}
.ig-step__ico {
  position: relative;
  width: 56px;
  height: 56px;
}
.ig-step__ico svg {
  width: 56px;
  height: 56px;
}
.ig-n {
  display: inline-block;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ig-accent);
  color: var(--ig-ink);
  font: 700 16px/26px var(--ui-font);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ig-step__n {
  position: absolute;
  top: -4px;
  left: -6px;
  box-shadow: 0 0 0 3px var(--ig-panel);
}
.ig-step__txt {
  padding-top: 3px;
}
.ig-step__t {
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  color: var(--ig-ink);
}
.ig-step__d {
  margin-top: 2px;
  font-size: 16px;
  line-height: 22px;
  color: var(--ig-ink2);
}
.ig-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 2px 10px;
  background: var(--ig-tint);
  color: var(--ig-tint-ink);
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
}
.ig-tag::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ig-accent-dk);
}
.ig-note {
  margin-top: 20px;
  padding: 12px 16px;
  background: #fff;
  border-left: 4px solid var(--ig-accent);
  font-size: 16px;
  line-height: 22px;
  color: var(--ig-ink);
}

/* Anatomy: an ordered ladder (cells darkest first, callouts beside them) or a proportional bar */
.ig-cells {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ig-cell__b {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ig-cell__v {
  font-size: 22px;
  line-height: 26px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.ig-cell__l {
  white-space: nowrap;
}
.ig-cells--ladder .ig-cell {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.ig-cells--ladder .ig-cell--noted {
  margin: 6px 0;
}
.ig-cells--ladder .ig-cell__b {
  padding-left: 16px;
}
.ig-cells--ladder .ig-cell--noted .ig-cell__b {
  box-shadow: inset 4px 0 0 var(--ig-accent);
}
.ig-cell__c {
  position: relative;
  padding-top: 7px;
  font-size: 16px;
  line-height: 22px;
  color: var(--ig-ink);
}
.ig-cell__c::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 17px;
  width: 10px;
  height: 2px;
  background: var(--ig-accent-dk);
}
.ig-cells--bar .ig-cell {
  width: var(--wp);
  min-width: max-content;
}
.ig-cells--bar .ig-cell__b {
  padding: 10px 12px;
}
.ig-cap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  color: var(--ig-ink2);
}
.ig-cap__arrow {
  flex: none;
  width: 12px;
  color: var(--ig-ink);
}
.ig-callouts {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.ig-callouts li {
  position: relative;
  padding-left: 20px;
}
.ig-callouts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 9px;
  height: 9px;
  background: var(--ig-accent);
}
.ig-callouts p {
  font-size: 16px;
  line-height: 22px;
  color: var(--ig-ink);
}

/* Comparison columns */
.ig-cmp {
  display: grid;
  gap: 12px;
}
.ig-cmp__c {
  padding: 16px;
  background: #fff;
  border-top: 3px solid var(--ig-rule);
}
.ig-cmp__c--yes {
  border-top-color: var(--ig-blue);
}
.ig-cmp__c--no {
  border-top-color: #5d7a91;
}
html.medio-page .prose-eu .ig .ig-cmp__t {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 18px !important;
  line-height: 24px;
  font-weight: 700;
  color: var(--ig-ink);
}
.ig-mark {
  flex: none;
  width: 28px;
  height: 28px;
}
.ig-cmp ul {
  display: grid;
  gap: 10px;
}
.ig-cmp li {
  position: relative;
  padding-left: 16px;
  font-size: 16px;
  line-height: 22px;
  color: var(--ig-ink);
}
.ig-cmp li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5d7a91;
}

.ig-src {
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px solid var(--ig-rule);
  font-size: 16px;
  line-height: 22px;
  color: var(--ig-ink2);
}

@container ig (min-width: 520px) {
  .ig-fig {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 28px;
  }
  .ig-fig--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px 22px;
  }
  .ig-fig__i--lead {
    grid-column: 1 / -1;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    padding: 20px 24px;
  }
  .ig-fig__i--lead .ig-fig__ico svg {
    width: 64px;
    height: 64px;
  }
  .ig-fig__i:not(.ig-fig__i--lead) {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .ig-fig__txt:only-child {
    grid-column: 1;
  }
  .ig-fig__i:not(.ig-fig__i--lead) .ig-fig__ico svg {
    width: 56px;
    height: 56px;
  }
  .ig-fig__units {
    display: flex;
    align-items: flex-end;
    height: 56px;
    margin-bottom: 10px;
  }
  .ig-fig__units svg {
    margin: 0;
  }
  .ig-fig__v {
    font-size: 30px;
    line-height: 34px;
  }
  .ig-fig--3 .ig-fig__i:not(.ig-fig__i--lead) .ig-fig__v {
    font-size: 26px;
    line-height: 30px;
  }
  .ig-step {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 18px;
  }
  .ig-step:not(:last-child)::before {
    left: 31px;
    top: 70px;
  }
  .ig-step__ico,
  .ig-step__ico svg {
    width: 64px;
    height: 64px;
  }
  .ig-step__txt {
    padding-top: 6px;
  }
  .ig-cells--ladder .ig-cell {
    grid-template-columns: 136px minmax(0, 1fr);
    gap: 22px;
  }
  .ig-cell__c::before {
    left: -22px;
    width: 14px;
  }
  .ig-cells--bar {
    flex-direction: row;
  }
  .ig-cells--bar .ig-cell {
    flex: var(--w) 1 0;
    width: auto;
  }
  .ig-cells--bar .ig-cell__b {
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
  }
  .ig-cmp {
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    gap: 16px;
  }
}

@media print {
  .ig {
    background: #fff;
    border: 1px solid var(--ig-rule);
    border-top: 4px solid var(--ig-ink);
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .ig-fig__i--lead {
    background: #fff;
    border: 2px solid var(--ig-ink);
  }
  .ig-fig__i--lead .ig-fig__v,
  .ig-fig__i--lead .ig-fig__l {
    color: var(--ig-ink);
  }
  .ig-step__n {
    top: 0;
    box-shadow: none;
  }
  .ig__head,
  .ig-fig__i,
  .ig-step,
  .ig-cells,
  .ig-callouts li,
  .ig-cmp__c {
    break-inside: avoid;
  }
}

/* Long unbreakable strings (urls, emails) must wrap instead of widening the page on a phone */
.ig { overflow-wrap: anywhere; }
