/* UEMOA Observatory — site layout on top of the HIG Native design system (hig.css).
   Rules here only place the system's components on the page and style the few things it has no component for
   (story rows, cards, where figures sit). Every colour, radius and size is one of the system's tokens; text uses its
   text-style classes. The site is built in the iOS / iPadOS idiom: a tab bar at compact widths, a sidebar at
   regular widths, grouped lists on the grouped background. */

[hidden] { display: none !important; }
html, body { background: var(--grouped-background-primary); }
body { min-height: 100vh; }
h1, h2, h3, p, dl, dd, figure, ul.hig-list-section__rows { margin: 0; }
a { color: var(--link); text-decoration: none; }
.prose a:hover, .page-foot a:hover, .lead a:hover, .block-foot a:hover { text-decoration: underline; }
.secondary { color: var(--label-secondary); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--background-primary); padding: 8px 12px; border-radius: var(--radius-sm); }
.skip:focus { left: 8px; }
.sample-banner { background: var(--system-yellow); color: var(--black); text-align: center; padding: 8px var(--margin-compact); }

/* ---- shell ---- */
.app-sidebar { display: none; position: fixed; top: 10px; left: 10px; bottom: 10px; z-index: 30; overflow-y: auto; border-radius: var(--radius-menu); }
.app-sidebar a.hig-sidebar__row { text-decoration: none; }
.sidebar-brand { padding: 22px 20px 10px; }
.sidebar-brand a { color: var(--glass-label-primary); }
.hig-sidebar__header-detail { margin-inline-start: auto; font: 400 13px/18px var(--font-sans); letter-spacing: -0.08px; align-self: center; padding-inline-end: 12px; }
.app-main { min-width: 0; }
.app-toolbar { position: sticky; top: 0; z-index: 20; }
.app-toolbar a.hig-toolbar__item { text-decoration: none; color: inherit; display: inline-flex; align-items: center; justify-content: center; }
/* The scroll edge effect and the inline title appear once content has scrolled under the bar. */
.js .app-toolbar .hig-toolbar__edge, .js .app-toolbar .inline-title { opacity: 0; transition: opacity 150ms linear; }
.js .is-scrolled .app-toolbar .hig-toolbar__edge, .js .is-scrolled .app-toolbar .inline-title { opacity: 1; }
.app-content { max-width: 1160px; margin: 0 auto; padding-bottom: calc(var(--tab-bar-height) + 24px); container: content / inline-size; }
.page-head { padding: 0 var(--margin-compact) 14px; }
.level-row { margin-top: 14px; }
.level-row .hig-segmented { width: 100%; }
.app-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-width: 460px; margin: 0 auto; pointer-events: none; padding-bottom: max(21px, env(safe-area-inset-bottom)); }
.app-tabbar .hig-tab-bar__tabs { pointer-events: auto; }
.app-tabbar a.hig-tab-bar__tab { text-decoration: none; }
.app-tabbar a.hig-tab-bar__tab:not(.is-selected) { color: var(--glass-label-primary); }
.page-foot { padding: 28px var(--margin-compact) 0; max-width: 760px; }
.page-foot p { margin-bottom: 8px; }
@media (min-width: 900px) {
  .app-sidebar { display: block; }
  .app-main { margin-inline-start: calc(var(--sidebar-width) + 20px); }
  .app-tabbar, .compact-only { display: none !important; }
  .app-content { padding-bottom: 40px; }
}
@media (max-width: 899.98px) { .regular-only { display: none !important; } }

/* ---- layout blocks ---- */
.split { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 20px; align-items: start; }
@container content (min-width: 820px) { .split { grid-template-columns: minmax(0, 1fr) 340px; } }
.split-main:not(.hig-list), .split-side:not(.hig-list) { padding: 0 var(--margin-compact); }
/* A brief in one column (phones): the two columns dissolve into a single run so the terms and the
   watch list follow the analysis they explain, and the reference lists (markets, sources) close the page. */
@container content (max-width: 819.98px) {
  .brief-split { display: flex; flex-direction: column; align-items: stretch; row-gap: 20px; padding: 0 var(--margin-compact); }
  .brief-split > .split-main, .brief-split > .split-side { display: contents; }
  .brief-split .hig-list-section { margin-top: 0; order: 5; }
  .brief-split [aria-labelledby="dev-h"] { order: 1; }
  .brief-split [aria-labelledby="ana-h"] { order: 2; }
  .brief-split [aria-labelledby="gl-h"] { order: 3; }
  .brief-split [aria-labelledby="wl-h"] { order: 4; }
  .brief-split [aria-labelledby="mk-h"] { order: 8; }
  .brief-split [aria-labelledby="src-h"] { order: 9; }
}
.stack, .block { margin-top: 20px; }
.block { padding: 0 var(--margin-compact); }
.block.first { margin-top: 0; }
.split-main > .block { padding: 0; }
.block-title { padding: 10px var(--margin-compact); }
.block-foot { padding: 8px var(--margin-compact) 0; }
.narrow { max-width: 760px; }
.lead { padding: 0 var(--margin-compact) 20px; max-width: 780px; }
.lead .headline { margin-bottom: 8px; }
.lead .ios-title-3 { margin-bottom: 10px; }
.lead-text { padding: 0 var(--margin-compact); }
.note { margin: 0 var(--margin-compact) 16px; padding: 12px var(--margin-compact); background: var(--grouped-background-secondary); border-radius: var(--radius-platter); color: var(--label-primary); }
.empty { text-align: center; padding: 80px var(--margin-compact); }
.empty p + p { margin-top: 6px; }

/* A card is one inset-grouped section holding something other than rows: text, a chart, a table. */
.card { background: var(--grouped-background-secondary); border-radius: var(--radius-group); padding: var(--margin-compact); color: var(--label-primary); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.table-card { padding: 0 0 0 var(--margin-compact); overflow-x: auto; }
.hig-list .card { margin: 0; }
.prose p { margin-bottom: 12px; }
.prose > :last-child, .prose .level > :last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 12px; padding-inline-start: 22px; }
.prose li { margin-bottom: 6px; }
.prose.padded { padding: 4px var(--margin-compact) var(--margin-compact); }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px; margin-top: 12px; }
.two h3 { margin-bottom: 6px; }
.stance { text-transform: capitalize; margin-bottom: 6px; }

/* ---- rows that carry a short story instead of a title and a detail ---- */
.hig-list-row__body.story { display: block; padding: 14px 0; }
.story h3 { margin-bottom: 4px; color: var(--label-primary); }
.story h3 a { color: var(--label-primary); }
.story p { margin-bottom: 6px; color: var(--label-primary); }
.story p.secondary { color: var(--label-secondary); }
.story > :last-child { margin-bottom: 0; }
.places > * + *::before { content: " · "; color: var(--label-secondary); }
.row-lead { flex: none; min-width: 20px; align-self: center; font-variant-numeric: tabular-nums; }
.hig-list-row:target .hig-list-row__content { background: var(--fill-quaternary); }
.cite { font: 600 11px/13px var(--font-sans); vertical-align: super; padding: 0 2px; }
.cite::before { content: "["; } .cite::after { content: "]"; }
.status { display: inline-flex; align-items: center; gap: 6px; color: var(--label-primary); }
.status.good .hig-icon { color: var(--system-green); }
.status.bad .hig-icon { color: var(--system-red); }
.status.warn .hig-icon { color: var(--system-orange); }
.status.neutral .hig-icon { color: var(--label-secondary); }
.help-list { margin: 14px 0; display: grid; gap: 12px; }
.help-list dd { color: var(--label-secondary); margin-top: 2px; }

/* ---- reading level ---- */
.level-control { --hig-seg-n: 3; --hig-seg-i: 1; }
html[data-level="essential"] .level-control { --hig-seg-i: 0; }
html[data-level="expert"] .level-control { --hig-seg-i: 2; }
.level, [data-level-desc] { display: none; }
html[data-level="essential"] .level[data-level-body="essential"],
html[data-level="standard"] .level[data-level-body="standard"],
html[data-level="expert"] .level[data-level-body="expert"] { display: block; }
html[data-level="essential"] [data-level-desc="essential"],
html[data-level="standard"] [data-level-desc="standard"],
html[data-level="expert"] [data-level-desc="expert"] { display: inline; }

/* Popover (regular widths) and sheet (compact widths) that explain the reading levels. */
.help-anchor { position: relative; }
.help-popover { top: calc(100% + 13px); right: -6px; width: min(380px, calc(100vw - 2 * var(--margin-compact))); }
.help-arrow { width: 56px; height: 13px; top: -13px; right: 0; -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'56'%20height%3D'13'%20viewBox%3D'0%200%2056%2013'%3E%3Cpath%20fill-rule%3D'nonzero'%20d%3D'M0%2013C0%2013%200.34%2013%200.34%2013C0.34%2013%201.86%2013%201.86%2013C1.86%2013%206.43%2013%206.43%2013C9.48%2013%2011.3%2012.73%2012.67%2012.18C14.04%2011.63%2014.96%2010.81%2016.17%209.72C17.39%208.62%2018.61%207.39%2019.83%206.09C21.05%204.79%2022.27%203.42%2023.49%202.05C24.7%200.68%2026.35%200%2028%200C29.65%200%2031.3%200.68%2032.51%202.05C33.73%203.42%2034.95%204.79%2036.17%206.09C37.39%207.39%2038.61%208.62%2039.82%209.72C41.04%2010.81%2041.96%2011.63%2043.33%2012.18C44.7%2012.73%2046.53%2013%2049.57%2013C49.57%2013%2054.14%2013%2054.14%2013C54.14%2013%2055.66%2013%2055.66%2013C55.66%2013%2056%2013%2056%2013C56%2013%200%2013%200%2013Z'%2F%3E%3C%2Fsvg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'56'%20height%3D'13'%20viewBox%3D'0%200%2056%2013'%3E%3Cpath%20fill-rule%3D'nonzero'%20d%3D'M0%2013C0%2013%200.34%2013%200.34%2013C0.34%2013%201.86%2013%201.86%2013C1.86%2013%206.43%2013%206.43%2013C9.48%2013%2011.3%2012.73%2012.67%2012.18C14.04%2011.63%2014.96%2010.81%2016.17%209.72C17.39%208.62%2018.61%207.39%2019.83%206.09C21.05%204.79%2022.27%203.42%2023.49%202.05C24.7%200.68%2026.35%200%2028%200C29.65%200%2031.3%200.68%2032.51%202.05C33.73%203.42%2034.95%204.79%2036.17%206.09C37.39%207.39%2038.61%208.62%2039.82%209.72C41.04%2010.81%2041.96%2011.63%2043.33%2012.18C44.7%2012.73%2046.53%2013%2049.57%2013C49.57%2013%2054.14%2013%2054.14%2013C54.14%2013%2055.66%2013%2055.66%2013C55.66%2013%2056%2013%2056%2013C56%2013%200%2013%200%2013Z'%2F%3E%3C%2Fsvg%3E"); }
.help-content { padding: 18px 20px 20px; }
.help-content h2 { margin-bottom: 8px; }
.help-sheet .help-content { padding-top: 4px; }

/* ---- charts: every figure is drawn by the Quiet Data design system (quiet.css, quiet.js).
        This file only places the figures on the page. A figure stands on Quiet Data's own ground with a square
        frame and no shadow, as that system asks, so its rings and label halos match what is behind them. ---- */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--margin-compact); padding: 0 var(--margin-compact); }
.brief > .figures { margin-top: 20px; }
.figures--wide { grid-template-columns: minmax(0, 1fr); }
.figures--map { grid-template-columns: minmax(0, 760px); }
.split-main > .figures, .block > .figures { padding: 0; }
/* A brief's own figures are spread through it: after the stories, the analysis, "For You" and the outlook.
   On a phone the sections are re-ordered (see .brief-split above), so each group of figures takes the place of
   the section it follows. Reading levels: Essential shows a figure and its key; Standard adds the table; Expert
   adds the precise figure (see .level-only). */
.brief-split .brief-figures--0 { order: 1; }
.brief-split .brief-figures--1 { order: 2; }
.brief-split .brief-figures--2, .brief-split .brief-figures--3 { order: 5; }
[data-level="essential"] .brief-figures .qd-table { display: none; }
.qd-plot { background: var(--ground); color: var(--ink); padding: var(--space-4); min-width: 0; }
.split-main > .qd-plot { margin: 0 var(--margin-compact); }
.qd-plot .qd-mount { min-width: 0; }
.qd-plot .qd-table-scroll { max-height: 320px; overflow-y: auto; }
/* A figure on a plate (the Data page). The slot is the plate, so every plate in a row has the same height;
   the figure's own plate inside it then adds nothing. */
.qd-plot.qd-plot--plate { --qd-surface: var(--plate); background: var(--plate); padding: var(--space-6) var(--space-4); }
.qd-plot--plate .qd-plate { background: none; padding: 0; }
/* The Data page's band: the chart system's Rose theme (pink ground, grey plates). Dark appearance keeps Dark.
   The band carries the class "qd" so that the chart system's spacing and type tokens apply to it. */
.data-band { margin: 20px var(--margin-compact) 0; padding: var(--space-6) var(--space-4) var(--space-8); }
.band-block + .band-block { margin-top: var(--space-12); }
.band-title { margin: 0 0 var(--space-3); }
.band-note { margin: var(--space-3) 0 0; color: var(--ink-soft); }
.data-band .figures { padding: 0; gap: var(--space-4); }
.figures--two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); }
.spiral-set { margin-bottom: var(--space-4); }
.data-band .figures + .figures { margin-top: var(--space-4); }
.spirals { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--space-4); justify-items: center; margin-top: var(--space-4); }
.qd-spiral-slot { width: 190px; }
.qd-spiral-slot p { margin: 0; text-align: center; }
/* A figure for one reading level only (the precise chart added for Expert readers). */
.level-only { display: none; }
[data-level="expert"] .level-only--expert { display: block; }
/* one key for a set of figures */
.qd-shared-key { padding: 0 calc(2 * var(--margin-compact)) 10px; }
.qd-shared-key .qd-legend, .qd-shared-key .qd-keyblock { margin: 0; }
.qd-shared-key .caption { margin: 0; color: var(--ink-soft); }
.qd-links { list-style: none; padding: 0; margin: var(--space-2) 0; display: grid; gap: var(--space-1); }
.qd a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.qd a.qd-mark { text-decoration: none; }
/* stat tiles: a rule on top and nothing else, four across at most */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--margin-compact) 24px; padding: 0 calc(2 * var(--margin-compact)); }
@container content (min-width: 820px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.qd-tile-slot { min-width: 0; color: var(--ink); }
/* a forecast: the probability as a rib dial, the question beside it */
.forecast { display: flex; align-items: center; gap: var(--margin-compact); padding: 12px var(--margin-compact) 12px 0; }
.forecast-text { min-width: 0; display: grid; gap: 4px; }
.qd-dial-slot { flex: none; width: 132px; }
.qd-dial-slot .figure-xl { margin: 0; text-align: center; color: var(--ink); }
@container content (max-width: 480px) { .forecast { flex-direction: column; align-items: flex-start; } }

/* ---- file photos: the lead story's picture spans its row; the other stories carry a small one ---- */
.story-lead { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-thumbnail); margin: 2px 0 12px; background: var(--fill-tertiary); }
.story.has-photo { display: grid; grid-template-columns: minmax(0, 1fr) 128px; column-gap: var(--margin-compact); align-items: start; }
.story-photo { width: 128px; height: 96px; object-fit: cover; border-radius: var(--radius-thumbnail); margin-top: 4px; background: var(--fill-tertiary); }
@container content (max-width: 480px) { .story.has-photo { grid-template-columns: minmax(0, 1fr) 88px; } .story-photo { width: 88px; height: 66px; } }
.photo-credits a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---- motion ----
   Moving between pages: the browser's own page transition (cross-document view transitions). The sidebar, the
   toolbar and the tab bar hold still while the content changes; the tab bar's selection glides to the new tab;
   going deeper (Countries to a country) slides forward, coming back slides back. A browser without this
   feature changes page as usual. Charts: see motion.js. All of it is off when the reader asks for less motion. */
:root { --ease-out: cubic-bezier(0.22, 1, 0.36, 1); --ease-in: cubic-bezier(0.5, 0, 0.9, 0.4); --spring: linear(0, 0.069, 0.222, 0.403, 0.575, 0.722, 0.837, 0.92, 0.975, 1.008, 1.025, 1.031, 1.031, 1.027, 1.021, 1.015, 1.01, 1.006, 1.003, 1.001, 1, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 1, 1); }
@view-transition { navigation: auto; }
.app-sidebar { view-transition-name: sidebar; }
.app-toolbar { view-transition-name: toolbar; }
.app-tabbar { view-transition-name: tabbar; }
.app-tabbar .hig-tab-bar__selection { view-transition-name: tab-selection; }
.app-content { view-transition-name: content; }
::view-transition-group(tab-selection) { animation-duration: 420ms; animation-timing-function: var(--spring); }
::view-transition-group(sidebar), ::view-transition-group(toolbar), ::view-transition-group(tabbar) { animation-duration: 240ms; }
/* A change of page (the type is set in theme.js): the old content leaves quickly, the new arrives softly. */
html:active-view-transition-type(page)::view-transition-old(content) { animation: 150ms var(--ease-in) both page-out; }
html:active-view-transition-type(page)::view-transition-new(content) { animation: 380ms var(--ease-out) 60ms both page-in; }
html:active-view-transition-type(deeper)::view-transition-old(content) { animation-name: page-out-left; }
html:active-view-transition-type(deeper)::view-transition-new(content) { animation-name: page-in-right; }
html:active-view-transition-type(shallower)::view-transition-old(content) { animation-name: page-out-right; }
html:active-view-transition-type(shallower)::view-transition-new(content) { animation-name: page-in-left; }
@keyframes page-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes page-out-left { to { opacity: 0; transform: translateX(-36px); } }
@keyframes page-in-right { from { opacity: 0; transform: translateX(48px); } }
@keyframes page-out-right { to { opacity: 0; transform: translateX(36px); } }
@keyframes page-in-left { from { opacity: 0; transform: translateX(-48px); } }

/* Things that open: the help popover grows from its button, the sheet rises, a disclosure unfolds. */
.hig-popover:not([hidden]) .hig-popover__body, .hig-popover:not([hidden]) .hig-popover__arrow { animation: 320ms var(--spring) both pop-in; transform-origin: top right; }
.hig-sheet-scrim:not([hidden]) { animation: 220ms ease-out both fade-in; }
.hig-sheet-scrim:not([hidden]) .hig-sheet { animation: 460ms var(--ease-out) both sheet-up; }
.hig-disclosure__content:not([hidden]), .qd-table[open] .qd-table-scroll { animation: 300ms var(--ease-out) both unfold; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.86); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes unfold { from { opacity: 0; transform: translateY(-6px); } }
/* Rows and tiles answer a press. */
.hig-list-row--actionable .hig-list-row__content, .hig-sidebar__row, .hig-tab-bar__tab { transition: background-color 180ms ease-out, transform 180ms var(--ease-out), opacity 180ms ease-out; }
.hig-list-row--actionable:active .hig-list-row__content { transform: scale(0.985); }
.hig-tab-bar__tab:active { transform: scale(0.94); }

/* Charts wait, drawn but unseen, until they are in view; then motion.js plays them once. With scripts on, the
   table a chart starts as is kept out of sight until the chart replaces it, so nothing flashes. */
.js .qd[data-qd]:not(.is-drawn) .qd-mount { visibility: hidden; }
.js .qd-plot:not(.is-drawn) { min-height: 300px; }
.js.no-charts .qd .qd-mount { visibility: visible; }
.qd-wait .qd-mount { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0s !important; transition-duration: 1ms !important; }
  .qd-wait .qd-mount { opacity: 1; }
}

@media print {
  .app-sidebar, .app-tabbar, .app-toolbar, .level-row, .tip, .hig-disclosure__trigger { display: none !important; }
  .app-main { margin: 0; }
  .level { display: block !important; }
}
