/* =====================================================================
   Pages « document » — refonte page 12 (v3.0.971)
   Mentions légales, confidentialité, cookies, à propos.
   Bonnes pratiques : résumé en tête (bandeau), sommaire cliquable
   (collé à gauche sur ordinateur, repliable sur mobile), colonne de lecture
   étroite, titres hiérarchisés, tableaux lisibles, bouton « haut de page ».
   Le sommaire est construit par js/doc_toc.js à partir des titres h2.
   ===================================================================== */
.doc-layout { display: block; }
@media (min-width: 1024px) {
  /* la mise en page s'élargit pour loger le sommaire à gauche */
  :is(.max-w-3xl):has(> .doc-layout), .max-w-3xl:has(.doc-layout) { max-width: 1100px !important; }
  .doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; }
  .doc-toc { position: sticky; top: 96px; }
}

/* Sommaire */
.doc-toc { margin: 0 0 16px; }
.doc-toc__box { background: #fff; border: 1px solid #DCE6EA; border-radius: 14px; padding: 4px 6px; }
.doc-toc summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  min-height: 44px; padding: 0 12px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #5B7684;
}
.doc-toc summary::-webkit-details-marker { display: none; }
.doc-toc summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid #96AFBA; border-bottom: 2px solid #96AFBA; transform: rotate(45deg); transition: transform .15s; margin-top: -4px; }
.doc-toc details[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.doc-toc ol { list-style: none; margin: 0; padding: 0 0 6px; counter-reset: doc; }
.doc-toc li { counter-increment: doc; }
.doc-toc a {
  display: flex; gap: 10px; align-items: baseline; min-height: 40px; padding: 9px 12px; border-radius: 10px;
  font-size: 14px; line-height: 1.35; color: #335566; text-decoration: none;
}
.doc-toc a::before { content: counter(doc); font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 700; color: #96AFBA; min-width: 14px; }
.doc-toc a:hover { background: #F1F6F8; color: #0D2B3A; }
.doc-toc a.is-current { background: #EAF3F6; color: #073A50; font-weight: 600; box-shadow: inset 3px 0 0 #006289; }
.doc-toc a.is-current::before { color: #006289; }

/* Carte de lecture : colonne étroite, typographie confortable */
.doc-card { border-radius: 16px !important; border-color: #DCE6EA !important; box-shadow: 0 1px 2px rgba(13, 43, 58, .04) !important; }
@media (min-width: 640px) { .doc-card { padding: 40px 48px !important; } }
.doc-card [data-doc] { max-width: 70ch; font-size: 16px !important; line-height: 1.7 !important; color: #335566 !important; }
.doc-card [data-doc] :is(p, li) { font-size: 16px !important; line-height: 1.7 !important; }
.doc-card [data-doc] h2 {
  font-family: Newsreader, Georgia, serif !important; font-weight: 500 !important; font-size: 26px !important; line-height: 1.2 !important;
  color: #0D2B3A !important; margin: 40px 0 12px !important; scroll-margin-top: 96px;
}
.doc-card [data-doc] h2:first-child, .doc-card [data-doc] > p:first-child + h2 { margin-top: 8px !important; }
.doc-card [data-doc] h3 { font-size: 18px !important; font-weight: 600 !important; color: #0D2B3A !important; margin: 24px 0 8px !important; }
.doc-card [data-doc] a { color: #006289 !important; text-underline-offset: 3px; }
.doc-card [data-doc] strong { color: #0D2B3A; }
/* Tableaux : défilement horizontal propre sur téléphone, en-têtes lisibles */
.doc-card [data-doc] table { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; font-size: 14px !important; }
.doc-card [data-doc] :is(th, td) { padding: 10px 12px !important; border-bottom: 1px solid #E6EEF1; vertical-align: top; min-width: 140px; }
.doc-card [data-doc] th { font-size: 13px !important; color: #0D2B3A !important; background: #F6F9FA; text-align: left; }
@media (max-width: 767.98px) {
  .doc-card { padding: 24px 18px !important; border-radius: 14px !important; }
  .doc-card [data-doc] h2 { font-size: 22px !important; margin-top: 32px !important; }
  .doc-card [data-doc] :is(p, li) { font-size: 15.5px !important; }
}

/* Bouton « haut de page » */
.doc-top {
  position: fixed; right: 18px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  width: 44px; height: 44px; border-radius: 999px; border: 1px solid #DCE6EA; background: #fff; color: #073A50;
  display: grid; place-items: center; box-shadow: 0 8px 20px -10px rgba(13, 43, 58, .4);
  opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.doc-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.doc-top svg { width: 18px; height: 18px; }
@media (max-width: 767.98px) { .doc-top { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); } }

/* Titre du bandeau : aligné sur le contenu par js/doc_toc.js (variables --band-w / --band-px) */
body:has([data-doc]) .cab-pagehead--band .cab-pagehead__title, body:has([data-doc]) .cab-pagehead--band .cab-pagehead__sub { padding-left: var(--band-px) !important; padding-right: var(--band-px) !important; }

/* =====================================================================
   Agenda des événements (refonte page 12, lot 2)
   ===================================================================== */
.ag-page > .max-w-6xl > .ag-hero { margin-bottom: 24px !important; }
.ag-hero .cab-pagehead__in > div:first-child { flex: 1 1 420px; }
.ag-hero .cab-pagehead__in > div:last-child > * { background: transparent !important; border-color: #5F8DA1 !important; }
/* Titre aligné sur les cartes (conteneur max-w-6xl + px-6 / lg:px-8) */
@media (min-width: 640px) { .ag-hero .cab-pagehead__in { max-width: calc(72rem + 48px) !important; padding: 0 24px !important; } }
@media (min-width: 1024px) { .ag-hero .cab-pagehead__in { max-width: calc(72rem + 64px) !important; padding: 0 32px !important; } }
/* Carte : bloc date à gauche, contenu à droite */
.ag-card { border-radius: 16px !important; border-color: #DCE6EA !important; }
.ag-card__top { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; align-items: start; }
.ag-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 56px; height: 60px; border-radius: 12px; background: #073A50; color: #fff; line-height: 1;
}
.ag-date__day { font-family: Newsreader, Georgia, serif; font-size: 26px; font-weight: 500; }
.ag-date__month { margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #A9CDDC; }
.ag-card.is-past .ag-date { background: #EEF3F5; color: #5B7684; }
.ag-card.is-past .ag-date__month { color: #8AA0AB; }
.ag-card h3 { font-family: Newsreader, Georgia, serif !important; font-weight: 500 !important; font-size: 20px !important; }
.ag-card .pt-3\.5.border-t :is(a, button) { min-height: 40px; display: inline-flex; align-items: center; border-radius: 10px !important; }
/* Barre de filtres flottante : au-dessus de la barre de navigation mobile (elle passait dessous) */
@media (max-width: 767.98px) {
  .ag-page .fixed.bottom-4.inset-x-0 { bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* Mes événements passés : encadré « événements en cours » sobre */
.ep-live { background: #fff !important; border: 1px solid #DCE6EA !important; border-left: 3px solid #2F9E6E !important; border-radius: 12px !important; }
.ep-live h3, .ep-live .font-bold { color: #0D2B3A !important; }
/* Mon QR code : boutons de navigation discrets, QR bien net */
main:has(img[alt*="QR" i]) .cta-grid > a { min-height: 42px; border-radius: 10px !important; box-shadow: none !important; }

/* =====================================================================
   Mon carnet d'adresses (face_a_face.html) — refonte page 12, lot 3
   ===================================================================== */
@media (min-width: 640px) {
  /* titre aligné sur la carte de contenu (max-w-4xl dans un conteneur px-6) */
  body:has(.faf-mobile-bar) .cab-pagehead--band :is(.cab-pagehead__title, .cab-pagehead__sub) { max-width: calc(56rem + 48px) !important; padding: 0 24px !important; }
}
/* Ordinateur (>= 768 px) : la barre Carnet / Scanner / Archives devient une rangée d'onglets juste sous le bandeau
   (au lieu d'une pastille flottante en bas). Mobile inchangé : barre fixée en bas. */
@media (min-width: 768px) {
  html body .faf-mobile-bar {
    position: static !important; inset: auto !important; transform: none !important; translate: none !important;
    width: auto !important; margin: 0 0 24px !important; padding: 0 !important;
    background: #fff !important; border: 0 !important; border-bottom: 1px solid #DCE6EA !important;
    border-radius: 0 !important; box-shadow: none !important;z-index: auto !important;
  }
  html body .faf-mobile-bar .faf-bar-inner {
    display: flex !important; justify-content: flex-start !important; gap: 4px !important;
    max-width: calc(56rem + 48px) !important; margin: 0 auto !important; padding: 0 8px !important;
  }
  html body .faf-mobile-bar__btn {
    flex: 0 0 auto !important; flex-direction: row !important; gap: 8px !important; align-items: center !important;
    min-height: 52px; padding: 0 16px !important; border-radius: 0 !important; background: transparent !important;
    box-shadow: inset 0 -2px 0 transparent !important; color: #5B7684 !important;
  }
  html body .faf-mobile-bar__btn:hover { color: #0D2B3A !important; background: #F4F7F8 !important; }
  html body .faf-mobile-bar__btn.is-active { color: #073A50 !important; box-shadow: inset 0 -2px 0 #006289 !important; background: transparent !important; }
  html body .faf-mobile-bar__btn svg { width: 20px !important; height: 20px !important; }
  html body .faf-mobile-bar__label { font-size: 14.5px !important; font-weight: 600 !important; }
  html body .faf-mobile-bar__icon-wrap { background: transparent !important; width: auto !important; height: auto !important; box-shadow: none !important; }
  html body .cab-pagehead--band:has(+ .faf-mobile-bar) { margin-bottom: 0 !important; }
  html body .faf-mobile-bar__icon-wrap { display: contents !important; }
  html body .faf-mobile-bar__badge { position: static !important; order: 3; transform: none !important; margin: 0 !important;
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11.5px !important; line-height: 20px;
    background: #EEF3F5 !important; color: #335566 !important; box-shadow: none !important; border: 0 !important; }
  html body .faf-mobile-bar__btn.is-active .faf-mobile-bar__badge { background: #E71D72 !important; color: #fff !important; }
  html body .faf-mobile-bar__label { order: 2; }
  html body .faf-mobile-bar__btn.is-active { box-shadow: inset 0 -3px 0 #006289 !important; }
}
/* Lignes de contact : plus compactes, avatars et chevrons discrets */
body:has(.faf-mobile-bar) .faf-contact-card { border-radius: 12px !important; border-color: #DCE6EA !important; box-shadow: none !important; }
body:has(.faf-mobile-bar) .faf-contact-card:hover { border-color: #9FC3D2 !important; }

/* Finitions (page 13) — Agenda : badges sur une ligne, libellés « Date / Lieu » plus discrets */
.ag-card .ag-card__main > div:first-child span { white-space: nowrap; }
.ag-card .ag-card__main > div:first-child > div:last-child { flex-wrap: nowrap; }
.ag-card .ag-card__main .font-bold.text-slate-900 { color: #5B7684 !important; font-weight: 600 !important; }
@media (max-width: 767.98px) {
  .ag-card .ag-card__main > div:first-child { flex-wrap: wrap; row-gap: 6px; }
  .ag-card .ag-card__main > div:first-child span.truncate { max-width: 150px !important; }
}
/* Agenda : le bandeau commençait sous la barre fixe du haut (titre caché) — on le décale de sa hauteur */
@media (min-width: 768px) { .ag-page { padding-top: 73px !important; } }
