:root {
  --accent: #1a3a5c;
  --accent-light: #2d6a9f;
  --bg-note: #f5f8fc;
  --red: #c0392b;
  --tag-lycee: #1a3a5c;
  --tag-eleve: #2e7d52;
  --tag-cpge:  #7b2d2d;
  --tag-asso:  #b8620a;
  --tag-prof:  #4a5568;
  --sidebar-w: 220px;
}

* { box-sizing: border-box; }

body {
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid #ddd;
  background: #fafafa;
  padding: 1.8rem 0;
  font-family: "Latin Modern Roman", Georgia, serif;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 0 1.2rem 1.3rem;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 0.8rem;
}
.sidebar-logo a { text-decoration: none; }
.sidebar-logo .name {
  font-size: 0.83rem;
  font-weight: bold;
  color: var(--accent);
  line-height: 1.35;
}
.sidebar-logo .tagline {
  font-size: 0.68rem;
  color: #999;
  font-style: italic;
}

/* Tree */
.tree { list-style: none; padding: 0; margin: 0; }
.tree li { margin: 0; }

.tree-section {
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #bbb;
  padding: 0.9rem 1.2rem 0.25rem;
}

/* Page links */
.tree > li > a.page-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 1.2rem;
  font-size: 0.82rem;
  color: #444;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s;
}
.tree > li > a.page-link:hover { color: var(--accent); background: #f0f4f8; }
.tree > li > a.page-link.current-page {
  color: var(--accent);
  font-weight: bold;
  border-left-color: var(--accent);
  background: #eef2f8;
}

/* Sub-sections (only shown for current page) */
.sub-sections {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}
.sub-sections.open { max-height: 400px; }

.sub-sections li a {
  display: block;
  padding: 0.2rem 1.2rem 0.2rem 2.2rem;
  font-size: 0.75rem;
  color: #999;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.15s;
}
.sub-sections li a:hover { color: var(--accent-light); }
.sub-sections li a.active {
  color: var(--accent-light);
  border-left-color: var(--accent-light);
  font-weight: 600;
}

/* ── Main wrapper: centered even with sidebar ── */
#main-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 3rem 2rem 4rem;
}

#main {
  width: 100%;
  max-width: 780px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 2rem 0 2rem 0;
  border-bottom: 1px solid #ccc;
  margin-bottom: 3rem;
}
.hero h1 { font-size: 2.2rem; margin-bottom: 0.3rem; }
.hero .subtitle { font-size: 1rem; color: #555; font-style: italic; }

section { margin-bottom: 3.5rem; }

.note {
  background: var(--bg-note);
  border-left: 3px solid var(--accent-light);
  padding: 1rem 1.4rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 1rem; margin: 2rem 0; }
.stat-box { border: 1px solid #ddd; padding: 1.4rem 1rem; text-align: center; background: #fff; }
.stat-box .big { font-size: 2.6rem; font-weight: bold; color: var(--accent); display: block; line-height: 1.1; }
.stat-box .big.red { color: var(--red); }
.stat-box .desc { font-size: 0.82rem; color: #555; margin-top: 0.5rem; line-height: 1.4; }

.highlight-stat { display: flex; align-items: center; gap: 1.5rem; border: 1px solid #ddd; padding: 1.2rem 1.6rem; margin: 1.5rem 0; background: #fff; }
.highlight-stat .num { font-size: 3.2rem; font-weight: bold; color: var(--red); white-space: nowrap; min-width: 80px; text-align: center; }
.highlight-stat .text { font-size: 0.92rem; color: #333; line-height: 1.5; }
.highlight-stat .text strong { color: var(--accent); }
.source { font-size: 0.78rem; color: #999; margin-top: 0.5rem; }

.cause-list { list-style: none; padding: 0; margin: 1rem 0; }
.cause-list li { padding: 0.45rem 0 0.45rem 1.4rem; position: relative; font-size: 0.93rem; border-bottom: 1px solid #eee; color: #444; }
.cause-list li::before { content: "→"; position: absolute; left: 0; color: var(--accent-light); font-weight: bold; }

.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; margin-top: 1.2rem; }
.card { border: 1px solid #ddd; padding: 1.1rem 1.3rem 0.9rem; background: #fff; display: flex; flex-direction: column; gap: 0.6rem; }
.card h3 { margin: 0; font-size: 1rem; color: var(--accent); }
.card p { margin: 0; font-size: 0.88rem; color: #444; line-height: 1.5; flex: 1; }

.card details { margin: 0; }
.card details summary { font-size: 0.82rem; color: var(--accent-light); cursor: pointer; user-select: none; list-style: none; display: flex; align-items: center; gap: 0.3rem; }
.card details summary::before { content: "▸"; font-size: 0.75rem; transition: transform 0.2s; }
.card details[open] summary::before { transform: rotate(90deg); }
.card details summary::-webkit-details-marker { display: none; }
.card details p { margin: 0.6rem 0 0 0; font-size: 0.85rem; color: #555; line-height: 1.5; }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.tag { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 0.18rem 0.65rem; border-radius: 999px; color: #fff; letter-spacing: 0.02em; }
.tag.lycee { background: var(--tag-lycee); }
.tag.eleve { background: var(--tag-eleve); }
.tag.cpge  { background: var(--tag-cpge); }
.tag.asso  { background: var(--tag-asso); }
.tag.prof  { background: var(--tag-prof); }

.contact-block { background: var(--bg-note); padding: 1.5rem 2rem; border: 1px solid #ccc; margin-top: 1rem; }
.contact-block p { margin: 0.3rem 0; }

footer { border-top: 1px solid #ccc; padding-top: 1.2rem; margin-top: 3rem; font-size: 0.82rem; color: #888; text-align: center; }

@media (max-width: 700px) {
  body { flex-direction: column; }
  #sidebar { display: none; }
  #main-wrapper { padding: 1.5rem 1.2rem 3rem; }
  .hero h1 { font-size: 1.7rem; }
  .highlight-stat { flex-direction: column; text-align: center; }
  .highlight-stat .num { font-size: 2.4rem; }
  .card-grid { grid-template-columns: 1fr; }
}