
:root {
  --bg: #f6f3ee;
  --panel: #fffdf9;
  --panel-2: #f1ece4;
  --text: #201a16;
  --muted: #6d6158;
  --border: #dfd4c7;
  --accent: #8a4b26;
  --accent-2: #b36a36;
  --shadow: 0 10px 30px rgba(36, 25, 18, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fbfaf7 0%, var(--bg) 100%);
}

img { max-width: 100%; }
a { color: #0d62b5; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 253, 249, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  min-height: 72px;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand img {
  width: 120px;
  height: auto;
  display: block;
}
.brand span {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.brand strong {
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}
.brand small {
  color: var(--muted);
  font-size: 0.82rem;
}
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  background: var(--panel-2);
  text-decoration: none;
}
.burger {
  display: none;
  border: 1px solid rgba(138, 75, 38, 0.25);
  background: rgba(179, 106, 54, 0.12);
  border-radius: 0.8rem;
  width: 2.7rem;
  height: 2.7rem;
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.burger:hover,
.burger[aria-expanded="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.burger:focus-visible {
  outline: 2px solid rgba(138, 75, 38, 0.35);
  outline-offset: 2px;
}

.layout {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.5rem;
}
.sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
}
.nav-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 1.35rem;
  box-shadow: var(--shadow);
  padding: 1rem;
}
.nav-link {
  display: block;
  padding: 0.75rem 0.85rem;
  border-radius: 0.9rem;
  color: var(--text);
  text-decoration: none;
  line-height: 1.25;
}
.nav-link:hover {
  background: var(--panel-2);
  text-decoration: none;
}
.nav-link.active {
  background: rgba(179, 106, 54, 0.12);
  color: var(--accent);
  font-weight: 600;
}

.main-content { min-width: 0; }
.article-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 1.6rem;
  box-shadow: var(--shadow);
  padding: clamp(1rem, 2vw, 2rem);
}
.article-header h1 {
  margin: 0 0 0.5rem 0;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 1.08;
}
.page-meta {
  margin: 0 0 1.25rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.article-content {
  display: flow-root;
  line-height: 1.68;
  font-size: 1.03rem;
}
.article-content p,
.article-content li,
.article-content td,
.article-content th {
  line-height: 1.68;
}
.article-content h2,
.article-content h3,
.article-content h4 {
  scroll-margin-top: 96px;
  margin-top: 2.3rem;
  margin-bottom: 0.9rem;
}
.article-content h2 {
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}
.article-content h3 {
  font-size: 1.15rem;
}
.article-content h4 {
  font-size: 1.04rem;
}
.article-content ul,
.article-content ol {
  padding-left: 1.4rem;
}
.article-content blockquote {
  margin: 1.5rem 0;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--accent-2);
  background: #fbf7f1;
}
.article-content .droite { text-align: right; }
.article-content .centered,
.article-content .figure { text-align: center; }
.article-content .italique { font-style: italic; }
.article-content .gras { font-weight: 700; }
.article-content .rouge { color: #9d1f1f; }
.article-content .vert { color: #1f6d3d; }
.article-content .alerte,
.lead-card,
.contact-card {
  background: #fbf7f1;
  border: 1px solid #eadccf;
  border-left: 5px solid var(--accent-2);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  margin: 1.25rem 0;
}
.article-content .alerte h2,
.contact-card h2,
.lead-card h2 {
  margin-top: 0;
}
.article-content img {
  border-radius: 0.7rem;
}
.article-content img.gauche {
  float: none;
  display: block;
  margin: 1rem auto;
}
.article-content .retour-sommaire {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}
.article-content .retour-sommaire a {
  color: inherit;
}
.reference {
  font-size: 0.8em;
  vertical-align: super;
}
.footnote-ref {
  text-decoration: none;
}
.article-content .ref {
  font-size: 0.97rem;
  color: #40362f;
  line-height: 1.4;
  margin: 0.35rem 0;
}

.toc-box {
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.15rem;
  background: #fbf7f1;
  border: 1px solid #eadccf;
  border-radius: 1rem;
}
.toc-box h2 {
  margin: 0 0 0.8rem 0;
  border: 0;
  padding: 0;
  font-size: 1.2rem;
}
.toc-list p {
  margin: 0.35rem 0;
}
.toc-list .sommaire-2 { padding-left: 1rem; }
.toc-list .sommaire-3 { padding-left: 2rem; }

.article-content .genealogie-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0.45rem 1rem;
  background: transparent;
}
.article-content .genealogie-table td {
  vertical-align: top;
}
.article-content .genealogie-table.ligneHaut {
  border-top: 1px solid var(--text);
  margin-top: 0.4rem;
}
.article-content .nomGenalogie {
  margin: 0.35rem 0 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #2593eb;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.2em;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}
.article-content .pGenalogie {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1em;
  line-height: 1.35;
  text-align: left;
}
.article-content .sousTitreGenalogie {
  margin: 1rem 0 0.55rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1em;
  font-weight: 700;
  text-align: left;
}
.article-content .EnormeFleche {
  display: inline-block;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}
.article-content .caseGenealogie {
  min-width: 13rem;
  padding: 0 10px;
  border: 1px solid var(--text);
  border-radius: 5px;
  background: var(--panel);
}
.article-content ul.ulGenealogie {
  margin: 10px 0 1rem 18px;
  padding: 0;
}

.table-wrap {
  clear: both;
  overflow-x: auto;
  margin: 1.25rem 0;
  border-radius: 0.9rem;
}
.table-wrap table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: white;
}
.table-wrap td,
.table-wrap th {
  padding: 0.5rem 0.65rem;
  vertical-align: top;
}
.table-wrap table[border="1"],
.table-wrap table[border="1"] td,
.table-wrap table[border="1"] th {
  border: 1px solid var(--border);
}

.memorial-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 1.5rem clamp(1.25rem, 4vw, 3rem);
  align-items: start;
  justify-items: center;
  max-width: 760px;
  margin: 1.5rem auto 2rem;
}
.memorial-card {
  width: 100%;
  max-width: 290px;
  margin: 0;
  text-align: center;
}
.memorial-card > a {
  display: block;
}
.memorial-card img {
  display: block;
  margin: 0 auto 0.85rem;
}
.memorial-card .figure {
  margin: 0;
  line-height: 1.45;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.button-link,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: white !important;
  text-decoration: none !important;
  padding: 0.8rem 1rem;
  border-radius: 0.9rem;
  font-weight: 600;
}
button:hover,
.button-link:hover {
  background: var(--accent-2);
}
.contact-form {
  display: grid;
  gap: 1rem;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
label {
  display: grid;
  gap: 0.4rem;
  font-weight: 600;
}
input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  padding: 0.85rem 0.95rem;
  font: inherit;
  background: white;
}
.contact-note {
  color: var(--muted);
}

@media (min-width: 900px) {
  .article-content img.gauche {
    float: left;
    max-width: min(42%, 420px);
    margin: 0.4rem 1.25rem 1rem 0;
  }
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .sidebar {
    display: none;
  }
  .sidebar.active {
    display: block;
  }
}

@media (max-width: 700px) {
  .topbar-inner {
    padding: 0.65rem 0.9rem;
  }
  .brand img {
    width: 92px;
  }
  .brand small {
    display: none;
  }
  .layout {
    padding: 1rem;
    gap: 1rem;
  }
  .article-card {
    padding: 1rem;
    border-radius: 1.1rem;
  }
  .form-row,
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .table-wrap table {
    min-width: 480px;
  }
  .memorial-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
  }
}
