@import url("./site-reading-layers.css?v=sha256-88d2f12982ad3252");

/* Tokens visuels et composants communs de l'Observatoire des Polycrises.
   Les palettes propres aux données et aux simulations restent locales. */
:root {
  --obs-ink: #0f172a;
  --obs-muted: #334155;
  --obs-action: #1d4ed8;
  --obs-action-hover: #1e40af;
  --obs-surface: #ffffff;
  --obs-surface-subtle: #f8fafc;
  --obs-border: #cbd5e1;
  --obs-control-border: #64748b;
  --obs-focus: #2563eb;
  --obs-caution: #92400e;
  --obs-caution-mark: #f59e0b;
  --obs-space-1: .25rem;
  --obs-space-2: .5rem;
  --obs-space-3: .75rem;
  --obs-space-4: 1rem;
  --obs-space-6: 1.5rem;
  --obs-space-8: 2rem;
  --obs-radius-control: .5rem;
  --obs-radius-panel: .75rem;
  --obs-radius-card: 1rem;
  --obs-shadow-panel: 0 8px 24px rgb(15 23 42 / 8%);
  --obs-reading-measure: 78ch;
  --obs-body-size: 1rem;
  --obs-body-leading: 1.6;
  --background-reading-veil-opacity: .6;
  --reading-surface-opacity: .84;
}

.obs-page {
  color: var(--obs-ink);
  font-size: var(--obs-body-size);
  line-height: var(--obs-body-leading);
}

/* Keep the shared header above the fixed reading veil and background canvas.
   The skip link remains above the header when it receives keyboard focus. */
#header-container {
  position: relative;
  z-index: 9999 !important;
  isolation: isolate;
}

.obs-page-intro { max-width: var(--obs-reading-measure); }

.skip-link {
  position: fixed;
  top: -6rem;
  left: .75rem;
  z-index: 10001 !important;
  max-width: calc(100vw - 1.5rem);
  padding: .75rem 1rem;
  border-radius: var(--obs-radius-control);
  background: var(--obs-surface);
  color: var(--obs-ink);
  box-shadow: var(--obs-shadow-panel);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: .75rem;
  outline: 3px solid var(--obs-focus);
  outline-offset: 3px;
}

.obs-header {
  background: var(--obs-surface);
  color: var(--obs-ink);
}

.obs-footer {
  border-color: var(--obs-border);
  background: var(--obs-surface-subtle);
  color: var(--obs-muted);
}

.obs-footer .text-slate-900 { color: var(--obs-ink); }
.obs-footer .text-slate-600,
.obs-footer .text-slate-500 { color: var(--obs-muted); }

.obs-panel {
  background: var(--obs-surface);
  border: 1px solid var(--obs-border);
  border-radius: var(--obs-radius-panel);
  box-shadow: var(--obs-shadow-panel);
}

.obs-card {
  background: var(--obs-surface);
  border: 1px solid var(--obs-border);
  border-radius: var(--obs-radius-card);
  box-shadow: var(--obs-shadow-panel);
}

.obs-link {
  color: var(--obs-action);
  text-decoration: underline;
  text-underline-offset: .15em;
}

.obs-link:hover { color: var(--obs-action-hover); }

.obs-focus-ring:focus-visible {
  outline: 3px solid var(--obs-focus);
  outline-offset: 3px;
}

.obs-page :is(select, textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"])) {
  border-color: var(--obs-control-border);
}

.reading-surface {
  background: rgba(255, 255, 255, var(--reading-surface-opacity)) !important;
  border: 1px solid rgba(255, 255, 255, .88);
  border-radius: var(--obs-radius-card);
  box-shadow: var(--obs-shadow-panel);
  -webkit-backdrop-filter: blur(8px) saturate(130%);
  backdrop-filter: blur(8px) saturate(130%);
}

body:has(> #background-graph)::before,
body.animated-content-page::before,
body.has-animated-background::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(255, 255, 255, var(--background-reading-veil-opacity));
  pointer-events: none;
}

body:has(> #background-graph) > #background-graph {
  position: fixed !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

body:has(> #background-graph) > :not(#background-graph):not(#header-container):not(#loading-screen):not(.skip-link):not(#back-to-top) {
  position: relative !important;
  z-index: 2 !important;
}

body.has-animated-background > :not(#background-graph):not(#loading-screen):not(#back-to-top) {
  position: relative !important;
  z-index: 2 !important;
}

/* Long headings and words must reflow when readers enlarge text. */
.obs-page :is(h1, h2, h3, p, li) { overflow-wrap: anywhere; }
