/**
 * CNR — liste publique (thème clair, couleurs officielles).
 */
.cnre {
	--cnr-orange: #f77f00;
	--cnr-white: #ffffff;
	--cnr-green: #009e60;
	--cnr-black: #0b0b0b;
	--cnr-text: #1a1f28;
	--cnr-text-muted: #5c6575;
	--cnr-page-bg: #f5f7fa;
	--cnr-listing-bg: #eef2f7;
	--cnr-card: #ffffff;
	--cnr-line: rgba(26, 31, 40, 0.1);
	--cnr-line-strong: rgba(26, 31, 40, 0.14);
	--cnr-radius: 16px;
	--cnr-radius-sm: 10px;
	--cnr-shadow: 0 14px 40px rgba(26, 31, 40, 0.1);
	--cnr-shadow-card: 0 4px 24px rgba(26, 31, 40, 0.08);
	background: var(--cnr-page-bg);
	color: var(--cnr-text) !important;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
	line-height: 1.5;
	margin: 0 0 3rem;
}

/* Sort du conteneur étroit du thème (pleine largeur viewport). */
.cnre.cnre--fullbleed {
	position: relative;
	width: 100vw;
	max-width: 100vw;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	padding-left: env(safe-area-inset-left, 0);
	padding-right: env(safe-area-inset-right, 0);
	overflow-x: hidden;
}

.cnre *,
.cnre *::before,
.cnre *::after {
	box-sizing: border-box;
}

.cnre--empty {
	background: var(--cnr-card);
	border: 1px solid var(--cnr-line);
	border-radius: var(--cnr-radius);
	padding: 2rem;
	text-align: center;
	box-shadow: var(--cnr-shadow-card);
}

.cnre-empty-msg {
	margin: 0;
	color: var(--cnr-text-muted);
}

/* Hero (photo + voile sombre : texte reste clair sur l’image) */
.cnre-hero {
	position: relative;
	min-height: clamp(320px, 52vw, 520px);
	display: grid;
	align-items: end;
	padding: clamp(1.5rem, 4vw, 3.5rem);
	overflow: hidden;
	border-radius: 0 0 var(--cnr-radius) var(--cnr-radius);
	background-color: var(--cnr-black);
	background-image: var(--cnre-hero-image);
	background-size: cover;
	background-position: center 35%;
	isolation: isolate;
}

.cnre-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.5) 0%,
		rgba(0, 0, 0, 0.72) 55%,
		rgba(0, 0, 0, 0.88) 100%
	);
	z-index: 0;
}

.cnre-hero__inner {
	position: relative;
	z-index: 1;
	max-width: 920px;
}

/* Sous les headers fixes / collants du thème (mobile) */
@media (max-width: 781px) {
	.cnre-hero {
		padding-top: max(
			env(safe-area-inset-top, 0px),
			clamp(5.25rem, 20vw, 7.75rem)
		);
	}
}

.cnre-hero__kicker {
	margin: 0 0 0.35rem;
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--cnr-orange);
}

.cnre-hero__title {
	margin: 0 0 0.75rem;
	font-size: clamp(2.25rem, 5vw, 3.5rem);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -0.02em;
	color: #ffffff !important;
}

.cnre-hero__lead {
	margin: 0 0 1.25rem;
	font-size: clamp(1rem, 2.2vw, 1.2rem);
	color: rgba(255, 255, 255, 0.88);
	max-width: 52ch;
}

.cnre-hero__stats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
}

.cnre-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.35rem 0.85rem;
	border-radius: 999px;
	font-size: 0.875rem;
	font-weight: 600;
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(6px);
}

.cnre-pill--orange {
	border-color: rgba(247, 127, 0, 0.65);
	color: #fff;
	box-shadow: inset 0 0 0 1px rgba(247, 127, 0, 0.2);
}

.cnre-pill--green {
	border-color: rgba(0, 158, 96, 0.55);
	color: #fff;
	box-shadow: inset 0 0 0 1px rgba(0, 158, 96, 0.15);
}

/* Zone liste : fond clair, marges latérales généreuses */
.cnre-listing {
	background: var(--cnr-listing-bg);
	padding: clamp(1.25rem, 3vw, 2.25rem) 0 clamp(2rem, 4vw, 3rem);
	border-top: 1px solid var(--cnr-line);
}

.cnre-toolbar {
	margin: 0 auto clamp(1.5rem, 4vw, 2.75rem);
	width: 100%;
	max-width: none;
	padding: 0 clamp(1.5rem, 8vw, 5.5rem);
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

@media (min-width: 720px) {
	.cnre-toolbar {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
}

.cnre-toolbar__search {
	flex: 1;
	min-width: 0;
}

/*
 * Recherche : flex (icône dans une colonne dédiée).
 * Le thème ne peut pas faire chevaucher l’icône et le texte comme avec padding + position absolue.
 */
.cnre-search-field {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: 0.35rem;
	width: 100%;
	min-height: 3.05rem;
	padding: 0.2rem 0.35rem 0.2rem 0.55rem;
	border-radius: 999px;
	border: 1px solid var(--cnr-line-strong);
	background-color: var(--cnr-card);
	box-shadow: 0 1px 3px rgba(26, 31, 40, 0.06);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cnre-search-field:focus-within {
	border-color: rgba(247, 127, 0, 0.55);
	box-shadow: 0 0 0 3px rgba(247, 127, 0, 0.2);
}

.cnre-search-field__icon {
	flex: 0 0 2.35rem;
	width: 2.35rem;
	min-width: 2.35rem;
	display: flex;
	align-items: center;
	justify-content: center;
	align-self: center;
	color: rgba(26, 31, 40, 0.45);
	pointer-events: none;
}

.cnre-search-field__icon svg {
	display: block;
	width: 1.25rem;
	height: 1.25rem;
	flex-shrink: 0;
}

.cnre-search {
	flex: 1 1 0%;
	min-width: 0;
	width: auto !important;
	max-width: 100%;
	margin: 0;
	padding: 0.65rem 0.85rem 0.65rem 0 !important;
	border: none !important;
	border-radius: 0;
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	color: var(--cnr-text) !important;
	font-size: 16px !important;
	line-height: 1.4;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

.cnre-search::placeholder {
	color: rgba(26, 31, 40, 0.45) !important;
}

.cnre-search:focus {
	border: none !important;
	box-shadow: none !important;
	outline: none;
}

.cnre-search-field:focus-within .cnre-search-field__icon {
	color: rgba(247, 127, 0, 0.85);
}

.cnre-toolbar__meta {
	margin: 0;
	font-size: 0.95rem;
	color: var(--cnr-text-muted) !important;
	white-space: nowrap;
}

.cnre-grid {
	width: 100%;
	max-width: none;
	margin: 0 auto;
	padding: clamp(1.25rem, 3.5vw, 2.5rem) clamp(1.5rem, 8vw, 5.5rem) 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
	gap: clamp(0.85rem, 2vw, 1.25rem);
}

.cnre-card {
	position: relative;
	background: var(--cnr-card) !important;
	border: 1px solid var(--cnr-line-strong);
	border-radius: var(--cnr-radius);
	box-shadow: var(--cnr-shadow-card);
	overflow: hidden;
	transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.cnre-card:hover {
	transform: translateY(-3px);
	border-color: rgba(0, 158, 96, 0.35);
	box-shadow: var(--cnr-shadow);
}

.cnre-card[hidden] {
	display: none !important;
}

.cnre-card__accent {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 4px;
	background: linear-gradient(180deg, var(--cnr-orange), var(--cnr-green));
}

.cnre-card__body {
	padding: 1rem 1rem 1rem 1.2rem;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	min-height: 100%;
}

.cnre-badge {
	align-self: flex-start;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 0.25rem 0.6rem;
	border-radius: 999px;
	/* Couleurs de fond / texte via style inline selon le libellé (rouge, violet, etc.) */
}

.cnre .cnre-card__title {
	margin: 0;
	font-size: clamp(1rem, 2.4vw, 1.12rem);
	font-weight: 800;
	line-height: 1.28;
	letter-spacing: -0.01em;
	color: var(--cnr-text) !important;
}

.cnre-card__school {
	margin: 0;
	font-size: 0.875rem;
	color: var(--cnr-text-muted) !important;
}

.cnre-card__project {
	margin: 0.15rem 0 0;
	font-size: 0.9rem;
	color: rgba(26, 31, 40, 0.88) !important;
	flex: 1;
}

.cnre-btn {
	cursor: pointer;
	border: none;
	font: inherit;
	font-weight: 700;
	border-radius: 999px;
	padding: 0.55rem 1.15rem;
	margin-top: 0.35rem;
	align-self: flex-start;
	transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.cnre-btn:active {
	transform: translateY(1px);
}

.cnre-btn--ghost {
	background: var(--cnr-orange);
	color: #ffffff !important;
	border: 1px solid var(--cnr-orange);
	box-shadow: 0 2px 8px rgba(247, 127, 0, 0.35);
}

.cnre-btn--ghost:hover,
.cnre-btn--ghost:focus-visible {
	background: #e67300;
	border-color: #e67300;
	box-shadow: 0 4px 14px rgba(247, 127, 0, 0.4);
	outline: none;
}

/* Modal (clair) */
.cnre-modal[hidden] {
	display: none;
}

.cnre-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: 1rem;
}

.cnre-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(26, 31, 40, 0.45);
	backdrop-filter: blur(4px);
}

.cnre-modal__dialog {
	position: relative;
	width: min(640px, 100%);
	max-height: min(88vh, 900px);
	overflow: auto;
	background: var(--cnr-card);
	border: 1px solid var(--cnr-line-strong);
	border-radius: calc(var(--cnr-radius) + 4px);
	box-shadow: var(--cnr-shadow);
	padding: clamp(1.25rem, 3vw, 2rem);
	z-index: 1;
}

.cnre-modal__close {
	position: absolute;
	top: 0.65rem;
	right: 0.65rem;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 999px;
	border: 1px solid var(--cnr-line);
	background: var(--cnr-listing-bg);
	color: var(--cnr-text);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.cnre-modal__close:hover,
.cnre-modal__close:focus-visible {
	background: rgba(247, 127, 0, 0.12);
	border-color: rgba(247, 127, 0, 0.45);
	outline: none;
}

.cnre-modal__content {
	padding-right: 0.25rem;
}

.cnre-dl {
	margin: 0;
	display: grid;
	gap: 0.85rem;
}

.cnre-dl__row {
	display: grid;
	gap: 0.2rem;
	padding-bottom: 0.85rem;
	border-bottom: 1px solid var(--cnr-line);
}

.cnre-dl__row:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.cnre-dl dt {
	margin: 0;
	font-size: 0.78rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--cnr-orange);
}

.cnre-dl dd {
	margin: 0;
	font-size: 1rem;
	color: var(--cnr-text);
	white-space: pre-wrap;
}

.cnre-modal__head {
	margin: 0 2.5rem 1rem 0;
}

.cnre-modal__head .cnre-modal__badge {
	margin-bottom: 0.5rem;
}

.cnre-modal__head h2 {
	margin: 0;
	font-size: clamp(1.35rem, 3vw, 1.75rem);
	font-weight: 900;
	letter-spacing: -0.02em;
	line-height: 1.15;
	color: var(--cnr-text) !important;
}

body.cnre-modal-open {
	overflow: hidden;
}
