/* sdeg-kernel — Living Documentation
   Palette LIVING / COLD + badges des méta-états de la machine sdlc.
   Respecte la sémantique définie dans sdlc/schema.js (META). */

:root {
  --sdeg-living: #00acc1;          /* cyan — IN_PROGRESS */
  --sdeg-living-frozen: #f9a825;    /* ambre — BLOCKED */
  --sdeg-cold: #546e7a;             /* gris-vert — DONE / NOT_STARTED / ARCHIVED */
  --sdeg-accent: #26a69a;
}

/* Badges d'état (à utiliser avec class="badge badge-living" etc.) */
.badge {
  display: inline-block;
  padding: 0.1em 0.55em;
  border-radius: 999px;
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  vertical-align: middle;
  white-space: nowrap;
}

.badge-living         { background: var(--sdeg-living);        color: white; }
.badge-living-frozen  { background: var(--sdeg-living-frozen); color: #2d1e00; }
.badge-cold           { background: var(--sdeg-cold);          color: white; }
.badge-not-started    { background: transparent;               color: var(--sdeg-cold); border: 1px solid var(--sdeg-cold); }
.badge-done           { background: #2e7d32;                   color: white; }
.badge-archived       { background: #6a6a6a;                   color: white; }

/* Encadrés pour transitions de portes */
.porte-card {
  border-left: 3px solid var(--sdeg-accent);
  padding: 0.5em 0.9em;
  margin: 0.6em 0;
  background: rgba(38, 166, 154, 0.04);
  border-radius: 0 4px 4px 0;
}

/* Tableau des portes : colonne porte en monospace */
.porte-ref { font-family: var(--md-code-font-family, monospace); font-weight: 600; }

/* Visualisations embarquées : encadre les iframes */
iframe.embed-visualisation {
  width: 100%;
  min-height: 640px;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 4px;
  background: var(--md-default-bg-color);
}

/* Notes de fraîcheur (git-revision-date) */
.md-source-date { font-style: italic; opacity: 0.8; }

/* Diagramme Mermaid : centré */
.mermaid { text-align: center; }

/* Charte aelworks : noir chaud, orange #F39200 en accent (texte en orange foncé
   pour le contraste), fond papier en clair. Mêmes valeurs que aelworks.fr. */
:root,
[data-md-color-scheme="default"] {
  --md-primary-fg-color: #1d1d1b;
  --md-primary-fg-color--light: #4a4945;
  --md-primary-fg-color--dark: #000000;
  --md-primary-bg-color: #fdfcf9;
  --md-primary-bg-color--light: rgba(253, 252, 249, 0.7);
  --md-accent-fg-color: #f39200;
  --md-accent-fg-color--transparent: rgba(243, 146, 0, 0.1);
}
[data-md-color-scheme="default"] {
  --md-default-bg-color: #f7f5f0;
  --md-typeset-a-color: #9a5c00;
}
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #1d1d1b;
  --md-primary-fg-color--light: #4a4945;
  --md-primary-fg-color--dark: #000000;
  --md-accent-fg-color: #f39200;
  --md-accent-fg-color--transparent: rgba(243, 146, 0, 0.1);
  --md-typeset-a-color: #f5a83a;
}

/* Mode Intention (voir assets/intention/) : le bouton vit dans l'en-tête. */
.md-header .int-entree {
  margin: 0 0.4rem;
  flex-shrink: 0;
  color: var(--md-primary-bg-color);
  border-color: var(--md-primary-bg-color--light);
}
.md-header .int-entree:hover {
  background: rgba(253, 252, 249, 0.12);
  color: var(--md-primary-bg-color);
}
.md-header .int-entree:focus-visible {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 2px;
}
/* Le thème sombre de Material se règle par attribut, pas seulement par le système. */
[data-md-color-scheme="default"] {
  --int-voile: rgba(78, 90, 150, .16);
  --int-voile-2: rgba(120, 110, 190, .10);
  --int-surface: rgba(247, 248, 253, .94);
  --int-ink: #1e2236;
  --int-ink-2: #555b78;
  --int-trait: #6a72b6;
  --int-halo: rgba(106, 114, 182, .32);
  --int-mote: rgba(90, 100, 170, .55);
  --int-gel: saturate(.28) contrast(.82) brightness(.97) blur(.7px);
}
[data-md-color-scheme="slate"] {
  --int-voile: rgba(110, 125, 210, .14);
  --int-voile-2: rgba(150, 130, 230, .08);
  --int-surface: rgba(20, 22, 34, .94);
  --int-ink: #e7e9f6;
  --int-ink-2: #a7acc8;
  --int-trait: #9ca5ea;
  --int-halo: rgba(156, 165, 234, .30);
  --int-mote: rgba(170, 180, 240, .5);
  --int-gel: saturate(.28) contrast(.8) brightness(.72) blur(.7px);
}
/* L'en-tête (onglets compris) se fige avec la page. */
.md-header { transition: filter .5s ease; }
html.int-gel .md-header { filter: var(--int-gel); }
@media (prefers-reduced-motion: reduce) { .md-header { transition: none; } }
