/**
 * BooThème — Styles du thème.
 *
 * Chargé après Bootstrap, le reset WordPress et le CSS dynamique des réglages.
 * Les couleurs et polices passent par les variables CSS (--bs-*, --bootheme-*)
 * pour rester pilotées par Réglages > Thème site.
 *
 * Sommaire
 *   1. Header et navigation
 *   2. Contenu éditorial
 *   3. Cartes d'articles
 *   4. Catégories (badges, couleurs du header, contenu riche)
 *   5. Barre latérale et widgets
 *   6. Navigation entre articles
 *   7. Recherche
 *   8. Pied de page
 */

/* ==========================================================================
   1. Header et navigation
   ========================================================================== */

.bootheme-logo {
	width: auto;
	max-height: 40px;
}

.site-header .navbar-brand {
	padding-top: 0;
	padding-bottom: 0;
}

.site-header .dropdown-menu {
	--bs-dropdown-font-size: .9375rem;
}

@media (max-width: 991.98px) {
	.site-header .navbar-collapse {
		padding-top: .75rem;
	}

	.site-header .dropdown-menu {
		border: 0;
	}
}

/* Ancre du lien d'évitement : pas de décalage sous la barre d'admin. */
#primary:focus {
	outline: none;
}

/* ==========================================================================
   2. Contenu éditorial
   ========================================================================== */

.entry-content > :last-child {
	margin-bottom: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
	margin-top: 2rem;
}

.entry-content a:not(.btn) {
	text-underline-offset: .2em;
}

/* ==========================================================================
   3. Cartes d'articles
   ========================================================================== */

.bootheme-card {
	transition: transform .15s ease-in-out, box-shadow .15s ease-in-out;
}

.bootheme-card:hover {
	box-shadow: var(--bs-box-shadow) !important;
	transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
	.bootheme-card,
	.bootheme-card:hover {
		transition: none;
		transform: none;
	}
}

.bootheme-card__media img {
	width: 100%;
	height: 100%;
}

.bootheme-card .card-text p:last-child {
	margin-bottom: 0;
}

/* ==========================================================================
   4. Catégories — la couleur vient de .bootheme-cat-{ID} (CSS dynamique)
   ========================================================================== */

.bootheme-cat-badge {
	color: var(--bootheme-cat-contrast, var(--bootheme-primary-contrast, #fff));
	background-color: var(--bootheme-cat-color, var(--bs-primary));
}

.bootheme-cat-badge:hover,
.bootheme-cat-badge:focus {
	color: var(--bootheme-cat-contrast, var(--bootheme-primary-contrast, #fff));
	filter: brightness(.9);
}

/* Utilitaires couleur de catégorie (équivalents de .bg-* / .text-* de Bootstrap). */
.bootheme-cat-bg {
	background-color: var(--bootheme-cat-color, var(--bs-primary));
}

.bootheme-cat-text {
	color: var(--bootheme-cat-contrast, var(--bootheme-primary-contrast, #fff));
}

/* Image du header : conserve les proportions malgré les attributs width/height (w-75). */
.bootheme-cat-header--has-image img {
	height: auto;
}

.bootheme-cat-content {
	padding-left: 1rem;
	border-left: .25rem solid var(--bootheme-cat-color, var(--bs-primary));
}

/* ==========================================================================
   5. Barre latérale et widgets
   ========================================================================== */

@media (min-width: 992px) {
	.bootheme-sidebar-inner {
		position: sticky;
		top: 1.5rem;
	}

	.admin-bar .bootheme-sidebar-inner {
		top: calc(32px + 1.5rem);
	}
}

.widget-area .widget {
	padding: 1.25rem;
	background-color: var(--bs-tertiary-bg);
	border-radius: var(--bs-border-radius-lg);
}

.widget-title {
	color: var(--bs-emphasis-color);
}

/* ==========================================================================
   6. Navigation entre articles
   ========================================================================== */

.bootheme-post-navigation,
.bootheme-comments-navigation {
	margin-top: 3rem;
	margin-bottom: 3rem;
}

.bootheme-post-navigation .nav-links {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
	gap: 1rem;
}

.bootheme-comments-navigation .nav-links {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}

.bootheme-post-navigation .nav-next {
	text-align: right;
}

.bootheme-post-navigation a {
	display: block;
	height: 100%;
	padding: 1rem;
	color: var(--bs-body-color);
	text-decoration: none;
	border: var(--bs-border-width) solid var(--bs-border-color);
	border-radius: var(--bs-border-radius-lg);
	transition: border-color .15s ease-in-out;
}

.bootheme-post-navigation a:hover,
.bootheme-post-navigation a:focus {
	border-color: var(--bs-primary);
}

/* ==========================================================================
   7. Recherche
   ========================================================================== */

.bootheme-search-thumb img {
	width: 80px;
	height: 80px;
}

.list-group-item .stretched-link:focus-visible {
	outline: none;
}

/* ==========================================================================
   8. Pied de page
   ========================================================================== */

.site-footer .widget {
	margin-bottom: 0;
}

.site-footer .nav-link:hover,
.site-footer .nav-link:focus {
	color: var(--bs-emphasis-color) !important;
}
