/* ============================================================================
   Clinique Nōv — base
   Remise à zéro douce, typographie, accessibilité, mouvement.
   ============================================================================ */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--nov-gallery);
    color: var(--nov-ink);
    font-family: var(--font-sans);
    font-size: var(--text-body);
    line-height: var(--leading-body);
    font-feature-settings: "kern", "liga", "calt";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

main { flex: 1 0 auto; }

/* Titres : Didone, bleu Nōv, interlignage serré */
h1, h2, h3, h4, .serif {
    font-family: var(--font-serif);
    font-weight: 400;
    color: var(--nov-blue);
    margin: 0 0 var(--space-4);
    letter-spacing: -0.01em;
    text-wrap: balance;
}
h1 { font-size: var(--text-h1); line-height: var(--leading-tight); }
h2 { font-size: var(--text-h2); line-height: var(--leading-title); }
h3 { font-size: var(--text-h3); line-height: var(--leading-title); }
h4 { font-size: var(--text-lead); line-height: var(--leading-title); }

p, ul, ol, dl, figure, blockquote { margin: 0 0 var(--space-4); }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }

em, blockquote { font-family: var(--font-serif); font-style: italic; }
strong { font-weight: 600; }
small { font-size: var(--text-ui); }

a {
    color: var(--nov-blue);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--nov-navy); }

img, video, svg { max-width: 100%; height: auto; display: block; }
img { font-style: italic; color: var(--nov-muted); }   /* texte alternatif visible si l'image manque */

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

hr {
    border: 0;
    border-top: var(--line);
    margin: var(--space-6) 0;
}

/* Focus visible au clavier : anneau bleu net, jamais supprimé */
:focus-visible {
    outline: 2px solid var(--nov-blue);
    outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--nov-blue); color: var(--nov-white); }

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

.skip-link {
    position: absolute;
    top: var(--space-3); left: var(--space-3);
    z-index: 1000;
    padding: var(--space-3) var(--space-4);
    background: var(--nov-blue);
    color: var(--nov-white);
    text-decoration: none;
    transform: translateY(-200%);
}
.skip-link:focus { transform: none; outline-color: var(--nov-red); }

/* Transitions « cimaises » entre les pages : un panneau blanc coulisse.
   Amélioration progressive : les navigateurs sans @view-transition naviguent normalement. */
@view-transition { navigation: auto; }

::view-transition-old(root) {
    animation: nov-fade-out var(--dur) var(--ease) both;
}
::view-transition-new(root) {
    animation: nov-cimaise-in var(--dur-slow) var(--ease) both;
}
@keyframes nov-fade-out {
    to { opacity: 0.4; }
}
@keyframes nov-cimaise-in {
    from { clip-path: inset(0 0 0 100%); }
    to   { clip-path: inset(0 0 0 0); }
}

/* Moins d'animations : tout est coupé, y compris les transitions de page */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    @view-transition { navigation: none; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Interrupteur « Réduire les animations » du site (widget 32) : mêmes effets que le réglage système */
html.reduce-motion { scroll-behavior: auto; }
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}
