/* bonjourliha.fr : pages de contenu (IA et RGPD en mairie, acheter sans appel d'offres,
   prix, fiche sécurité). Complète /site/styles.css (design system LIHA) sans le modifier.
   Aucun style en ligne : la CSP du site (style-src 'self') les bloque. */

/* ---------- Tête de page : fil de retour, titre, réponse courte ---------- */

.article-tete {
    padding: 32px 0 48px;
    background:
        radial-gradient(ellipse 60% 70% at 0% 0%, var(--peche-pale) 0%, rgba(255, 214, 194, 0) 70%),
        radial-gradient(ellipse 50% 70% at 100% 100%, var(--lavande) 0%, rgba(207, 202, 255, 0) 70%),
        var(--brume);
}

.article-in {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 var(--marge);
}

.article-tete h1 {
    font-size: clamp(32px, 4.4vw, 48px);
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.reponse {
    margin-top: 28px;
    padding: 24px 26px;
    border-radius: var(--rayon);
    border: 1px solid var(--trait);
    border-left: 5px solid var(--signal);
    background: var(--blanc);
    box-shadow: 0 24px 48px -36px rgba(18, 20, 43, 0.4);
}

/* Plus précis que « .reponse p » ci-dessous, pour garder la petite taille et le violet. */
.reponse .reponse-titre {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--signal);
}

.reponse p {
    font-size: 19px;
    line-height: 1.55;
    color: var(--encre);
}

.reponse p + p {
    margin-top: 10px;
}

/* ---------- Corps de l'article ---------- */

.article-corps {
    padding: 48px 0 72px;
}

.sommaire {
    padding: 20px 22px;
    border-radius: var(--rayon);
    border: 1px solid var(--trait);
}

.sommaire p {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--discret);
}

.sommaire ol {
    margin: 10px 0 0;
    padding-left: 22px;
    font-size: 16.5px;
    line-height: 1.5;
}

.sommaire li + li {
    margin-top: 4px;
}

.article-corps h2 {
    margin: 56px 0 0;
    font-size: clamp(26px, 3vw, 32px);
    letter-spacing: -0.025em;
    line-height: 1.15;
    scroll-margin-top: 96px;
}

.article-corps h3 {
    margin: 32px 0 0;
    font-size: 21px;
    letter-spacing: -0.015em;
    line-height: 1.25;
}

.article-corps p {
    margin-top: 14px;
}

.article-corps h2 + p,
.article-corps h3 + p {
    margin-top: 12px;
}

.puces {
    margin-top: 14px;
    padding-left: 22px;
    list-style: disc;
}

.puces li + li {
    margin-top: 8px;
}

.puces li::marker {
    color: var(--signal);
}

/* Étapes numérotées : reprend la pastille .etape de la page « Créer un compte ». */
.etapes {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.etapes li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.etapes .etape {
    margin-top: 1px;
}

/* Encadrés */
.encadre {
    margin-top: 24px;
    padding: 18px 20px;
    border-radius: 12px;
    background: var(--brume);
    font-size: 16.5px;
    line-height: 1.5;
}

.encadre p:first-child {
    margin-top: 0;
}

.encadre-prudence {
    background: #FFF4EF;
    border: 1px solid var(--peche-pale);
}

.encadre-titre {
    font-weight: 600;
    color: var(--encre);
}

/* « 1er » : l'exposant ne doit pas écarter les lignes. */
.article sup {
    font-size: 0.65em;
    line-height: 0;
}

/* Les tableaux du site, dans la colonne de lecture */
.article-corps .tableau-cadre {
    margin-top: 24px;
}

.tableau-moitie tbody th {
    width: 46%;
}

.tableau-chiffres td {
    white-space: nowrap;
}

.tableau-chiffres td.texte {
    white-space: normal;
}

.tableau caption.legende {
    caption-side: bottom;
    padding: 10px 20px 14px;
    text-align: left;
    font-size: 14px;
    line-height: 1.45;
    color: var(--discret);
}

/* Fiche sécurité : une ligne par sujet */
.fiche-dsi {
    margin-top: 20px;
    border-top: 1px solid var(--trait);
}

.fiche-dsi > div {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 2fr);
    gap: 8px 24px;
    padding: 18px 0;
    border-bottom: 1px solid var(--trait);
}

.fiche-dsi dt {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-weight: 600;
    color: var(--encre);
}

.fiche-dsi dt .ico {
    margin-top: 2px;
    color: var(--signal);
}

.fiche-dsi dd {
    font-size: 16.5px;
    line-height: 1.5;
}

.fiche-dsi dd > p:first-child {
    margin-top: 0;
}

.fiche-dsi dd p + p {
    margin-top: 8px;
}

/* Sources officielles et signature */
.liste-sources {
    margin: 16px 0 0;
    padding-left: 22px;
    font-size: 15.5px;
    line-height: 1.5;
}

.liste-sources li + li {
    margin-top: 8px;
}

.liste-sources a {
    overflow-wrap: anywhere;
}

.signature {
    margin-top: 36px;
    padding-top: 16px;
    border-top: 1px solid var(--trait);
    font-size: 15px;
    color: var(--discret);
}

/* ---------- Fin de page : autres pages et appel à l'action ---------- */

.a-lire {
    padding: 64px 0;
    background: var(--brume);
}

.a-lire h2 {
    font-size: clamp(24px, 2.6vw, 28px);
    letter-spacing: -0.02em;
}

.a-lire .cartes {
    margin-top: 24px;
}

.cartes-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lien-carte {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    padding: 22px 22px 20px;
    border-radius: var(--rayon);
    border: 1px solid var(--trait);
    background: var(--blanc);
    color: var(--texte);
    text-decoration: none;
    transition: border-color 0.2s ease;
}

.lien-carte:hover {
    border-color: var(--signal);
    color: var(--texte);
}

.lien-carte strong {
    font-size: 18px;
    line-height: 1.25;
}

.lien-carte span {
    font-size: 15.5px;
    line-height: 1.45;
}

.lien-carte .ico {
    color: var(--signal);
}

.appel {
    padding: 72px 0 88px;
    background:
        radial-gradient(ellipse 60% 70% at 0% 100%, var(--peche-pale) 0%, rgba(255, 214, 194, 0) 70%),
        radial-gradient(ellipse 60% 70% at 100% 0%, var(--lavande) 0%, rgba(207, 202, 255, 0) 70%),
        var(--blanc);
}

.appel h2 {
    font-size: clamp(28px, 3.4vw, 38px);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.appel .chapo {
    max-width: 640px;
}

.appel .boutons {
    margin-top: 28px;
}

/* ---------- Adaptations ---------- */

@media (max-width: 860px) {
    .a-lire .cartes-3 {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .article-tete {
        padding: 20px 0 36px;
    }

    .reponse {
        padding: 18px 18px;
    }

    .reponse p {
        font-size: 17.5px;
    }

    .article-corps h2 {
        margin-top: 44px;
    }

    .fiche-dsi > div {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Tableaux empilés : chaque ligne devient une carte, comme le tableau des modes.
       (Sous 640 px, styles.css rend tous les .tableau-cadre visibles et sans bord.) */
    .tableau-empile thead {
        display: none;
    }

    .tableau-empile,
    .tableau-empile tbody,
    .tableau-empile tr,
    .tableau-empile th,
    .tableau-empile td {
        display: block;
        width: auto;
    }

    .tableau-empile caption.legende {
        display: block;
        padding: 0 0 10px;
    }

    .tableau-empile tr {
        margin-bottom: 12px;
        border: 1px solid var(--trait);
        border-radius: var(--rayon);
        overflow: hidden;
    }

    .tableau-empile tbody th {
        width: auto;
        padding: 12px 16px;
        background: var(--brume);
    }

    .tableau-empile td {
        padding: 10px 16px;
        white-space: normal;
    }

    .tableau-empile tbody tr:last-child td {
        border-bottom: 1px solid var(--trait);
    }

    .tableau-empile tr td:last-child,
    .tableau-empile tbody tr:last-child td:last-child {
        border-bottom: 0;
    }

    .tableau-empile td[data-col]::before {
        content: attr(data-col);
        display: block;
        font-size: 13px;
        font-weight: 600;
        color: var(--encre);
    }

    .appel .btn {
        width: 100%;
    }
}

@media print {
    .a-lire,
    .appel {
        display: none !important;
    }

    .article-tete {
        background: none;
    }
}
