/*************************************
    BOOTSTRAP 5 COMPATIBILITY SHIM

    Bootstrap 5 removed "position: relative" from the grid columns
    (Bootstrap 4 had it on every .col-*). The theme's CSS places
    absolutely positioned elements (card images, shadow titles, etc.)
    inside columns and relies on them as positioning context.
 *************************************/

.row > * {
	position: relative;
}

/* Bootstrap 4 gave every label a bottom margin (removed in BS5),
   the input fields under the labels depend on it for their spacing */
label {
	margin-bottom: 0.5rem;
}

/* Bootstrap 5 changed the grid gutter from 15px to 12px per side
   (--bs-gutter-x from 1.875rem to 1.5rem), which shrinks the rows
   and the horizontal padding of the containers and columns.
   Bootstrap sets the variable on the .row and .container elements
   themselves, so it has to be overridden there (not on :root). */
.row,
.container,
.container-fluid,
.container-sm,
.container-md,
.container-lg,
.container-xl,
.container-xxl {
	--bs-gutter-x: 1.875rem;
}

/* Bootstrap 4 capped every grid column with a max-width matching its width
   (Bootstrap 5 uses only "width", so theme rules like .bar-image { width: 100% }
   make the column grow to the full row). Restored for the column classes
   used by this theme, with the Bootstrap 4 breakpoint behavior. */
.col-2 { max-width: 16.6667%; }
.col-10 { max-width: 83.3333%; }
.col-12 { max-width: 100%; }

@media (min-width: 576px) {
	.col-sm-12 { max-width: 100%; }
}

@media (min-width: 768px) {
	.col-md-4 { max-width: 33.3333%; }
	.col-md-6 { max-width: 50%; }
	.col-md-7 { max-width: 58.3333%; }
	.col-md-8 { max-width: 66.6667%; }
}

@media (min-width: 992px) {
	.col-lg-3 { max-width: 25%; }
	.col-lg-4 { max-width: 33.3333%; }
	.col-lg-6 { max-width: 50%; }
	.col-lg-8 { max-width: 66.6667%; }
}

/* Bootstrap 5 renders <hr> with opacity: 0.25 (Bootstrap 4 was fully opaque,
   colored via the border color) */
hr {
	opacity: 1;
}

/* Bootstrap 4 had no default underline on links (BS5 underlines them) */
a {
	text-decoration: none;
}

/* Restore the Bootstrap 4 container max-widths
   (BS5 introduced a 1320px wide xxl breakpoint at 1400px) */
@media (min-width: 576px) {
	.container {
		max-width: 540px;
	}
}

@media (min-width: 768px) {
	.container {
		max-width: 720px;
	}
}

@media (min-width: 992px) {
	.container {
		max-width: 960px;
	}
}

@media (min-width: 1200px) {
	.container {
		max-width: 1140px;
	}
}
