/* ============================================================
   sauveteur-secouriste-travail.fr - Wiki SST encyclopédique
   Design sobre type Wikipedia / MDN / référence éducative
   ============================================================ */

:root {
  --c-bg: #ffffff;
  --c-bg-soft: #f8f9fa;
  --c-bg-alt: #eaecf0;
  --c-text: #202122;
  --c-text-light: #54595d;
  --c-muted: #72777d;
  --c-link: #36c;
  --c-link-visited: #6b4ba1;
  --c-link-hover: #447ff5;
  --c-line: #a2a9b1;
  --c-line-light: #c8ccd1;
  --c-accent: #36c;
  --c-warning: #fc3;
  --c-note: #eaecf0;
  --serif: Georgia, 'Liberation Serif', 'Nimbus Roman No9 L', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: sans-serif;
  color: var(--c-text);
  background: var(--c-bg);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-link); text-decoration: none; }
a:visited { color: var(--c-link-visited); }
a:hover { text-decoration: underline; color: var(--c-link-hover); }

h1, h2, h3, h4, h5 {
  font-family: var(--serif);
  color: var(--c-text);
  font-weight: normal;
  margin: 0 0 0.4em;
  line-height: 1.3;
}
h1 {
  font-size: 1.9rem;
  border-bottom: 1px solid var(--c-line-light);
  padding-bottom: 0.25em;
  margin-bottom: 0.6em;
}
h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--c-line-light);
  padding-bottom: 0.2em;
  margin-top: 1.6em;
}
h3 { font-size: 1.2rem; margin-top: 1.4em; }
h4 { font-size: 1.05rem; margin-top: 1.2em; font-weight: bold; }

p { margin: 0 0 0.8em; }

ul, ol { margin: 0 0 0.8em; padding-left: 26px; }
li { margin-bottom: 4px; }

strong { font-weight: bold; }
em { font-style: italic; }

/* ===== Top bar ===== */
.topbar {
  background: var(--c-bg-alt);
  border-bottom: 1px solid var(--c-line);
  padding: 8px 0;
  font-size: 0.86rem;
}
.topbar .container {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.topbar-info { display: flex; gap: 16px; flex-wrap: wrap; }

/* ===== Header ===== */
.site-header {
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-line);
  padding: 14px 0;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; color: var(--c-text);
}
.brand:visited { color: var(--c-text); }
.brand-logo {
  width: 48px; height: 48px;
  background: var(--c-accent); color: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-size: 1.5rem; font-weight: bold;
}
.brand-name {
  display: flex; flex-direction: column;
}
.brand-main {
  font-family: var(--serif);
  font-size: 1.25rem; font-weight: normal;
  line-height: 1.1;
}
.brand-sub {
  font-size: 0.78rem; color: var(--c-muted);
  margin-top: 3px;
}

/* ===== Main layout ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.wiki-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  padding-top: 24px;
  padding-bottom: 48px;
}
@media (max-width: 880px) {
  .wiki-layout { grid-template-columns: 1fr; }
  .wiki-nav { order: 2; }
}

/* ===== Sidebar nav ===== */
.wiki-nav {
  background: var(--c-bg-soft);
  border: 1px solid var(--c-line-light);
  padding: 16px;
  border-radius: 4px;
  height: fit-content;
  position: sticky;
  top: 16px;
  font-size: 0.92rem;
}
.wiki-nav h3 {
  font-family: var(--sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-muted);
  margin: 0 0 8px;
  font-weight: bold;
  border: none;
}
.wiki-nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}
.wiki-nav li {
  margin-bottom: 2px;
}
.wiki-nav a {
  display: block;
  padding: 5px 8px;
  border-radius: 3px;
  font-size: 0.9rem;
}
.wiki-nav a:hover { background: var(--c-bg-alt); text-decoration: none; }
.wiki-nav a.active { background: var(--c-bg-alt); color: var(--c-text); font-weight: bold; }

/* ===== Article ===== */
.wiki-content {
  min-width: 0;
}
.wiki-content > p { font-size: 1rem; line-height: 1.7; }
.wiki-content > p:first-of-type {
  font-size: 1.05rem;
  margin-bottom: 1em;
}

/* Table of contents */
.toc {
  background: var(--c-bg-soft);
  border: 1px solid var(--c-line-light);
  padding: 12px 16px;
  margin: 20px 0;
  font-size: 0.94rem;
  max-width: 480px;
}
.toc-title {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: bold;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: 8px;
}
.toc ol { padding-left: 22px; margin: 0; }
.toc li { margin-bottom: 3px; }

/* Infobox (sidebar in article) */
.infobox {
  background: var(--c-bg-soft);
  border: 1px solid var(--c-line);
  padding: 0;
  margin: 0 0 18px 24px;
  float: right;
  width: 280px;
  font-size: 0.9rem;
  border-radius: 4px;
}
@media (max-width: 760px) {
  .infobox { float: none; width: 100%; margin: 16px 0; }
}
.infobox-title {
  background: var(--c-accent);
  color: #fff;
  padding: 8px 12px;
  font-family: var(--serif);
  font-size: 1.05rem;
  text-align: center;
}
.infobox-table {
  width: 100%;
  border-collapse: collapse;
}
.infobox-table td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--c-line-light);
  vertical-align: top;
}
.infobox-table tr:last-child td { border-bottom: none; }
.infobox-table .label {
  background: var(--c-bg-alt);
  font-weight: bold;
  width: 38%;
  font-size: 0.88rem;
}

/* Note boxes */
.note {
  background: #fffbe7;
  border: 1px solid #fce100;
  border-left: 4px solid var(--c-warning);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 4px 4px 0;
  font-size: 0.95rem;
}
.note strong { color: #8b6800; }

.legal-quote {
  background: var(--c-bg-soft);
  border-left: 4px solid var(--c-accent);
  padding: 12px 18px;
  margin: 16px 0;
  font-style: italic;
  font-size: 0.96rem;
}
.legal-quote cite { display: block; margin-top: 8px; font-size: 0.85rem; color: var(--c-muted); font-style: normal; }

/* Definition list */
dl { margin: 16px 0; }
dt {
  font-weight: bold;
  margin-top: 12px;
  font-family: var(--serif);
  font-size: 1.02rem;
}
dd { margin: 0 0 10px 20px; }

/* Tables */
.wikitable {
  border-collapse: collapse;
  margin: 16px 0;
  background: var(--c-bg);
  border: 1px solid var(--c-line-light);
  font-size: 0.94rem;
}
.wikitable th, .wikitable td {
  border: 1px solid var(--c-line-light);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.wikitable th {
  background: var(--c-bg-alt);
  font-weight: bold;
}

/* See also / references */
.see-also, .references {
  background: var(--c-bg-soft);
  border: 1px solid var(--c-line-light);
  padding: 12px 18px;
  margin: 24px 0;
  font-size: 0.94rem;
  border-radius: 4px;
}
.see-also h3, .references h3 {
  font-family: var(--sans);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-muted);
  margin: 0 0 8px;
  border: none;
  font-weight: bold;
}
.see-also ul, .references ul { margin: 0; padding-left: 22px; }

/* Footer */
.site-footer {
  background: var(--c-bg-soft);
  border-top: 1px solid var(--c-line);
  padding: 32px 0 24px;
  font-size: 0.88rem;
  color: var(--c-text-light);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 24px;
}
@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.site-footer h4 {
  font-family: var(--sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-muted);
  margin: 0 0 8px;
  font-weight: bold;
  border: none;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 4px; }
.footer-bottom {
  border-top: 1px solid var(--c-line-light);
  padding-top: 16px;
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: 12px;
  color: var(--c-muted); font-size: 0.82rem;
}

/* Breadcrumbs */
.crumbs {
  font-size: 0.86rem;
  color: var(--c-muted);
  padding: 12px 0;
  background: var(--c-bg-soft);
  border-bottom: 1px solid var(--c-line-light);
}
.crumbs strong { color: var(--c-text); font-weight: normal; }

/* Article meta */
.article-meta {
  color: var(--c-muted);
  font-size: 0.88rem;
  margin-bottom: 18px;
}

/* Category grid (home) */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.cat-card {
  background: var(--c-bg);
  border: 1px solid var(--c-line-light);
  border-radius: 4px;
  padding: 18px 20px;
}
.cat-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-family: var(--serif);
}
.cat-card h3 a { color: var(--c-text); }
.cat-card h3 a:visited { color: var(--c-text); }
.cat-card ul {
  margin: 8px 0 0;
  padding-left: 22px;
  font-size: 0.92rem;
}
.cat-card li { margin-bottom: 3px; }

/* Featured article on home */
.featured {
  background: var(--c-bg-soft);
  border-left: 4px solid var(--c-accent);
  padding: 18px 24px;
  margin: 24px 0;
}
.featured h2 { margin-top: 0; }

/* Mobile cta */
.commercial-cta {
  background: var(--c-bg-alt);
  border: 1px dashed var(--c-line);
  padding: 14px 18px;
  margin: 24px 0;
  font-size: 0.92rem;
  border-radius: 4px;
}
.commercial-cta a { font-weight: bold; }
