/*
 * Netpublic Sidebar — styles front.
 * Toutes les classes sont préfixées nps- et la feuille n'est chargée
 * que sur les pages éligibles : aucun impact sur les catégories,
 * l'accueil ou les pages outils.
 */

/*
 * NB : la bascule 1 colonne / 2 colonnes dépend du point de rupture réglable
 * dans l'admin. Ces règles-là sont générées en CSS inline par le plugin
 * (NPS_Render::inline_css), car une media query ne peut pas lire une variable
 * CSS. Ici on ne pose que les styles indépendants de la largeur.
 */

.nps-layout {
	display: block;
}

.nps-main {
	min-width: 0;
}

.nps-sidebar {
	min-width: 0;
	font-size: 15px;
	line-height: 1.45;
}

.nps-sidebar__inner {
	display: flex;
	flex-direction: column;
	gap: 28px;
}

/* ---------------------------------------------------------------- Blocs */

.nps-block {
	margin: 0;
}

.nps-block__title {
	margin: 0 0 14px;
	padding: 0 0 10px;
	font-size: 16px;
	line-height: 1.3;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	border-bottom: 2px solid var(--nps-accent, #2d81e0);
}

.nps-block__more {
	display: inline-block;
	margin-top: 12px;
	font-size: 14px;
	font-weight: 600;
	color: var(--nps-accent, #2d81e0);
	text-decoration: none;
}

.nps-block__more:hover,
.nps-block__more:focus {
	text-decoration: underline;
}

/* ---------------------------------------------------------- Bons plans */

.nps-deals {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.nps-deals li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.nps-deal__link {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 12px;
	border: 1px solid rgba(0, 0, 0, 0.09);
	border-radius: 8px;
	background: #fff;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.nps-deal__link:hover,
.nps-deal__link:focus-visible {
	border-color: var(--nps-accent, #2d81e0);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
	transform: translateY(-1px);
}

.nps-deal__logo {
	flex: 0 0 56px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.nps-deal__logo img {
	max-width: 56px;
	max-height: 40px;
	width: auto;
	height: auto;
	display: block;
}

.nps-deal__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.nps-deal__badge {
	align-self: flex-start;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 2px 7px;
	border-radius: 3px;
	background: var(--nps-accent, #2d81e0);
	color: #fff;
}

.nps-deal__brand {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	opacity: 0.65;
}

.nps-deal__title {
	font-size: 15px;
	font-weight: 700;
}

.nps-deal__desc {
	font-size: 13px;
	opacity: 0.8;
}

.nps-deal__cta {
	align-self: flex-start;
	margin-top: 4px;
	font-size: 13px;
	font-weight: 600;
	color: var(--nps-accent, #2d81e0);
}

.nps-deal__cta::after {
	content: " \203A";
}

/* ------------------------------------------------- Articles de la rubrique */

.nps-posts {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
}

.nps-posts li {
	margin: 0;
	padding: 0;
	list-style: none;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.nps-posts li:last-child {
	border-bottom: 0;
}

.nps-post__link {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 12px 0;
	text-decoration: none;
	color: inherit;
}

.nps-post__link:hover .nps-post__title,
.nps-post__link:focus-visible .nps-post__title {
	color: var(--nps-accent, #2d81e0);
}

.nps-post__thumb {
	flex: 0 0 72px;
	width: 72px;
	height: 54px;
	overflow: hidden;
	border-radius: 5px;
	background: rgba(0, 0, 0, 0.05);
}

.nps-post__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 5px;
}

.nps-post__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.nps-post__date {
	font-size: 12px;
	opacity: 0.6;
}

.nps-post__title {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	transition: color 0.15s ease;
}

/* ------------------------------------------------------------- Bannière */

.nps-banner {
	text-align: center;
}

.nps-banner img {
	max-width: 100%;
	height: auto;
	display: block;
	margin: 0 auto;
	border-radius: 6px;
}

/* --------------------------------------------------- Mode autonome */

.nps-sidebar--standalone {
	max-width: 360px;
}

/* --------------------------------------------------- Mode sombre */

@media (prefers-color-scheme: dark) {
	.nps-deal__link {
		background: transparent;
		border-color: rgba(255, 255, 255, 0.14);
	}
}
