/* ============================================================
   Base — reset minimal + surcharges Pico
   Styles sur éléments HTML natifs, sans classes.
   ============================================================ */

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

html {
    font-size: var(--font-size);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

/* Ancre de section (champ « Ancre » du builder, lien de menu #ancre) : la cible
   s'arrête sous l'en-tête fixe au lieu de passer dessous. */
.section-anchor {
    scroll-margin-top: var(--anchor-offset, 5rem);
}

body {
    overflow-x: clip; /* un élément pleine largeur (100vw, ex. .page-banner) ne crée pas de défilement horizontal */
    font-family: var(--font-base);
    color: var(--text);
    background: var(--bg);
    line-height: var(--line-height);
    min-height: 100vh;
}

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

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

a:hover {
    color: var(--primary-dark);
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.25;
    font-weight: 700;
    color: var(--text);
}

p {
    margin-bottom: var(--space-md);
}

p:last-child {
    margin-bottom: 0;
}

ul, ol {
    padding-left: var(--space-lg);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

th {
    text-align: left;
    padding: .625rem var(--space-md);
    font-weight: 600;
    background: var(--bg-alt);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

td {
    padding: .625rem var(--space-md);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--bg-alt);
}

label {
    display: block;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: .4rem;
    color: var(--text);
}

input[type=text],
input[type=email],
input[type=password],
input[type=url],
input[type=number],
input[type=search],
input[type=tel],
input[type=datetime-local],
select,
textarea {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .875rem;
    font-family: var(--font-base);
    color: var(--text);
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

input[type=checkbox],
input[type=radio] {
    width: auto;
    accent-color: var(--primary);
}

button {
    cursor: pointer;
    font-family: var(--font-base);
    /* Sans ce reset, le navigateur garde son propre chrome natif (fond +
       bordure en relief, clair en haut/gauche, sombre en bas/droite) par-
       dessus les styles .btn/.icon-btn-carre/etc., visible surtout sur les
       fonds pleins et saturés (ex. .icon-btn-carre--bleu). */
    border: none;
    background: none;
    appearance: none;
    -webkit-appearance: none;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: var(--space-lg) 0;
}

/* ── Wikilinks résolus ────────────────────────────────────── */
a.wikilink {
    color: var(--primary);
    text-decoration: underline dotted;
}

a.wikilink:hover {
    text-decoration: underline;
}

.wikilink-badge {
    font-size: .75em;
    color: var(--text-muted);
    margin-left: .2em;
}

code, pre {
    font-family: var(--font-mono);
    font-size: .875em;
    background: var(--bg-alt);
    border-radius: var(--radius);
}

code {
    padding: .15em .4em;
}

pre {
    padding: var(--space-md);
    overflow-x: auto;
}
