/* DA « Guichet & Papier-monnaie » : vert billet, papier, laiton ; filets guillochés, tampon, talons.
   Polices (--f-titre, --f-texte, --f-mono) injectées par la Fonts API d'Astro, servies par le site. */
:root {
  --vert-billet: #0F3D2E;
  --vert-profond: #0A2A20;
  --papier: #F4EFE3;
  --papier-clair: #FBF8F0;
  --papier-alt: #E7E0CF;
  --laiton: #C8A24A;
  --encre: #1B1B1B;
  --encre-douce: #4B4A43;
  --tampon: #8C2F1E;
  --papier-sur-vert: #D9D2BE;
  --filet: #CFC6AE;
  --mesure: 840px;
  --rayon: 3px;
}

/* ---- Reset et base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1rem; }
body { margin: 0; background: var(--papier); color: var(--encre); font-family: var(--f-texte), Arial, sans-serif; font-size: 18px; line-height: 1.65; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--vert-billet); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--vert-profond); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--vert-billet); outline-offset: 2px; border-radius: 2px; }
.site-header :focus-visible, .site-footer :focus-visible { outline-color: var(--laiton); }
.skip { position: absolute; left: -999px; top: 0; background: var(--vert-billet); color: var(--papier); padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 0; }
h1, h2, h3, h4 { font-family: var(--f-titre), Georgia, serif; font-weight: 600; line-height: 1.2; color: var(--vert-billet); font-optical-sizing: auto; text-wrap: balance; }
.mono, .tampon, .kicker, .pieces__titre { font-family: var(--f-mono), Consolas, monospace; }

/* ---- Images : reset + wrappers à ratio fixe (jamais object-fit sur <img> seul) ---- */
.img-hero { aspect-ratio: 16 / 9; max-height: min(75vh, 44vw); overflow: hidden; width: 100%; }
.img-hero img, .img-card img, .img-body img, .img-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.img-card { aspect-ratio: 3 / 2; overflow: hidden; display: block; }
.img-body { aspect-ratio: 3 / 2; overflow: hidden; }
.img-portrait { aspect-ratio: 1 / 1; overflow: hidden; border-radius: 50%; }
.hero-band { margin: 0; background: var(--vert-billet); border-bottom: 4px solid var(--laiton); }
.hero-band figcaption { max-width: var(--mesure); margin: 0 auto; padding: .5rem 1rem; font-size: .8rem; color: var(--papier-sur-vert); background: var(--vert-billet); }
.hero-band figcaption a { color: var(--papier); }
.fig { margin: 2rem 0; }
.fig figcaption { font-size: .85rem; color: var(--encre-douce); margin-top: .5rem; }

/* ---- En-tête : bandeau vert billet, filet laiton ---- */
.site-header { background: var(--vert-billet); color: var(--papier); border-bottom: 3px solid var(--laiton); }
.site-header__inner { max-width: 1180px; margin: 0 auto; padding: .7rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--papier); text-decoration: none; }
.brand:hover { color: #fff; }
.brand__mark { border-radius: 50%; flex: none; }
.brand__name { font-family: var(--f-titre), Georgia, serif; font-weight: 600; font-size: 1.3rem; line-height: 1.1; }
.nav-toggle { background: transparent; color: var(--papier); border: 1px solid var(--laiton); border-radius: var(--rayon); padding: .45rem .9rem; font: inherit; font-size: .95rem; cursor: pointer; }
.site-nav { display: none; background: var(--vert-profond); }
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: .4rem 1rem .8rem; max-width: 1180px; margin-inline: auto; }
.site-nav a { display: block; color: var(--papier); text-decoration: none; padding: .55rem 0; border-bottom: 1px solid rgba(244, 239, 227, .18); font-size: 1rem; }
.site-nav a:hover, .site-nav a[aria-current] { color: #fff; border-bottom-color: var(--laiton); }
@media (min-width: 1000px) {
  .nav-toggle { display: none; }
  .site-header { display: grid; grid-template-columns: auto 1fr; align-items: center; }
  .site-nav { display: block; background: transparent; }
  .site-nav ul { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .1rem 1.3rem; padding: .5rem 1.25rem .5rem 0; max-width: none; margin: 0; }
  .site-nav a { border-bottom: 2px solid transparent; padding: .35rem 0; font-size: .95rem; }
  .site-header__inner { padding-right: 0; }
}

/* ---- Mise en page ---- */
.page { max-width: var(--mesure); margin: 0 auto; padding: 1.25rem 1rem 4rem; }
.page--liste { max-width: 1180px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem .6rem; padding: 0; margin: 0 0 1.25rem; font-size: .85rem; color: var(--encre-douce); }
.crumbs li + li::before { content: "/"; color: var(--laiton); margin-right: .6rem; }
.crumbs a { color: var(--encre-douce); }
.page__entete h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); margin: .2rem 0 .8rem; }
.page__cat { margin: 0; font-family: var(--f-mono), monospace; font-size: .85rem; color: var(--vert-billet); border-left: 3px solid var(--laiton); padding-left: .6rem; }
.page__meta { font-size: .9rem; color: var(--encre-douce); margin: 0 0 1.5rem; }
.verifie { font-family: var(--f-mono), monospace; font-size: .85rem; color: var(--vert-billet); }
.prose > p, .prose > ul, .prose > ol { max-width: 70ch; }
.prose p { margin: 0 0 1.15rem; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.25rem; }
.prose li { margin-bottom: .35rem; }
.prose h2 { font-size: clamp(1.5rem, 3.2vw, 1.95rem); margin: 3rem 0 1.4rem; }
.prose h2::after { content: ""; display: block; height: 12px; margin-top: .55rem; background: var(--guilloche) repeat-x left center / 56px 12px; }
.prose h3 { font-size: 1.3rem; margin: 2rem 0 .6rem; }
/* Lettrine Fraunces sur les piliers */
.page--pilier .prose > p:first-of-type::first-letter { font-family: var(--f-titre), Georgia, serif; font-weight: 600; font-size: 4.3em; line-height: .8; float: left; margin: .08em .12em 0 0; color: var(--vert-billet); }
:root { --guilloche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='12' viewBox='0 0 56 12'%3E%3Cpath d='M0 6C7 -1 21 -1 28 6S49 13 56 6' fill='none' stroke='%23C8A24A' stroke-width='1.1'/%3E%3Cpath d='M0 6C7 13 21 13 28 6S49 -1 56 6' fill='none' stroke='%230F3D2E' stroke-width='1.1' opacity='.55'/%3E%3C/svg%3E"); }

/* ---- Sommaire ---- */
.sommaire, .toc { background: var(--papier-clair); border: 1px solid var(--filet); border-left: 4px solid var(--laiton); padding: 1rem 1.25rem; margin: 0 0 2.2rem; max-width: 70ch; }
.sommaire__titre { margin: 0 0 .4rem; font-family: var(--f-titre), serif; font-weight: 600; color: var(--vert-billet); }
.sommaire ol { margin: 0; padding-left: 1.3rem; }
.sommaire li { margin: .2rem 0; }

/* ---- Kicker « Pièce n° N » et étapes ---- */
.kicker { margin: 0 0 .2rem; font-size: .85rem; color: var(--vert-billet); border-left: 3px solid var(--laiton); padding-left: .6rem; }
.howto { margin-top: 3rem; }
.howto h2::after { content: ""; display: block; height: 12px; margin-top: .55rem; background: var(--guilloche) repeat-x left center / 56px 12px; }
.howto__liste { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1rem; }
.howto__etape { background: var(--papier-clair); border: 1px solid var(--filet); padding: 1rem 1.25rem 1rem 1.25rem; position: relative; }
.howto__etape::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--laiton); margin-left: .0; }
.howto__etape h3 { margin: .2rem 0 .4rem; font-size: 1.2rem; }
.howto__etape p:last-child { margin-bottom: 0; }

/* ---- Encadrés ---- */
.encadre { margin: 1.8rem 0; padding: 1rem 1.25rem; border: 1px solid var(--filet); border-left: 5px solid var(--vert-billet); background: var(--papier-clair); max-width: 70ch; border-radius: 0 var(--rayon) var(--rayon) 0; }
.encadre > :last-child { margin-bottom: 0; }
.encadre__titre { margin: 0 0 .4rem; font-family: var(--f-titre), serif; font-weight: 600; color: var(--vert-billet); }
.encadre--attention { border-left-color: var(--tampon); }
.encadre--attention .encadre__titre { color: var(--tampon); }
.encadre--quebec { border-left-color: var(--laiton); background: var(--papier-alt); }
.fleur { display: inline-block; font-size: .95em; color: var(--vert-billet); margin-right: .15rem; }

/* ---- Tableaux datés + tampon ---- */
.tableau-date { position: relative; margin: 2.2rem 0; padding-top: 1.4rem; overflow: clip; }
.tableau-date__scroll { overflow-x: auto; border: 1px solid var(--vert-billet); background: var(--papier-clair); max-width: 100%; }
.tableau-date__scroll:focus-visible { outline-offset: 3px; }
.tableau-date table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: .95rem; }
.tableau-date caption { text-align: left; font-family: var(--f-titre), serif; font-weight: 600; color: var(--vert-billet); padding: .75rem 1rem .5rem; font-size: 1.05rem; }
.tableau-date th, .tableau-date td { padding: .6rem 1rem; text-align: left; vertical-align: top; border-top: 1px solid var(--filet); }
.tableau-date thead th { background: var(--vert-billet); color: var(--papier); font-weight: 600; border-top: 0; }
.tableau-date tbody tr:nth-child(even) { background: var(--papier-alt); }
.tableau-date tbody th { position: sticky; left: 0; background: inherit; font-weight: 600; color: var(--vert-billet); min-width: 8.5rem; box-shadow: 1px 0 0 var(--filet); }
.tableau-date tbody tr:nth-child(odd) th { background: var(--papier-clair); }
.tableau-date td.mono, .mono { font-family: var(--f-mono), Consolas, monospace; font-size: .92em; white-space: nowrap; }
.tableau-date__source { margin: .55rem 0 0; font-size: .85rem; color: var(--encre-douce); font-family: var(--f-mono), monospace; }
.tampon { position: absolute; top: 0; right: .9rem; z-index: 2; transform: rotate(-7deg); pointer-events: none; }
.tampon span { display: inline-block; border: 2px solid var(--tampon); color: var(--tampon); padding: .12rem .55rem; font-size: .8rem; font-weight: 500; background: rgba(244, 239, 227, .92); border-radius: 2px; box-shadow: inset 0 0 0 2px rgba(244, 239, 227, .92), inset 0 0 0 3px var(--tampon); }
/* Une seule animation : le tampon se pose quand le tableau entre à l'écran. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .tampon span { animation: pose .5s cubic-bezier(.2, .9, .3, 1.2) both; animation-timeline: view(); animation-range: entry 10% cover 30%; }
    @keyframes pose { from { opacity: 0; transform: scale(1.5) rotate(5deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
  }
}

/* ---- Justificatifs : formulaire à souches ---- */
.pieces { margin: 2.2rem 0; border: 1.5px solid var(--vert-billet); background: var(--papier-clair); border-radius: var(--rayon); }
.pieces__entete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .8rem 1.1rem; background: var(--papier-alt); border-bottom: 2px dashed var(--laiton); }
.pieces__titre { margin: 0; font-size: 1.05rem; font-weight: 500; color: var(--vert-billet); }
.pieces__groupes { display: grid; gap: 0; }
.pieces__groupe { margin: 0; border: 0; padding: 1rem 1.1rem 1rem 1.1rem; border-top: 1px solid var(--filet); }
.pieces__groupe:first-child { border-top: 0; }
@media (min-width: 760px) { .pieces__groupes { grid-template-columns: 1fr 1fr; } .pieces__groupe:nth-child(even) { border-left: 2px dashed var(--laiton); } .pieces__groupe:nth-child(2) { border-top: 0; } }
.pieces__groupe legend { font-family: var(--f-titre), serif; font-weight: 600; color: var(--vert-billet); padding: 0 .3rem; }
.pieces ul { list-style: none; margin: .3rem 0 0; padding: 0; }
.pieces li { margin: .35rem 0; }
.pieces label { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; }
.pieces input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin-top: .3rem; accent-color: var(--vert-billet); flex: none; }
.pieces input:checked + span { color: var(--encre-douce); text-decoration: line-through; text-decoration-color: var(--laiton); }
/* Listes de tâches Markdown (- [ ] pièce) */
.prose ul.contains-task-list { list-style: none; padding-left: 0; border: 1.5px solid var(--vert-billet); background: var(--papier-clair); padding: .8rem 1.1rem; }
.prose .task-list-item input { accent-color: var(--vert-billet); margin-right: .55rem; }

/* ---- FAQ, références, YMYL ---- */
.faq { margin-top: 3rem; }
.faq h2::after, .references h2::after { content: ""; display: block; height: 12px; margin-top: .55rem; background: var(--guilloche) repeat-x left center / 56px 12px; }
.faq__item { border-bottom: 1px solid var(--filet); }
.faq__item summary { cursor: pointer; padding: .9rem 2rem .9rem 0; font-weight: 600; list-style: none; position: relative; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; position: absolute; right: .2rem; top: .55rem; font-family: var(--f-mono), monospace; font-size: 1.4rem; color: var(--vert-billet); }
.faq__item[open] summary::after { content: "\2212"; }
.faq__item p { margin: 0 0 1rem; max-width: 70ch; }
.references { margin-top: 3rem; font-size: .9rem; }
.references ol { padding-left: 1.4rem; }
.references li { margin-bottom: .4rem; overflow-wrap: anywhere; }
.ymyl { margin-top: 2.5rem; padding: .8rem 1rem; border: 1px dashed var(--vert-billet); font-size: .9rem; color: var(--encre-douce); }

/* ---- Talons d'article (cards) ---- */
.grille-talons { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); margin-top: 1.5rem; }
.talon { background: var(--papier-clair); border: 1px solid var(--filet); border-radius: var(--rayon); display: flex; flex-direction: column; overflow: hidden; }
.talon[hidden] { display: none; }
.talon__corps { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.talon__meta { order: 3; margin: auto 0 0; padding-top: .7rem; border-top: 2px dashed var(--filet); font-size: .82rem; color: var(--encre-douce); display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.talon__cat { font-family: var(--f-mono), monospace; color: var(--vert-billet); }
.talon__titre { font-size: 1.2rem; margin: 0 0 .7rem; }
.talon__titre a { text-decoration: none; color: var(--vert-billet); }
.talon__titre a:hover { text-decoration: underline; }
.talon__resume { margin: 0 0 .9rem; font-size: .95rem; }
.filtre { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }
.filtre[hidden] { display: none; }
.filtre__btn { font: inherit; font-size: .9rem; padding: .35rem .85rem; border: 1px solid var(--vert-billet); background: transparent; color: var(--vert-billet); border-radius: 999px; cursor: pointer; }
.filtre__btn[aria-pressed="true"] { background: var(--vert-billet); color: var(--papier); }

/* ---- Boutons et formulaire ---- */
.btn { display: inline-block; font: inherit; font-weight: 600; background: var(--vert-billet); color: var(--papier); border: 2px solid var(--vert-billet); padding: .6rem 1.2rem; border-radius: var(--rayon); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--vert-profond); color: #fff; }
.btn--clair { background: transparent; color: var(--vert-billet); padding: .35rem .9rem; font-size: .9rem; }
.btn--clair:hover { background: var(--vert-billet); color: var(--papier); }
.contact-form { max-width: 36rem; }
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: .3rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; font: inherit; padding: .6rem .75rem; border: 1.5px solid var(--vert-billet); background: var(--papier-clair); color: var(--encre); border-radius: var(--rayon); }
.contact-form__piege { position: absolute; left: -9999px; }
.contact-form__statut { min-height: 1.5rem; margin-top: .8rem; }
.contact-form__statut.is-ok { color: var(--vert-profond); font-weight: 600; }
.contact-form__statut.is-erreur { color: var(--tampon); font-weight: 600; }

/* ---- Pied de page : fond vert billet ---- */
.site-footer { background: var(--vert-billet); color: var(--papier-sur-vert); border-top: 4px solid var(--laiton); margin-top: 3rem; font-size: .95rem; }
.site-footer__inner { max-width: 1180px; margin: 0 auto; padding: 2.5rem 1rem 2rem; display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 800px) { .site-footer__inner { grid-template-columns: 1.6fr 1fr 1fr; } }
.site-footer a { color: var(--papier); }
.site-footer a:hover { color: #fff; }
.site-footer p { margin: 0 0 .5rem; }
.site-footer__nom { font-family: var(--f-titre), serif; font-size: 1.25rem; font-weight: 600; color: var(--papier); }
.site-footer__indep { border-top: 1px dashed var(--laiton); padding-top: .7rem; margin-top: .8rem; }
.site-footer__titre { font-family: var(--f-titre), serif; font-weight: 600; color: var(--papier); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: .35rem 0; }

/* ---- Impression : liste des pièces seule, lisible ---- */
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .site-header, .site-footer, .hero-band, .crumbs, .sommaire, .faq, .references, .ymyl, .pieces__imprimer, .skip, .tampon, .filtre { display: none !important; }
  .page { max-width: none; padding: 0; }
  .pieces { border: 1px solid #000; break-inside: avoid; background: #fff; }
  .pieces__entete { background: #fff; border-bottom: 1px dashed #000; }
  .pieces input[type="checkbox"] { appearance: none; width: 1rem; height: 1rem; border: 1.5px solid #000; }
  a { color: #000; text-decoration: none; }
}
/* Le titre du bloc de pièces n'est pas un H2 de section : pas de filet guilloché */
.prose .pieces__titre { margin: 0; font-size: 1.05rem; }
.prose .pieces__titre::after { content: none; display: none; }

/* ---- Accueil (prompt 02) ---- */
.page--accueil { max-width: 1180px; }
.page--accueil .page__entete { max-width: var(--mesure); }
.chapeau { font-size: 1.2rem; line-height: 1.6; color: var(--encre-douce); max-width: 70ch; margin: 0; }
.accueil-bloc { margin-top: 3.2rem; }
.accueil-bloc > h2 { font-size: clamp(1.5rem, 3.2vw, 1.95rem); margin: 0 0 .4rem; }
.accueil-bloc.prose { max-width: var(--mesure); }
.accueil-suite { margin: 1.4rem 0 0; font-family: var(--f-mono), monospace; font-size: .92rem; }
.filtre__n { font-family: var(--f-mono), monospace; font-size: .8em; opacity: .8; }
.talon__resume { order: 2; }

/* ---- Sous-menu « À l'étranger » ---- */
.nav-groupe__btn { display: block; width: 100%; text-align: left; background: transparent; color: var(--papier); border: 0; border-bottom: 1px solid rgba(244, 239, 227, .18); padding: .55rem 0; font: inherit; font-size: 1rem; cursor: pointer; }
.nav-groupe__btn::after { content: ""; display: inline-block; width: .4em; height: .4em; margin-left: .45em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-.15em) rotate(45deg); }
.nav-groupe.is-open .nav-groupe__btn::after { transform: translateY(.05em) rotate(225deg); }
.nav-groupe__btn:hover, .nav-groupe__btn[aria-current], .nav-groupe.is-open .nav-groupe__btn { color: #fff; border-bottom-color: var(--laiton); }
.nav-groupe__btn:focus-visible, .site-nav a:focus-visible { outline: 2px solid var(--laiton); outline-offset: 2px; }
.site-nav .nav-groupe__liste { display: none; padding: 0 0 0 1rem; margin: 0; }
.nav-groupe.is-open .nav-groupe__liste { display: block; }
@media (min-width: 1000px) {
  .nav-groupe { position: relative; }
  .nav-groupe__btn { width: auto; border-bottom: 2px solid transparent; padding: .35rem 0; font-size: .95rem; }
  .site-nav .nav-groupe__liste { position: absolute; z-index: 30; top: 100%; left: -.8rem; min-width: 13rem; background: var(--vert-profond); border: 1px solid var(--laiton); border-radius: var(--rayon); padding: .35rem .9rem .5rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); display: none; flex-wrap: nowrap; flex-direction: column; gap: 0; max-width: none; margin: 0; }
  .site-nav .nav-groupe.is-open .nav-groupe__liste { display: flex; }
  .site-nav .nav-groupe__liste a { padding: .45rem 0; }
}

/* Variantes de structure (classes posées par les gabarits, aucun changement de rendu) */
.site-footer__marque { min-width: 0; }
.encadre--a-savoir { border-left-color: var(--vert-billet); }
.page--article, .page--util { min-width: 0; }
