/* =====================================================
 *  Blog Numérique - Recent Posts
 *  Version 1.2.0
 *  ===================================================== */

.bnb-recent-posts {

	--bnb-accent: #dc3545;
	--bnb-columns: 2;
	--bnb-image-ratio: 16 / 9;
	--bnb-radius: 14px;
	--bnb-border: #e8eaed;
	--bnb-text: #1f2328;
	--bnb-muted: #6b7280;
	--bnb-surface: #ffffff;
	--bnb-soft: #f5f6f8;
	--bnb-gap: 18px;

	margin: 40px 0;

	color: var(--bnb-text);

	font-size: 1rem;
	line-height: 1.6;
}

.bnb-recent-posts,
.bnb-recent-posts *,
.bnb-recent-posts *::before,
.bnb-recent-posts *::after {

	box-sizing: border-box;
}

/* =====================================================
 *  LIENS
 *  ===================================================== */

.bnb-recent-posts a {

	color: inherit;

	text-decoration: none !important;

	transition:
		color .18s ease,
		background-color .18s ease,
		border-color .18s ease,
		opacity .18s ease;
}

.bnb-recent-posts a:focus-visible {

	outline: 2px solid var(--bnb-accent);
	outline-offset: 3px;

	border-radius: 4px;
}

/* =====================================================
 *  ICONES
 *  ===================================================== */

.bnb-recent-posts .bnb-icon {

	display: inline-block;

	flex: 0 0 auto;

	vertical-align: -0.125em;
}

/* =====================================================
 *  ENTETE
 *  ===================================================== */

.bnb-recent-posts .bnb-header {

	margin-bottom: 24px;
}

.bnb-recent-posts .bnb-title {

	display: flex;
	align-items: center;

	gap: 10px;

	margin: 0 0 12px;

	color: var(--bnb-text);

	font-size: clamp(1.45rem, 1.4rem + 0.4vw, 1.8rem);
	font-weight: 700;
	line-height: 1.2;
}

.bnb-recent-posts .bnb-header-icon {

	flex: 0 0 auto;

	color: var(--bnb-accent);

	font-size: 1.08em;
}

.bnb-recent-posts .bnb-header::after {

	content: "";

	display: block;

	height: 3px;

	border-radius: 2px;

	background: linear-gradient(
		90deg,
		var(--bnb-accent) 0,
		var(--bnb-accent) 120px,
		var(--bnb-border) 120px,
		var(--bnb-border) 100%
	);
}

/* =====================================================
 *  GRILLE
 *  ===================================================== */

.bnb-recent-posts .bnb-grid {

	display: grid;

	grid-template-columns: repeat(var(--bnb-columns), minmax(0, 1fr));

	gap: var(--bnb-gap);

	align-items: stretch;
}

/* =====================================================
 *  ARTICLE VEDETTE
 *  ===================================================== */

.bnb-recent-posts .bnb-hero {

	grid-column: 1 / -1;

	background: var(--bnb-surface);

	border: 1px solid var(--bnb-border);
	border-radius: calc(var(--bnb-radius) + 2px);

	overflow: hidden;

	transition:
		transform .25s ease,
		box-shadow .25s ease,
		border-color .25s ease;
}

.bnb-recent-posts .bnb-hero:hover {

	transform: translateY(-2px);

	border-color: #dfe3e8;

	box-shadow: 0 10px 24px rgba(15, 23, 42, .09);
}

.bnb-recent-posts .bnb-hero-media {

	display: block;

	width: 100%;
	height: 280px;

	overflow: hidden;

	background: var(--bnb-soft);
}

.bnb-recent-posts .bnb-hero-media img,
.bnb-recent-posts .bnb-card-media img {

	display: block;

	width: 100%;
	height: 100%;

	object-fit: cover;
}

.bnb-recent-posts .bnb-hero-content {

	padding: 22px 24px 24px;
}

.bnb-recent-posts .bnb-hero-title {

	margin: 0 0 10px;

	color: var(--bnb-text);

	font-size: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
	font-weight: 700;
	line-height: 1.3;

	overflow-wrap: anywhere;
}

.bnb-recent-posts .bnb-hero:hover .bnb-hero-title a {

	color: var(--bnb-accent);
}

.bnb-recent-posts .bnb-hero .bnb-excerpt {

	margin: 0 0 14px;

	font-size: .98rem;
}

/* =====================================================
 *  CARTES
 *  ===================================================== */

.bnb-recent-posts .bnb-card {

	display: flex;
	flex-direction: column;

	background: var(--bnb-surface);

	border: 1px solid var(--bnb-border);
	border-radius: var(--bnb-radius);

	overflow: hidden;

	transition:
		transform .25s ease,
		box-shadow .25s ease,
		border-color .25s ease;
}

.bnb-recent-posts .bnb-card:hover {

	transform: translateY(-2px);

	border-color: #dfe3e8;

	box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}

.bnb-recent-posts .bnb-card-media {

	display: block;

	width: 100%;

	aspect-ratio: var(--bnb-image-ratio);

	overflow: hidden;

	background: var(--bnb-soft);
}

.bnb-recent-posts .bnb-card-media img {

	transition: transform .35s ease;
}

.bnb-recent-posts .bnb-card:hover .bnb-card-media img {

	transform: scale(1.03);
}

.bnb-recent-posts .bnb-card-content {

	display: flex;
	flex: 1;
	flex-direction: column;

	padding: 16px 18px 18px;
}

.bnb-recent-posts .bnb-card-title {

	margin: 0 0 8px;

	color: var(--bnb-text);

	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.4;

	overflow-wrap: anywhere;
}

.bnb-recent-posts .bnb-card:hover .bnb-card-title a {

	color: var(--bnb-accent);
}

/* =====================================================
 *  VISUEL DE REMPLACEMENT
 *  ===================================================== */

.bnb-recent-posts .bnb-media-placeholder {

	display: flex;
	align-items: center;
	justify-content: center;

	width: 100%;
	height: 100%;

	color: var(--bnb-accent);

	background: linear-gradient(135deg, #f8f9fb 0%, #eef0f3 100%);

	font-size: 2rem;

	opacity: .85;
}

.bnb-recent-posts .bnb-hero-media .bnb-media-placeholder {

	font-size: 3rem;
}

/* =====================================================
 *  CATEGORIE
 *  ===================================================== */

.bnb-recent-posts .bnb-category {

	display: inline-flex;
	align-self: flex-start;
	align-items: center;

	max-width: 100%;

	margin-bottom: 9px;
	padding: 4px 9px;

	border-radius: 100px;

	background: var(--bnb-soft);
	color: var(--bnb-accent);

	font-size: .72rem;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: .04em;
	text-transform: uppercase;

	overflow-wrap: anywhere;
}

.bnb-recent-posts .bnb-category:hover {

	background: #eceef1;
}

.bnb-recent-posts .bnb-hero .bnb-category {

	background: var(--bnb-accent);
	color: #fff;
}

.bnb-recent-posts .bnb-hero .bnb-category:hover {

	background: var(--bnb-accent);

	filter: brightness(.95);
}

/* =====================================================
 *  EXTRAIT
 *  ===================================================== */

.bnb-recent-posts .bnb-excerpt {

	margin: 0;

	color: #5b6470;

	font-size: .92rem;
	line-height: 1.65;
}

.bnb-recent-posts .bnb-card .bnb-excerpt {

	display: -webkit-box;

	overflow: hidden;

	margin-bottom: 12px;

	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

/* =====================================================
 *  META
 *  ===================================================== */

.bnb-recent-posts .bnb-meta {

	display: flex;
	flex-wrap: wrap;
	align-items: center;

	gap: 6px 14px;

	margin-top: auto;

	color: var(--bnb-muted);

	font-size: .8rem;
	line-height: 1.4;
}

.bnb-recent-posts .bnb-meta-item {

	display: inline-flex;
	align-items: center;

	gap: 5px;

	min-width: 0;

	color: inherit;

	overflow-wrap: anywhere;
}

.bnb-recent-posts .bnb-meta a:hover {

	color: var(--bnb-accent);
}

.bnb-recent-posts .bnb-meta-icon {

	font-size: 1em;

	opacity: .8;
}

.bnb-recent-posts .bnb-hero .bnb-meta {

	margin-top: 14px;
}

/* =====================================================
 *  BOUTON
 *  ===================================================== */

.bnb-recent-posts .bnb-footer {

	display: flex;
	justify-content: center;

	margin-top: 26px;
}

.bnb-recent-posts .bnb-button {

	display: inline-flex;
	align-items: center;

	gap: 9px;

	padding: 11px 22px;

	border-radius: 100px;

	background: var(--bnb-accent);
	color: #fff !important;

	font-size: .9rem;
	font-weight: 600;
	line-height: 1.2;

	box-shadow: 0 4px 12px rgba(15, 23, 42, .12);

	transition:
		transform .2s ease,
		box-shadow .2s ease,
		filter .2s ease;
}

.bnb-recent-posts .bnb-button:hover {

	color: #fff !important;

	transform: translateY(-1px);

	filter: brightness(.97);

	box-shadow: 0 7px 18px rgba(15, 23, 42, .18);
}

.bnb-recent-posts .bnb-button:focus-visible {

	outline: 2px solid #fff;
	outline-offset: 2px;

	box-shadow: 0 0 0 4px var(--bnb-accent);
}

.bnb-recent-posts .bnb-button-icon {

	font-size: 1.05em;
}

/* =====================================================
 *  STYLE : LISTE COMPACTE
 *  ===================================================== */

.bnb-recent-posts.bnb-layout--compact .bnb-grid,
.bnb-recent-posts.bnb-layout--list .bnb-grid {

	grid-template-columns: 1fr;
}

.bnb-recent-posts.bnb-layout--compact .bnb-card {

	flex-direction: row;
	align-items: stretch;
}

.bnb-recent-posts.bnb-layout--compact .bnb-card-media {

	flex: 0 0 150px;

	width: 150px;
	min-width: 150px;

	align-self: stretch;

	aspect-ratio: auto;
}

.bnb-recent-posts.bnb-layout--compact .bnb-card-content {

	padding: 14px 18px;
}

.bnb-recent-posts.bnb-layout--compact .bnb-card-title {

	font-size: 1rem;
}

.bnb-recent-posts.bnb-layout--compact .bnb-excerpt {

	-webkit-line-clamp: 2;
}

/* =====================================================
 *  STYLE : LISTE SIMPLE
 *  ===================================================== */

.bnb-recent-posts.bnb-layout--list .bnb-grid {

	gap: 0;
}

.bnb-recent-posts.bnb-layout--list .bnb-card,
.bnb-recent-posts.bnb-layout--list .bnb-hero {

	overflow: visible;

	background: transparent;

	border: 0;
	border-bottom: 1px solid var(--bnb-border);
	border-radius: 0;

	box-shadow: none;
}

.bnb-recent-posts.bnb-layout--list .bnb-grid > :first-child {

	border-top: 1px solid var(--bnb-border);
}

.bnb-recent-posts.bnb-layout--list .bnb-card:hover,
.bnb-recent-posts.bnb-layout--list .bnb-hero:hover {

	transform: none;

	border-color: var(--bnb-border);

	box-shadow: none;
}

.bnb-recent-posts.bnb-layout--list .bnb-card-content,
.bnb-recent-posts.bnb-layout--list .bnb-hero-content {

	padding: 16px 0;
}

.bnb-recent-posts.bnb-layout--list .bnb-card-title,
.bnb-recent-posts.bnb-layout--list .bnb-hero-title {

	font-size: 1.12rem;
}

.bnb-recent-posts.bnb-layout--list .bnb-hero-media {

	display: none;
}

.bnb-recent-posts.bnb-layout--list .bnb-excerpt {

	-webkit-line-clamp: 2;
}

.bnb-recent-posts.bnb-layout--list .bnb-card:hover .bnb-card-title a,
.bnb-recent-posts.bnb-layout--list .bnb-hero:hover .bnb-hero-title a {

	color: var(--bnb-accent);
}

/* =====================================================
 *  STYLE : TIMELINE
 *  ===================================================== */

.bnb-recent-posts .bnb-timeline {

	position: relative;

	margin: 0;
	padding: 0;
}

.bnb-recent-posts .bnb-timeline::before {

	content: "";

	position: absolute;
	top: 8px;
	bottom: 8px;
	left: 88px;

	width: 2px;

	background: var(--bnb-border);
}

.bnb-recent-posts .bnb-timeline-list {

	margin: 0;
	padding: 0;

	list-style: none;
}

.bnb-recent-posts .bnb-timeline-day + .bnb-timeline-day {

	margin-top: 10px;
}

.bnb-recent-posts .bnb-timeline-day-label {

	position: relative;

	margin: 0 0 14px;
	padding-left: 112px;

	color: var(--bnb-text);

	font-size: .78rem;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: .07em;
	text-transform: uppercase;
}

.bnb-recent-posts .bnb-timeline-day-label::before {

	content: "";

	position: absolute;
	top: 50%;
	left: 80px;

	width: 18px;
	height: 18px;

	border: 3px solid var(--bnb-surface);
	border-radius: 50%;

	background: var(--bnb-accent);

	box-shadow: 0 0 0 2px var(--bnb-accent);

	transform: translateY(-50%);
}

.bnb-recent-posts .bnb-timeline-item {

	position: relative;

	padding-left: 112px;
	padding-bottom: 22px;

	list-style: none;
}

.bnb-recent-posts .bnb-timeline-item:last-child {

	padding-bottom: 4px;
}

.bnb-recent-posts .bnb-timeline-marker {

	position: absolute;
	top: 8px;
	left: 83px;
	z-index: 1;

	width: 12px;
	height: 12px;

	border: 2px solid var(--bnb-surface);
	border-radius: 50%;

	background: var(--bnb-accent);

	box-shadow: 0 0 0 2px var(--bnb-border);
}

.bnb-recent-posts .bnb-timeline-time {

	position: absolute;
	top: 4px;
	left: 0;

	width: 70px;

	color: var(--bnb-muted);

	font-size: .8rem;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	line-height: 1.35;
	text-align: right;
	white-space: normal;
}

.bnb-recent-posts .bnb-timeline-date {

	display: block;

	color: var(--bnb-muted);

	font-size: .68rem;
	font-weight: 500;
	line-height: 1.4;
	text-transform: uppercase;

	overflow-wrap: anywhere;
}

.bnb-recent-posts .bnb-timeline-hour {

	display: block;

	white-space: nowrap;
}

.bnb-recent-posts .bnb-timeline-entry {

	display: flex;
	align-items: flex-start;

	gap: 16px;

	min-width: 0;
}

.bnb-recent-posts .bnb-timeline-body {

	flex: 1 1 auto;

	min-width: 0;
}

.bnb-recent-posts .bnb-timeline-media {

	display: block;
	flex: 0 0 144px;

	width: 144px;

	aspect-ratio: var(--bnb-image-ratio);

	overflow: hidden;

	border-radius: 10px;

	background: var(--bnb-soft);
}

.bnb-recent-posts .bnb-timeline-media img {

	display: block;

	width: 100%;
	height: 100%;

	object-fit: cover;

	transition: transform .35s ease;
}

.bnb-recent-posts .bnb-timeline-entry:hover .bnb-timeline-media img {

	transform: scale(1.03);
}

.bnb-recent-posts .bnb-timeline-title {

	margin: 0 0 7px;

	color: var(--bnb-text);

	font-size: 1.03rem;
	font-weight: 600;
	line-height: 1.4;

	overflow-wrap: anywhere;
}

.bnb-recent-posts .bnb-timeline-entry:hover .bnb-timeline-title a {

	color: var(--bnb-accent);
}

.bnb-recent-posts .bnb-timeline-entry .bnb-category {

	margin-bottom: 6px;
}

.bnb-recent-posts .bnb-timeline-entry .bnb-excerpt {

	display: -webkit-box;

	overflow: hidden;

	margin-bottom: 10px;

	font-size: .89rem;

	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.bnb-recent-posts .bnb-timeline-entry .bnb-meta {

	margin-top: 0;
}


/* =====================================================
 *  STYLE : WIDGET ÉTROIT
 *  ===================================================== */

.bnb-recent-posts.bnb-layout--widget .bnb-grid {

	grid-template-columns: 1fr;
	gap: 0;
}

.bnb-recent-posts .bnb-widget-card {

	display: flex;
	flex-direction: row;
	align-items: flex-start;

	gap: 12px;

	padding: 12px 0;

	background: transparent;

	border: 0;
	border-bottom: 1px solid var(--bnb-border);
	border-radius: 0;

	box-shadow: none;
}

.bnb-recent-posts .bnb-widget-card:first-child {

	padding-top: 0;
}

.bnb-recent-posts .bnb-widget-card:last-child {

	padding-bottom: 0;

	border-bottom: 0;
}

.bnb-recent-posts.bnb-layout--widget .bnb-card:hover {

	transform: none;

	border-color: var(--bnb-border);

	box-shadow: none;
}

.bnb-recent-posts .bnb-widget-media {

	display: block;
	flex: 0 0 72px;

	width: 72px;
	height: 72px;

	overflow: hidden;

	border-radius: 9px;

	background: var(--bnb-soft);
}

.bnb-recent-posts .bnb-widget-media img {

	display: block;

	width: 100%;
	height: 100%;

	object-fit: cover;

	transition: transform .35s ease;
}

.bnb-recent-posts .bnb-widget-card:hover .bnb-widget-media img {

	transform: scale(1.03);
}

.bnb-recent-posts .bnb-widget-card .bnb-card-content {

	flex: 1 1 auto;

	min-width: 0;

	padding: 0;
}

.bnb-recent-posts .bnb-widget-card .bnb-card-title {

	margin: 0 0 4px;

	font-size: .95rem;
	line-height: 1.35;
}

.bnb-recent-posts .bnb-widget-card .bnb-category {

	margin-bottom: 4px;
	padding: 3px 7px;

	font-size: .65rem;
}

.bnb-recent-posts .bnb-widget-card .bnb-meta {

	gap: 4px 9px;

	font-size: .72rem;
}

.bnb-recent-posts .bnb-widget-card .bnb-media-placeholder {

	font-size: 1.35rem;
}

/* =====================================================
 *  CLASSEMENT
 *  ===================================================== */

.bnb-recent-posts .bnb-rank {

	display: inline-flex;
	align-self: flex-start;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;

	min-width: 20px;
	height: 20px;
	margin-bottom: 4px;
	padding: 0 5px;

	border-radius: 100px;

	background: var(--bnb-accent);
	color: #fff;

	font-size: .68rem;
	font-weight: 700;
	line-height: 1;
}

/* Numbered list: same layout as the unnumbered grid. */
.bnb-recent-posts ol.bnb-grid {

	margin: 0;
	padding: 0;

	list-style: none;
}

/* !important: themes style sidebar items with ID selectors (Astra: #secondary li). */
.bnb-recent-posts li.bnb-card {

	margin: 0 !important;

	line-height: inherit !important;
	list-style: none;
}

.bnb-recent-posts .bnb-sr-only {

	position: absolute;

	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;

	overflow: hidden;

	border: 0;

	clip-path: inset(50%);
	white-space: nowrap;
}

/* =====================================================
 *  RESPONSIVE
 *  ===================================================== */

@media (max-width: 900px) {

	.bnb-recent-posts.bnb-cols-3 .bnb-grid,
	.bnb-recent-posts.bnb-cols-4 .bnb-grid {

		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.bnb-recent-posts.bnb-layout--compact .bnb-grid,
	.bnb-recent-posts.bnb-layout--list .bnb-grid {

		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {

	.bnb-recent-posts {

		margin: 30px 0;
	}

	.bnb-recent-posts .bnb-grid {

		grid-template-columns: 1fr !important;
	}

	.bnb-recent-posts .bnb-title {

		font-size: 1.5rem;
	}

	/* Sur mobile, la colonne est trop étroite pour une hauteur fixe :
	 * l'image devenait presque carrée et une image 16/9 était fortement recadrée.
	 * On suit le ratio choisi dans le bloc, comme les cartes. */
	.bnb-recent-posts .bnb-hero-media {

		height: auto;

		aspect-ratio: var(--bnb-image-ratio);
	}

	.bnb-recent-posts .bnb-hero-content {

		padding: 18px;
	}

	.bnb-recent-posts .bnb-hero-title {

		font-size: 1.2rem;
	}

	.bnb-recent-posts.bnb-layout--compact .bnb-card-media {

		flex-basis: 110px;

		width: 110px;
		min-width: 110px;
	}

	.bnb-recent-posts.bnb-layout--compact .bnb-card-content {

		padding: 12px 14px;
	}

	.bnb-recent-posts .bnb-timeline::before {

		top: 4px;
		bottom: 4px;
		left: 8px;
	}

	.bnb-recent-posts .bnb-timeline-day-label {

		margin-bottom: 12px;
		padding-left: 28px;
	}

	.bnb-recent-posts .bnb-timeline-day-label::before {

		left: 1px;

		width: 16px;
		height: 16px;
	}

	.bnb-recent-posts .bnb-timeline-item {

		padding-left: 28px;
		padding-bottom: 18px;
	}

	.bnb-recent-posts .bnb-timeline-marker {

		top: 4px;
		left: 3px;
	}

	.bnb-recent-posts .bnb-timeline-time {

		position: static;

		width: auto;

		margin-bottom: 5px;

		text-align: left;
		white-space: normal;
	}

	.bnb-recent-posts .bnb-timeline-date,
	.bnb-recent-posts .bnb-timeline-hour {

		display: inline;
	}

	.bnb-recent-posts .bnb-timeline-date::after {

		content: " · ";
	}

	.bnb-recent-posts .bnb-timeline-media {

		flex-basis: 96px;

		width: 96px;
	}

	.bnb-recent-posts .bnb-widget-media {

		flex-basis: 64px;

		width: 64px;
		height: 64px;
	}

	.bnb-recent-posts .bnb-widget-card .bnb-card-title {

		font-size: .9rem;
	}
}

@media (min-width: 1200px) {

	.bnb-recent-posts .bnb-hero-media {

		height: 340px;
	}
}

/* =====================================================
 *  ACCESSIBILITE
 *  ===================================================== */

@media (prefers-reduced-motion: reduce) {

	.bnb-recent-posts *,
	.bnb-recent-posts *::before,
	.bnb-recent-posts *::after {

		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
	}
}
