/* ═══════════════════════════════════════════════════════════
         RESET & VARIABLES
      ═══════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bleu: #004aad;
  --vert: #00bf63;
  --rouge: #ff0000;
  --noir: #0a0a0a;
  --blanc: #ffffff;
  --gris: #888888;
  --gris-clair: #f4f4f4;

  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ── MODE SOMBRE ── */
html.dark {
  --noir: #ffffff;
  --blanc: #0a0a0a;
  --gris-clair: #1a1a1a;
  --gris: #aaaaaa;
}
html.dark footer {
  background: var(--gris-clair);
}

/* Transition douce sur tout */
*,
*::before,
*::after {
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease;
}

/* Bouton toggle — positionné en absolu à droite du header */
.theme-toggle {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--noir);
  background: var(--blanc);
  color: var(--noir);
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
  z-index: 10;
}
.theme-toggle:hover {
  background: var(--noir);
  color: var(--blanc);
}
/* Icônes selon le mode */
.theme-toggle .icon-dark {
  display: block;
}
.theme-toggle .icon-light {
  display: none;
}
html.dark .theme-toggle .icon-dark {
  display: none;
}
html.dark .theme-toggle .icon-light {
  display: block;
}

.main-header nav {
  position: relative;
}

/* Espace à droite pour que les liens ne chevauchent jamais le bouton toggle */
.nav-links {
  padding-right: 60px;
}

/* Corrections mode sombre spécifiques */
html.dark .blog-table thead tr {
  background: #ffffff;
  color: #0a0a0a;
}
html.dark .blog-table .category-header {
  background: var(--bleu);
  color: #ffffff;
}
html.dark .blog-table tbody tr {
  border-bottom-color: #2a2a2a;
}
html.dark .blog-table tbody tr:hover {
  background: #1a1a1a;
}
html.dark .blog-table tbody td {
  border-right-color: #2a2a2a;
  color: #ffffff;
}
html.dark .blog-table img {
  border-color: #444;
}
html.dark .budget-banner {
  background: #0a0a0a;
  border-color: #0a0a0a;
  color: #ffffff;
}
html.dark .budget-banner strong {
  color: var(--vert);
}
html.dark .table-wrapper {
  border-color: #ffffff;
}
html.dark .blog-table tbody tr:nth-child(even) {
  background: #111111;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-display);
  background: var(--blanc);
  color: var(--noir);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
         HEADER
      ═══════════════════════════════════════════════════════════ */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--blanc);
  border-bottom: 3px solid var(--noir);
}

.main-header nav {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo a {
  display: block;
  height: 40px;
}

.logo img {
  height: 100%;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 0;
  list-style: none;
}

.nav-links li {
  border-left: 2px solid var(--noir);
}

.nav-links a {
  display: block;
  padding: 0.7rem 1.5rem;
  color: var(--noir);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition:
    background 0.2s,
    color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--noir);
  color: var(--blanc);
}

/* ═══════════════════════════════════════════════════════════
         CHAPTER CONTENT
      ═══════════════════════════════════════════════════════════ */
.chapter-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 120px 2rem 80px;
}

.chapter-content > h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: 3rem;
  padding: 1.5rem;
  background: var(--noir);
  color: var(--blanc);
  border: 3px solid var(--noir);
}

.chapter-content > h1::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--rouge);
  margin-right: 1rem;
}

/* ═══════════════════════════════════════════════════════════
         SECTIONS
      ═══════════════════════════════════════════════════════════ */
section {
  margin-bottom: 4rem;
}

section h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
  padding: 1rem 1.5rem;
  background: var(--gris-clair);
  border-left: 6px solid var(--bleu);
}

section > p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--gris);
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--gris-clair);
  border: 2px solid var(--gris-clair);
}

section h3 {
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 3rem 0 1.5rem;
  padding: 0.8rem 1rem;
  background: var(--noir);
  color: var(--blanc);
  border: 3px solid var(--noir);
  display: inline-block;
}

/* ═══════════════════════════════════════════════════════════
         LIST ITEMS
      ═══════════════════════════════════════════════════════════ */
ul {
  list-style: none;
}

section li,
section ul li {
  list-style: none;
  margin-bottom: 1.5rem;
  padding: 1.2rem 1.5rem;
  background: var(--blanc);
  border: 3px solid var(--noir);
  position: relative;
  transition: all 0.2s;
  font-size: 1rem;
}

section li::before,
section ul li::before {
  content: '▸';
  position: absolute;
  left: -25px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bleu);
}

section li:hover,
section ul li:hover {
  transform: translateX(8px);
  border-color: var(--bleu);
  box-shadow: -8px 8px 0 var(--noir);
}

.proposal-explanation {
  display: block;
  margin-top: 0.8rem;
  padding: 0.8rem 1rem;
  background: var(--gris-clair);
  border-left: 4px solid var(--vert);
  font-size: 0.9rem;
  color: var(--gris);
  font-style: italic;
}

.proposal-explanation:empty {
  display: none;
}

/* ═══════════════════════════════════════════════════════════
         BUDGET BANNER
      ═══════════════════════════════════════════════════════════ */
.budget-banner {
  background: var(--noir);
  color: var(--blanc);
  border: 3px solid var(--noir);
  padding: 1.5rem 2rem;
  margin-bottom: 3rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.8;
  border-left: 8px solid var(--rouge);
}

.budget-banner strong {
  color: var(--vert);
  font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════════════
         BRUTALIST TABLE
      ═══════════════════════════════════════════════════════════ */
.table-wrapper {
  overflow-x: auto;
  border: 3px solid var(--noir);
  margin-bottom: 3rem;
}

.blog-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.blog-table thead tr {
  background: var(--noir);
  color: var(--blanc);
}

.blog-table thead th {
  padding: 1rem 1.2rem;
  text-align: left;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  border-right: 2px solid rgba(255, 255, 255, 0.15);
}

.blog-table thead th:last-child {
  border-right: none;
}

/* Category header rows */
.blog-table .category-header {
  background: var(--bleu);
  color: var(--blanc);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.8rem 1.2rem;
  border-top: 3px solid var(--noir);
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

/* Data rows */
.blog-table tbody tr {
  border-bottom: 2px solid var(--gris-clair);
  transition: background 0.15s;
}

.blog-table tbody tr:hover {
  background: var(--gris-clair);
}

.blog-table tbody tr:hover td {
  border-color: var(--bleu);
}

.blog-table tbody td {
  padding: 0.9rem 1.2rem;
  border-right: 2px solid var(--gris-clair);
  vertical-align: middle;
  color: var(--noir);
}

.blog-table tbody td:last-child {
  border-right: none;
}

/* Equipment images */
.blog-table img {
  display: block;
  width: 80px;
  height: 55px;
  object-fit: cover;
  border: 2px solid var(--noir);
  background: var(--gris-clair);
}

/* Price cells */
.blog-table .price {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--bleu);
  white-space: nowrap;
}

/* Quantity cells */
.blog-table td:nth-child(4) {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--gris);
}

/* Type cell — tag style */
.blog-table td:nth-child(2) {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gris);
}

/* Zebra striping on alternating equipment rows */
.blog-table tbody tr:not(.category-row):nth-child(even) {
  background: #fafafa;
}

/* ═══════════════════════════════════════════════════════════
         IMAGE ILLUSTRATION
      ═══════════════════════════════════════════════════════════ */
.illustration {
  width: 100%;
  display: block;
  border: 3px solid var(--noir);
  margin-bottom: 4rem;
  object-fit: cover;
  max-height: 400px;
}

/* ═══════════════════════════════════════════════════════════
         FOOTER
      ═══════════════════════════════════════════════════════════ */
footer {
  background: var(--noir);
  color: var(--blanc);
  border-top: 4px solid var(--rouge);
  padding: 60px 2rem 40px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.footer-section h4 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.footer-section p {
  color: rgba(255, 255, 255, 0.7);
}

.footer-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-section li::before {
  display: none;
}
.footer-section li:hover {
  transform: none;
  box-shadow: none;
  border: none;
}
.footer-section li {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-section a:hover {
  color: var(--vert);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ═══════════════════════════════════════════════════════════
         RESPONSIVE
      ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .chapter-content {
    padding: 100px 1.5rem 60px;
  }

  section li::before {
    left: -20px;
    font-size: 1.2rem;
  }
  section li {
    padding: 1rem;
  }

  .blog-table img {
    width: 60px;
    height: 42px;
  }
}
