/* ==========================================================================
   MPTFO Annual Report 2025 — Chapter / Sub-page Styles
   ========================================================================== */

/* ── Local variable fixes (undefined in index.css) ── */
:root {
  --un-blue:        #2EABE1;
  --un-blue-hover:  #005880;
  --un-dark:        #15385F;
  --un-mid:         #66809D;
  --un-light:       #F0F7FC;
  --un-teal:        #007A74;
  --un-amber:       #F7A800;
  --un-green:       #3D7A27;
  --text-primary:   #0A0A0A;
  --text-secondary: #3D4D5C;
  --text-muted:     #5A6070;
  --border:         #C8D4E0;
  --bg:             #F3F4F8;
  --white:          #FFFFFF;
  --table-header:   #1A3A5C;
  --table-alt:      #EEF5FF;
  --focus-ring:     #0072A3;
  --section-gap: 48px;
  --radius: 12px;
  --max-w: 1152px;
  --side-pad: 24px;
}

/* ── PHOTO + caption ── */
.photo-card {
  position: relative;
  display: inline-block;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}
.photo-card img { width: 100%; height: auto; display: block; }
.photo-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(20, 40, 80, 0.82);
  color: #ffffff;
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 12px 16px;
}

/* ── STAT BOXES ── */
.card-number { overflow: hidden; }
.stat-row-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 16px; }
.sbox { background: var(--white); padding: 16px; }
.sbox .lbl { font-size: 1rem; color: var(--un-dark); font-weight: 500; }
.sbox .num { font-size: 2.5rem; font-weight: 800; color: var(--un-dark); }

/* ── DATA TABLES ── */

/* Wrapper enables horizontal scroll on narrow screens */
.data-table-wrap {
  border: 1px solid var(--border);
  margin: 16px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.data-table thead tr { background: var(--un-dark); color: #fff; }
.data-table thead th {
  padding: 11px 14px; text-align: left; font-weight: 600;
  font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
.data-table thead th:not(:first-child) { text-align: right; }
.data-table thead th:nth-child(2) { text-align: left; }
.data-table tbody tr { border-bottom: 1px solid var(--border); transition: background var(--trans); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--un-light); }
.data-table tbody td { padding: 10px 14px; color: var(--text); vertical-align: middle; }
.data-table tbody td:first-child { color: var(--text-muted); font-size: .8rem; font-weight: 600; width: 32px; }
.data-table tbody td:not(:first-child):not(:nth-child(2)) { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tfoot tr { background: var(--un-dark); }
.data-table tfoot td { padding: 10px 14px; color: #fff; font-weight: 700; font-size: .84rem; }
.data-table tfoot td:not(:first-child) { text-align: right; }
.data-table strong { color: white; font-weight: 700; }

.check-link { color: var(--un-dark); }

/* ── DONUT CHARTS ── */
.body-2 { font-family: system-ui, sans-serif; background: #fff; display: flex; justify-content: center; align-items: center; }
.charts-row { display: flex; justify-content: center; align-items: flex-start; gap: 48px; padding: 2rem 1rem; flex-wrap: wrap; }
.chart-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.chart-container { position: relative; width: 220px; height: 220px; }
.chart-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.chart-year { font-size: 22px; font-weight: 500; color: #1a1a2e; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; font-size: 13px; color: #555; }
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Region pie chart */
.transfers-container { display: flex; flex-direction: column; align-items: center; padding: 2rem; }
.transfers-chart-wrapper { position: relative; width: 320px; height: 320px; }
.transfers-center-label {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center; pointer-events: none;
}
.transfers-center-label .amount { font-size: 22px; font-weight: 600; color: #111; line-height: 1.2; }
.transfers-center-label .subtitle { font-size: 13px; color: #666; }
.transfers-legend { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 1.5rem; justify-content: center; font-size: 13px; color: #555; }
.transfers-legend-item { display: flex; align-items: center; gap: 6px; }
.transfers-legend-color { width: 11px; height: 11px; border-radius: 2px; flex-shrink: 0; }

/* ── GEO TABS ── */
.fund { text-align: center; margin-bottom: 1rem; color: var(--un-dark); }
.fund-title { font-weight: 900; font-size: 1.5rem; margin-bottom: 0; }
.fund-description { font-size: 15px; margin-top: 0; }

.geo-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; gap: 0; margin-top: 1.5rem; }
.geo-tab {
  padding: 9px 22px; background: none; border: none; cursor: pointer;
  font-size: .86rem; font-weight: 600; color: var(--text-muted);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.geo-tab.active { color: var(--un-dark); border-bottom-color: var(--un-dark); }
.geo-panel { display: none; }
.geo-panel.active { display: block; }
.geo-highlights { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 18px; justify-content: center;}
.geo-hl { background: var(--bg); padding: 13px 16px; flex: 1; min-width: 110px; max-width:300px; }
.geo-hl .lbl { font-size: .7rem; color: var(--un-dark); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.geo-hl .num { font-size: 1.5rem; font-weight: 800; color: var(--un-dark); }

/* ── BADGES ── */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.badge-peace   { background: #e8eef6; color: #2a5080; }
.badge-climate { background: #e2f4f0; color: #1a6a54; }
.badge-dev     { background: #fdf0dc; color: #7a4f00; }
.badge-hum     { background: #fdeee8; color: #8a3020; }

/* ── SECTION NAV ── */
.sec-nav { display: flex; justify-content: flex-end; padding: 20px 0 0; margin-top: 16px; }
.sec-nav.both { justify-content: space-between; }
.snav-a { color: var(--un-dark); font-size: 1rem; font-weight: 600; text-decoration: none; line-height: 1.55; }
.snav-a:hover { text-decoration: underline; }
.snav-sub { font-size: .8rem; color: var(--text-muted); font-weight: 400; }
.card-body2 { display: flex; justify-content: flex-end; }
.back-and-next { display: flex; justify-content: space-between; }

/* ── KPI ── */
.kpi-container { margin-bottom: 24px; padding: 32px 24px; background: var(--bg); position: relative; }
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); }
.kpi-tag { background-color: var(--un-blue); border-radius: 24px; color: white; padding: 2px 8px; width: fit-content; font-size: 0.8rem; }
.kpi-number { font-weight: bold; color: var(--un-dark); font-size: 1rem; }

/* ── IMAGES ── */
.static-image { width: 100%; height: auto; }

/* ── TWO COLUMNS ── */
.two-col { display: flex; gap: 3rem; align-items: flex-start; max-width: 1100px; margin: 0 auto; background: #fff; border-radius: 8px; }
.two-col__text { flex: 1; }
.two-col__text h2 { font-size: 1.6rem; font-weight: 400; color: #2c3e50; border-left: 3px solid #5bc0de; padding-left: 0.75rem; margin: 0 0 1.5rem; }
.two-col__text p { font-size: 0.95rem; line-height: 1.75; color: #444; margin: 0 0 1rem; }
.two-col__image { flex: 0 0 380px; }
.two-col__image img { width: 100%; height: auto; display: block; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ═════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .stat-row-4 { grid-template-columns: 1fr 1fr; }
  .two-col { flex-direction: column; }
  .two-col__image { flex: none; width: 100%; }
}

@media (max-width: 640px) {
  .stat-row-4 { grid-template-columns: 1fr 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }
  .photo-card { border-radius: 0; max-width: 100%; }
  .photo-caption { font-size: 0.78rem; padding: 4px 6px; }
  /* Ensure tables have a minimum width so they scroll instead of wrapping badly */
  .data-table-wrap .data-table { min-width: 480px; }

  .photo-caption {
    position:relative ;
    background-color: var(--un-dark);
  }
  .geo-tab {
    padding: 9px 10px;
    line-height: 1.4;
    font-size: 16px;
  }
  .geo-hl{
    max-width: 500px;
  }
}

@media (max-width: 520px) {
  .chart-wrap { flex-direction: column; align-items: center; }
  .charts-row { justify-content: center; gap: 24px; }
  .chart-block { max-width: 150px; }
  .description { font-size: 13px; }
}
