/* Publiciel — habillage des pages publiques : direction « bandeau sombre »
   (canevas de maquettes de la carte 592, direction C retenue par Maxence).
   En-tête bleu nuit portant titre, version et téléchargement ; corps clair ;
   accent ambre ; tableaux zébrés. Police Archivo auto-hébergée (pas d'appel
   à un service tiers depuis une page client). */

@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/fonts/archivo-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/fonts/archivo-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --band: #101826;
    --band-line: #26324a;
    --band-soft: #9aa6ba;
    --band-link: #c7d0de;
    --band-footer-ink: #7d8aa1;
    --paper: #fbfaf8;
    --ink: #23282f;
    --ink-soft: #6d7684;
    --accent: #f59e0b;
    --accent-ink: #1a1205;
    --link: #b45309;
    --link-hover: #8a3e06;
    --zebra: #f5f2ec;
    --line: #e3dccf;
    --code-background: #14213a;
    --code-ink: #dbe4f2;
    --inline-code-background: #f1ede6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Archivo", "Segoe UI", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--link);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--link-hover);
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

/* En-tête : bandeau bleu nuit, marque ou logo d'intermédiaire, puis héros de page. */

.site-header {
    background: var(--band);
    color: #ffffff;
}

.band-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 22px 24px 20px;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--band-line);
    padding-bottom: 16px;
}

.brand-name {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.brand-tick {
    width: 28px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.brand-chip {
    display: inline-flex;
    background: #ffffff;
    border-radius: 8px;
    padding: 6px 14px;
}

.brand-logo {
    height: 32px;
    display: block;
}

/* Héros : titre, méta et téléchargement dans le bandeau. */

.hero {
    padding: 30px 0 24px;
}

.hero-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 32px;
}

.hero h1 {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.08;
    margin: 0;
}

.hero h1 .version {
    color: var(--accent);
    font-weight: 700;
}

.hero .meta {
    margin: 10px 0 0;
    font-size: 17px;
    color: var(--band-soft);
}

.hero-muted {
    color: var(--band-soft);
}

.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.download-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--accent);
    color: var(--accent-ink);
    border-radius: 6px;
    padding: 14px 26px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.download-button:hover {
    background: #dd8e08;
    color: var(--accent-ink);
}

.download-button svg {
    flex-shrink: 0;
}

.hero-file {
    font-size: 14px;
    color: var(--band-link);
    overflow-wrap: anywhere;
    text-align: right;
}

.hero-file:hover {
    color: #ffffff;
}

/* Corps de page. */

.site-main {
    flex: 1;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
}

h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 14px;
}

/* Notes de version : rendu Markdown assaini (Markdig). */

.notes h1,
.notes h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--link);
    margin: 26px 0 10px;
}

.notes h1:first-child,
.notes h2:first-child {
    margin-top: 0;
}

.notes h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 22px 0 8px;
}

.notes p {
    margin: 0 0 12px;
}

.notes ul,
.notes ol {
    margin: 0 0 14px;
    padding-left: 24px;
}

.notes li {
    margin: 4px 0;
}

.notes code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.88em;
    background: var(--inline-code-background);
    border: 1px solid var(--line);
    padding: 1px 6px;
    border-radius: 4px;
}

.notes pre {
    background: var(--code-background);
    color: var(--code-ink);
    border-radius: 6px;
    padding: 14px 18px;
    overflow-x: auto;
    margin: 0 0 14px;
}

.notes pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    color: inherit;
}

.notes blockquote {
    margin: 0 0 14px;
    padding: 4px 18px;
    border-left: 3px solid var(--accent);
    color: var(--ink-soft);
}

.notes table {
    border-collapse: collapse;
    margin: 0 0 14px;
}

.notes th,
.notes td {
    border: 1px solid var(--line);
    padding: 6px 12px;
}

/* Fichiers restants listés hors héros (page sans héros, cas rare). */

.files ul {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.files li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.file-size {
    color: var(--ink-soft);
    font-size: 14px;
    white-space: nowrap;
}

/* Historique : tableau zébré, défilant dans son conteneur, jamais la page. */

.history {
    margin-top: 46px;
}

.history-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.table-scroll {
    overflow-x: auto;
}

.history table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.history th {
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    padding: 10px 14px;
    border-bottom: 2px solid var(--band);
}

.history td {
    text-align: left;
    padding: 13px 14px;
}

.history tbody tr:nth-child(odd) {
    background: var(--zebra);
}

.history .date-cell {
    color: var(--ink-soft);
}

/* Page introuvable : 404 neutre, centré. */

.not-found {
    text-align: center;
    padding: 60px 0;
}

.not-found .code {
    font-size: 64px;
    font-weight: 700;
    color: #d5d0c6;
    letter-spacing: 0.04em;
    line-height: 1;
}

.not-found h1 {
    margin: 16px 0 0;
}

.not-found p {
    color: var(--ink-soft);
}

/* Pied de page : rappel discret de la marque neutre. */

.site-footer {
    background: var(--band);
    color: var(--band-footer-ink);
    padding: 15px 24px;
    text-align: center;
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* Téléphone : le héros s'empile, le bouton s'étire, les marges se resserrent. */

@media (max-width: 640px) {
    .band-inner {
        padding: 18px 18px 16px;
    }

    .hero {
        padding: 22px 0 8px;
    }

    .hero-row {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }

    .hero h1 {
        font-size: 31px;
    }

    .hero .meta {
        font-size: 14px;
    }

    .hero-actions {
        align-items: stretch;
    }

    .download-button {
        justify-content: center;
        white-space: normal;
    }

    .hero-file {
        text-align: center;
    }

    .site-main {
        padding: 30px 18px 44px;
    }

    .history th,
    .history td {
        padding: 10px 8px;
    }
}
