:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #66645f;
  --paper: #e4e3e3;
  --panel: #fffdf8;
  --mint: #a9e3d2;
  --mint-soft: #bbf9f6;
  --lavender: #d2c3e1;
  --warm: #f1c5a5;
  --ascii-blue: #106d87;
  --border: 2px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, Helvetica, sans-serif; }
.page { max-width: 1240px; margin: 0 auto; padding: 78px 24px 54px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.ascii-card {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  width: 100%;
  overflow: hidden;
  border-bottom: 2px solid var(--ascii-blue);
  background: var(--mint-soft);
}
.header-logo-link {
  position: absolute;
  top: 50%;
  left: 18px;
  z-index: 1;
  display: flex;
  align-items: center;
  width: clamp(150px, 11vw, 210px);
  transform: translateY(-50%);
}
.header-logo-link img { display: block; width: 100%; height: auto;  }
.header-logo-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.ascii-title { margin: 0 ;margin-bottom: -5px; color: var(--ascii-blue); font-family: "Courier New", Courier, monospace; font-size: 5px; font-weight: 900; line-height: .88; letter-spacing: 0; text-align: center; white-space: pre; }
.mobile-title { display: none; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
  gap: 48px;
  align-items: center;
  padding: 38px 0 42px;
  border-bottom: 2px solid var(--ink);
}
.hero-copy { max-width: 760px; }
.eyebrow {
  display: inline-block;
  padding: 5px 10px;
  border: 1.5px solid var(--ink);
  background: var(--warm);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .14em;
}
.hero-copy h2 { max-width: 850px; margin: 17px 0 13px; font-size: clamp(2.6rem, 5.2vw, 4.7rem); line-height: .94; letter-spacing: -.06em; }
.subtitle { max-width: 650px; margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.hero-card { min-height: 245px; padding: 25px; border: var(--border); background: var(--mint-soft); box-shadow: var(--shadow); }
.hero-card-label, .summary-label, .control > label, .method-card h3 { font-size: .66rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.hero-card-value { margin: 27px 0 8px; font-size: clamp(2.2rem, 4vw, 3.6rem); font-weight: 900; letter-spacing: -.06em; }
.hero-card p { margin: 0; color: var(--muted); line-height: 1.4; }
.hero-keys { display: flex; gap: 8px; margin-top: 25px; flex-wrap: wrap; }
.hero-keys span { padding: 5px 8px; border: 1.5px solid var(--ink); font-size: .6rem; font-weight: 800; }
.cold-key { background: #bcd9ea; }
.hot-key { background: #efaaa1; }

.freshness-card { display: block; margin-top: 22px; padding: 17px 19px; border: var(--border); background: #f5dfae; box-shadow: 4px 4px 0 var(--ink); }
.freshness-main { display: flex; flex-direction: column; gap: 11px; }
.freshness-label { font-size: .64rem; font-weight: 850; letter-spacing: .12em; }
.freshness-main strong { font-size: 1.08rem; }
.freshness-note { margin: 13px 0 0; color: var(--muted); font-size: .76rem; font-style: italic; font-weight: 400; line-height: 1.5; text-align: left; }

.city-bar { margin-top: 18px; padding: 15px; border: var(--border); background: var(--panel); box-shadow: 4px 4px 0 var(--ink); }
.city-bar > div { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.city-radio-input { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
.city-radio-label { display: inline-block; margin: 0 2px 2px 0; padding: 7px 15px; border: 1.5px solid var(--ink); background: var(--mint-soft); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); cursor: pointer; font-size: .82rem; font-weight: 750; user-select: none; transition: transform .12s, background .12s, box-shadow .12s; }
.city-radio-label:hover { transform: translate(-1px, -1px); background: #c9ecdf; box-shadow: 4px 4px 0 #55bca0; }
.city-radio-input:checked + .city-radio-label { background: var(--lavender); box-shadow: 3px 3px 0 #7779b7; }
.city-radio-input:focus-visible + .city-radio-label { outline: 3px solid var(--ink); outline-offset: 3px; }

.stripes-card { margin-top: 18px; padding: 14px 17px 8px; border: var(--border); background: var(--panel); box-shadow: 4px 4px 0 var(--ink); }
.stripes-header { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 7px; }
.stripes-kicker { font-size: .67rem; font-weight: 850; letter-spacing: .12em; }
.stripes-caption { color: var(--muted); font-size: .72rem; font-weight: 700; text-align: right; }
#climate-stripes { width: 100%; height: 92px; }
.stripes-note { margin: 2px 0 3px; color: var(--muted); font-size: .68rem; line-height: 1.35; }
.stripes-note a { color: var(--ink); font-weight: 800; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.stripes-note a:hover { color: #397a6b; }

.toolbar { display: flex; align-items: flex-start; gap: 34px; margin-top: 18px; padding: 34px 24px 27px; border: var(--border); background: var(--lavender); box-shadow: 4px 4px 0 var(--ink); }
.year-control {
  flex: 1;
  min-width: 0;
  --Dash-Fill-Interactive-Strong: #a9e3d2;
  --Dash-Fill-Interactive-Hover: #79ceb7;
  --Dash-Fill-Interactive-Active: #55bca0;
  --Dash-Stroke-Strong: #171717;
  --Dash-Text-Strong: #171717;
}
.year-control .rc-slider { margin-top: 10px; }
.control > label { display: block; margin: 0 0 24px; color: var(--ink); font-size: .78rem; font-weight: 850; line-height: 1; letter-spacing: .12em; transform: translateY(-10px); }
.mode-control #mode label { display: inline-flex; align-items: center; margin: 0 16px 0 0; color: var(--ink) !important; font-size: .9rem; font-weight: 750; cursor: pointer; }
.mode-control #mode { transform: translateY(-6px); }
.mode-control #mode label:hover,
.mode-control #mode label:focus,
.mode-control #mode label:focus-within,
.mode-control #mode label:active { color: var(--ink) !important; }
.mode-control input {
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0 7px 0 0;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: var(--panel);
  box-shadow: 1.5px 1.5px 0 var(--ink);
  cursor: pointer;
}
.mode-control input:hover { background: #c9ecdf; box-shadow: 2px 2px 0 #55bca0; }
.mode-control input:checked { background: var(--mint); box-shadow: inset 0 0 0 3px var(--panel), 1.5px 1.5px 0 var(--ink); }
.mode-control input:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Slider Dash / rc-slider */
.year-control .rc-slider-rail { height: 5px; border: 1px solid var(--ink); border-radius: 0; background: var(--panel); }
.year-control .rc-slider-track { height: 5px; border-radius: 0; background: var(--mint); }
.year-control .rc-slider-handle {
  width: 17px;
  height: 17px;
  margin-top: -6px;
  border: 2px solid var(--ink) !important;
  border-radius: 0;
  background: var(--mint) !important;
  box-shadow: 2px 2px 0 var(--ink) !important;
  opacity: 1;
}
.year-control .rc-slider-handle:hover,
.year-control .rc-slider-handle:active,
.year-control .rc-slider-handle:focus,
.year-control .rc-slider-handle-dragging {
  border-color: var(--ink) !important;
  outline: none !important;
  background: #79ceb7 !important;
  box-shadow: inset 0 0 0 3px var(--panel), 3px 3px 0 #55bca0 !important;
}
.year-control .rc-slider-dot { width: 7px; height: 7px; margin-bottom: -1px; border: 1.5px solid var(--ink); border-radius: 0; background: var(--panel); }
.year-control .rc-slider-dot-active { background: var(--mint); }
.year-control .rc-slider-mark-text { margin-top: 4px; color: var(--muted); font-size: .68rem; font-weight: 700; }
.year-control .rc-slider-tooltip-inner { min-width: 46px; height: auto; padding: 4px 7px; border: 1.5px solid var(--ink); border-radius: 0; background: var(--mint); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); font-size: .72rem; font-weight: 850; }
.year-control .rc-slider-tooltip-arrow { display: none; }

.summary-section { padding: 18px 0; }
.summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); width: 100%; border: var(--border); background: var(--mint-soft); box-shadow: 4px 4px 0 var(--ink); }
.summary-item { display: flex; min-width: 0; padding: 13px 15px; flex-direction: column; border-left: 1.5px solid var(--ink); }
.summary-item:first-child { border-left: 0; }
.summary-label { margin-bottom: 5px; color: #34332f; }
.summary strong { white-space: nowrap; font-size: 1.03rem; }

.chart-card { height: 580px; padding: 10px 10px 2px; overflow: hidden; border: var(--border); background: var(--panel); box-shadow: var(--shadow); }
#chart { width: 100%; height: 100%; }
#chart .js-plotly-plot,
#chart .plot-container,
#chart .svg-container { width: 100% !important; height: 100% !important; }
.source-content { color: var(--muted); font-size: .9rem; line-height: 1.65; }
.source-content strong { color: var(--ink); }
.source-content p { margin: 13px 0 0; }
.source-link { display: inline-block; margin-left: 10px; color: var(--ink); font-weight: 800; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.source-link:hover { background: var(--mint); text-decoration: none; }

.modal-actions { display: flex; justify-content: center; gap: 12px; margin-top: 22px; }
.info-button {
  padding: 10px 15px;
  border: var(--border);
  border-radius: 0;
  background: var(--mint-soft);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font: inherit;
  font-size: .78rem;
  font-weight: 850;
  cursor: pointer;
}
.info-button-alt { background: #e7e6f5; }
.info-button:hover { transform: translate(-1px, -1px); background: #d4ebe3; box-shadow: 5px 5px 0 #92c8b8; }
.info-button-alt:hover { background: #deddf0; box-shadow: 5px 5px 0 #aaaadc; }
.info-button:focus-visible, .modal-close:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(23, 23, 23, .56);
}
.modal-overlay.is-open { display: flex; }
.modal-card {
  width: min(100%, 1080px);
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 26px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--panel);
  box-shadow: 8px 8px 0 var(--ink);
}
.modal-card-small { max-width: 660px; }
.modal-card h2 { margin: 14px 0 24px; font-size: 1.8rem; letter-spacing: -.04em; }
.modal-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1.5px solid var(--ink); padding-bottom: 12px; }
.modal-kicker { font-size: .67rem; font-weight: 850; letter-spacing: .13em; }
.modal-close {
  width: 34px;
  height: 34px;
  padding: 0 0 3px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: var(--warm);
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--ink);
  font: inherit;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: #e8a97e; transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }

.method-card { margin-top: 31px; padding: 27px; border: var(--border); background: var(--panel); box-shadow: var(--shadow); }
.method-card h2 { margin: 0 0 24px; font-size: 1.65rem; letter-spacing: -.035em; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.method-grid article { min-height: 175px; padding: 18px; border: 1.5px solid var(--ink); background: #faf8f2; }
.method-grid article:first-child { background: var(--mint-soft); }
.method-grid article:nth-child(2) { background: var(--lavender); }
.method-grid article:nth-child(3) { background: #f8eee5; }
.method-grid h3 { margin: 0 0 14px; color: var(--ink); }
.method-grid p, .data-warning { margin: 0; color: var(--muted); font-size: .87rem; line-height: 1.6; }
.data-warning { margin-top: 15px; padding: 14px 16px; border: 1.5px solid var(--ink); background: #f5dfae; color: #473a27; }

.site-footer {
  margin-top: 48px;
  padding: 24px 16px 4px;
  color: var(--muted);
  font-family: "Courier New", Courier, monospace;
  font-size: .72rem;
  line-height: 1.55;
  text-align: center;
}
.site-footer p { margin: 2px 0; }
.site-footer a { color: #d85f66; font-weight: 700; text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.site-footer nav { display: flex; justify-content: center; gap: 18px; margin-top: 4px; }
.site-footer span { color: #397a6b; }

@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; gap: 27px; }
  .hero-card { min-height: 0; }
  .summary { grid-template-columns: repeat(3, 1fr); }
  .summary-item:nth-child(4) { border-left: 0; }
  .summary-item:nth-child(n+4) { border-top: 1.5px solid var(--ink); }
  .method-grid { grid-template-columns: 1fr; }
  .method-grid article { min-height: 0; }
}

@media (max-width: 600px) {
  .page { padding: 54px 12px 36px; }
  .ascii-card { padding: 10px 8px 9px; }
  .header-logo-link { left: 8px; width: 78px; }
  .ascii-title { display: none; }
  .mobile-title { display: block; padding-left: 86px; font-family: "Courier New", Courier, monospace; font-size: clamp(.57rem, 2.75vw, .74rem); font-weight: 900; line-height: 1; letter-spacing: .05em; text-align: right; white-space: nowrap; }
  .hero { padding: 26px 0 31px; }
  .hero-copy h2 { font-size: 2.65rem; }
  .freshness-card { padding: 14px; }
  .freshness-main strong { font-size: .95rem; }
  .freshness-note { margin-top: 12px; }
  .toolbar { flex-wrap: wrap; padding: 18px; }
  .stripes-header { display: block; }
  .stripes-caption { display: block; margin-top: 4px; text-align: left; }
  .year-control { flex-basis: 100%; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .summary-item:nth-child(odd) { border-left: 0; }
  .summary-item:nth-child(even) { border-left: 1.5px solid var(--ink); }
  .summary-item:nth-child(n+3) { border-top: 1.5px solid var(--ink); }
  .chart-card { padding: 3px; }
  .chart-card { height: 430px; }
  #chart { height: 100%; }
  #chart .gtitle { font-size: 13px !important; }
  .method-card { padding: 18px; }
  .site-footer { margin-top: 38px; padding: 20px 4px 0; font-size: .66rem; }
  .modal-actions { display: grid; grid-template-columns: 1fr; }
  .modal-overlay { padding: 14px; }
  .modal-card { max-height: calc(100vh - 28px); padding: 18px; box-shadow: 5px 5px 0 var(--ink); }
  .source-link { display: block; margin: 12px 0 0; }
}

/* Surcharge finale des états natifs de rc-slider (Dash). */
#year .rc-slider-handle,
#year .rc-slider-handle:hover,
#year .rc-slider-handle:focus,
#year .rc-slider-handle:active,
#year .rc-slider-handle-click-focused:focus,
#year .rc-slider-handle-dragging,
#year .rc-slider-handle-dragging.rc-slider-handle-dragging.rc-slider-handle-dragging {
  width: 17px !important;
  height: 17px !important;
  margin-top: -6px !important;
  border: 2px solid var(--ink) !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background-color: var(--mint) !important;
  box-shadow: inset 0 0 0 3px var(--panel), 3px 3px 0 #55bca0 !important;
}

/* Poignée du nouveau Slider introduit dans Dash 4. */
#year .dash-slider-thumb,
#year .dash-slider-thumb-1,
#year .dash-slider-thumb:hover,
#year .dash-slider-thumb:focus,
#year .dash-slider-thumb:focus-visible,
#year .dash-slider-thumb:active {
  width: 17px !important;
  height: 17px !important;
  border: 2px solid var(--ink) !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: var(--mint) !important;
  background-color: var(--mint) !important;
  box-shadow: 3px 3px 0 #55bca0 !important;
}

#year .dash-slider-thumb:hover,
#year .dash-slider-thumb:focus,
#year .dash-slider-thumb:focus-visible,
#year .dash-slider-thumb:active {
  background: #79ceb7 !important;
  background-color: #79ceb7 !important;
}

#year .dash-slider-tooltip > span,
#year .dash-slider-tooltip > div {
  min-width: 40px !important;
  padding: 3px 6px !important;
  border: 1.5px solid var(--ink) !important;
  border-radius: 0 !important;
  background: var(--mint-soft) !important;
  background-color: var(--mint-soft) !important;
  color: var(--ink) !important;
  box-shadow: 2px 2px 0 #55bca0 !important;
  font-size: .66rem !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
}

#year .dash-slider-tooltip {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#year .dash-slider-tooltip::before,
#year .dash-slider-tooltip::after { display: none !important; }
