/* ==========================================================
   Version 01 — Section 02 · الأثر بالأرقام (redesign)
   Three-column composition around an interactive dotted map of Latin America.
   Desktop: the whole section fits one viewport below the floating nav.
   ========================================================== */
.ixs {
  --ink: var(--navy); --tealink: #1c6b64; --muted: #4a6670; --line: rgba(18,59,64,.12);
  --gap: clamp(10px, 1.6vh, 16px);
  position: relative; z-index: 3; isolation: isolate;
  margin-top: -40px; border-radius: 40px 40px 0 0;
  background: var(--offwhite); color: var(--ink);
  scroll-margin-top: var(--nav-h);
}
.ixs__wrap { max-width: 1400px; margin-inline: auto; padding: clamp(56px, 7vh, 88px) clamp(20px, 3vw, 48px) clamp(48px, 6vh, 80px); }

/* ---------- reveal plumbing (armed by JS) ---------- */
.ixs.is-armed [data-rv] { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease) calc(var(--d,0)*1ms), transform .9s var(--ease) calc(var(--d,0)*1ms); }
.ixs.is-armed .ix-card[data-side="r"] { transform: translateX(28px); }
.ixs.is-armed .ix-card[data-side="l"] { transform: translateX(-28px); }
.ixs.is-armed [data-rv].is-in { opacity: 1; transform: none; }
.ixs .mask { display: block; overflow: hidden; padding-block: .06em; }
.ixs .mask > span { display: inline-block; }
.ixs.is-armed .mask > span { transform: translateY(110%); transition: transform 1s var(--ease) calc(var(--d,0)*1ms); }
.ixs.is-armed .mask.is-in > span { transform: none; }

/* ---------- compact centred heading ---------- */
.ix-head { text-align: center; margin-bottom: clamp(14px, 2.6vh, 30px); }
.ix-eyebrow { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 6px; font-size: clamp(13px, 1.6vh, 14.5px); font-weight: 500; color: var(--tealink); }
.ix-eyebrow::before, .ix-eyebrow::after { content: ''; width: 24px; height: 1px; background: currentColor; opacity: .7; }
.ix-title { margin: 0; font-size: clamp(1.9rem, 4.6vh, 3rem); font-weight: 700; line-height: 1.2; }
.ix-lead { margin: 6px 0 0; font-size: clamp(14.5px, 1.9vh, 17px); color: var(--muted); }

/* ---------- 3-column grid: right cards · map · left cards ---------- */
.ix-grid { display: grid; gap: var(--gap);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.22fr) minmax(0, 1fr);
  grid-template-rows: 1.3fr 1fr 1fr;
  grid-template-areas: "p map a" "b map c" "d map e"; }
.ix-card--p { grid-area: p; } .ix-card--a { grid-area: a; } .ix-card--b { grid-area: b; }
.ix-card--c { grid-area: c; } .ix-card--d { grid-area: d; } .ix-card--e { grid-area: e; } .ix-map { grid-area: map; }

/* ---------- cards ---------- */
.ix-card { position: relative; overflow: hidden; isolation: isolate; min-height: 0;
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  padding: clamp(14px, 2.2vh, 24px) clamp(16px, 1.6vw, 26px);
  border-radius: 20px; background: #fff; border: 1px solid var(--line);
  transition: opacity .8s var(--ease) calc(var(--d,0)*1ms), transform .9s var(--ease) calc(var(--d,0)*1ms), border-color .35s, box-shadow .35s; }
.ixs .ix-card.is-in:hover, .ixs:not(.is-armed) .ix-card:hover { transform: translateY(-4px); border-color: rgba(28,107,100,.45); box-shadow: 0 18px 36px -28px rgba(11,32,44,.45); transition-delay: 0s; }
.ix-card__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ix-card__label { font-size: clamp(14.5px, 1.95vh, 17px); font-weight: 600; color: var(--ink); line-height: 1.35; }
.ix-card__ico { flex-shrink: 0; width: clamp(42px, 5.8vh, 52px); height: clamp(42px, 5.8vh, 52px); display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); color: var(--tealink); }
.ix-card__ico svg { width: 56%; height: 56%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ix-num { display: block; font-weight: 700; line-height: 1; letter-spacing: -.02em; direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.ix-card .ix-num { font-size: clamp(1.8rem, min(5.2vh, 3.1vw), 3.1rem); color: var(--ink); }

/* primary card */
.ix-card--primary { background: var(--teal); border-color: var(--teal); color: #fff; --mx: 70%; --my: 30%; }
.ix-card--primary::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(360px circle at var(--mx) var(--my), rgba(163,226,206,.16), transparent 65%); transition: opacity .4s; }
.ix-card--primary::after { content: ''; position: absolute; top: 0; right: clamp(16px, 1.6vw, 26px); width: 56px; height: 3px; border-radius: 0 0 3px 3px; background: var(--mint); }
.ix-card--primary .ix-card__label { color: var(--mint); }
.ix-card--primary .ix-card__ico { color: var(--mint); border-color: rgba(163,226,206,.3); }
.ix-card--primary .ix-num { color: #fff; font-size: clamp(2.6rem, min(8.6vh, 5.2vw), 5.4rem); }
.ixs .ix-card--primary.is-in:hover { border-color: var(--mint); }

/* ---------- map ---------- */
.ix-map { position: relative; margin: 0; min-height: 0; min-width: 0; outline: none; touch-action: pan-y; }
.ix-map canvas { position: absolute; inset: 0 0 34px 0; width: 100%; height: calc(100% - 34px); display: block; }
.ix-map:focus-visible { outline: 2px solid var(--tealink); outline-offset: 4px; border-radius: 20px; }
.ix-map.has-link { cursor: pointer; }
.ix-map__glow { position: absolute; inset: 6% 8% 14%; z-index: -1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(163,226,206,.55), rgba(163,226,206,.18) 55%, rgba(163,226,206,0)); filter: blur(6px); }
.ix-map__fallback { display: none; position: absolute; inset: 10% 20% 20%; border-radius: 40%; background: radial-gradient(circle, rgba(84,185,165,.25), transparent 70%); }
.ix-map.is-fallback .ix-map__fallback { display: block; }
.ix-legend { position: absolute; inset-inline: 0; bottom: 4px; display: flex; justify-content: center; align-items: center; gap: 8px; font-size: clamp(13px, 1.7vh, 14.5px); color: var(--muted); }
.ix-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(84,185,165,.3); }
.ix-tip { position: absolute; z-index: 3; pointer-events: none; padding: 8px 14px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap;
  opacity: 0; transform: translate(-50%, calc(-100% - 8px)) scale(.96); transition: opacity .2s, transform .25s var(--ease); }
.ix-tip.is-on { opacity: 1; transform: translate(-50%, calc(-100% - 12px)) scale(1); }
.ix-tip small { display: block; margin-top: 1px; font-size: 12px; font-weight: 400; color: var(--mint); }

/* ---------- follow-up status (calm, neutral) ---------- */
.ix-status { margin-top: var(--gap); display: grid; grid-template-columns: auto 1fr 1fr; align-items: center; gap: clamp(16px, 2.4vw, 40px);
  padding: clamp(12px, 1.8vh, 18px) clamp(18px, 2vw, 30px); border-radius: 18px; background: #eceee8; border: 1px solid rgba(18,59,64,.08); }
.ix-status__title { font-size: 14px; font-weight: 600; color: var(--muted); padding-inline-end: clamp(16px, 2vw, 32px); border-inline-end: 1px solid rgba(18,59,64,.14); }
.ix-status__item { display: flex; align-items: center; gap: 14px; }
.ix-status__item + .ix-status__item { padding-inline-start: clamp(16px, 2.4vw, 40px); border-inline-start: 1px solid rgba(18,59,64,.14); }
.ix-status .ix-num { font-size: clamp(1.5rem, 3.6vh, 2.1rem); color: #3a4c52; }
.ix-status__lbl { font-size: clamp(14px, 1.8vh, 16px); color: var(--muted); }
.ix-status__bar { position: relative; flex: 1; max-width: 220px; height: 6px; border-radius: 999px; background: rgba(18,59,64,.1); overflow: hidden; }
.ix-status__bar i { position: absolute; inset-block: 0; right: 0; width: var(--v); border-radius: 999px; background: #c9ad84; transform-origin: right; transition: transform 1.4s var(--ease) .3s; }
.ixs.is-armed .ix-status__bar i { transform: scaleX(0); }
.ixs.is-armed .ix-status.is-in .ix-status__bar i { transform: scaleX(1); }

/* ---------- one-viewport desktop composition ---------- */
@media (min-width: 1024px) and (min-height: 640px) {
  .ixs { height: calc(100svh - var(--nav-h)); }
  .ixs__wrap { height: 100%; display: flex; flex-direction: column; padding-block: clamp(26px, 4.2vh, 52px) clamp(18px, 3vh, 36px); }
  .ix-grid { flex: 1; min-height: 0; }
}

/* ---------- tablet / short screens: natural flow ---------- */
@media (max-width: 1023px), (max-height: 639px) {
  .ix-grid { grid-template-columns: 1fr 1fr; grid-template-rows: none; grid-template-areas: "p p" "map map" "a b" "c d" "e e"; }
  .ix-map { height: min(110vw, 620px); }
  .ix-card { min-height: 128px; }
  .ix-card .ix-num { font-size: clamp(2rem, 6vw, 2.8rem); }
  .ix-card--primary .ix-num { font-size: clamp(3.2rem, 11vw, 4.6rem); }
  .ix-status { grid-template-columns: 1fr 1fr; }
  .ix-status__title { grid-column: 1 / -1; border: 0; padding: 0; }
  .ix-status__item + .ix-status__item { padding-inline-start: 16px; }
  .ix-status__item { flex-wrap: wrap; }
  .ix-status__bar { flex-basis: 100%; max-width: none; }
}
@media (max-width: 600px) {
  .ixs { margin-top: -32px; border-radius: 32px 32px 0 0; }
  .ix-map { height: 125vw; }
  .ix-card { padding: 16px; min-height: 118px; }
  .ix-card__label { font-size: 14.5px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .ixs.is-armed [data-rv], .ixs.is-armed .mask > span, .ixs.is-armed .ix-card[data-side] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .ixs.is-armed .ix-status__bar i { transform: none !important; transition: none !important; }
}
@media print { .ixs { height: auto; margin-top: 0; border-radius: 0; } }

/* legend: evidence + country studies */
.ix-legend { gap: 18px; flex-wrap: wrap; }
.ix-legend span { display: inline-flex; align-items: center; gap: 8px; }
.ix-legend i.is-study { background: #54b9a5; box-shadow: 0 0 0 2px #fff, 0 0 0 3.4px var(--teal); }
/* entrance offsets (±28px) must never widen the page on small screens */
.ixs { overflow-x: clip; }
