/* ============================================================
   PAGES PUBLIQUES ÉDITORIALES ET WIKI

   S'ajoute à landing.css (qui porte les jetons de couleur, l'en-tête et
   le pied de page) et à societe.css. Tout ce qui est ici sert aux pages
   rendues par routes/pagesPubliquesContenu.js : wiki, tutoriels,
   actualités, contact.

   Préfixe `pb-` pour ne jamais entrer en collision avec `lp-` (landing)
   ni `sc-` (fiches de société).
   ============================================================ */

.pb-main {
  max-width: 960px; margin: 0 auto; padding: 28px 20px 64px;
}
.pb-article { max-width: 720px; }

/* ---------- fil d'Ariane ---------- */
.pb-ariane { margin: 0 0 18px; font-size: 13px; color: var(--concrete-dim); }
.pb-ariane ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.pb-ariane li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.pb-ariane a { color: var(--concrete); text-decoration: none; }
.pb-ariane a:hover { color: var(--amber); text-decoration: underline; }

/* ---------- titres et chapô ---------- */
.pb-titre {
  font-family: "Oswald", system-ui, sans-serif; font-weight: 600;
  font-size: clamp(26px, 5vw, 38px); line-height: 1.15;
  margin: 0 0 12px; color: var(--ink);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.pb-titre .ico { width: 32px; height: 32px; flex: none; color: var(--amber); }
.pb-chapo { font-size: 17px; line-height: 1.6; color: var(--concrete); margin: 0 0 28px; max-width: 68ch; }
.pb-h2 {
  font-family: "Oswald", system-ui, sans-serif; font-weight: 600;
  font-size: 22px; margin: 36px 0 14px; color: var(--ink);
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.pb-h3 {
  font-family: "Oswald", system-ui, sans-serif; font-weight: 600;
  font-size: 17px; margin: 24px 0 8px; color: var(--ink);
}
.pb-h3 .ico { width: 19px; height: 19px; vertical-align: -3px; color: var(--amber); }
.pb-h3 a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.pb-h3 a:hover { color: var(--amber); border-color: var(--amber); }
.pb-sous { color: var(--concrete-dim); font-size: 13px; }

/* ---------- illustrations du wiki ----------
   Une zone déclarée dans data/wikiIllustrations.js, remplie depuis
   l'administration. Pas de hauteur imposée : une capture large et une
   capture haute se posent aussi bien, et rien ne saute au chargement
   puisque l'image garde son ratio dans la largeur du texte. */
.pb-illustration {
  margin: 0 0 24px; padding: 0;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-panel); overflow: hidden;
}
.pb-illustration img { display: block; width: 100%; height: auto; }
.pb-illustration figcaption {
  padding: 10px 14px; font-size: 13px; color: var(--concrete-dim);
  border-top: 1px solid var(--line); background: var(--bg-panel-2);
}

/* ---------- grille de sections (accueil du wiki, contact) ---------- */
.pb-grille-sections {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px; margin: 0 0 10px;
}
.pb-carte-section {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-panel); text-decoration: none; color: inherit;
  transition: border-color .15s, background .15s;
}
.pb-carte-section:hover { border-color: var(--amber); background: var(--bg-panel-2); }
.pb-carte-icone { flex: none; color: var(--amber); }
.pb-carte-icone .ico { width: 26px; height: 26px; }
.pb-carte-texte { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pb-carte-texte strong { font-size: 16px; color: var(--ink); }
.pb-carte-texte span { font-size: 13px; color: var(--concrete-dim); line-height: 1.45; }

/* ---------- grille de fiches (véhicules, ressources, bâtiments) ---------- */
.pb-grille-fiches {
  list-style: none; margin: 0 0 8px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px;
}
.pb-grille-fiches a {
  display: flex; flex-direction: column; gap: 5px;
  padding: 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-panel); text-decoration: none; color: inherit; height: 100%;
  transition: border-color .15s, background .15s;
}
.pb-grille-fiches a:hover { border-color: var(--amber); background: var(--bg-panel-2); }
.pb-fiche-icone { color: var(--amber); }
.pb-fiche-icone .ico { width: 22px; height: 22px; }
.pb-grille-fiches strong { font-size: 15px; color: var(--ink); }
.pb-fiche-sous { font-size: 12.5px; color: var(--concrete-dim); }

/* ---------- listes de faits (les caractéristiques d'une fiche) ---------- */
.pb-faits {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin: 0 0 24px; padding: 16px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg-panel);
}
.pb-faits > div { display: flex; flex-direction: column; gap: 3px; }
.pb-faits dt { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--concrete-dim); }
.pb-faits dd {
  margin: 0; font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 15px; color: var(--ink);
}
.pb-faits-serres { padding: 12px; gap: 8px; margin-bottom: 0; background: transparent; border: none; }

/* ---------- listes ---------- */
.pb-liste { margin: 0 0 18px; padding-left: 20px; line-height: 1.7; color: var(--concrete); }
.pb-liste li { margin-bottom: 6px; }
.pb-liste a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.pb-liste a:hover { color: var(--amber); border-color: var(--amber); }
.pb-liste .ico { width: 17px; height: 17px; vertical-align: -3px; color: var(--amber); }

.pb-liste-liens { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pb-liste-liens a {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-panel); text-decoration: none; color: inherit;
  transition: border-color .15s, background .15s;
}
.pb-liste-liens a:hover { border-color: var(--amber); background: var(--bg-panel-2); }
.pb-liste-liens strong { font-size: 16px; color: var(--ink); }
.pb-liste-liens span { font-size: 13.5px; color: var(--concrete-dim); line-height: 1.5; }

/* ---------- tableaux (modèles d'engins, chantiers) ----------
   Un tableau peut dépasser la largeur de l'écran : il défile dans sa
   propre enveloppe, jamais le corps de la page. */
.pb-table-enveloppe { overflow-x: auto; margin: 0 0 24px; border: 1px solid var(--line); border-radius: 8px; }
.pb-table { width: 100%; border-collapse: collapse; background: var(--bg-panel); font-size: 13.5px; }
.pb-table th, .pb-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pb-table thead th {
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--concrete-dim); background: var(--bg-panel-2); position: sticky; top: 0;
}
.pb-table tbody th { font-weight: 600; color: var(--ink); white-space: normal; }
.pb-table tbody tr:last-child th, .pb-table tbody tr:last-child td { border-bottom: none; }
.pb-table tbody tr:hover { background: var(--bg-panel-2); }
.pb-table td { color: var(--concrete); font-family: "IBM Plex Mono", ui-monospace, monospace; }
.pb-marque { display: block; font-size: 12.5px; font-weight: 400; color: var(--concrete-dim); margin-top: 2px; }
.pb-puce {
  display: inline-block; padding: 2px 8px; margin: 2px 3px 2px 0;
  border: 1px solid var(--line); border-radius: 999px;
  font-family: "Inter", system-ui, sans-serif; font-size: 12px;
  color: var(--concrete); text-decoration: none;
}
.pb-puce:hover { border-color: var(--amber); color: var(--amber); }

/* ---------- corps d'article ---------- */
.pb-article p { line-height: 1.75; color: var(--concrete); margin: 0 0 16px; }
.pb-article h2 {
  font-family: "Oswald", system-ui, sans-serif; font-weight: 600;
  font-size: 21px; color: var(--ink); margin: 32px 0 12px;
}
.pb-article blockquote {
  margin: 0 0 18px; padding: 14px 18px;
  border-left: 3px solid var(--amber); background: var(--bg-panel);
}
.pb-article blockquote p { margin: 0; font-style: italic; color: var(--ink); }
.pb-article cite { display: block; margin-top: 8px; font-size: 13px; color: var(--concrete-dim); font-style: normal; }
.pb-encadre {
  margin: 0 0 20px; padding: 16px 18px;
  border: 1px solid var(--line); border-left: 3px solid var(--blueprint);
  border-radius: 6px; background: var(--bg-panel);
}
.pb-encadre strong { display: block; color: var(--ink); margin-bottom: 6px; }
.pb-encadre p { margin: 0; font-size: 14px; }
.pb-lien-bloc { margin: 22px 0; }

/* ---------- boutons et retours ---------- */
.pb-bouton {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px; border-radius: 6px;
  border: 1px solid var(--amber); background: transparent; color: var(--amber);
  font-weight: 600; font-size: 14px; text-decoration: none;
  transition: background .15s, color .15s;
}
.pb-bouton:hover { background: var(--amber); color: #15171b; }
.pb-bouton .ico { width: 16px; height: 16px; }
.pb-retour { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }
.pb-retour a { color: var(--concrete); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.pb-retour a:hover { color: var(--amber); }
.pb-retour .ico { width: 16px; height: 16px; }

/* ---------- journal (actualités) ---------- */
.pb-journal { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.pb-journal article {
  padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-panel);
}
.pb-journal h2 { font-family: "Oswald", system-ui, sans-serif; font-size: 21px; margin: 6px 0 10px; }
.pb-journal h2 a { color: var(--ink); text-decoration: none; }
.pb-journal h2 a:hover { color: var(--amber); }
.pb-journal p { color: var(--concrete); line-height: 1.65; margin: 0 0 12px; }
.pb-date {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--concrete-dim); margin: 0 0 4px;
}
.pb-etiquette {
  padding: 2px 9px; border-radius: 999px; background: var(--bg-panel-2);
  border: 1px solid var(--line); font-size: 12.5px; color: var(--concrete);
}
.pb-lire { color: var(--amber); text-decoration: none; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.pb-lire:hover { text-decoration: underline; }
.pb-lire .ico { width: 15px; height: 15px; }

/* ---------- métiers et contact ---------- */
.pb-carte-metier, .pb-carte-contact {
  padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-panel);
}
.pb-carte-metier h2, .pb-carte-contact h2 {
  font-family: "Oswald", system-ui, sans-serif; font-size: 18px; color: var(--ink);
  margin: 0 0 8px; display: flex; align-items: center; gap: 9px;
}
.pb-carte-metier h2 .ico, .pb-carte-contact h2 .ico { width: 21px; height: 21px; color: var(--amber); flex: none; }
.pb-carte-metier p, .pb-carte-contact p { color: var(--concrete); line-height: 1.6; font-size: 14px; margin: 0 0 12px; }

/* ---------- FAQ dépliable ---------- */
.pb-faq { display: flex; flex-direction: column; gap: 8px; }
.pb-faq details { border: 1px solid var(--line); border-radius: 8px; background: var(--bg-panel); }
.pb-faq summary {
  padding: 14px 18px; cursor: pointer; list-style: none;
  font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 10px;
}
.pb-faq summary::-webkit-details-marker { display: none; }
.pb-faq summary::before { content: "+"; color: var(--amber); font-weight: 700; flex: none; }
.pb-faq details[open] summary::before { content: "\2212"; }
.pb-faq summary:hover { color: var(--amber); }
.pb-faq p { margin: 0; padding: 0 18px 16px; color: var(--concrete); line-height: 1.65; }

/* ---------- téléphone ---------- */
@media (max-width: 640px) {
  .pb-main { padding: 20px 16px 48px; }
  .pb-faits { grid-template-columns: 1fr 1fr; padding: 14px; }
  .pb-grille-sections { grid-template-columns: 1fr; }
  .pb-table th, .pb-table td { padding: 9px 11px; font-size: 12.5px; }
}

/* ---------- tableaux de texte (pages légales) ----------
   .pb-table est taillée pour des données de wiki : colonnes courtes, chiffres
   en chasse fixe, pas de retour à la ligne. Les pages légales y mettent des
   phrases entières, ce qui poussait les deux dernières colonnes hors de
   l'écran. Même balisage, autre traitement. */
.pb-table-texte { table-layout: fixed; }
.pb-table-texte th, .pb-table-texte td {
  white-space: normal;
  vertical-align: top;
  line-height: 1.6;
  font-family: "Inter", system-ui, sans-serif;
}
.pb-table-texte td { font-family: "Inter", system-ui, sans-serif; }
.pb-table-texte .pb-sous { display: block; margin-top: 6px; font-size: 12.5px; }
/* Deux colonnes : un intitulé court, puis l'explication. */
.pb-table-texte.pb-deux th[scope="row"] { width: 30%; }

/* Sur téléphone, trois colonnes de phrases ne tiennent pas : chaque ligne
   devient un bloc, et l'intitulé de colonne passe devant sa valeur. */
@media (max-width: 640px) {
  .pb-table-texte, .pb-table-texte tbody, .pb-table-texte tr, .pb-table-texte td, .pb-table-texte th { display: block; width: auto; }
  .pb-table-texte thead { display: none; }
  .pb-table-texte tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .pb-table-texte tr:last-child { border-bottom: none; }
  .pb-table-texte td, .pb-table-texte th { border-bottom: none; padding: 4px 14px; }
  .pb-table-texte td[data-colonne]::before {
    content: attr(data-colonne);
    display: block;
    font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--concrete-dim); margin-bottom: 2px;
  }
}
