/* Reset et typographie */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--cream);
    color: var(--navy);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

p,
h1,
h2,
h3,
h4 {
    overflow-wrap: break-word;
}

h1,
h2,
h3,
h4 {
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
}

h2 {
    font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
}

h3 {
    font-size: 1.125rem;
}

a {
    color: var(--blue);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

a:hover {
    text-decoration-color: var(--yellow);
}

b,
strong {
    font-weight: 700;
}

small,
.small {
    font-size: 0.8125rem;
}

.muted {
    color: var(--muted);
}

:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px var(--navy);
    border-radius: 6px;
}

::selection {
    background: var(--yellow);
    color: var(--navy);
}

.icon {
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0;
    vertical-align: -0.2em;
    display: inline-block;
}

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

/* rythme vertical : chaque enfant direct espacé */
.stack > * + * {
    margin-top: var(--stack-gap, 1rem);
}

.stack--lg {
    --stack-gap: 2.5rem;
}

.stack--md {
    --stack-gap: 1.5rem;
}

.stack--sm {
    --stack-gap: 0.5rem;
}

.cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--cluster-gap, 0.5rem);
}

.cluster--nowrap {
    flex-wrap: nowrap;
}

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

/* --- mode discret, décidé dans le navigateur (docs/spec/hors-ligne.md) -------------------------------------
   Le serveur rend toujours tout ; `html.discret` (posé par le serveur puis par le script du <head>) masque ce qui est
   marqué data-discret="masque" et montre la version de remplacement data-discret="remplace". */
.discret [data-discret="masque"] {
    display: none !important;
}

html:not(.discret) [data-discret="remplace"] {
    display: none !important;
}

/* un souhait acheté redevient visuellement « non acheté » */
.discret .wish--bought {
    background: var(--paper);
}

.discret .btn--discret {
    --btn-bg: var(--blue);
    --btn-fg: var(--paper);
}
