/* =========================================================================
   Hub IA — documentation, charte SPIE
   Bleu SPIE #0F1E5A · Rouge SPIE #CC0000 (accent rare)
   ========================================================================= */

/* ---------- Jetons ---------- */
:root > * {
  --hub-navy: #0f1e5a;
  --hub-navy-deep: #0a1442;
  --hub-navy-soft: #24346f;
  --hub-red: #cc0000;
  --hub-link: #1d4fa8;
  --hub-ink: #1b2340;
  --hub-muted: #5b6480;
  --hub-surface: #f4f6fa;
  --hub-line: #dfe3ec;
  --hub-radius: 8px;

  --md-primary-fg-color: var(--hub-navy);
  --md-primary-fg-color--light: var(--hub-navy-soft);
  --md-primary-fg-color--dark: var(--hub-navy-deep);
  --md-primary-bg-color: #ffffff;
  --md-primary-bg-color--light: rgba(255, 255, 255, 0.72);
  --md-accent-fg-color: var(--hub-red);
  --md-accent-fg-color--transparent: rgba(204, 0, 0, 0.08);

  --md-default-fg-color: var(--hub-ink);
  --md-default-fg-color--light: var(--hub-muted);
  --md-default-fg-color--lighter: #8a92ab;
  --md-typeset-color: var(--hub-ink);
  --md-typeset-a-color: var(--hub-link);
  --md-code-bg-color: var(--hub-surface);
  --md-code-fg-color: #1f2a4d;
  --md-footer-bg-color: var(--hub-navy-deep);
  --md-footer-bg-color--dark: #070f33;
}

/* Mode sombre (si le sélecteur de thème est activé) */
[data-md-color-scheme="slate"] {
  --hub-ink: #e4e8f3;
  --hub-muted: #a3abc4;
  --hub-surface: #1a2140;
  --hub-line: #2c3560;
  --hub-link: #8fb0ff;
  --md-default-bg-color: #11173a;
  --md-default-fg-color: var(--hub-ink);
  --md-default-fg-color--light: var(--hub-muted);
  --md-typeset-color: var(--hub-ink);
  --md-typeset-a-color: var(--hub-link);
  --md-code-bg-color: var(--hub-surface);
  --md-code-fg-color: #dfe5f7;
}

/* ---------- Typographie ---------- */
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.md-typeset {
  font-size: 0.8rem;
  line-height: 1.7;
}

.md-content__inner {
  max-width: 46rem;
}

.md-typeset h1 {
  color: var(--hub-navy);
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

.md-typeset h2 {
  color: var(--hub-navy);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  margin-top: 2.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--hub-line);
}

.md-typeset h3 {
  color: var(--hub-navy-soft);
  font-weight: 600;
  font-size: 1.02rem;
  margin-top: 1.8rem;
}

.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  color: var(--hub-navy-soft);
  font-weight: 600;
}

[data-md-color-scheme="slate"] .md-typeset h1,
[data-md-color-scheme="slate"] .md-typeset h2,
[data-md-color-scheme="slate"] .md-typeset h3,
[data-md-color-scheme="slate"] .md-typeset h4 {
  color: #f1f4fb;
}

.md-typeset a {
  text-decoration: underline;
  text-decoration-color: rgba(29, 79, 168, 0.3);
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.15s, color 0.15s;
}

.md-typeset a:hover {
  color: var(--hub-red);
  text-decoration-color: currentColor;
}

.md-typeset .headerlink {
  text-decoration: none;
}

.md-typeset hr {
  border-bottom-color: var(--hub-line);
  margin: 2rem 0;
}

/* ---------- En-tête : un seul bandeau bleu, filet rouge SPIE ---------- */
.md-header {
  background-color: var(--hub-navy);
  box-shadow: none;
}

.md-header__title {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.md-header__button.md-logo img {
  height: 1.6rem;
}

.md-tabs {
  background-color: var(--hub-navy);
  border-bottom: 3px solid var(--hub-red);
}

.md-tabs__link {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.78;
  margin-top: 0.55rem;
  transition: opacity 0.15s;
}

.md-tabs__item--active .md-tabs__link,
.md-tabs__link:hover {
  opacity: 1;
  color: #ffffff;
}

.md-tabs__item--active .md-tabs__link {
  font-weight: 600;
}

/* Recherche */
.md-search__form {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

.md-search__form:hover {
  background-color: rgba(255, 255, 255, 0.16);
}

[data-md-toggle="search"]:checked ~ .md-header .md-search__form {
  border-radius: 6px 6px 0 0;
}

/* ---------- Navigation latérale ---------- */
.md-nav {
  font-size: 0.72rem;
}

.md-nav__title {
  color: var(--hub-muted);
  font-weight: 600;
}

.md-nav__link {
  color: var(--hub-ink);
  transition: color 0.15s;
}

.md-nav__link:hover,
.md-nav__link:focus {
  color: var(--hub-red);
}

.md-sidebar--primary .md-nav__link--active {
  color: var(--hub-navy);
  font-weight: 600;
  position: relative;
}

.md-sidebar--primary .md-nav__link--active::before {
  content: "";
  position: absolute;
  left: -0.6rem;
  top: 0.15em;
  bottom: 0.15em;
  width: 3px;
  border-radius: 2px;
  background: var(--hub-red);
}

[data-md-color-scheme="slate"] .md-sidebar--primary .md-nav__link--active {
  color: #ffffff;
}

.md-sidebar--secondary .md-nav__link--active,
.md-sidebar--secondary .md-nav__link--passed {
  color: var(--hub-muted);
}

.md-sidebar--secondary .md-nav__link--active {
  color: var(--hub-navy);
  font-weight: 600;
}

[data-md-color-scheme="slate"] .md-sidebar--secondary .md-nav__link--active {
  color: #ffffff;
}

/* Fil d'Ariane */
.md-path {
  font-size: 0.68rem;
  color: var(--hub-muted);
}

/* ---------- Code ---------- */
.md-typeset code {
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.86em;
}

.md-typeset pre > code {
  padding: 0.9rem 1.1rem;
}

.md-typeset pre,
.md-typeset .highlight,
.md-typeset .codehilite {
  border-radius: var(--hub-radius);
}

.md-typeset .highlight {
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius);
  overflow: hidden;
  margin: 1em 0;
}

.md-typeset .highlight > pre {
  margin: 0;
  border-radius: 0;
}

/* ---------- Tableaux ---------- */
.md-typeset table:not([class]) {
  font-size: 0.72rem;
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius);
  overflow: hidden;
  box-shadow: none;
}

.md-typeset table:not([class]) th {
  background-color: var(--hub-surface);
  color: var(--hub-navy);
  font-weight: 600;
  border-bottom: 1px solid var(--hub-line);
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
  color: #ffffff;
}

.md-typeset table:not([class]) td {
  border-top: 1px solid var(--hub-line);
  vertical-align: top;
}

.md-typeset table:not([class]) tbody tr:hover {
  background-color: rgba(15, 30, 90, 0.035);
  box-shadow: none;
}

/* ---------- Encadrés ---------- */
.md-typeset .admonition,
.md-typeset details {
  border: 0;
  border-left: 4px solid var(--hub-navy-soft);
  border-radius: 0 var(--hub-radius) var(--hub-radius) 0;
  background-color: var(--hub-surface);
  box-shadow: none;
  font-size: 0.76rem;
}

.md-typeset .admonition-title,
.md-typeset summary {
  background-color: transparent !important;
  font-weight: 600;
  border: 0;
}

.md-typeset .admonition.info,
.md-typeset .admonition.note {
  border-left-color: #2f6fd1;
}

.md-typeset .admonition.tip,
.md-typeset .admonition.success {
  border-left-color: #1f8a5b;
}

.md-typeset .admonition.warning {
  border-left-color: #d98a00;
  background-color: #fff8eb;
}

.md-typeset .admonition.danger {
  border-left-color: var(--hub-red);
  background-color: #fff3f3;
}

[data-md-color-scheme="slate"] .md-typeset .admonition.warning {
  background-color: #2b2618;
}

[data-md-color-scheme="slate"] .md-typeset .admonition.danger {
  background-color: #2e1a22;
}

/* ---------- Listes de contrôle ---------- */
.md-typeset .task-list-item {
  margin-bottom: 0.35em;
}

.md-typeset .task-list-indicator::before {
  background-color: var(--hub-line);
}

.md-typeset [type="checkbox"]:checked + .task-list-indicator::before {
  background-color: #1f8a5b;
}

/* ---------- Écran « page protégée » (encryptcontent) ---------- */
#mkdocs-decrypt-form {
  max-width: 26rem;
  margin: 2.5rem 0 3rem;
  padding: 1.6rem 1.6rem 1.2rem;
  border: 1px solid var(--hub-line);
  border-top: 3px solid var(--hub-navy);
  border-radius: var(--hub-radius);
  background: var(--md-default-bg-color, #ffffff);
}

#mkdocs-decrypt-form h1 {
  font-size: 1.25rem;
  margin: 0 0 0.4rem;
}

#mkdocs-decrypt-form p {
  color: var(--hub-muted);
  font-size: 0.74rem;
  margin: 0 0 1rem;
}

#mkdocs-content-password {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-size: 0.8rem;
  color: var(--hub-ink);
  background: var(--md-default-bg-color, #ffffff);
  border: 1px solid var(--hub-line);
  border-radius: 6px;
  box-shadow: none;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#mkdocs-content-password:focus {
  border-color: var(--hub-navy-soft);
  box-shadow: 0 0 0 3px rgba(36, 52, 111, 0.18);
}

#mkdocs-decrypt-form button {
  margin-top: 0.8rem;
  padding: 0.55rem 1.2rem;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--hub-navy);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

#mkdocs-decrypt-form button:hover {
  background: var(--hub-navy-soft);
}

#mkdocs-decrypt-msg:not(:empty) {
  margin-top: 0.7rem !important;
  color: var(--hub-red) !important;
  font-weight: 500;
}

/* ---------- Pied de page ---------- */
.md-footer-meta {
  font-size: 0.66rem;
}

/* ---------- Accessibilité ---------- */
:focus-visible {
  outline: 2px solid var(--hub-red);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- Mobile ---------- */
@media screen and (max-width: 76.1875em) {
  .md-nav--primary .md-nav__title {
    background-color: var(--hub-navy-deep);
    color: #ffffff;
  }

  .md-sidebar--primary .md-nav__link--active::before {
    display: none;
  }
}
