/* ═══════════════════════════════════════════════════════════════════
   bresil.css — Thème : Forêt tropicale, carnaval, vert/or brésilien
   Polices : Fraunces (display optique) + Nunito Sans (corps) + Fira Code
   ═══════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,600;1,9..144,300;1,9..144,400;1,9..144,600&family=Nunito+Sans:ital,opsz,wght@0,6..12,300;0,6..12,400;0,6..12,600;1,6..12,300&family=Fira+Code:wght@400;500&display=swap');

:root {
  --jungle:   #041208;
  --jungle-2: #071a0c;
  --surface:  #0d2614;
  --surface-2:#142e1a;

  --verde:    #009C3B;
  --verde-2:  #22c04a;
  --verde-pale:rgba(0,156,59,.09);
  --verde-dim: rgba(0,156,59,.35);
  --ouro:     #FEDD00;
  --ouro-2:   #ffe840;
  --ouro-pale:rgba(254,221,0,.08);
  --azul:     #009fe3;
  --azul-pale:rgba(0,159,227,.08);

  --ink:      #e0f8e0;
  --ink-mid:  rgba(224,248,224,.62);
  --ink-dim:  rgba(224,248,224,.28);

  --border:   rgba(0,156,59,.22);
  --border-hi:rgba(0,156,59,.55);

  --fd: 'Fraunces', Georgia, serif;
  --fb: 'Nunito Sans', sans-serif;
  --fm: 'Fira Code', monospace;

  --sidebar-w: 272px;
  --radius: 10px;
}

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

body {
  font-family: var(--fb);
  background: var(--jungle);
  color: var(--ink);
  font-size: 16.5px;
  line-height: 1.82;
  background-image:
    radial-gradient(ellipse at 15% 70%, rgba(0,156,59,.14) 0, transparent 44%),
    radial-gradient(ellipse at 85% 20%, rgba(254,221,0,.07) 0, transparent 36%),
    radial-gradient(ellipse at 50% 100%, rgba(0,159,227,.06) 0, transparent 40%);
  background-attachment: fixed;
}

.progress-bar {
  position: fixed; top: 0; left: 0; height: 4px; width: 0%;
  background: linear-gradient(90deg, var(--verde), var(--ouro), var(--verde));
  z-index: 200; transition: width .08s linear;
  box-shadow: 0 1px 10px rgba(0,156,59,.5);
}

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

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--jungle-2);
  border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto; display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: var(--surface-2) transparent;
}
.sidebar-header {
  padding: 28px 22px 22px;
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.sidebar-header::after {
  content: '◆'; position: absolute; right: 10px; bottom: 6px;
  font-size: 3rem; color: rgba(254,221,0,.06); pointer-events: none;
}
.sidebar-back {
  font-family: var(--fm); font-size: .6rem; letter-spacing: .14em;
  color: var(--ink-dim); text-decoration: none; display: block; margin-bottom: 12px;
}
.sidebar-back:hover { color: var(--verde-2); }
.sidebar-title {
  font-family: var(--fd); font-size: 1.9rem; font-weight: 600;
  color: var(--verde-2); line-height: 1.0; font-style: italic;
}
.toc-nav { padding: 10px 0 14px; flex: 1; }
.toc-section-label {
  font-family: var(--fm); font-size: .58rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-dim); padding: 8px 22px 4px;
}
.toc-link {
  display: block; padding: 5px 22px 5px 26px;
  font-family: var(--fb); font-size: .83rem;
  color: var(--ink-mid); text-decoration: none;
  border-left: 2px solid transparent; transition: all .15s;
}
.toc-link:hover, .toc-link.active {
  color: var(--verde-2); border-left-color: var(--verde); background: var(--verde-pale);
}
.sidebar-nav { padding: 12px 22px; border-top: 1px solid var(--border); }
.sidebar-nav p {
  font-family: var(--fm); font-size: .56rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-dim); margin-bottom: 7px;
}
.sidebar-nav a {
  display: block; font-family: var(--fb); font-size: .8rem;
  color: var(--ink-dim); text-decoration: none; padding: 2px 0;
}
.sidebar-nav a:hover, .sidebar-nav a.current { color: var(--verde-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: 1px solid var(--border); position: relative;
}
.page-header::after {
  content: ''; position: absolute; bottom: -1px; left: 0;
  width: 140px; height: 2px;
  background: linear-gradient(90deg, var(--verde), var(--ouro), transparent);
  box-shadow: 0 0 10px rgba(0,156,59,.4);
}
.subject-tag {
  font-family: var(--fm); font-size: .62rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--verde-2); margin-bottom: 12px;
}
h1.page-title {
  font-family: var(--fd); font-size: 3.6rem; font-weight: 600;
  color: var(--ink); line-height: .95; font-style: italic;
}
h1.page-title .sub {
  color: var(--ouro); font-style: normal; font-size: 1.2rem;
  display: block; margin-top: 6px;
  font-family: var(--fm); letter-spacing: .06em;
}
.page-intro { margin-top: 16px; font-size: 1rem; color: var(--ink-mid); font-style: italic; max-width: 520px; }

.section { margin-bottom: 60px; scroll-margin-top: 26px; }
h2.section-title {
  font-family: var(--fd); font-size: 1.9rem; font-weight: 600; font-style: italic;
  color: var(--ink); margin-bottom: 20px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: baseline; gap: 14px;
}
h2.section-title .num {
  font-family: var(--fm); font-size: .7rem; font-style: normal;
  color: var(--jungle); background: var(--verde);
  padding: 2px 10px; border-radius: 20px; font-weight: 400;
  box-shadow: 0 0 8px rgba(0,156,59,.4);
}
h3.sub-title {
  font-family: var(--fd); font-size: 1.2rem; font-style: italic;
  color: var(--verde-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(--radius); border: 1px solid var(--border); background: rgba(255,255,255,.04); }
.box-label { font-family: var(--fm); font-size: .62rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; display: block; margin-bottom: 8px; }
.box.def       { background: var(--verde-pale); border-color: var(--border-hi); } .box.def .box-label { color: var(--verde-2); }
.box.histoire  { background: var(--ouro-pale); border-left: 4px solid var(--ouro); } .box.histoire .box-label { color: var(--ouro); }
.box.technique { background: rgba(255,255,255,.05); border-left: 4px solid var(--verde-2); } .box.technique .box-label { color: var(--verde-2); }
.box.conseil   { background: var(--azul-pale); border-left: 4px solid var(--azul); } .box.conseil .box-label { color: var(--azul); }
.box.attention { background: rgba(255,60,30,.08); border-left: 4px solid #f05030; } .box.attention .box-label { color: #f07050; }
.box.chiffres  { background: rgba(0,0,0,.35); border-color: var(--border-hi); } .box.chiffres .box-label { color: var(--verde-2); }
.box.remark    { background: transparent; border-left: 3px solid var(--border); padding-left: 20px; } .box.remark .box-label { color: var(--ink-dim); }

.detail-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--fd); font-style: italic; font-size: .9rem;
  color: var(--verde-2); border: 1px solid var(--verde);
  padding: 4px 14px; border-radius: 20px; cursor: pointer;
  background: transparent; margin-top: 8px; transition: all .18s; user-select: none;
}
.detail-toggle:hover { background: var(--verde); color: var(--jungle); }
.detail-toggle .arrow { transition: transform .2s; font-style: normal; }
.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,.3); border: 1px dashed var(--border); border-radius: var(--radius); color: var(--ink-mid); font-size: .93rem; }

.data-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: .89rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.data-table th { background: rgba(0,0,0,.5); color: var(--verde-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(--border-hi); }
.data-table td { padding: 8px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tr:hover td { background: var(--verde-pale); }
.data-table td:first-child { font-family: var(--fm); font-size: .8rem; color: var(--verde-2); }

code { font-family: var(--fm); font-size: .82em; background: rgba(0,0,0,.3); color: var(--verde-2); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); }
.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(--jungle-2); border-bottom: 2px solid var(--verde); padding: 12px 18px; align-items: center; justify-content: space-between; }
.mobile-menu-btn { background: none; border: none; color: var(--verde-2); font-size: 1.3rem; cursor: pointer; }
.mobile-title { font-family: var(--fd); font-size: 1rem; color: var(--verde-2); font-style: italic; }
.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,.78); }
.drawer-panel { position: relative; z-index: 1; width: 272px; background: var(--jungle-2); height: 100%; overflow-y: auto; padding: 14px 0; border-right: 1px solid var(--border); }
@media (max-width: 960px) { .sidebar { display: none; } .mobile-header { display: flex; } .main { padding: 0 20px 70px; } h1.page-title { font-size: 2.7rem; } .two-col { grid-template-columns: 1fr; } }
