/* ============================================================
   FINANCIA — histoire.css
   Page dédiée "Histoire des marchés" — charte noir/blanc/violet.
   style.css is dark by default site-wide now, so this file only
   holds this page's own layout (timeline, legend cards, detail
   panel) — no color overrides needed anymore.
   Chargé uniquement par histoire.html, en complément de style.css
   ============================================================ */

/* ── Layout de base ── */
.hist-section { padding: 88px 0; position: relative; }
.hist-section-alt { background: #0A0A0A; }
.hist-h2 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}
.hist-section-sub {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  color: rgba(255,255,255,0.55);
  max-width: 640px;
  margin-bottom: 56px;
  line-height: 1.6;
}

/* ── HERO ── */
/* Padding/bg-grid/glow/badge/H1/lead viennent du composant partagé
   .page-hero de style.css — ne reste ici que ce qui est propre à
   cette page : la ligne de boutons sous le lead. */
.hist-hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

/* ── Scroll reveal ── */
.hist-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(0.4,0,0.2,1), transform 0.6s cubic-bezier(0.4,0,0.2,1);
}
.hist-reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ── TIMELINE ── */
.hist-timeline { position: relative; max-width: 820px; margin: 0 auto; }
.hist-timeline::before {
  content: '';
  position: absolute;
  left: 27px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, rgba(124,58,237,0.05), rgba(124,58,237,0.55) 10%, rgba(124,58,237,0.55) 90%, rgba(124,58,237,0.05));
}
.hist-tl-item {
  position: relative;
  display: flex;
  gap: 28px;
  padding-left: 0;
  margin-bottom: 32px;
}
.hist-tl-item:last-child { margin-bottom: 0; }
.hist-tl-dot {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: none;
}
.hist-tl-dot::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #000;
  border: 3px solid #7C3AED;
  box-shadow: 0 0 0 5px rgba(124,58,237,0.12);
}
.hist-tl-item { padding-left: 56px; }
.hist-tl-item .hist-tl-dot { display: block; position: absolute; left: 0; top: 0; }
.hist-tl-card {
  flex: 1;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(124,58,237,0.22);
  border-radius: 18px;
  padding: 28px 30px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.hist-tl-card:hover {
  transform: translateY(-4px);
  border-color: rgba(124,58,237,0.55);
  background: rgba(124,58,237,0.06);
}
.hist-tl-year {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: #7C3AED;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.hist-tl-card h3 { font-size: 1.15rem; font-weight: 700; color: #fff; margin-bottom: 8px; }
.hist-tl-card p { font-size: 0.94rem; color: rgba(255,255,255,0.65); line-height: 1.6; margin-bottom: 14px; }
.hist-tl-stat {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #c4b5fd;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 100px;
  padding: 5px 14px;
}

/* ── LÉGENDES (cartes cliquables) ── */
.hist-legend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.hist-legend-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  background: rgba(255,255,255,0.035);
  border: 1.5px solid rgba(124,58,237,0.22);
  border-radius: 18px;
  padding: 26px 24px;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  width: 100%;
}
.hist-legend-card:hover, .hist-legend-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(124,58,237,0.18);
  border-color: #7C3AED;
  background: rgba(124,58,237,0.08);
}
.hist-legend-card[aria-expanded="true"] {
  border-color: #7C3AED;
  background: rgba(124,58,237,0.1);
}
.hist-legend-top { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.hist-legend-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124,58,237,0.25) 0%, rgba(124,58,237,0.08) 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.hist-legend-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c4b5fd;
  background: rgba(124,58,237,0.14);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 100px;
  padding: 4px 10px;
}
.hist-legend-card h3 { font-size: 1.1rem; font-weight: 700; color: #fff; }
.hist-legend-card p { font-size: 0.9rem; color: rgba(255,255,255,0.6); line-height: 1.55; }
.hist-legend-cta { font-size: 0.85rem; font-weight: 600; color: #7C3AED; margin-top: auto; }

/* ── Panneau de détail ── */
.hist-detail {
  margin-top: 40px;
  background: rgba(124,58,237,0.05);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 22px;
  padding: 36px 32px;
  position: relative;
  animation: histDetailIn 0.35s cubic-bezier(0.4,0,0.2,1);
}
@keyframes histDetailIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.hist-detail[hidden] { display: none; }
.hist-detail-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.hist-detail-close:hover { background: rgba(124,58,237,0.25); }
.hist-detail-head { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; padding-right: 50px; }
.hist-detail-icon {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(124,58,237,0.3) 0%, rgba(124,58,237,0.1) 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.hist-detail-head h3 { font-size: 1.4rem; font-weight: 800; color: #fff; }
.hist-detail-period { font-size: 0.9rem; color: rgba(255,255,255,0.5); margin-top: 2px; }

.hist-chart-wrap { position: relative; width: 100%; }
.hist-chart {
  width: 100%;
  height: auto;
  aspect-ratio: 800 / 320;
  display: block;
  overflow: visible;
}
.hist-chart-grid-line { stroke: rgba(255,255,255,0.06); stroke-width: 1; }
.hist-chart-fill { fill: rgba(124,58,237,0.12); stroke: none; }
.hist-chart-path {
  fill: none;
  stroke: #7C3AED;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.4,0,0.2,1);
}
.hist-chart-point {
  fill: #000;
  stroke: #7C3AED;
  stroke-width: 3;
  cursor: pointer;
  transition: r 0.15s ease, fill 0.15s ease;
}
.hist-chart-point-hit { fill: transparent; cursor: pointer; }
.hist-chart-point.is-active, .hist-chart-point:hover { fill: #7C3AED; r: 8; }
.hist-chart-tooltip {
  position: absolute;
  max-width: 240px;
  background: #16161f;
  border: 1px solid rgba(124,58,237,0.5);
  color: #fff;
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 10px 14px;
  border-radius: 10px;
  pointer-events: none;
  transform: translate(-50%, -115%);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 2;
}
.hist-chart-tooltip.flip-below { transform: translate(-50%, 22%); }
.hist-chart-tooltip[hidden] { display: none; }
.hist-chart-caption {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  margin-top: 10px;
  font-style: italic;
}
.hist-detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 28px 0 20px;
}
.hist-stat-chip {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px 16px;
}
.hist-stat-chip .n { font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; color: #c4b5fd; display: block; margin-bottom: 2px; }
.hist-stat-chip .l { font-size: 0.78rem; color: rgba(255,255,255,0.5); }
.hist-lesson {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.82);
  line-height: 1.65;
  background: rgba(124,58,237,0.08);
  border-left: 4px solid #7C3AED;
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
}
.hist-lesson strong { color: #fff; }

/* ── LEÇON DE L'HISTOIRE ── */
.hist-lesson-section { background: #000; }
.hist-lesson-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 40px; }
.hist-lesson-card {
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(124,58,237,0.22);
  border-radius: 18px;
  padding: 30px 26px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.hist-lesson-card:hover { transform: translateY(-4px); border-color: rgba(124,58,237,0.5); }
.hist-lesson-icon { color: #7C3AED; margin-bottom: 14px; }
.hist-lesson-card h3 { font-size: 1.05rem; font-weight: 700; color: #fff; margin-bottom: 8px; }
.hist-lesson-card p { font-size: 0.9rem; color: rgba(255,255,255,0.6); line-height: 1.6; }

.hist-disclaimer {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
  font-style: italic;
  max-width: 720px;
  line-height: 1.6;
  margin-bottom: 36px;
}

.hist-cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ── Footer sur fond noir ── */
.hist-footer { background: #000; border-top-color: rgba(255,255,255,0.1); }
.hist-footer .footer-brand p,
.hist-footer .footer-links a,
.hist-footer .footer-legal p { color: rgba(255,255,255,0.55); }
.hist-footer .footer-links a:hover { color: #c4b5fd; }
.hist-footer .logo { color: #fff; }

/* ============================================================
   Responsive — mobile-first adjustments
   ============================================================ */
@media (max-width: 900px) {
  .hist-legend-grid { grid-template-columns: repeat(2, 1fr); }
  .hist-lesson-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .hist-hero { padding: 116px 0 64px; }
  .hist-section { padding: 60px 0; }
  .hist-section-sub { margin-bottom: 36px; }
  .hist-legend-grid { grid-template-columns: 1fr; }

  .hist-timeline::before { left: 19px; }
  .hist-tl-item { padding-left: 40px; gap: 0; }
  .hist-tl-dot::before { left: 12px; }
  .hist-tl-card { padding: 22px 20px; }
  .hist-tl-year { font-size: 1.4rem; }

  .hist-detail { padding: 26px 18px; }
  .hist-detail-close { top: 14px; right: 14px; }
  .hist-detail-head { padding-right: 44px; }

  .hist-cta-row { flex-direction: column; }
  .hist-cta-row a { text-align: center; justify-content: center; }
}

/* ── Motion & touch ── */
@media (prefers-reduced-motion: reduce) {
  .hist-reveal { opacity: 1; transform: none; transition: none; }
  .hist-chart-path { transition: none; stroke-dashoffset: 0; }
}
