/* ═══════════════════════════════════════════════════════════════════
   cuba.css — Thème : Havane vintage, socialisme patiné, années 50 en ruines
   Couleurs drapeau : rouge + blanc + bleu triangulaire + étoile solitaire
   + tons sépia du rhum et du tabac, bleu délavé de l'azur caribéen
   Polices : Libre Baskerville (classicisme) + Barlow (poids cubain) + Space Mono
   ═══════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Barlow+Condensed:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  --sb:     #0f0a07;            /* noir tabac */
  --sb2:    #17100a;
  --surf:   #221810;
  --surf2:  #2e2015;

  --rojo:      #CF142B;         /* rouge drapeau */
  --rojo-2:    #ee3a4e;
  --rojo-p:    rgba(207,20,43,.12);
  --rojo-d:    rgba(207,20,43,.45);
  --azul:      #002A8F;         /* bleu drapeau */
  --azul-2:    #3a5cb8;
  --azul-p:    rgba(0,42,143,.16);
  --sepia:     #b08858;          /* rhum/tabac patiné */
  --sepia-2:   #d9ae7a;
  --sepia-p:   rgba(176,136,88,.10);
  --crema:     #f4e8d0;
  --azur:      #6ea8c8;          /* bleu caraïbe délavé */

  --ink:    #f0e4d0;
  --ink2:   rgba(240,228,208,.62);
  --ink3:   rgba(240,228,208,.26);

  --brd:    rgba(176,136,88,.20);
  --brdh:   rgba(176,136,88,.50);

  --fd: 'Libre Baskerville', Georgia, serif;
  --fb: 'Barlow Condensed', sans-serif;
  --fm: 'Space Mono', monospace;

  --sw: 272px;
  --r: 4px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--fb);
  background: var(--sb);
  color: var(--ink);
  font-size: 17.5px;
  line-height: 1.72;
  font-weight: 400;
  background-image:
    /* vignette papier patiné */
    radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(0,0,0,.3) 85%),
    /* grain sépia */
    radial-gradient(ellipse at 25% 15%, rgba(176,136,88,.10) 0, transparent 40%),
    radial-gradient(ellipse at 75% 85%, rgba(207,20,43,.06) 0, transparent 38%);
  background-attachment: fixed;
}

/* Texture papier vieilli, très discret */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .06;
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 2px, rgba(176,136,88,.3) 2px, rgba(176,136,88,.3) 3px),
    repeating-linear-gradient(90deg, transparent 0, transparent 3px, rgba(176,136,88,.2) 3px, rgba(176,136,88,.2) 4px);
}

.progress-bar {
  position: fixed; top: 0; left: 0; height: 4px; width: 0%;
  background: linear-gradient(90deg, var(--rojo) 0%, var(--crema) 33%, var(--azul) 66%, var(--rojo) 100%);
  z-index: 200; transition: width .08s linear;
  box-shadow: 0 1px 8px rgba(207,20,43,.4);
}

.page-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sw); flex-shrink: 0;
  background: linear-gradient(175deg, var(--sb2) 0%, var(--sb) 100%);
  border-right: 2px solid var(--brd);
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto; display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: var(--surf2) transparent;
}
.sidebar-header {
  padding: 30px 22px 22px;
  border-bottom: 2px solid var(--brd);
  position: relative; overflow: hidden;
}
.sidebar-header::after {
  content: '★'; position: absolute; left: 12px; bottom: 4px;
  font-size: 3.5rem; color: rgba(207,20,43,.10); pointer-events: none;
  font-family: serif;
}
.sidebar-back {
  font-family: var(--fm); font-size: .62rem; letter-spacing: .14em;
  color: var(--ink3); text-decoration: none; display: block; margin-bottom: 14px;
  text-transform: uppercase;
}
.sidebar-back:hover { color: var(--sepia-2); }
.sidebar-title {
  font-family: var(--fd); font-size: 2.1rem; font-weight: 700;
  color: var(--crema); line-height: 1.0; letter-spacing: -.01em;
  text-shadow: 0 1px 0 rgba(0,0,0,.7);
}
.toc-nav { padding: 10px 0 14px; flex: 1; }
.toc-section-label {
  font-family: var(--fm); font-size: .6rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink3); padding: 8px 22px 6px;
}
.toc-link {
  display: block; padding: 4px 22px 4px 26px;
  font-family: var(--fb); font-size: .98rem; font-weight: 400;
  color: var(--ink2); text-decoration: none;
  border-left: 3px solid transparent; transition: all .15s;
  letter-spacing: .01em;
}
.toc-link:hover, .toc-link.active {
  color: var(--sepia-2); border-left-color: var(--sepia); background: var(--sepia-p);
}
.sidebar-nav { padding: 12px 22px; border-top: 2px solid var(--brd); }
.sidebar-nav p {
  font-family: var(--fm); font-size: .58rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink3); margin-bottom: 7px;
}
.sidebar-nav a {
  display: block; font-family: var(--fb); font-size: .95rem;
  color: var(--ink3); text-decoration: none; padding: 2px 0;
}
.sidebar-nav a:hover, .sidebar-nav a.current { color: var(--sepia-2); }
.sidebar-nav a.current { font-weight: 700; }

.main { flex: 1; min-width: 0; padding: 0 58px 100px; max-width: 840px; }

.page-header {
  padding: 54px 0 36px; margin-bottom: 50px;
  border-bottom: 2px solid var(--brd); position: relative;
}
.page-header::before {
  /* bandes drapeau horizontales */
  content: ''; position: absolute; top: 5px; right: 0;
  width: 110px; height: 70px;
  background:
    linear-gradient(180deg,
      var(--azul) 0%, var(--azul) 20%,
      var(--crema) 20%, var(--crema) 40%,
      var(--azul) 40%, var(--azul) 60%,
      var(--crema) 60%, var(--crema) 80%,
      var(--azul) 80%, var(--azul) 100%);
  clip-path: polygon(45% 0, 100% 0, 100% 100%, 45% 100%);
  opacity: .5;
}
.page-header::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 170px; height: 3px;
  background: linear-gradient(90deg, var(--rojo), var(--sepia), transparent);
}
.subject-tag {
  font-family: var(--fm); font-size: .64rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--sepia-2); margin-bottom: 12px;
}
h1.page-title {
  font-family: var(--fd); font-size: 3.4rem; font-weight: 700;
  color: var(--crema); line-height: .98;
  text-shadow: 0 1px 0 rgba(0,0,0,.6), 2px 2px 0 rgba(207,20,43,.12);
}
h1.page-title .sub {
  color: var(--sepia); font-size: 1.15rem;
  display: block; margin-top: 8px;
  font-family: var(--fm); letter-spacing: .1em; font-weight: 400;
  text-shadow: none;
}
.page-intro { margin-top: 18px; font-size: 1.1rem; color: var(--ink2); max-width: 580px; font-weight: 400; }

.section { margin-bottom: 60px; scroll-margin-top: 26px; }
h2.section-title {
  font-family: var(--fd); font-size: 1.85rem; font-weight: 700;
  color: var(--crema); margin-bottom: 20px; padding-bottom: 10px;
  border-bottom: 2px solid var(--brd);
  display: flex; align-items: baseline; gap: 14px;
}
h2.section-title .num {
  font-family: var(--fm); font-size: .7rem;
  color: var(--crema); background: var(--rojo);
  padding: 3px 11px; border-radius: 2px; font-weight: 700;
  letter-spacing: .08em;
}
h3.sub-title {
  font-family: var(--fd); font-size: 1.25rem; font-style: italic; font-weight: 400;
  color: var(--sepia-2); margin: 26px 0 11px;
}
p { margin-bottom: .9em; } ul, ol { padding-left: 1.4em; margin-bottom: .9em; } li { margin-bottom: .3em; }

.box { padding: 15px 18px 13px; margin: 16px 0; border-radius: var(--r); border: 1px solid var(--brd); background: rgba(255,255,255,.02); }
.box-label { font-family: var(--fm); font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; display: block; margin-bottom: 8px; }
.box.def       { background: var(--sepia-p); border-color: var(--brdh); } .box.def .box-label { color: var(--sepia-2); }
.box.histoire  { background: var(--rojo-p); border-left: 4px solid var(--rojo); } .box.histoire .box-label { color: var(--rojo-2); }
.box.technique { background: var(--azul-p); border-left: 4px solid var(--azul-2); } .box.technique .box-label { color: var(--azur); }
.box.conseil   { background: rgba(110,168,200,.08); border-left: 4px solid var(--azur); } .box.conseil .box-label { color: var(--azur); }
.box.attention { background: rgba(207,20,43,.14); border-left: 4px solid var(--rojo); } .box.attention .box-label { color: var(--rojo-2); }
.box.chiffres  { background: rgba(0,0,0,.5); border-color: var(--brdh); } .box.chiffres .box-label { color: var(--sepia-2); }
.box.remark    { background: transparent; border-left: 3px solid var(--brd); padding-left: 20px; } .box.remark .box-label { color: var(--ink3); }

.detail-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--fb); font-weight: 600; font-size: .95rem;
  color: var(--sepia-2); border: 1px solid var(--sepia);
  padding: 4px 14px; border-radius: 2px; cursor: pointer;
  background: transparent; margin-top: 8px; transition: all .18s; user-select: none;
  text-transform: uppercase; letter-spacing: .1em;
}
.detail-toggle:hover { background: var(--sepia); color: var(--sb); }
.detail-toggle .arrow { transition: transform .2s; }
.detail-toggle.open .arrow { transform: rotate(90deg); }
.detail-content { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.detail-content.open { max-height: 900px; }
.detail-inner { margin-top: 10px; padding: 13px 18px; background: rgba(0,0,0,.35); border: 1px dashed var(--brd); border-radius: var(--r); color: var(--ink2); font-size: .98rem; }

.data-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: .98rem; border-radius: var(--r); overflow: hidden; border: 1px solid var(--brd); }
.data-table th { background: rgba(0,0,0,.55); color: var(--sepia-2); padding: 9px 14px; text-align: left; font-family: var(--fm); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; border-bottom: 1px solid var(--brdh); }
.data-table td { padding: 8px 14px; border-bottom: 1px solid var(--brd); vertical-align: top; }
.data-table tr:hover td { background: var(--sepia-p); }
.data-table td:first-child { font-family: var(--fm); font-size: .88rem; color: var(--sepia-2); }

code { font-family: var(--fm); font-size: .8em; background: rgba(0,0,0,.35); color: var(--sepia-2); padding: 2px 6px; border-radius: 2px; border: 1px solid var(--brd); }
em { color: var(--sepia-2); font-style: italic; }
strong { color: var(--crema); font-weight: 700; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; } .two-col .box { margin: 0; }

.mobile-header { display: none; position: sticky; top: 0; z-index: 50; background: var(--sb2); border-bottom: 3px solid var(--rojo); padding: 12px 18px; align-items: center; justify-content: space-between; }
.mobile-menu-btn { background: none; border: none; color: var(--sepia-2); font-size: 1.3rem; cursor: pointer; }
.mobile-title { font-family: var(--fd); font-size: 1.1rem; color: var(--crema); font-weight: 700; }
.mobile-drawer { display: none; position: fixed; inset: 0; z-index: 100; } .mobile-drawer.open { display: flex; }
.drawer-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.8); }
.drawer-panel { position: relative; z-index: 1; width: 272px; background: var(--sb2); height: 100%; overflow-y: auto; padding: 14px 0; border-right: 2px solid var(--brd); }

@media (max-width: 960px) {
  .sidebar { display: none; }
  .mobile-header { display: flex; }
  .main { padding: 0 20px 70px; }
  h1.page-title { font-size: 2.5rem; }
  .page-header::before { display: none; }
  .two-col { grid-template-columns: 1fr; }
}
