/* ==========================================================================
   Design system — BOUTONS (étape 3, lot 1). Chargé en dernier (couche de migration).
   Référence = BO01 « Utiliser cet itinéraire » : orange plein, rayon 14, Barlow 16/700, hauteur 48.
   Les anciens styles listés ici sont remplacés par celui-ci ; à terme les règles
   d'origine seront supprimées des feuilles historiques (refonte.css, style.css…).
   ========================================================================== */

/* --- Principal : tous les boutons orange pleins --- */
html body .ca-h3__btn--or,
html body .np__btn--p,
html body .casj-page__btn,
html body .ca-sg__btn,
html body .ctp__btn:not(.ctp__btn--clair),
html body .ca-me__btn:not(.ca-me__btn--clair):not(.ca-me__btn--danger):not(.ca-me__btn--clair):not(.ca-me__btn--danger),
html body .pj-parc__btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:var(--ds-h-bouton-l,48px);height:auto;padding:0 22px;
  background:var(--ds-accent) !important;color:#fff !important;border:0 !important;
  border-radius:var(--ds-r-m) !important;box-shadow:none !important;
  font-family:'Barlow',system-ui,sans-serif !important;font-size:16px !important;font-weight:700 !important;
  letter-spacing:normal !important;text-transform:none !important;line-height:1.1;text-decoration:none;
  cursor:pointer;transition:background var(--ds-transition),transform var(--ds-transition);
}
html body .ca-h3__btn--or:hover,html body .np__btn--p:hover,html body .casj-page__btn:hover,html body .ca-sg__btn:hover,
html body .ctp__btn:not(.ctp__btn--clair):hover,html body .ca-me__btn:not(.ca-me__btn--clair):not(.ca-me__btn--danger):not(.ca-me__btn--clair):not(.ca-me__btn--danger):hover,html body .pj-parc__btn:hover{
  background:#F2A33A !important;color:#fff !important;transform:translateY(-1px);
}
html body .ca-h3__btn--or:focus-visible,html body .np__btn--p:focus-visible,html body .casj-page__btn:focus-visible,html body .ca-sg__btn:focus-visible,
html body .ctp__btn:focus-visible,html body .ca-me__btn:not(.ca-me__btn--clair):not(.ca-me__btn--danger):focus-visible,html body .pj-parc__btn:focus-visible{outline:0;box-shadow:var(--ds-focus) !important}
html body .ca-h3__btn--or:disabled,html body .ctp__btn:disabled,html body .ca-me__btn:not(.ca-me__btn--clair):not(.ca-me__btn--danger):disabled{opacity:.5;cursor:default;transform:none}

/* --- Même gabarit (taille, police, rayon, hauteur) pour onglets, bascules, sélecteurs et « Fermer » --- */
html body .ca-flux__onglet,
html body .ca-pv__bascule button,
html body .ca-vp__chip,
html body .ca-sel__btn,
html body .sj-fermer{
  min-height:48px !important;height:48px !important;border-radius:var(--ds-r-m) !important;
  font-family:'Barlow',system-ui,sans-serif !important;font-size:16px !important;font-weight:700 !important;
  letter-spacing:normal !important;text-transform:none !important;
}
/* Onglets actifs : bleu principal */
html body .ca-flux__onglet.is-actif,html body .ca-flux__onglet[aria-selected="true"],html body .ca-flux__onglet.actif,html body .ca-flux__onglet.on,
html body .ca-pv__bascule button[aria-pressed="true"],html body .ca-vp__chip[aria-pressed="true"],html body .ca-vp__chip.on,html body .ca-vp__chip.is-actif{
  background:var(--ds-primaire) !important;border-color:var(--ds-primaire) !important;color:#fff !important;
}

/* --- Lien textuel « En savoir plus » : orange plus clair (orange du site) --- */
html body #main-content .ca-flux__cta,html body .ca-flux__cta{color:var(--ds-accent) !important;font-weight:700}
html body #main-content .ca-flux__cta:hover,html body .ca-flux__cta:hover{color:var(--ds-accent-fonce) !important}

/* --- Texte courant des cartes d'actualité : même traitement que l'intro de la carte (X12) --- */
html body .ca-flux__texte{font-size:17.5px !important;line-height:1.6 !important;font-weight:400;color:var(--ds-texte-2) !important}

/* ==========================================================================
   LOGIQUE DES COULEURS (tous les boutons secondaires)
   repos : blanc, texte bleu, contour bleu clair
   survol : fond bleu pâle, contour et texte bleu
   clic / sélectionné : aspect BO01 (orange plein, texte blanc)
   ========================================================================== */
html body :is(.ca-flux__onglet,.ca-pv__bascule button,.ca-vp__chip,.ca-sel__btn,.ca-pv__puce,.pa-fbtn,.ca-pv__fbtn,.iti__btn--clair,.np__btn--s,.fc-haut,.ca-flux__plus,.ca-btn--fantome,.ca-vis__btn,.ctp__btn--clair,.ca-cal__auj,.np__ico){
  background:#fff !important;color:var(--ds-primaire) !important;border:1.5px solid var(--ds-bordure-forte) !important;box-shadow:none !important;
  transition:background var(--ds-transition),border-color var(--ds-transition),color var(--ds-transition),transform var(--ds-transition);
}
html body :is(.ca-flux__onglet,.ca-pv__bascule button,.ca-vp__chip,.ca-sel__btn,.ca-pv__puce,.pa-fbtn,.ca-pv__fbtn,.iti__btn--clair,.np__btn--s,.fc-haut,.ca-flux__plus,.ca-btn--fantome,.ca-vis__btn,.ctp__btn--clair,.ca-cal__auj,.np__ico):hover,
html body #main-content .ca-cal--large :is(.ca-cal__nav,.ca-cal__auj):hover:not(:disabled){
  background:var(--ds-primaire-pale) !important;border-color:var(--ds-primaire) !important;color:var(--ds-primaire-fonce) !important;
}
/* clic et état sélectionné = BO01 */
html body :is(.ca-flux__onglet,.ca-pv__bascule button,.ca-vp__chip,.ca-sel__btn,.ca-pv__puce,.pa-fbtn,.ca-pv__fbtn,.iti__btn--clair,.np__btn--s,.fc-haut,.ca-flux__plus,.ca-btn--fantome,.ca-vis__btn,.ctp__btn--clair,.ca-cal__auj,.np__ico):active,
html body :is(.ca-flux__onglet,.ca-pv__bascule button,.ca-vp__chip,.ca-sel__btn,.ca-pv__puce,.pa-fbtn,.ca-pv__fbtn,.ca-cal__auj)[aria-pressed="true"],
html body :is(.ca-flux__onglet,.ca-vp__chip,.ca-sel__btn,.ca-pv__puce,.pa-fbtn,.ca-pv__fbtn,.ca-pv__bascule button).is-actif,
html body :is(.ca-flux__onglet,.ca-vp__chip,.ca-pv__bascule button).on,
html body :is(.ca-flux__onglet,.ca-pv__bascule button).actif,
html body :is(.ca-flux__onglet,.ca-vp__chip)[aria-selected="true"],
html body .pa-fbtn.is-filtre,
html body #main-content .ca-cal--large :is(.ca-cal__nav,.ca-cal__auj):active:not(:disabled){
  background:var(--ds-accent) !important;border-color:var(--ds-accent) !important;color:#fff !important;
}
html body .ca-pv__puce[aria-pressed="true"] small,html body .ca-vp__chip[aria-pressed="true"] small{color:#fff !important}
/* onglets du bloc Mon trip */
html body .ctp__onglets button:hover{color:var(--ds-primaire)}
html body .ctp__onglets button:active,html body .ctp__onglets button[aria-selected="true"]{background:var(--ds-accent) !important;color:#fff !important;box-shadow:none}
/* Calendrier : flèches */
html body #main-content .ca-cal--large .ca-cal__nav,html body #main-content .ca-cal--large .ca-cal__auj{background:#fff !important;color:var(--ds-primaire) !important;border:1.5px solid var(--ds-bordure-forte) !important}

/* Bascule Liste / Calendrier : le conteneur est neutre, seuls les deux boutons ont un style */
html body:not(#_) .ca-pv__bascule{display:inline-flex;gap:8px;padding:0 !important;margin-left:auto;background:transparent !important;border:0 !important;border-radius:0 !important;box-shadow:none !important;height:auto !important;min-height:0 !important}
html body:not(#_) .ca-pv__bascule button{min-height:44px !important;height:44px !important;padding:0 18px}

/* Barre de recherche et filtres des projets : plus de barre flottante, elle reste en haut de la liste */
html body:not(#_) .ca-pv__barre{position:static !important;top:auto !important;box-shadow:none !important;border-bottom:0 !important;padding:0 !important;margin:0 0 16px !important}

/* « Tout marquer comme lu » et autres boutons clairs de l'espace membre : secondaires */
html body:not(#_) .ca-me__btn--clair{min-height:44px;padding:0 20px;border:1.5px solid var(--ds-bordure-forte,#B9C9E6) !important;border-radius:var(--ds-r-m,14px) !important;background:#fff !important;color:var(--ds-primaire,#124A9E) !important;box-shadow:none !important;font:700 16px 'Barlow',system-ui,sans-serif !important;letter-spacing:normal !important;text-transform:none !important;transition:background .18s,border-color .18s,color .18s}
html body:not(#_) .ca-me__btn--clair:hover{background:var(--ds-primaire-pale,#EEF3FB) !important;border-color:var(--ds-primaire,#124A9E) !important;color:var(--ds-primaire-fonce,#0B3C91) !important}
html body:not(#_) .ca-me__btn--clair:active{background:var(--ds-accent,#ec9521) !important;border-color:var(--ds-accent,#ec9521) !important;color:#fff !important}

/* ==========================================================================
   Onglets Halloween et Noël du fil : une teinte de base (rouge / vert), une animation à thème au survol et quand ils sont actifs
   ========================================================================== */
html body:not(#_) :is(.ca-flux__onglet--halloween,.ca-flux__onglet--noel){position:relative;overflow:visible}
html body:not(#_) .ca-flux__onglet--halloween{background:#FDECEF !important;border-color:#E3A3B0 !important;color:#8E1024 !important}
html body:not(#_) .ca-flux__onglet--halloween:hover{background:#F9D5DC !important;border-color:#8E1024 !important;color:#6E0C1B !important}
html body:not(#_) .ca-flux__onglet--halloween:is(.is-actif,.on,.actif,[aria-selected="true"],[aria-pressed="true"]),html body:not(#_) .ca-flux__onglet--halloween:active{background:#8E1024 !important;border-color:#8E1024 !important;color:#fff !important}
html body:not(#_) .ca-flux__onglet--noel{background:#E8F5EC !important;border-color:#9FD1B0 !important;color:#1B6B3A !important}
html body:not(#_) .ca-flux__onglet--noel:hover{background:#D3EBDB !important;border-color:#1B6B3A !important;color:#145429 !important}
html body:not(#_) .ca-flux__onglet--noel:is(.is-actif,.on,.actif,[aria-selected="true"],[aria-pressed="true"]),html body:not(#_) .ca-flux__onglet--noel:active{background:#1B6B3A !important;border-color:#1B6B3A !important;color:#fff !important}
/* petites bêtes qui volent autour du bouton */
html body:not(#_) :is(.ca-flux__onglet--halloween,.ca-flux__onglet--noel)::before,html body:not(#_) :is(.ca-flux__onglet--halloween,.ca-flux__onglet--noel)::after{position:absolute;pointer-events:none;line-height:1;opacity:0}
html body:not(#_) .ca-flux__onglet--halloween::before{content:"🦇";left:-6px;top:-12px;font-size:17px}
html body:not(#_) .ca-flux__onglet--halloween::after{content:"🎃";right:-4px;top:-13px;font-size:16px}
html body:not(#_) .ca-flux__onglet--halloween:is(:hover,.is-actif,.on,.actif,[aria-selected="true"],[aria-pressed="true"])::before{opacity:1;animation:ds-chauve 2.2s ease-in-out infinite !important}
html body:not(#_) .ca-flux__onglet--halloween:is(:hover,.is-actif,.on,.actif,[aria-selected="true"],[aria-pressed="true"])::after{opacity:1;animation:ds-citrouille 1.4s ease-in-out infinite !important}
html body:not(#_) .ca-flux__onglet--noel::before{content:"❄";left:10px;top:-14px;font-size:14px;color:#7FB8DC}
html body:not(#_) .ca-flux__onglet--noel::after{content:"❅";right:12px;top:-14px;font-size:15px;color:#9CC9E6}
html body:not(#_) .ca-flux__onglet--noel:is(:hover,.is-actif,.on,.actif,[aria-selected="true"],[aria-pressed="true"])::before{opacity:1;animation:ds-neige 2.2s linear infinite !important}
html body:not(#_) .ca-flux__onglet--noel:is(:hover,.is-actif,.on,.actif,[aria-selected="true"],[aria-pressed="true"])::after{opacity:1;animation:ds-neige 2.8s linear .7s infinite !important}
@keyframes ds-chauve{0%{transform:translate(0,0) rotate(0) scaleX(1)}20%{transform:translate(12px,-4px) rotate(10deg) scaleX(.6)}40%{transform:translate(24px,2px) rotate(-8deg) scaleX(1)}60%{transform:translate(38px,-5px) rotate(8deg) scaleX(.6)}80%{transform:translate(50px,3px) rotate(-6deg) scaleX(1)}100%{transform:translate(0,0) rotate(0) scaleX(1)}}
@keyframes ds-citrouille{0%,100%{transform:translateY(0) rotate(0)}40%{transform:translateY(-5px) rotate(14deg)}70%{transform:translateY(1px) rotate(-8deg)}}
@keyframes ds-neige{0%{transform:translate(0,0) rotate(0);opacity:0}15%{opacity:1}100%{transform:translate(-8px,62px) rotate(200deg);opacity:0}}
