:root {
    --bg: #F7F4EF;
    --surface: #FFFDF7;
    --surface-muted: #DFE8DC;
    --surface-elevated: rgba(255, 253, 247, .94);
    --text: #1B1D18;
    --muted: #5F665D;
    --line: #DFD4C3;
    --brand: #245A3B;
    --brand-strong: #183923;
    --brand-soft: #DFE8DC;
    --accent: #C86138;
    --accent-strong: #A64F31;
    --accent-soft: #FFF8EC;
    --cream: #FFF8EC;
    --primary: #245A3B;
    --primary-strong: #183923;
    --danger: #A64F31;
    --focus: #245A3B;
    /* Alias de l'echelle commune (css/ui/tokens.css). */
    --shadow-soft: var(--ui-shadow-sm);
    --radius: var(--ui-radius-sm);
    --tap-size: 44px;
    /* LA REGLE DU GRAND ECRAN, DECLAREE ICI ET NULLE PART AILLEURS (10/11/2026).
     *
     * Julien, capture de /road-book/ a ~2000 points : « partout ou je passe en
     * mode grand ecran bureau je n'ai pas d'optimisation en RWD ». Le releve
     * (cibles/grand-ecran-20261110/) montrait deux cadres : l'en-tete et le pied
     * a 1 680 points, les pages d'information, les fiches et les vitrines a
     * 1 120. A 1 920, le logo tombait 280 points a gauche du contenu, et a
     * 2 560 le contenu flottait entre deux vides de 720.
     *
     * UN SEUL CADRE, `--page-max` : en-tete, contenu et pied s'y alignent. Les
     * pages en profitent par des COLONNES (grilles, panneaux colles), jamais en
     * etirant une ligne de texte : `--lecture-max` borne le texte courant.
     * Paliers, en min-width seulement : 720, 1024, 1280, 1440, 1920.
     * L'espace compte et le road book lisent ces jetons (avec repli). */
    --page-max: 1440px;
    --page-gutter: max(clamp(14px, 2vw, 32px), env(safe-area-inset-left), env(safe-area-inset-right));
    --lecture-max: 68ch;
    --grille-colonnes: 12;
    --grille-ecart: clamp(16px, 2vw, 32px);
    /* La hauteur de l'en-tete colle au bureau : le haut des colonnes collees. */
    --site-header-hauteur: 72px;

    --space-1: .25rem;
    --space-2: .5rem;
    --space-3: .75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Pas de mot orphelin en fin de paragraphe (ignore sans support). */
p,
li,
dd {
    text-wrap: pretty;
}

::selection {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

img,
svg,
video,
canvas {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
}

a {
    color: var(--primary);
    text-decoration: none;
    overflow-wrap: anywhere;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

h1,
h2,
h3,
p,
dl {
    margin-block-start: 0;
}

/* Les titres prennent la police de marque (24/10/2026), a la specificite
   d'un element : un composant qui a choisi sa police la garde. h3 et moins
   restent en pile systeme — Fraunces est une police d'affichage. */
h1,
h2 {
    font-family: var(--ui-font-display);
    font-weight: var(--ui-titre-graisse);
    letter-spacing: var(--ui-titre-approche);
    text-wrap: balance;
}

h3 {
    text-wrap: balance;
}

h1 {
    font-size: clamp(1.6rem, 5vw, 2.25rem);
    line-height: var(--ui-titre-interligne);
}

h2 {
    font-size: clamp(1.15rem, 4vw, 1.4rem);
    line-height: 1.25;
}

.page-shell,
.messages {
    width: min(var(--page-max), calc(100% - (var(--page-gutter) * 2)));
    margin-inline: auto;
}

/* Plus de hauteur minimale (24/10) : elle etirait les pages courtes et
   laissait du creme entre le contenu et le pied. C'est le pied qui remplit
   desormais le bas de l'ecran (components/site-footer.css). */
.page-shell {
    margin-block: clamp(16px, 4vw, 32px);
}

.brand {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: var(--tap-size);
    color: var(--accent-strong);
    font-weight: 700;
    letter-spacing: 0;
}

.brand:hover {
    text-decoration: none;
}

.heop-logo {
    display: block;
    width: clamp(116px, 24vw, 150px);
    height: auto;
}

.main-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.nav-form,
.main-nav form {
    display: contents;
}

.nav-menu,
.nav-link {
    flex: 0 0 auto;
}

.nav-menu {
    position: relative;
    display: inline-flex;
}

.nav-summary,
.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tap-size);
    max-width: 100%;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    color: color-mix(in srgb, var(--text) 88%, var(--brand));
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--ui-motion-response) var(--ui-motion-ease),
                border-color var(--ui-motion-response) var(--ui-motion-ease),
                color var(--ui-motion-response) var(--ui-motion-ease);
}

.nav-summary {
    gap: 8px;
    padding: 0 12px;
    list-style: none;
}

.nav-summary::-webkit-details-marker {
    display: none;
}

.nav-summary::after {
    content: "";
    width: 0;
    height: 0;
    border-inline: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform 160ms ease;
}

.nav-menu[open] .nav-summary::after {
    transform: rotate(180deg);
}

.nav-link {
    padding: 0 12px;
}

.nav-link:hover,
.nav-summary:hover,
.nav-link.is-active,
.nav-summary.is-active {
    border-color: var(--line);
    background: var(--surface);
    color: var(--brand-strong);
    text-decoration: none;
}

.nav-link-primary {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--surface);
    box-shadow: var(--ui-shadow-sm);
}

.nav-link-primary:hover {
    border-color: var(--accent-strong);
    background: var(--accent-strong);
    color: var(--surface);
}

.nav-submenu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 60;
    display: grid;
    gap: 4px;
    min-width: min(220px, calc(100vw - 32px));
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--ui-shadow-md);
}

.nav-link-sub {
    justify-content: flex-start;
    width: 100%;
}

.container {
    width: min(var(--page-max), 100%);
    margin-inline: auto;
}

/* LE SEUL NOM DU PROJET pour « lu par les lecteurs d'écran, invisible à
   l'œil ». La coquille intranet remplace cette feuille par
   `apps/backoffice/css/intranet-shell.css` : la même règle y est déclarée, à
   l'identique, et `apps/core/test_contrat_classes_utilitaires.py` vérifie que
   les deux coquilles masquent PAREIL. Écrire `sr-only` ici — le réflexe
   Bootstrap/Tailwind — ne masquait rien : le texte s'affichait en clair et
   faisait déborder la page au pouce. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Une table ne se reduit pas a 1 px et ignore `overflow` : celle du graphique
   de ventes (642 px) faisait defiler /users/compte/ et /pro/ en largeur. */
table.visually-hidden {
    display: block;
}

@media (min-width: 720px) {
    .main-nav {
        justify-content: flex-end;
    }

    .nav-submenu {
        right: 0;
        left: auto;
    }
}

@media (orientation: landscape) and (max-height: 520px) {
    .page-shell {
        margin-block: 12px;
    }
}


@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto;
        transition-duration: .01ms;
        animation-duration: .01ms;
        animation-iteration-count: 1;
    }
}

/* ---- Logos de marque -------------------------------------------------- */
/* Ces traces portent leurs propres couleurs et ne suivent pas currentColor,
   contrairement aux pictogrammes de components/ui/icon.html. Regle placee ici
   car base.css est charge aussi bien par le site que par les apercus vitrine. */
.brand-mark {
    display: inline-flex;
    width: 19px;
    height: 19px;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.brand-mark svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* --- LE LIEN D'EVITEMENT ------------------------------------------------
 *
 * Il n'existait sur aucune page. Sans lui, un visiteur au clavier traverse
 * l'en-tete entier a chaque page avant d'atteindre le contenu.
 *
 * Il est SORTI DU CADRE, pas masque. `display: none` ou `visibility: hidden`
 * le retireraient de l'ordre de tabulation — c'est-a-dire de la seule chose
 * qu'il sert. Un decalage suffit : invisible tant qu'on ne le vise pas,
 * present des qu'on tabule.
 */
.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 200;
    /* Hors cadre vers le haut. La transition ramene le lien en douceur : il ne
       surgit pas, il arrive. */
    translate: 0 calc(-100% - 16px);
    padding: 12px 18px;
    border-radius: var(--ui-radius-sm, 8px);
    background: var(--ui-color-brand, #245A3B);
    color: var(--ui-color-cream, #FFF8EC);
    font-weight: 600;
    text-decoration: none;
    transition: translate 180ms var(--ui-motion-ease, ease);
}

/* L'ombre seulement dans le cadre : au repos, son flou debordait sous le lien
   cache et tachait de gris le haut gauche de chaque page. */
.skip-link:focus-visible {
    box-shadow: var(--ui-shadow-md);
    translate: 0 0;
    outline: 2px solid var(--ui-color-cream, #FFF8EC);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .skip-link { transition: none; }
}
