/*
 * Harmonisation des zones de contenu ARTsynonyme.
 * Le header est volontairement hors périmètre : les règles sont limitées
 * au contenu principal, aux fenêtres modales et au pied de page.
 */

:where(main, .modal, .offcanvas, footer) {
  --bs-primary: #133b63;
  --bs-primary-rgb: 19, 59, 99;
  --bs-primary-text-emphasis: #0d2847;
  --bs-primary-bg-subtle: #e6ecf2;
  --bs-primary-border-subtle: #b8c8d8;
  --bs-link-color: #133b63;
  --bs-link-color-rgb: 19, 59, 99;
  --bs-link-hover-color: #0d2847;
  --bs-link-hover-color-rgb: 13, 40, 71;
}

/* Boutons plus compacts, sans écraser les boutons-icônes à taille fixe. */
:where(main, .modal, .offcanvas, footer) .btn {
  --bs-btn-padding-y: .28rem;
  --bs-btn-padding-x: .62rem;
  --bs-btn-font-size: .86rem;
  --bs-btn-line-height: 1.35;
}

:where(main, .modal, .offcanvas, footer) .btn-sm {
  --bs-btn-padding-y: .18rem;
  --bs-btn-padding-x: .48rem;
  --bs-btn-font-size: .78rem;
}

:where(main, .modal, .offcanvas, footer) .btn-lg {
  --bs-btn-padding-y: .34rem;
  --bs-btn-padding-x: .75rem;
  --bs-btn-font-size: .92rem;
}

/* Le formulaire du pied de page possédait un espacement propre plus grand. */
.as-public-footer-wrap footer form .btn {
  padding: .28rem .62rem;
  font-size: .86rem;
  line-height: 1.35;
}

:where(main, .modal, .offcanvas, footer) .btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: #133b63;
  --bs-btn-border-color: #133b63;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #0d2847;
  --bs-btn-hover-border-color: #0d2847;
  --bs-btn-focus-shadow-rgb: 19, 59, 99;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #0d2847;
  --bs-btn-active-border-color: #0d2847;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: #133b63;
  --bs-btn-disabled-border-color: #133b63;
}

:where(main, .modal, .offcanvas, footer) .btn-outline-primary {
  --bs-btn-color: #133b63;
  --bs-btn-border-color: #133b63;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #133b63;
  --bs-btn-hover-border-color: #133b63;
  --bs-btn-focus-shadow-rgb: 19, 59, 99;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #133b63;
  --bs-btn-active-border-color: #133b63;
  --bs-btn-disabled-color: #133b63;
  --bs-btn-disabled-border-color: #133b63;
}

:where(main, .modal, .offcanvas, footer) .text-primary {
  color: #133b63 !important;
}

:where(main, .modal, .offcanvas, footer) .bg-primary,
:where(main, .modal, .offcanvas, footer) .text-bg-primary {
  background-color: #133b63 !important;
}

:where(main, .modal, .offcanvas, footer) .border-primary {
  border-color: #133b63 !important;
}

:where(main, .modal, .offcanvas, footer) :where(.nav-pills, .progress) {
  --bs-nav-pills-link-active-bg: #133b63;
  --bs-progress-bar-bg: #133b63;
}

:where(main, .modal, .offcanvas, footer) .dropdown-item.active,
:where(main, .modal, .offcanvas, footer) .dropdown-item:active,
:where(main, .modal, .offcanvas, footer) .list-group-item.active,
:where(main, .modal, .offcanvas, footer) .page-item.active .page-link {
  background-color: #133b63;
  border-color: #133b63;
}

:where(main, .modal, .offcanvas, footer) .page-link {
  color: #133b63;
}

:where(main, .modal, .offcanvas, footer) .form-check-input:checked {
  background-color: #133b63;
  border-color: #133b63;
}

:where(main, .modal, .offcanvas, footer) :where(.form-control, .form-select):focus {
  border-color: #53799d;
  box-shadow: 0 0 0 .2rem rgba(19, 59, 99, .18);
}

/* Icônes du contenu en bleu de marque. Les icônes placées sur un fond plein
   conservent la couleur du texte du composant afin de rester lisibles. */
:where(main, .modal, .offcanvas, footer) :where(svg, i.bi) {
  color: #133b63 !important;
}

/* Le widget de chat visiteur ("Une question ?") a son propre fond bleu
   marine et ses icônes (SVG + i.bi-headphones) sont en blanc par design
   (currentColor hérité de .as-vchat-launcher). La règle générale ci-dessus
   forçait leur couleur en bleu marine identique au fond : icône invisible
   (bleu sur bleu). On exclut donc ce widget flottant, qui n'appartient pas
   au flux de contenu visé par la règle. */
.as-vchat :where(svg, i.bi) {
  color: inherit !important;
}

:where(main, .modal, .offcanvas, footer)
  :where(.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-dark, .badge, .progress-bar)
  :where(svg, i.bi) {
  color: inherit !important;
}

:where(main, .modal, .offcanvas, footer)
  :where(.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-dark):is(:hover, :focus, :active, .active)
  :where(svg, i.bi) {
  color: inherit !important;
}
