/* =====================================================================
   ATPH — finition : filigranes, icônes, mouvement.
   Mouvement « institutionnel » : une courbe, trois durées, une seule entrée par page.
   Chargé après atph.css.
   ===================================================================== */
:root {
  --courbe: cubic-bezier(0.2, 0, 0, 1);
  --courbe-entree: cubic-bezier(0.05, 0.7, 0.1, 1);
  --d-rapide: 150ms;
  --d-standard: 250ms;
  --d-lente: 450ms;
  --ombre-1: 0 1px 2px rgba(20, 42, 76, .06), 0 2px 8px rgba(20, 42, 76, .06);
  --ombre-2: 0 6px 18px rgba(20, 42, 76, .12), 0 2px 4px rgba(20, 42, 76, .06);
}

/* ---------------- Filigrane : grand mot en contour derrière le titre de la page */
.entete-page,
main:has(> .barre-membre) > .section:first-of-type { position: relative; overflow: hidden; isolation: isolate; }
.entete-page { padding-block: 48px 36px; }
.entete-page::before,
main:has(> .barre-membre) > .section:first-of-type::before {
  content: var(--filigrane);
  position: absolute; z-index: -1; right: -0.04em; bottom: -0.16em;
  font-family: var(--titre); font-weight: 700; line-height: 1; letter-spacing: -0.02em; white-space: nowrap;
  font-size: clamp(4.5rem, 14vw, 11rem);
  color: transparent; -webkit-text-stroke: 1.5px rgba(20, 42, 76, .09);
  pointer-events: none; user-select: none;
  animation: filigrane-entree 900ms var(--courbe-entree) both;
}
main:has(> .barre-membre) > .section:first-of-type::before {
  top: 8px; bottom: auto; font-size: clamp(3.5rem, 10vw, 8rem); -webkit-text-stroke-color: rgba(20, 42, 76, .06);
}
.entete-page h1,
main:has(> .barre-membre) > .section:first-of-type h1:first-of-type {
  position: relative; padding-bottom: 14px; animation: titre-entree var(--d-lente) var(--courbe-entree) both;
}
.entete-page h1::after,
main:has(> .barre-membre) > .section:first-of-type h1:first-of-type::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 56px; height: 4px; border-radius: 2px; background: var(--jaune);
  transform-origin: left; animation: trait-entree var(--d-lente) var(--courbe) 120ms both;
}
@keyframes filigrane-entree { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes titre-entree { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes trait-entree { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------------- Icônes */
.bi { line-height: 1; vertical-align: -0.125em; }
.bouton .bi, .btn-atph .bi { margin-right: .4em; transition: transform var(--d-rapide) var(--courbe); }
.bouton:hover .bi-arrow-right, .bouton:hover .bi-chevron-right { transform: translateX(3px); }
.entete .dropdown-item .bi { color: var(--etoile); width: 1.25em; margin-right: .45em; text-align: center; }
.entete .bouton-membre .bi { margin-right: .35em; }
.fiche .coordonnees .bi { color: var(--etoile); margin-right: .45em; }
.pied .bi { color: var(--jaune); margin-right: .45em; }

/* Liens vers des fichiers dans le contenu : icône selon le type */
.contenu-riche a[href$=".pdf" i]::before,
.contenu-riche a[href$=".doc" i]::before, .contenu-riche a[href$=".docx" i]::before,
.contenu-riche a[href$=".xls" i]::before, .contenu-riche a[href$=".xlsx" i]::before {
  font-family: "bootstrap-icons"; font-weight: normal; margin-right: .35em; display: inline-block;
}
.contenu-riche a[href$=".pdf" i]::before { content: "\f63e"; color: #c0392b; }
.contenu-riche a[href$=".doc" i]::before, .contenu-riche a[href$=".docx" i]::before { content: "\f38d"; color: #2b579a; }
.contenu-riche a[href$=".xls" i]::before, .contenu-riche a[href$=".xlsx" i]::before { content: "\f368"; color: #217346; }

/* ---------------- Survol et appui */
.bouton, .btn-atph {
  transition: background-color var(--d-rapide) var(--courbe), border-color var(--d-rapide) var(--courbe),
              transform var(--d-rapide) var(--courbe), box-shadow var(--d-rapide) var(--courbe);
}
.bouton:hover, .btn-atph:hover { box-shadow: var(--ombre-1); }
.bouton:active, .btn-atph:active { transform: scale(.98); }
.tuile, .fiche, .saviez article, .carte-diapo {
  transition: transform var(--d-standard) var(--courbe), box-shadow var(--d-standard) var(--courbe), border-color var(--d-standard) var(--courbe);
}
.tuile:hover, .fiche:hover, .saviez article:hover, .carte-diapo:hover { transform: translateY(-3px); box-shadow: var(--ombre-2); }
.fiche img { transition: transform var(--d-lente) var(--courbe); }
.fiche:hover img { transform: scale(1.03); }
.liste-nouvelles li { transition: background-color var(--d-standard) var(--courbe); }
.liste-nouvelles li:hover { background: linear-gradient(90deg, rgba(255, 205, 0, .08), transparent 60%); }
.table-atph tbody tr { transition: background-color var(--d-rapide) var(--courbe); }

/* Tuiles du tableau de bord avec icône */
.tuile { display: flex; align-items: center; gap: 14px; box-shadow: var(--ombre-1); }
.tuile .bi {
  font-size: 1.5rem; color: var(--etoile); flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 10px; background: #e8f0fb; transition: background-color var(--d-standard) var(--courbe), color var(--d-standard) var(--courbe);
}
.tuile:hover .bi { background: var(--jaune); color: var(--marine); }

/* ---------------- Entrée en cascade (une fois, au chargement ; total < 300 ms) */
.liste-nouvelles > li, .tableau-bord > .tuile, .grille-equipe > .fiche, .saviez > article, .liste-docs > li {
  animation: carte-entree var(--d-lente) var(--courbe-entree) both;
}
:is(.liste-nouvelles, .tableau-bord, .grille-equipe, .saviez, .liste-docs) > :nth-child(2) { animation-delay: 40ms; }
:is(.liste-nouvelles, .tableau-bord, .grille-equipe, .saviez, .liste-docs) > :nth-child(3) { animation-delay: 80ms; }
:is(.liste-nouvelles, .tableau-bord, .grille-equipe, .saviez, .liste-docs) > :nth-child(4) { animation-delay: 120ms; }
:is(.liste-nouvelles, .tableau-bord, .grille-equipe, .saviez, .liste-docs) > :nth-child(5) { animation-delay: 160ms; }
:is(.liste-nouvelles, .tableau-bord, .grille-equipe, .saviez, .liste-docs) > :nth-child(6) { animation-delay: 200ms; }
:is(.liste-nouvelles, .tableau-bord, .grille-equipe, .saviez, .liste-docs) > :nth-child(n+7) { animation-delay: 240ms; }
@keyframes carte-entree { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------------- Pages Documents : contenu + menu latéral */
.page-documents { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 40px; align-items: start; }
.carte-contenu { background: var(--blanc); border: 1px solid var(--ligne); border-radius: 10px; padding: 28px 32px; box-shadow: var(--ombre-1); }
.carte-contenu p:has(> a:only-child) { margin: 8px 0; }
.carte-contenu p > a:only-child {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--ligne); border-radius: 8px;
  text-decoration: none; color: var(--marine); font-weight: 600; background: var(--blanc);
  transition: border-color var(--d-rapide) var(--courbe), background-color var(--d-rapide) var(--courbe), transform var(--d-rapide) var(--courbe);
}
.carte-contenu p > a:only-child:hover { border-color: var(--etoile); background: #f5f8fd; transform: translateX(3px); }
.carte-contenu p > a:only-child::after { content: "\f1c5"; font-family: "bootstrap-icons"; margin-left: auto; color: var(--gris); font-weight: normal; }
.maj-document { display: flex; align-items: center; gap: 8px; color: var(--gris); font-size: .95rem; margin: 10px 0 0; }
.menu-documents { position: sticky; top: 104px; background: var(--brume); border-radius: 10px; padding: 16px; }
.menu-documents h2 { font-size: 1.05rem; margin: 4px 8px 10px; }
.menu-documents ul { list-style: none; margin: 0; padding: 0; }
.menu-documents a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--encre); text-decoration: none;
  transition: background-color var(--d-rapide) var(--courbe), color var(--d-rapide) var(--courbe);
}
.menu-documents a .bi { color: var(--etoile); width: 1.25em; text-align: center; }
.menu-documents a:hover { background: var(--blanc); color: var(--marine); }
.menu-documents a[aria-current] { background: var(--marine); color: var(--blanc); }
.menu-documents a[aria-current] .bi { color: var(--jaune); }
.aide-documents { margin-top: 16px; padding: 14px 16px; border-radius: 10px; background: var(--marine); color: #dfe6f1; font-size: .95rem; }
.aide-documents strong { color: var(--blanc); display: block; margin-bottom: 4px; }
.aide-documents a { color: var(--jaune); }
.icone-page {
  display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 12px;
  background: var(--marine); color: var(--jaune); font-size: 1.6rem; margin-bottom: 12px; box-shadow: var(--ombre-1);
}
.vide { text-align: center; padding: 28px 12px; color: var(--gris); }
.vide .bi { display: block; font-size: 2.4rem; color: var(--ligne); margin-bottom: 8px; }

@media (max-width: 991.98px) {
  .page-documents { grid-template-columns: 1fr; }
  .menu-documents { position: static; }
}
@media (max-width: 767.98px) {
  .entete-page::before { font-size: 4.5rem; }
  .carte-contenu { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Pas d'icône de fichier dans les titres du contenu */
.contenu-riche :is(h1, h2, h3, h4, h5) a::before { content: none !important; }
.contenu-riche li:empty { display: none; }

/* Actions de tableau sur une seule ligne */
.table-atph .actions-ligne { flex-wrap: nowrap; }
.table-atph .bouton-petit { white-space: nowrap; }

/* ---------------- Logos : sceau ATPH et signature JobeLabs */
.pied-marque { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.pied-marque img { width: 56px; height: 56px; border-radius: 50%; background: var(--blanc); padding: 3px; flex: none;
  box-shadow: 0 0 0 3px rgba(255, 205, 0, .35); }
.pied-marque h2 { margin: 0; }
.pied .bas .conteneur { align-items: center; }
.signature-jobelabs { display: inline-flex; align-items: center; gap: 8px; color: #c9d3e2; text-decoration: none; font-size: .88rem; }
.signature-jobelabs .pastille { display: inline-flex; align-items: center; gap: 6px; background: var(--blanc); border-radius: 999px; padding: 3px 10px 3px 4px;
  transition: transform var(--d-standard) var(--courbe), box-shadow var(--d-standard) var(--courbe); }
.signature-jobelabs .pastille img { width: 22px; height: 22px; border-radius: 50%; }
.signature-jobelabs strong { font-family: var(--titre); font-weight: 700; letter-spacing: .01em;
  background: linear-gradient(90deg, #6a3be0, #2a7de1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.signature-jobelabs:hover .pastille, .signature-jobelabs:focus-visible .pastille { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }

.photo-scellee { position: relative; margin: 0; }
.photo-scellee > img:first-child { border-radius: var(--rayon); display: block; width: 100%; height: auto; }
.photo-scellee .sceau { position: absolute; left: -18px; bottom: -18px; width: 84px; height: 84px; border-radius: 50%; background: var(--blanc);
  padding: 4px; box-shadow: 0 0 0 4px var(--jaune), var(--ombre-2); animation: sceau-entree 600ms var(--courbe-entree) 200ms both; }
@keyframes sceau-entree { from { opacity: 0; transform: scale(.8) rotate(-12deg); } to { opacity: 1; transform: none; } }

.carte-connexion { max-width: 440px; margin-inline: auto; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 12px;
  padding: 28px 30px 22px; box-shadow: var(--ombre-2); position: relative; }
.carte-connexion-logo { display: block; width: 80px; height: 80px; margin: -68px auto 8px; border-radius: 50%; background: var(--blanc);
  padding: 4px; box-shadow: 0 0 0 4px var(--jaune), var(--ombre-1); }
.carte-connexion-titre { text-align: center; font-family: var(--titre); font-weight: 700; color: var(--marine); font-size: 1.2rem; margin-bottom: 14px; }
.carte-connexion-titre::before { content: "\f47a"; font-family: "bootstrap-icons"; font-weight: normal; color: var(--vert); margin-right: .35em; }
.carte-connexion .bouton[type=submit] { width: 100%; }
main:has(.carte-connexion) .section { padding-top: 70px; }
@media (max-width: 767.98px) {
  .photo-scellee .sceau { width: 64px; height: 64px; left: 10px; bottom: -14px; }
  .pied .bas .conteneur { flex-direction: column; align-items: flex-start; }
}

/* ---------------- Pagination commune */
.barre-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 24px; }
.barre-pagination .pagination-atph { margin: 0; align-items: center; }
.pagination-atph a, .pagination-atph span { transition: background-color var(--d-rapide) var(--courbe), border-color var(--d-rapide) var(--courbe); }
.pagination-atph a:hover { background: var(--brume); border-color: var(--etoile); }
.pagination-atph .precedente, .pagination-atph .suivante { padding-inline: 12px; }
.pagination-atph .desactive { color: #a7b1bf; border-style: dashed; }
.pagination-atph .ellipse { border: 0; min-width: 20px; color: var(--gris); }
.par-page { display: flex; align-items: center; gap: 14px; margin: 0; color: var(--gris); font-size: .92rem; }
.par-page select { border: 1px solid var(--ligne); border-radius: 6px; padding: 4px 8px; margin: 0 4px; background: var(--blanc); color: var(--encre); }
@media (max-width: 575.98px) {
  .pagination-atph .precedente, .pagination-atph .suivante { flex: 1; text-align: center; }
}

/* ---------------- Recherche dans une liste */
.recherche-liste { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 18px; padding: 8px 10px;
  background: var(--brume); border-radius: 10px; max-width: 640px; }
.recherche-liste > .bi { color: var(--gris); margin-left: 4px; }
.recherche-liste input[type=search] { flex: 1; min-width: 180px; border: 1px solid var(--ligne); border-radius: 6px; padding: 7px 10px; background: var(--blanc); }
.recherche-liste input[type=search]:focus { outline: none; border-color: var(--etoile); box-shadow: 0 0 0 3px rgba(31, 95, 191, .2); }

/* Petits écrans : la gouttière g-5 (48 px) dépassait la marge du conteneur (20 px) et créait un défilement horizontal. */
@media (max-width: 991.98px) { .row.g-5 { --bs-gutter-x: 2.5rem; } }

/* Filigrane : seulement sur les grands écrans, et seulement dans le bandeau gris des pages publiques.
   - Cellulaire : il dédoublait le titre → retiré.
   - Espace membre : blanc sur blanc, il passait derrière les titres longs et les boutons → retiré. */
@media (max-width: 991.98px) {
  .entete-page::before, .entete-page h1::before { content: none !important; }
}
main:has(> .barre-membre) > .section:first-of-type::before { content: none !important; }

/* ---------------- Pastille de nouveautés (en-tête et tableau de bord) */
.pastille {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-rond);
  background: var(--rouge); color: var(--blanc); font: 700 .78rem/1 var(--texte); font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--blanc), 0 3px 8px rgba(180, 35, 24, .35);
  animation: pastille-entree 420ms cubic-bezier(.175, .885, .32, 1.275) both;
}
.entete .bouton-membre { position: relative; }
.pastille-entete { position: absolute; top: -8px; right: -8px; box-shadow: 0 0 0 2px var(--blanc), 0 3px 8px rgba(180, 35, 24, .35); }
@keyframes pastille-entree { from { transform: scale(0); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .pastille { animation: none; } }
.toggler-nouveau { position: relative; }
.toggler-nouveau::after { content: ""; position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--rouge); box-shadow: 0 0 0 2px var(--blanc); }
