/* ==========================================================================
   Documentation produit Socium — feuille de style commune
   HTML statique, sans framework.
   Charte graphique officielle Socium, reprise de socium-components-library
   (sociumflow __variables.scss / __colors.scss) et de
   socium-workspace-frontend-v2 (_variables.scss) :
   - échelle primaire bleue $sociumPrimary50…950
   - fonds sombres $layoutBackground / $asideBackground
   - polices DM Sans (corps) et Lexend (titres), rayon 12px
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Lexend:wght@100..900&display=swap");

:root {
  /* Échelle primaire Socium */
  --primary-50: #edfaff;
  --primary-100: #d7f2ff;
  --primary-200: #b7eaff;
  --primary-300: #85dfff;
  --primary-400: #4ccbff;
  --primary-500: #23adff;
  --primary-600: #0c90ff;
  --primary-700: #0573e8;
  --primary-800: #0c5ec1;
  --primary-900: #105198;
  --primary-950: #0f325c;

  /* Couleurs sémantiques Socium */
  --socium-dark: #00172d;      /* $sociumDark */
  --socium-body: #0d0140;      /* $sociumBody */
  --socium-gray: #635f73;      /* $sociumGray */
  --socium-success: #1f9900;   /* $sociumSuccess */
  --socium-warn: #fb7d5b;      /* $sociumWarn */
  --socium-danger: #d54947;    /* $sociumDanger */
  --layout-bg: #182438;        /* $layoutBackground */
  --aside-bg: #0e1727;         /* $asideBackground */

  /* Rôles dans la maquette */
  --brand: var(--primary-700);
  --brand-strong: var(--primary-800);
  --brand-dark: var(--socium-dark);
  --brand-light: var(--primary-50);
  --accent: var(--primary-500);
  --text: var(--socium-body);
  --text-muted: var(--socium-gray);
  --border: #e2e8f0;
  --bg: #ffffff;
  --bg-alt: #f8f9fa;           /* $sociumTableTheadBg */
  --thead-color: #343a40;      /* $sociumTableTheadColor */
  --sidebar-width: 280px;
  --radius: 12px;              /* $borderRadius */
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Lexend", "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

/* --------------------------------------------------------------------------
   Structure générale : barre latérale fixe + contenu
   -------------------------------------------------------------------------- */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--aside-bg);
  color: #fff;
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .logo {
  display: block;
  padding: 0 1.5rem 1.25rem;
  color: #fff;
  text-decoration: none;
}

.sidebar .logo img {
  display: block;
  height: 26px;
  width: auto;
}

.sidebar .logo small {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: #8fa1c7;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.5rem;
}

.sidebar nav { padding: 0 0.75rem; }

.sidebar .nav-section {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8fa1c7;
  padding: 1.1rem 0.75rem 0.35rem;
}

.sidebar a.nav-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.42rem 0.75rem;
  color: #d7deee;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.92rem;
}

.sidebar .nav-hint {
  font-size: 0.7rem;
  color: #7286ad;
  white-space: nowrap;
}

.sidebar a.nav-link.active .nav-hint,
.sidebar a.nav-link:hover .nav-hint { color: #b8c4dd; }

.sidebar a.nav-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.sidebar a.nav-link.active {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 3rem 4rem;
  max-width: 60rem;
}

/* --------------------------------------------------------------------------
   Recherche
   -------------------------------------------------------------------------- */

.search-box { position: relative; margin-bottom: 2.25rem; max-width: 34rem; }

.search-box input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  font-size: 0.95rem;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23635f73' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 0.8rem center;
  color: var(--text);
}

.search-box input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(5, 115, 232, 0.14);
  background-color: #fff;
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(20, 33, 61, 0.14);
  max-height: 24rem;
  overflow-y: auto;
  z-index: 50;
  display: none;
}

.search-results.open { display: block; }

.search-results a {
  display: block;
  padding: 0.7rem 1rem;
  text-decoration: none;
  border-bottom: 1px solid var(--bg-alt);
}

.search-results a:last-child { border-bottom: none; }
.search-results a:hover, .search-results a.selected { background: var(--brand-light); }

.search-results .r-title { font-weight: 600; color: var(--brand); font-size: 0.93rem; }
.search-results .r-module { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.search-results .r-excerpt { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.1rem; }
.search-results .r-empty { padding: 0.9rem 1rem; color: var(--text-muted); font-size: 0.9rem; }

/* --------------------------------------------------------------------------
   Typographie du contenu
   -------------------------------------------------------------------------- */

.content h1 {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  line-height: 1.25;
  margin: 0 0 0.4rem;
  color: var(--brand-dark);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 2rem;
}

.content h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--primary-100);
  color: var(--brand-dark);
}

.content h3 {
  font-family: var(--font-heading);
  font-size: 1.08rem;
  margin: 1.75rem 0 0.5rem;
  color: var(--brand);
}

.content p { margin: 0.6rem 0 1rem; }

.content ul, .content ol { padding-left: 1.4rem; margin: 0.5rem 0 1rem; }
.content li { margin: 0.3rem 0; }

.content a { color: var(--brand); }

.content code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.88em;
}

/* --------------------------------------------------------------------------
   Composants : badges, cartes, tableaux, encadrés
   -------------------------------------------------------------------------- */

.badges { margin: 0 0 1.5rem; }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  margin-right: 0.4rem;
  margin-bottom: 0.3rem;
  background: var(--primary-100);
  color: var(--brand-strong);
}

.badge.role { background: #e8f5e3; color: #187a00; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  text-decoration: none;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
  border-color: var(--primary-400);
  box-shadow: 0 4px 14px rgba(5, 115, 232, 0.12);
}

.card img.card-icon {
  display: block;
  width: 34px;
  height: 34px;
  margin-bottom: 0.6rem;
}

/* Logos en mot-symbole (Assia) : même encombrement vertical que les tuiles */
.card img.card-icon--wordmark {
  width: auto;
  height: 12px;
  margin: 11px 0 17px;
}

/* Logo produit en tête de fiche */
.page-logo {
  display: block;
  width: 42px;
  height: 42px;
  margin-bottom: 0.9rem;
}

.page-logo--wordmark {
  width: auto;
  height: 16px;
  margin: 13px 0 1rem;
}
.card h3 { margin: 0 0 0.3rem; font-size: 1.02rem; color: var(--brand-dark); }
.card p { margin: 0; font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  vertical-align: top;
}

th { background: var(--bg-alt); color: var(--thead-color); font-weight: 600; }

tbody tr:nth-child(even) { background: var(--bg-alt); }

.note {
  border-left: 4px solid var(--brand);
  background: var(--brand-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.8rem 1.1rem;
  margin: 1.25rem 0;
  font-size: 0.93rem;
}

.note strong:first-child { color: var(--brand-dark); }

/* Fiche fonctionnalité détaillée */
.feature {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem 1.2rem;
  margin: 1.4rem 0;
  background: #fff;
  scroll-margin-top: 1.5rem;
}

.feature h3 { margin-top: 0; font-size: 1.12rem; }

.feature .meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.6rem; }

/* Date de dernière mise à jour, rendue par search.js depuis data-updated */
.feature .updated {
  margin: -0.35rem 0 0.9rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.feature .updated time { color: inherit; }

.content h4,
.feature h4 {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-800);
  margin: 1.2rem 0 0.45rem;
}

/* Bénéfices par audience */
ul.impact { list-style: none; padding-left: 0; margin: 0.4rem 0 0.6rem; }

ul.impact li {
  position: relative;
  padding-left: 1.25rem;
  margin: 0.4rem 0;
}

ul.impact li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: 700;
}

/* Connexions vers d'autres fonctionnalités / produits */
.feature-links {
  border-top: 1px dashed var(--border);
  margin-top: 1.1rem;
  padding-top: 0.7rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.feature-links strong { color: var(--brand-dark); }

/* Parcours transverses (page parcours.html) */
.journey h2 {
  margin: 0 0 0.5rem;
  border-bottom: none;
  padding-bottom: 0;
  font-size: 1.25rem;
}

.journey ol { counter-reset: step; list-style: none; padding-left: 0; margin-top: 1rem; }

.journey ol li {
  counter-increment: step;
  position: relative;
  padding: 0.15rem 0 0.9rem 2.5rem;
  border-left: 2px solid var(--primary-100);
  margin-left: 0.9rem;
}

.journey ol li:last-child { border-left-color: transparent; padding-bottom: 0.2rem; }

.journey ol li::before {
  content: counter(step);
  position: absolute;
  left: -0.95rem;
  top: -0.1rem;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Glossaire */
dl.glossary dt {
  font-weight: 700;
  color: var(--brand-dark);
  margin-top: 1.1rem;
  font-size: 1.02rem;
}

dl.glossary dd { margin: 0.25rem 0 0 0; color: var(--text); }

dl.glossary dd .g-module { font-size: 0.78rem; color: var(--text-muted); }

/* Pied de page */
.page-footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-footer a { color: var(--brand); text-decoration: none; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

.menu-toggle {
  display: none;
  position: fixed;
  top: 0.9rem;
  left: 0.9rem;
  z-index: 100;
  background: var(--aside-bg);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  font-size: 1.1rem;
  cursor: pointer;
}

@media (max-width: 860px) {
  .menu-toggle { display: block; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    width: min(var(--sidebar-width), 84vw);
  }

  .sidebar.open { transform: translateX(0); }

  .content { padding: 4.5rem 1.25rem 3rem; }
}

@media print {
  .sidebar, .search-box, .menu-toggle { display: none; }
  .content { padding: 0; max-width: none; }
}
