/* ===========================================================
   UECT 2026 — Article détail Semaine Européenne
   Chargé sur les articles de la catégorie 12 (SE).
   =========================================================== */

.uect-se-detail { display: block; }

/* --- Bandeau bleu --- */
.uect-se-detail__hero {
	width: 100%;
	background: var(--uect-blue);
	color: var(--uect-white);
	padding: 28px 0 30px;
}
.uect-se-detail__hero-inner {
	max-width: var(--uect-container);
	margin: 0 auto;
	padding: 0 var(--uect-gutter-x);
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.uect-se-detail__crumbs {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 15px;
	color: rgba(255,255,255,.7);
}
.uect-se-detail__crumbs a {
	color: var(--uect-white);
	font-weight: 600;
	text-decoration: none;
}
.uect-se-detail__crumbs a:hover { color: var(--uect-yellow-2); }
.uect-se-detail__crumbs-current {
	font-weight: 600;
	color: var(--uect-yellow);
}

.uect-se-detail__title {
	margin: 0;
	font-family: var(--uect-font-cond);
	font-weight: 700;
	font-size: clamp(60px, 10vw, 142px);
	line-height: .88;
	letter-spacing: -.02em;
	color: var(--uect-white);
	text-transform: uppercase;
	/* Les titres longs comme « VILA POUCA DE AGUIAR » doivent tenir sur
	   une seule ligne sur grand écran. Si l'espace manque, le texte rétrécit. */
	white-space: nowrap;
}

.uect-se-detail__meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 40px;
	flex-wrap: nowrap;
	border-top: 1px solid rgba(255,255,255,.28);
	padding: 26px 0 0;
}
.uect-se-detail__meta-item {
	font-family: var(--uect-font-sans);
	font-size: 26px;
	font-weight: 700;
	line-height: 1.3;
	white-space: nowrap;
	color: var(--uect-white);
}
.uect-se-detail__meta-item--accent { color: var(--uect-yellow); }

.uect-se-detail__cta {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	background: var(--uect-yellow);
	color: var(--uect-ink);
	font-family: var(--uect-font-sans);
	font-size: 18px;
	font-weight: 700;
	padding: 18px 34px;
	text-decoration: none;
	white-space: nowrap;
	transition: background .18s ease;
}
.uect-se-detail__cta:hover { background: var(--uect-yellow-2); color: var(--uect-ink); }
.uect-se-detail__cta svg { color: var(--uect-ink); flex: none; display: block; }
.uect-se-detail__cta--footer { align-self: center; margin: 18px 0 6px; }
.uect-se-detail__cta--closed {
	background: rgba(255,255,255,.14);
	color: rgba(255,255,255,.75);
	cursor: not-allowed;
}
.uect-se-detail__cta--closed:hover { background: rgba(255,255,255,.14); color: rgba(255,255,255,.75); }
.uect-se-detail__cta--closed svg { color: rgba(255,255,255,.65); }

/* --- Corps --- */
.uect-se-detail__body { padding: 52px 0 76px; }
.uect-se-detail__body-inner {
	max-width: var(--uect-container);
	margin: 0 auto;
	padding: 0 var(--uect-gutter-x);
	display: flex;
	flex-direction: column;
	gap: 32px;
}

/* --- Tabs (2 cartes cliquables : image + libellé bouton) --- */
.uect-se-detail__tabs {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 40px;
	margin: 0 auto 40px;
	max-width: 900px;
}
.uect-se-detail__tab {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 0;
	background: transparent;
	border: 0;
	cursor: pointer;
	font-family: var(--uect-font-sans);
	color: var(--uect-ink);
	box-sizing: border-box;
	transition: transform .18s ease;
}
.uect-se-detail__tab:hover { transform: translateY(-3px); }

.uect-se-detail__tab-media {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #EFF3F8;
}
.uect-se-detail__tab-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .3s ease;
}
.uect-se-detail__tab:hover .uect-se-detail__tab-media img { transform: scale(1.03); }

/* Image d'accroche standalone : affichée quand il n'y a PAS d'onglets
   (SE historique sans « infos pratiques ») mais que le custom field
   « Image infos générales » est rempli. */
.uect-se-detail__accroche {
	max-width: 440px;
	margin: 0 auto 40px;
	padding: 0;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #EFF3F8;
}
.uect-se-detail__accroche img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.uect-se-detail__tab-label {
	align-self: center;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 11px;
	min-width: 260px;
	padding: 15px 32px;
	font-size: 18px;
	font-weight: 700;
	background: var(--uect-blue);
	color: var(--uect-white);
	border: 2px solid var(--uect-blue);
	transition: gap .18s ease, background .18s ease;
	box-sizing: border-box;
}
.uect-se-detail__tab:hover .uect-se-detail__tab-label { gap: 17px; }
.uect-se-detail__tab--pra .uect-se-detail__tab-label {
	background: #1C3557;
	border-color: #1C3557;
}
.uect-se-detail__tab.is-active .uect-se-detail__tab-label {
	background: var(--uect-yellow);
	color: var(--uect-ink);
	border-color: var(--uect-yellow);
}
.uect-se-detail__panel[hidden] { display: none; }
.uect-se-detail__panel { animation: uectSeTabIn .24s ease-out both; margin: 0 auto; }
@keyframes uectSeTabIn {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

.uect-se-detail__panel {
	width: 100%;
	max-width: 820px;
	margin: 0 auto;
	border-top: 4px solid var(--uect-yellow);
	background: var(--uect-white);
	padding: 40px 0 8px;
	display: flex;
	flex-direction: column;
	gap: 20px;
	color: var(--uect-ink-2);
	font-size: 17.5px;
	line-height: 1.72;
}

.uect-se-detail__panel h2 {
	margin: 0 0 6px;
	font-family: var(--uect-font-sans);
	font-size: 34px;
	font-weight: 700;
	letter-spacing: -.02em;
	color: var(--uect-ink);
}

.uect-se-detail__panel h3 {
	margin: 14px 0 0;
	font-family: var(--uect-font-cond);
	font-size: 34px;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--uect-blue);
	position: relative;
	padding-left: 48px;
}
.uect-se-detail__panel h3::before {
	content: '';
	position: absolute;
	left: 0; top: 50%;
	transform: translateY(-50%);
	width: 34px; height: 4px;
	background: var(--uect-yellow);
}

.uect-se-detail__panel p {
	margin: 0;
	text-wrap: pretty;
}
.uect-se-detail__panel p strong { color: var(--uect-ink); }

.uect-se-detail__panel a {
	color: var(--uect-blue);
	font-weight: 700;
	text-decoration: none;
	border-bottom: 1px solid rgba(41,88,166,.4);
}
.uect-se-detail__panel a:hover { border-bottom-color: var(--uect-blue); }

/* Lien enveloppant une image : ni soulignage ni décor */
.uect-se-detail__panel a:has(> img),
.uect-se-detail__panel a:has(> img):hover {
	border-bottom: 0;
	display: inline-block;
}
.uect-se-detail__panel a:has(> img)::before { content: none; }

/* Lien vers un fichier → flèche ↓ automatique (sauf image).
   Liste élargie : documents, tableurs, présentations, archives (zip/rar/7z/gz/tar),
   parcours (gpx/kml/kmz), médias. */
.uect-se-detail__panel a[href$=".pdf" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".doc" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".docx" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".odt" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".txt" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".csv" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".xls" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".xlsx" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".ods" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".ppt" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".pptx" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".odp" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".zip" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".rar" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".7z" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".gz" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".tar" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".tgz" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".gpx" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".kml" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".kmz" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".mp3" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".mp4" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".wav" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".mov" i]:not(:has(> img)),
.uect-se-detail__panel a[href$=".avi" i]:not(:has(> img)) {
	display: inline-flex;
	align-items: baseline;
	gap: 7px;
}
.uect-se-detail__panel a[href$=".pdf" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".doc" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".docx" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".odt" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".txt" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".csv" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".xls" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".xlsx" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".ods" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".ppt" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".pptx" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".odp" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".zip" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".rar" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".7z" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".gz" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".tar" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".tgz" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".gpx" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".kml" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".kmz" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".mp3" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".mp4" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".wav" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".mov" i]:not(:has(> img))::before,
.uect-se-detail__panel a[href$=".avi" i]:not(:has(> img))::before {
	content: "↓";
	flex: none;
	font-size: 18px;
	font-weight: 900;
	line-height: 1;
	color: var(--uect-blue);
	-webkit-text-stroke: 1px var(--uect-blue);
}

/* Listes à puces (carré jaune 9px au niveau 1, carré bleu au niveau 2) */
.uect-se-detail__panel ul {
	list-style: none;
	padding: 0;
	margin: 0 0 18px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.uect-se-detail__panel ul li {
	position: relative;
	padding-left: 34px;
	font-size: 17.5px;
	line-height: 1.6;
}
.uect-se-detail__panel ul li::before {
	content: '';
	position: absolute;
	left: 20px;
	top: 12px;
	width: 9px;
	height: 9px;
	background: var(--uect-yellow);
}
/* Niveau 2 : carré bleu UECT, retrait supplémentaire */
.uect-se-detail__panel ul ul {
	margin: 8px 0 4px;
	padding-left: 24px;
}
.uect-se-detail__panel ul ul li { padding-left: 34px; }
.uect-se-detail__panel ul ul li::before {
	background: var(--uect-blue);
}

/* Encadré (blockquote OU div .uect-se-note) */
.uect-se-detail__panel blockquote,
.uect-se-detail__panel .uect-se-note {
	background: var(--uect-light-1);
	padding: 22px 26px;
	border-left: 3px solid var(--uect-blue);
	margin: 0;
	font-size: 17px;
	line-height: 1.68;
	color: var(--uect-ink-2);
	font-style: normal;
	quotes: none;
}

/* Bouton CTA jaune (classes .btn / .uect-btn) — utilisable dans le WYSIWYG.
   Le parent .uect-se-detail__panel est un flex container : il blockifie
   `display: inline-flex` en `flex`. On force donc align-self + width:fit-content
   pour ne pas s'étirer sur toute la largeur. */
.uect-se-detail__panel .btn,
.uect-se-detail__panel a.btn,
.uect-se-detail__panel .uect-btn,
.uect-se-detail__panel a.uect-btn {
	display: inline-flex;
	align-self: flex-start;
	width: fit-content;
	max-width: 100%;
	align-items: center;
	gap: 12px;
	margin: 16px 0 6px;
	padding: 18px 34px;
	background: var(--uect-yellow);
	color: var(--uect-ink);
	font-family: var(--uect-font-sans);
	font-size: 18px;
	font-weight: 700;
	border: 0;
	border-bottom: 0;
	text-decoration: none;
	transition: background .18s ease;
}
.uect-se-detail__panel .btn:hover,
.uect-se-detail__panel .uect-btn:hover { background: #E8AB05; border-bottom: 0; }

/* Encart discret : fond clair + filets bleus haut/bas (classe .uect-note) */
.uect-se-detail__panel .uect-note {
	background: #EFF3F8;
	border-top: 1px solid var(--uect-blue);
	border-bottom: 1px solid var(--uect-blue);
	padding: 26px 32px;
	margin: 22px 0;
	color: #333D4F;
	font-size: 17px;
	line-height: 1.7;
}
.uect-se-detail__panel .uect-note > *:first-child { margin-top: 0; }
.uect-se-detail__panel .uect-note > *:last-child { margin-bottom: 0; }
.uect-se-detail__panel .uect-note p { margin: 0 0 10px; font-size: 17px; line-height: 1.7; }
.uect-se-detail__panel .uect-note p:last-child { margin-bottom: 0; }

/* Encart bleu (classe .uect-note-blue) */
.uect-se-detail__panel .uect-note-blue {
	background: var(--uect-blue);
	color: var(--uect-white);
	padding: 28px 32px;
	margin: 22px 0;
}
.uect-se-detail__panel .uect-note-blue > *:first-child { margin-top: 0; }
.uect-se-detail__panel .uect-note-blue > *:last-child { margin-bottom: 0; }
.uect-se-detail__panel .uect-note-blue h2,
.uect-se-detail__panel .uect-note-blue h3,
.uect-se-detail__panel .uect-note-blue h4,
.uect-se-detail__panel .uect-note-blue p,
.uect-se-detail__panel .uect-note-blue li,
.uect-se-detail__panel .uect-note-blue strong { color: var(--uect-white); }
.uect-se-detail__panel .uect-note-blue a {
	color: var(--uect-yellow);
	font-weight: 700;
	border-bottom-color: rgba(242,183,5,.4);
}
.uect-se-detail__panel .uect-note-blue a:hover { border-bottom-color: var(--uect-yellow); }
.uect-se-detail__panel .uect-note-blue ul li::before { background: var(--uect-yellow); }
.uect-se-detail__panel .uect-note-blue em { font-style: normal; color: rgba(255,255,255,.75); font-size: 15.5px; }

/* Grille de figures (images avec caption centré) */
.uect-se-detail__panel .uect-se-figures {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px 20px;
	margin: 14px 0 6px;
	list-style: none;
	padding: 0;
}
.uect-se-detail__panel .uect-se-figures li,
.uect-se-detail__panel figure {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 9px;
	padding: 0;
}
.uect-se-detail__panel .uect-se-figures li::before { display: none; }
.uect-se-detail__panel figure img { width: 100%; height: auto; display: block; }

/* Paragraphe contenant plusieurs images → galerie horizontale qui s'enroule.
   L'alignement répond à l'attribut `style="text-align:…"` posé par le WYSIWYG
   via les boutons « Aligner à gauche / centre / droite / justifier ». */
.uect-se-detail__panel p:has(> img + img) {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-start;
	justify-content: flex-start;
}
.uect-se-detail__panel p:has(> img + img)[style*="text-align:center"],
.uect-se-detail__panel p:has(> img + img)[style*="text-align: center"] {
	justify-content: center;
}
.uect-se-detail__panel p:has(> img + img)[style*="text-align:right"],
.uect-se-detail__panel p:has(> img + img)[style*="text-align: right"] {
	justify-content: flex-end;
}
.uect-se-detail__panel p:has(> img + img)[style*="text-align:justify"],
.uect-se-detail__panel p:has(> img + img)[style*="text-align: justify"] {
	justify-content: space-between;
}
.uect-se-detail__panel p:has(> img + img) img {
	flex: 0 0 auto;
	max-width: 100%;
	height: auto;
	/* Neutraliser les styles inline posés par TinyMCE au moment du centrage,
	   sinon chaque image prend margin:auto et passe à la ligne. */
	margin-left: 0 !important;
	margin-right: 0 !important;
}
.uect-se-detail__panel figcaption {
	font-size: 14.5px;
	line-height: 1.45;
	color: var(--uect-ink-3);
	text-align: center;
}

/* Bloc contact (fond bleu) — via class .uect-se-contact dans le content */
.uect-se-detail__panel .uect-se-contact {
	background: var(--uect-blue);
	color: var(--uect-white);
	padding: 30px 32px;
	margin: 26px 0 10px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}
.uect-se-detail__panel .uect-se-contact a {
	color: var(--uect-yellow);
	border-bottom: 0;
}
.uect-se-detail__panel .uect-se-contact a:hover { color: var(--uect-yellow-2); }

.uect-se-detail__modified {
	margin: 12px auto 0;
	max-width: 820px;
	font-size: 14px;
	color: var(--uect-ink-3);
	padding: 0;
}

/* --- Tableaux : même rendu que dans les articles standards --- */
.uect-se-detail__panel table {
	width: 100%;
	max-width: 100%;
	margin: 20px 0 24px;
	border-collapse: collapse;
	font-size: 16.5px;
	line-height: 1.55;
	color: #333D4F;
}
.uect-se-detail__panel table th,
.uect-se-detail__panel table td {
	padding: 12px 14px;
	border: 1px solid #DFE5EE;
	text-align: left;
	vertical-align: top;
	word-wrap: break-word;
}
.uect-se-detail__panel table thead th,
.uect-se-detail__panel table th:first-child {
	background: #EFF3F8;
	color: var(--uect-ink);
	font-weight: 700;
}

/* --- Responsive --- */
@media (max-width: 640px) {
	/* En dessous de 640 px, les titres longs comme « VILA POUCA DE AGUIAR »
	   dépassent le viewport avec nowrap. On redonne le wrap à 2 lignes max. */
	.uect-se-detail__title { white-space: normal; }

	/* Tableaux : chaque ligne devient une carte empilée, chaque td affiche
	   son titre de colonne via data-label (injecté par responsive-tables.js). */
	.uect-se-detail__panel table,
	.uect-se-detail__panel table tbody,
	.uect-se-detail__panel table thead,
	.uect-se-detail__panel table tr,
	.uect-se-detail__panel table th,
	.uect-se-detail__panel table td {
		display: block;
		width: 100%;
		box-sizing: border-box;
	}
	.uect-se-detail__panel table thead { display: none; }
	.uect-se-detail__panel table tr {
		margin-bottom: 14px;
		border: 1px solid #DFE5EE;
	}
	.uect-se-detail__panel table td {
		border: 0;
		border-bottom: 1px solid #DFE5EE;
		padding: 10px 14px;
		font-size: 15.5px;
	}
	.uect-se-detail__panel table tr td:last-child { border-bottom: 0; }
	.uect-se-detail__panel table tr td:first-child {
		background: #EFF3F8;
		color: var(--uect-ink);
		font-weight: 700;
	}
	.uect-se-detail__panel table td[data-label]:not(:first-child)::before {
		content: attr(data-label);
		display: block;
		margin-bottom: 2px;
		font-size: 12px;
		font-weight: 600;
		letter-spacing: .04em;
		text-transform: uppercase;
		color: var(--uect-blue);
		opacity: .85;
	}
	/* Thead = titre de section fusionné (th unique en colspan) → bloc visible */
	.uect-se-detail__panel table.has-section-header thead { display: block; }
	.uect-se-detail__panel table.has-section-header thead tr,
	.uect-se-detail__panel table.has-section-header thead th {
		display: block;
		width: 100%;
		box-sizing: border-box;
	}
	.uect-se-detail__panel table.has-section-header thead th {
		background: #EFF3F8;
		color: var(--uect-ink);
		font-weight: 700;
		padding: 12px 14px;
		border: 1px solid #DFE5EE;
		border-bottom: 0;
		margin: 0;
		text-align: left;
		font-size: 15px;
	}
}

@media (max-width: 768px) {
	.uect-se-detail__hero { padding: 22px 0 26px; }
	/* Les 2 onglets Infos générales / Infos pratiques s'empilent sur mobile
	   plutôt que de rester côte à côte (sinon la 2e image déborde). */
	.uect-se-detail__tabs {
		grid-template-columns: 1fr;
		gap: 20px;
		max-width: 100%;
		padding: 0 20px;
	}
	.uect-se-detail__tab-media { max-width: 440px; margin: 0 auto; }
	.uect-se-detail__meta {
		flex-direction: column;
		gap: 8px;
		align-items: flex-start;
		padding-top: 18px;
	}
	.uect-se-detail__meta-item { font-size: 18px; white-space: normal; }
	.uect-se-detail__body { padding: 32px 0 48px; }
	.uect-se-detail__panel { padding: 28px 0 8px; }
	.uect-se-detail__panel h2 { font-size: 26px; }
	.uect-se-detail__panel h3 { font-size: 26px; padding-left: 40px; }
	.uect-se-detail__panel h3::before { width: 24px; }
	.uect-se-detail__panel .uect-se-figures { grid-template-columns: 1fr; }
	.uect-se-detail__cta { width: 100%; justify-content: center; padding: 15px 22px; }
}
