: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;
    --shadow-soft: 0 12px 32px rgba(27, 29, 24, .08);
    --radius: 8px;
    --tap-size: 44px;
    --page-max: 1680px;
    --page-gutter: max(clamp(14px, 2vw, 32px), env(safe-area-inset-left), env(safe-area-inset-right));
    --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;
}

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: 3px solid var(--focus);
    outline-offset: 2px;
}

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

h1 {
    font-size: clamp(1.6rem, 5vw, 2.25rem);
    line-height: 1.15;
}

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;
}

.page-shell {
    min-height: calc(100svh - 76px);
    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: color-mix(in srgb, var(--text) 88%, var(--brand));
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
}

.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: #FFFDF7;
    box-shadow: 0 8px 18px rgba(200, 97, 56, .18);
}

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

.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: 0 8px 0 rgba(223, 212, 195, .72);
}

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

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

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@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;
    box-shadow: var(--ui-shadow-md, 0 16px 42px rgba(27, 29, 24, .11));
    transition: translate 180ms var(--ui-motion-ease, ease);
}

.skip-link:focus-visible {
    translate: 0 0;
    outline: 2px solid var(--ui-color-cream, #FFF8EC);
    outline-offset: 2px;
}

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