:root {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --tint: #eaeff5;
  --ink: #1a222b;
  --muted: #4b5563;
  --navy: #1d3557;
  --navy-dark: #14263f;
  --ochre: #b45309;
  --ochre-bright: #e08d3c;
  --border: rgba(29, 53, 87, 0.16);
  --border-strong: rgba(29, 53, 87, 0.34);
  --rail-w: 290px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(to right, var(--navy-dark) 0, var(--navy-dark) var(--rail-w), var(--bg) var(--rail-w), var(--bg) 100%);
  color: var(--ink);
  font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  opacity: 1;
}
h1, h2, h3, h4 {
  font-family: 'Merriweather', Georgia, serif;
  color: var(--navy);
  line-height: 1.25;
  margin-top: 0;
}
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* Shell: Fixed Left-Rail Dossier */
.dossier-shell {
  min-height: 100vh;
}

aside.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  background: var(--navy-dark);
  color: #e2e8f0;
  border-right: 4px solid var(--ochre);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px 22px;
  overflow-y: auto;
  z-index: 40;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.rail-brand:hover { text-decoration: none; }
.rail-title {
  font-family: 'Merriweather', serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  display: block;
  color: #ffffff;
}
.rail-sub {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #f3b574;
  margin-top: 3px;
}

.rail-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #c2d1e3;
  margin: 18px 0 8px;
  font-weight: 700;
}

nav.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
nav.rail-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 5px;
  color: #dbe5f0;
  font-size: 0.92rem;
  font-weight: 600;
  border-left: 3px solid transparent;
}
nav.rail-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  text-decoration: none;
}
nav.rail-nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-left-color: var(--ochre-bright);
}

.rail-anchors {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rail-anchors a {
  font-size: 0.85rem;
  color: #dce6f2;
  padding: 5px 8px;
  border-radius: 4px;
}
.rail-anchors a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.rail-meta {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.8rem;
  color: #b8c7d9;
  line-height: 1.5;
}
.rail-meta strong { color: #ffffff; }
.rail-meta a { color: #f6c28b; }

/* Main Dossier Column */
.dossier-main {
  margin-left: var(--rail-w);
  min-width: 0;
}

.dossier-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.dossier-wrap {
  max-width: 980px;
  padding: 36px 36px 56px;
}

.badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ochre);
  background: rgba(180, 83, 9, 0.11);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-dark); text-decoration: none; color: #fff; }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--tint); text-decoration: none; }

/* Numbered Dossier Sections (01..04) */
.dossier-sec {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px 30px;
  margin-bottom: 26px;
}
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--navy);
}
.sec-num {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ochre);
  line-height: 1;
  flex-shrink: 0;
}
.sec-title-wrap h1,
.sec-title-wrap h2 {
  margin-bottom: 4px;
}
.sec-kicker {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.meta-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.meta-cell {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
}
.meta-cell span {
  display: block;
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 700;
}
.meta-cell strong {
  font-size: 0.92rem;
  color: var(--navy);
}

/* Horizontal Photo Strip */
.photo-strip-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 24px 24px;
  margin-bottom: 26px;
}
.photo-strip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.photo-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.strip-frame {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg);
}
.strip-frame img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}
.strip-cap {
  padding: 10px 12px;
  font-size: 0.83rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  line-height: 1.45;
}
.strip-fig {
  display: inline-block;
  font-weight: 700;
  color: var(--ochre);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  margin-right: 6px;
}

/* Dossier Rows for Interventions */
.dossier-rows {
  display: flex;
  flex-direction: column;
}
.dossier-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.dossier-row:first-child { padding-top: 4px; }
.dossier-row:last-child { border-bottom: none; padding-bottom: 4px; }
.row-code {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ochre);
  padding-top: 3px;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.card-body { padding: 20px; }
.card img { width: 100%; height: 220px; object-fit: cover; }

table.statuts {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
}
table.statuts th, table.statuts td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.93rem;
}
table.statuts th { background: var(--tint); color: var(--navy); }

/* Light Dossier Footer */
footer.dossier-foot {
  border-top: 2px solid var(--navy);
  background: var(--surface);
  padding: 22px 36px;
  font-size: 0.86rem;
  color: var(--muted);
}
.dossier-foot-inner {
  max-width: 908px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

@media (max-width: 960px) {
  html, body { background: var(--bg); }
  aside.rail {
    position: static;
    width: 100%;
    border-right: none;
    border-bottom: 4px solid var(--ochre);
    padding: 18px 20px;
  }
  .rail-anchors, .rail-anchors-label, .rail-meta { display: none; }
  nav.rail-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
  }
  nav.rail-nav a {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 6px 10px;
    font-size: 0.86rem;
  }
  nav.rail-nav a.active {
    border-bottom-color: var(--ochre-bright);
  }
  .dossier-main { margin-left: 0; }
  .dossier-topbar { padding: 10px 20px; }
  .dossier-wrap { padding: 22px 18px 40px; }
  footer.dossier-foot { padding: 20px; }
  .meta-strip, .photo-strip, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .dossier-row { grid-template-columns: 1fr; gap: 6px; }
  .dossier-sec { padding: 22px 18px; }
}

@media (max-width: 680px) {
  table.statuts thead { display: none; }
  table.statuts, table.statuts tbody, table.statuts tr, table.statuts td {
    display: block;
    width: 100%;
  }
  table.statuts tr {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-strong);
  }
  table.statuts tr:last-child { border-bottom: none; }
  table.statuts td {
    padding: 3px 0;
    border-bottom: none;
    font-size: 0.9rem;
  }
  table.statuts td::before {
    content: attr(data-label) ' : ';
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ochre);
    display: inline-block;
    margin-right: 4px;
  }
}
