/* Carte des flux — bifurque énergie.
 * All colours come from CSS variables set by applyTheme() in app.js;
 * the four palettes were validated with the dataviz colour checks
 * (CVD separation, lightness bands, contrast). */

:root {
  --font-body: "Inter", sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  /* defaults = Nuit; overwritten by applyTheme() */
  --bg: #0E1621;
  --panel: #16202C;
  --panel-strong: #1C2836;
  --text: #E8EDF2;
  --muted: #93A1B0;
  --border: #2A3948;
  --accent: #C48200;
  --renew-bg: #0E5C49;
  --renew-text: #E8EDF2;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  margin: 0;
  overflow: hidden;
}

.fs-7 { font-size: .75rem !important; }
.pbd-10px { margin-bottom: 15px; }
.vh-100-md { height: 100vh; }
.custom-cf-title { font-size: 1.5rem; font-family: var(--font-display); letter-spacing: .02em; }
.custom-cf-panel { flex: 0 0 auto; width: 31%; }
.custom-cf-map { flex: 0 0 auto; width: 69%; }
.p-10 { padding: 10px; }

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: .01em;
  margin-bottom: 10px;
}
.brand-sub { color: var(--muted); font-weight: 500; }

/* map */
#map-wrap { position: relative; width: 100%; height: calc(100vh - 20px); background: var(--bg); }
#init-zoom {
  position: absolute; top: 14px; left: 14px; z-index: 10;
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 8px; cursor: pointer; color: var(--text);
}

/* right panel */
.parent { padding-top: 28px; }
.panel-stack { height: 100vh; }
.panel-stack .child1, .panel-stack .child2 { flex: 0 0 auto; }
.panel-stack .child3 {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 32px;
}
.panel-stack .child3::-webkit-scrollbar { width: 12px; }
.panel-stack .child3::-webkit-scrollbar-track { background: var(--panel); border-radius: 8px; }
.panel-stack .child3::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
.text-infos { line-height: 17px; color: var(--muted); }
.sources { color: var(--muted); }

.mobile-bg2 { background-color: var(--panel); border-radius: 6px; }

.title { font-size: 20px; font-weight: 600; font-family: var(--font-display); }
.text-help { position: relative; left: 8px; top: 2px; color: var(--muted); }
.flux-bloc { padding-left: 15px; }

.production-title, .production-value { font-size: 20px; font-weight: 600; font-family: var(--font-display); }
.renew-block { background-color: var(--renew-bg) !important; color: var(--renew-text); border-radius: 4px; }

/* inline icons (stroke = currentColor) */
.ic { display: inline-flex; width: 22px; height: 22px; vertical-align: middle; color: var(--text); }
.ic svg { width: 100%; height: 100%; }
.ic-s { width: 15px; height: 15px; color: var(--muted); margin-left: 7px; }
.eye { cursor: pointer; }
.eye.off { color: var(--muted); }

/* line legend swatches (coloured by theme via JS) */
.line-swatch { display: inline-block; width: 24px; height: 4px; border-radius: 2px; vertical-align: middle; }

/* snapshot + theme selectors */
.snapshot-select {
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; font-family: inherit; font-size: .8rem;
  padding: 3px 6px; max-width: 100%;
}
.theme-select { display: inline-flex; gap: 6px; }
.theme-dot {
  width: 20px; height: 20px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; padding: 0;
}
.theme-dot.active { border-color: var(--text); }

/* consumption legend */
.conso-legend { display: flex; gap: 10px; align-items: stretch; height: 96px; margin-top: 4px; }
.conso-bar { width: 22px; border-radius: 2px; }
.conso-labels { display: flex; flex-direction: column; justify-content: space-between; font-size: .95rem; }
.conso-labels .tick { display: inline-block; width: 26px; border-top: 2px solid var(--text); vertical-align: middle; margin-right: 10px; }

/* production size legend (inline SVG themed by JS) */
.prod-legend svg { display: block; }
.prod-legend text { font-family: var(--font-body); }

/* tooltip */
.cf-tip { position: relative; cursor: help; }
.cf-tip::after {
  content: attr(data-tip);
  position: absolute; left: 50%; top: 130%; transform: translateX(-50%);
  background: var(--panel-strong); color: var(--text); font-size: .75rem; white-space: normal;
  width: max-content; max-width: 240px;
  padding: 4px 8px; display: none; z-index: 30; border: 1px solid var(--border); border-radius: 4px;
}
.cf-tip:hover::after { display: block; }

/* about / methodology fold */
.about-details { margin-top: 6px; }
.about-details summary {
  cursor: pointer; color: var(--accent); font-weight: 600;
  list-style: none; display: inline-block;
}
.about-details summary::before { content: "▸ "; }
.about-details[open] summary::before { content: "▾ "; }
.about-details summary::-webkit-details-marker { display: none; }
.about-body { margin-top: 8px; }
.about-body p { margin-bottom: 8px; }
.about-body p:last-child { margin-bottom: 16px; }

.about-body a { color: var(--accent); text-decoration: none; }
.about-body a:hover { text-decoration: underline; }
