/*
 * public/v2/css/chrome.css — l'en-tête et le pied de page uniques (views/v2/partials/header.ejs et footer.ejs)
 * affichés aussi sur les pages v1 (views/partials/navbar.ejs et footer.ejs les appellent).
 * Contient seulement ce que base.css apporte à ces deux blocs, sans les règles globales (titres, liens, corps de page)
 * qui changeraient la mise en forme des pages v1. Couleurs : uniquement les jetons de tokens.css.
 */
.v2-header, .v2-header *, .v2-footer, .v2-footer *, .v2-footer::before { box-sizing: border-box; }
.v2-container { width: 100%; max-width: var(--size-content); margin-inline: auto; padding-inline: var(--space-4); }
.v2-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.v2-skip-link { position: absolute; left: var(--space-2); top: -100px; z-index: 1000; background: var(--color-surface); color: var(--color-text); padding: var(--space-3); }
.v2-skip-link:focus { top: var(--space-2); }
.v2-header :focus-visible, .v2-footer :focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; border-radius: var(--radius-sm); }
/* Les pages v1 réservaient 64 px pour l'ancien menu fixe : l'en-tête v2 est dans le flux, plus de bande vide. */
body:has(> .v2-header), body:has(.v2-header) { padding-top: 0; }
.v2-header, .v2-footer { font-family: var(--font-family); font-size: var(--font-size-base); line-height: var(--font-line-height); color: var(--color-text); text-align: left; }
/* :where() = spécificité nulle : ces remises à zéro ne passent jamais devant les classes de components.css */
:where(.v2-header, .v2-footer) :where(h2, p, ul) { margin: 0; }
:where(.v2-header, .v2-footer) ul { list-style: none; padding: 0; }
:where(.v2-header, .v2-footer) a { text-underline-offset: 0.15em; }




/* ── Navigation officielle UDCShare : bleu nuit (référence visuelle du tableau de bord) ──
   Portée volontairement limitée à l'en-tête et à la barre de navigation.
   Le contenu des pages conserve son thème propre ; l'administration garde son chrome indépendant. */
.v2-header {
  --color-bg: #162141;
  --color-surface: #162141;
  --color-surface-2: #1D2B50;
  --color-border: #30416D;
  --color-border-strong: #4B8DF8;
  --color-text: #EEF3FF;
  --color-text-muted: #9BB0D8;
  --color-brand: #4B8DF8;
  --color-brand-strong: #4B8DF8;
  --color-brand-soft: rgba(75, 141, 248, .16);
  --color-on-brand: #FFFFFF;
  --color-link: #8BB5FF;
  --color-focus: #8BB5FF;
  background: #162141;
  color: #EEF3FF;
  border-bottom-color: #30416D;
}
.v2-header .v2-header__brand .udc-logo-mark,
.v2-header .v2-header__brand .udc-logo-name em {
  color: #FF2D73;
}
.v2-header .v2-header__toggle,
.v2-header .v2-touch-desktop-menu-toggle {
  color: #EEF3FF;
  border-color: #30416D;
  background: #1D2B50;
}
.v2-header .v2-header__menu {
  --color-bg: #162141;
  --color-surface: #162141;
  --color-surface-2: #1D2B50;
  --color-border: #30416D;
  --color-border-strong: #4B8DF8;
  --color-text: #EEF3FF;
  --color-text-muted: #9BB0D8;
  --color-brand: #4B8DF8;
  --color-brand-strong: #4B8DF8;
  --color-brand-soft: rgba(75, 141, 248, .16);
  --color-on-brand: #FFFFFF;
  --color-link: #8BB5FF;
  --color-focus: #8BB5FF;
  color: #EEF3FF;
  background: #162141;
  border-color: #30416D;
}
.v2-header .v2-header__menu-group {
  background: #1D2B50;
  border-color: #30416D;
}
.v2-header .v2-header__menu a { color: #EEF3FF; }
.v2-header .v2-header__menu a svg {
  color: #8BB5FF;
  background: rgba(75, 141, 248, .16);
}
.v2-header .v2-header__menu a[aria-current="page"] {
  color: #FFFFFF;
  background: rgba(75, 141, 248, .22);
}
.v2-header .v2-header__menu a[aria-current="page"] svg {
  color: #FFFFFF;
  background: #376FC8;
}
.v2-header .v2-header__menu-title { color: #9BB0D8; }
.v2-header .v2-header__menu .v2-header__account {
  background: #162141;
  border-top-color: #30416D;
}
.v2-header .v2-header__menu a.v2-header__logout {
  color: #FF9A9A;
  border-color: #FF7777;
}
.v2-header .v2-header__toggle[aria-expanded="true"] {
  color: #8BB5FF;
  border-color: #4B8DF8;
  background: rgba(75, 141, 248, .16);
}
.v2-header .udc-theme-toggle,
.v2-header .v2-topbar__m,
.v2-header .v2-account__btn {
  color: #EEF3FF;
}
body:has(.v2-header) .udc-app-nav {
  --color-surface: #162141;
  --color-border: #30416D;
  --color-text-muted: #9BB0D8;
  --color-brand-strong: #8BB5FF;
  --color-brand-soft: rgba(75, 141, 248, .22);
  --color-focus: #8BB5FF;
}
body:has(.v2-header) .udc-app-nav {
  background: rgba(22, 33, 65, .96);
  border-color: #30416D;
}
body:has(.v2-header) .udc-app-nav a { color: #9BB0D8; }
body:has(.v2-header) .udc-app-nav a[aria-current="page"] {
  color: #FFFFFF;
  background: rgba(75, 141, 248, .22);
}


/* Correctif global et persistant du chrome de navigation — toutes les pages non-admin.
   Ces règles restent prioritaires sur le thème clair/sombre du contenu et les anciennes feuilles v1.
   La navigation officielle est toujours bleu nuit, quelle que soit la page ou le thème choisi. */
html body:has(.v2-header) header.v2-header {
  --color-bg: #162141 !important;
  --color-surface: #162141 !important;
  --color-surface-2: #1D2B50 !important;
  --color-border: #30416D !important;
  --color-border-strong: #4B8DF8 !important;
  --color-text: #EEF3FF !important;
  --color-text-muted: #9BB0D8 !important;
  --color-brand: #4B8DF8 !important;
  --color-brand-strong: #4B8DF8 !important;
  --color-brand-soft: rgba(75, 141, 248, .16) !important;
  --color-on-brand: #FFFFFF !important;
  --color-link: #8BB5FF !important;
  --color-focus: #8BB5FF !important;
  color: #EEF3FF !important;
  background: #162141 !important;
  border-color: #30416D !important;
}
html body:has(.v2-header) header.v2-header .v2-header__menu,
html body:has(.v2-header) header.v2-header .v2-header__more-list,
html body:has(.v2-header) header.v2-header .v2-account__menu {
  color: #EEF3FF !important;
  background: #162141 !important;
  border-color: #30416D !important;
}
html body:has(.v2-header) header.v2-header .v2-header__menu-group {
  color: #EEF3FF !important;
  background: #1D2B50 !important;
  border-color: #30416D !important;
}
html body:has(.v2-header) header.v2-header .v2-header__menu-title,
html body:has(.v2-header) header.v2-header .v2-header__menu a svg {
  color: #9BB0D8 !important;
}
html body:has(.v2-header) header.v2-header .v2-header__menu a {
  color: #EEF3FF !important;
}
html body:has(.v2-header) header.v2-header .v2-header__menu a[aria-current="page"] {
  color: #FFFFFF !important;
  background: rgba(75, 141, 248, .22) !important;
}
html body:has(.v2-header) header.v2-header .v2-header__toggle,
html body:has(.v2-header) header.v2-header .v2-touch-desktop-menu-toggle,
html body:has(.v2-header) header.v2-header .v2-topbar__m,
html body:has(.v2-header) header.v2-header .v2-account__btn {
  color: #EEF3FF !important;
  border-color: #30416D !important;
}
html body:has(.v2-header) .udc-app-nav {
  --color-surface: #162141;
  --color-border: #30416D;
  --color-text-muted: #9BB0D8;
  --color-brand-strong: #8BB5FF;
  --color-brand-soft: rgba(75, 141, 248, .22);
  --color-focus: #8BB5FF;
  color: #EEF3FF;
  background: rgba(22, 33, 65, .97) !important;
  border-color: #30416D !important;
}
html body:has(.v2-header) .udc-app-nav a { color: #9BB0D8 !important; }
html body:has(.v2-header) .udc-app-nav a[aria-current="page"] {
  color: #FFFFFF !important;
  background: rgba(75, 141, 248, .22) !important;
}


/* Barre canonique commune : mêmes règles et même version CSS sur l'accueil,
   les pages v2 (dont /dropzones) et les pages éditoriales v1 (dont /aide).
   Mobile : logo à gauche ; avatar du compte puis menu à droite.
   Desktop : logo à gauche, navigation centrée, actions/avatar à droite. */
html body:has(header.v2-header) header.v2-header .v2-header__bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: var(--space-3, 12px) !important;
  width: 100% !important;
  max-width: var(--size-content, 72rem) !important;
  min-height: var(--size-header, 56px) !important;
  margin-inline: auto !important;
  padding-inline: var(--space-4, 16px) !important;
}
html body:has(header.v2-header) header.v2-header .v2-header__brand {
  order: 0 !important;
  display: inline-flex !important;
  flex: 0 0 auto !important;
  margin-inline: 0 auto !important;
  visibility: visible !important;
}
html body:has(header.v2-header) header.v2-header .v2-header__nav {
  order: 1 !important;
  flex: 0 1 auto !important;
  align-items: center !important;
  justify-content: center !important;
  margin-inline: auto !important;
}
html body:has(header.v2-header) header.v2-header .v2-header__toggle {
  order: 2 !important;
  flex: 0 0 44px !important;
  margin: 0 !important;
}
html body:has(header.v2-header) header.v2-header .v2-header__account-shortcut {
  order: 3 !important;
  display: inline-flex !important;
  flex: 0 0 42px !important;
  width: 42px !important;
  height: 42px !important;
  margin: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
}
html body:has(header.v2-header) header.v2-header .v2-header__actions,
html body:has(header.v2-header) header.v2-header .v2-header__cta-mobile,
html body:has(header.v2-header) header.v2-header .v2-topbar__actions {
  order: 3 !important;
  flex: 0 0 auto !important;
  margin-inline-start: 0 !important;
}
@media (max-width: 1279px) {
  html body:has(header.v2-header) header.v2-header .v2-header__nav {
    display: none !important;
  }
  html body:has(header.v2-header) header.v2-header .v2-header__brand {
    margin-inline-end: auto !important;
  }
  html body:has(header.v2-header) header.v2-header .v2-header__toggle {
    display: inline-flex !important;
    order: 1 !important;
    flex: 0 0 42px !important;
    margin-inline-start: 0 !important;
  }
  html body:has(header.v2-header) header.v2-header .v2-header__account-shortcut {
    order: 2 !important;
    flex: 0 0 42px !important;
    width: 42px !important;
    height: 42px !important;
    margin-inline-start: 0 !important;
  }
}
@media (min-width: 1280px) {
  html body:has(header.v2-header) header.v2-header .v2-header__toggle {
    display: none !important;
  }
  html body:has(header.v2-header) header.v2-header .v2-header__nav {
    display: flex !important;
  }
}
