/* ==========================================================================
 * BS4 → BS5 compatibility shim
 * Restitue les classes BS4 supprimées en BS5 (text-left, ml-N, badge-X,
 * font-weight-X, font-italic, sr-only, close, etc.) en utilisant les
 * valeurs natives BS5 pour préserver le visuel.
 * Inclus dans toutes les pages publiques altissimo qui chargent BS5.
 * ========================================================================== */

/* -- Liens : pas de souligné par défaut, souligné au hover ---------------- */
a { text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }


/* -- Alignement texte BS4 ------------------------------------------------- */
.text-left  { text-align: left !important; }
.text-right { text-align: right !important; }

/* -- Float BS4 ------------------------------------------------------------ */
.float-left  { float: left !important; }
.float-right { float: right !important; }

/* -- Margins (m[lr]-N) → mappées sur start/end BS5 ----------------------- */
.ml-0    { margin-left: 0 !important; }
.ml-1    { margin-left: .25rem !important; }
.ml-2    { margin-left: .5rem !important; }
.ml-3    { margin-left: 1rem !important; }
.ml-4    { margin-left: 1.5rem !important; }
.ml-5    { margin-left: 3rem !important; }
.ml-auto { margin-left: auto !important; }
.ml-n1   { margin-left: -.25rem !important; }
.ml-n2   { margin-left: -.5rem !important; }
.ml-n3   { margin-left: -1rem !important; }

.mr-0    { margin-right: 0 !important; }
.mr-1    { margin-right: .25rem !important; }
.mr-2    { margin-right: .5rem !important; }
.mr-3    { margin-right: 1rem !important; }
.mr-4    { margin-right: 1.5rem !important; }
.mr-5    { margin-right: 3rem !important; }
.mr-auto { margin-right: auto !important; }
.mr-n1   { margin-right: -.25rem !important; }
.mr-n2   { margin-right: -.5rem !important; }
.mr-n3   { margin-right: -1rem !important; }

/* -- Padding (p[lr]-N) → mappées sur start/end BS5 ----------------------- */
.pl-0 { padding-left: 0 !important; }
.pl-1 { padding-left: .25rem !important; }
.pl-2 { padding-left: .5rem !important; }
.pl-3 { padding-left: 1rem !important; }
.pl-4 { padding-left: 1.5rem !important; }
.pl-5 { padding-left: 3rem !important; }

.pr-0 { padding-right: 0 !important; }
.pr-1 { padding-right: .25rem !important; }
.pr-2 { padding-right: .5rem !important; }
.pr-3 { padding-right: 1rem !important; }
.pr-4 { padding-right: 1.5rem !important; }
.pr-5 { padding-right: 3rem !important; }

/* -- Responsive variants (sm, md, lg, xl) -------------------------------- */
@media (min-width: 576px) {
	.text-sm-left  { text-align: left !important; }
	.text-sm-right { text-align: right !important; }
	.float-sm-left  { float: left !important; }
	.float-sm-right { float: right !important; }
	.ml-sm-0 { margin-left: 0 !important; }
	.ml-sm-1 { margin-left: .25rem !important; }
	.ml-sm-2 { margin-left: .5rem !important; }
	.ml-sm-3 { margin-left: 1rem !important; }
	.ml-sm-auto { margin-left: auto !important; }
	.mr-sm-0 { margin-right: 0 !important; }
	.mr-sm-1 { margin-right: .25rem !important; }
	.mr-sm-2 { margin-right: .5rem !important; }
	.mr-sm-3 { margin-right: 1rem !important; }
	.mr-sm-auto { margin-right: auto !important; }
	.pl-sm-0 { padding-left: 0 !important; }
	.pl-sm-1 { padding-left: .25rem !important; }
	.pl-sm-2 { padding-left: .5rem !important; }
	.pl-sm-3 { padding-left: 1rem !important; }
	.pr-sm-0 { padding-right: 0 !important; }
	.pr-sm-3 { padding-right: 1rem !important; }
}
@media (min-width: 768px) {
	.text-md-left  { text-align: left !important; }
	.text-md-right { text-align: right !important; }
	.float-md-left  { float: left !important; }
	.float-md-right { float: right !important; }
	.ml-md-0 { margin-left: 0 !important; }
	.ml-md-1 { margin-left: .25rem !important; }
	.ml-md-2 { margin-left: .5rem !important; }
	.ml-md-3 { margin-left: 1rem !important; }
	.ml-md-auto { margin-left: auto !important; }
	.mr-md-0 { margin-right: 0 !important; }
	.mr-md-1 { margin-right: .25rem !important; }
	.mr-md-2 { margin-right: .5rem !important; }
	.mr-md-3 { margin-right: 1rem !important; }
	.mr-md-auto { margin-right: auto !important; }
	.pl-md-0 { padding-left: 0 !important; }
	.pl-md-3 { padding-left: 1rem !important; }
	.pr-md-0 { padding-right: 0 !important; }
	.pr-md-3 { padding-right: 1rem !important; }
}
@media (min-width: 992px) {
	.text-lg-left  { text-align: left !important; }
	.text-lg-right { text-align: right !important; }
	.float-lg-left  { float: left !important; }
	.float-lg-right { float: right !important; }
	.ml-lg-0 { margin-left: 0 !important; }
	.ml-lg-1 { margin-left: .25rem !important; }
	.ml-lg-2 { margin-left: .5rem !important; }
	.ml-lg-3 { margin-left: 1rem !important; }
	.ml-lg-auto { margin-left: auto !important; }
	.mr-lg-0 { margin-right: 0 !important; }
	.mr-lg-1 { margin-right: .25rem !important; }
	.mr-lg-2 { margin-right: .5rem !important; }
	.mr-lg-3 { margin-right: 1rem !important; }
	.mr-lg-auto { margin-right: auto !important; }
}
@media (min-width: 1200px) {
	.text-xl-left  { text-align: left !important; }
	.text-xl-right { text-align: right !important; }
	.ml-xl-auto { margin-left: auto !important; }
	.mr-xl-auto { margin-right: auto !important; }
}

/* -- Badges (BS4) — mêmes couleurs que BS5 .bg-* ------------------------- */
.badge-primary   { background-color: #0d6efd; color: #fff; }
.badge-secondary { background-color: #6c757d; color: #fff; }
.badge-success   { background-color: #198754; color: #fff; }
.badge-info      { background-color: #0dcaf0; color: #000; }
.badge-warning   { background-color: #ffc107; color: #000; }
.badge-danger    { background-color: #dc3545; color: #fff; }
.badge-light     { background-color: #f8f9fa; color: #000; }
.badge-dark      { background-color: #212529; color: #fff; }

/* -- Font weight BS4 ------------------------------------------------------ */
.font-weight-light    { font-weight: 300 !important; }
.font-weight-lighter  { font-weight: lighter !important; }
.font-weight-normal   { font-weight: 400 !important; }
.font-weight-bold     { font-weight: 700 !important; }
.font-weight-bolder   { font-weight: bolder !important; }

/* -- Italic ---------------------------------------------------------------- */
.font-italic { font-style: italic !important; }

/* -- sr-only --------------------------------------------------------------- */
.sr-only,
.sr-only-focusable:not(:focus) {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* -- Close button (BS4 style) — rendu × via ::after --------------------- */
button.close,
span.close,
.modal-header .close {
	padding: 0 .5rem;
	margin: 0;
	background: transparent;
	border: 0;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1;
	color: #000;
	opacity: .5;
	cursor: pointer;
}
button.close::after,
span.close::after,
.modal-header .close::after {
	content: "×";
	display: inline-block;
}
button.close:hover,
span.close:hover,
.modal-header .close:hover {
	opacity: .75;
}

/* -- form-row (BS4 — supprimé en BS5) ----------------------------------- */
.form-row {
	display: flex;
	flex-wrap: wrap;
	margin-right: -5px;
	margin-left: -5px;
}
.form-row > .col,
.form-row > [class*="col-"] {
	padding-right: 5px;
	padding-left: 5px;
}

/* -- form-group (BS4 — gardé en BS5 mais sans style) ------------------ */
.form-group {
	margin-bottom: 1rem;
}

/* -- no-gutters (BS4 — devenu g-0 en BS5) ------------------------------ */
.no-gutters {
	margin-right: 0 !important;
	margin-left: 0 !important;
}
.no-gutters > .col,
.no-gutters > [class*="col-"] {
	padding-right: 0 !important;
	padding-left: 0 !important;
}

/* -- custom-control / custom-checkbox / custom-radio (BS4 → form-check) - */
.custom-control {
	position: relative;
	display: block;
	min-height: 1.5rem;
	padding-left: 1.5rem;
}
.custom-control-input {
	position: absolute;
	z-index: -1;
	opacity: 0;
	width: 1em;
	height: 1.25em;
	margin-top: .25em;
}
.custom-control-label {
	position: relative;
	margin-bottom: 0;
	vertical-align: top;
	cursor: pointer;
}
.custom-control-label::before {
	position: absolute;
	top: .25rem;
	left: -1.5rem;
	display: block;
	width: 1rem;
	height: 1rem;
	pointer-events: none;
	content: "";
	background-color: #fff;
	border: #adb5bd solid 1px;
}
.custom-checkbox .custom-control-label::before {
	border-radius: .25rem;
}
.custom-radio .custom-control-label::before {
	border-radius: 50%;
}
.custom-control-input:checked ~ .custom-control-label::before {
	color: #fff;
	background-color: #0d6efd;
	border-color: #0d6efd;
}
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after {
	position: absolute;
	top: .35rem;
	left: -1.35rem;
	width: .7rem;
	height: .7rem;
	content: "";
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E") no-repeat center/contain;
}

/* -- Embed responsive (BS4) — mappé sur .ratio BS5 ---------------------- */
.embed-responsive {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	overflow: hidden;
}
.embed-responsive::before { display: block; content: ""; }
.embed-responsive-16by9::before { padding-top: 56.25%; }
.embed-responsive-4by3::before  { padding-top: 75%; }
.embed-responsive-21by9::before { padding-top: 42.857143%; }
.embed-responsive-1by1::before  { padding-top: 100%; }
.embed-responsive-item,
.embed-responsive iframe,
.embed-responsive embed,
.embed-responsive object,
.embed-responsive video {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}


/* -- Containers : BS5 va jusqu'à 1140 (xl) puis 1320 (xxl).
   Pour préserver le visuel des sites historiques BS4, on plafonne à 1130
   dès le breakpoint xl (≥1200px).                                          */
@media (min-width: 1200px) {
	.container,
	.container-sm,
	.container-md,
	.container-lg,
	.container-xl,
	.container-xxl { max-width: 1130px; }
}
