/* =========================================================================
 * CDM 2026 — Feuille de style unique
 * Préfixe de classes : .cdm2026-*
 * Sections : variables, guide+grille, popup/modale, barre, widget, bouton menu
 * ====================================================================== */

/* Thème sombre : on redéfinit les variables sur le conteneur portant la classe. */
.cdm2026-theme-dark {
	--cdm2026-ink: #e8e9ee;
	--cdm2026-muted: #9aa0ad;
	--cdm2026-border: #2a2d36;
	--cdm2026-bg: #15171c;
	--cdm2026-bg-alt: #1d2027;
	--cdm2026-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}

:root {
	--cdm2026-red: #e2001a;
	--cdm2026-red-dark: #b00015;
	--cdm2026-ink: #1a1a1a;
	--cdm2026-muted: #6b7280;
	--cdm2026-border: #e5e7eb;
	--cdm2026-bg: #ffffff;
	--cdm2026-bg-alt: #f7f7f9;
	--cdm2026-radius: 12px;
	--cdm2026-shadow: 0 6px 24px rgba(0, 0, 0, .12);
}

/* ----------------------------------------------------------------------- *
 * Drapeaux
 * ----------------------------------------------------------------------- */
.cdm2026-flag {
	display: inline-block;
	width: 32px;
	height: 24px;
	object-fit: cover;
	border-radius: 3px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
	vertical-align: middle;
}
.cdm2026-flag--sm { width: 22px; height: 16px; }
.cdm2026-flag--lg { width: 56px; height: 42px; }
.cdm2026-flag--emoji {
	font-size: 22px;
	line-height: 1;
	box-shadow: none;
	width: auto;
	height: auto;
}
.cdm2026-flag--lg.cdm2026-flag--emoji { font-size: 40px; }
.cdm2026-flag--sm.cdm2026-flag--emoji { font-size: 16px; }

/* ======================================================================= *
 * MODULE 1 — Guide des groupes
 * ======================================================================= */
.cdm2026-guide {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	margin: 24px 0;
}
.cdm2026-group {
	background: var(--cdm2026-bg);
	border: 1px solid var(--cdm2026-border);
	border-radius: var(--cdm2026-radius);
	padding: 14px 16px 18px;
}
.cdm2026-group__title {
	margin: 0 0 12px;
	font-size: 1rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--cdm2026-red);
	border-bottom: 2px solid var(--cdm2026-red);
	padding-bottom: 6px;
}
/* Grille interne : 4 équipes/ligne en desktop. */
.cdm2026-group__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
}
.cdm2026-team {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 10px 6px;
	background: var(--cdm2026-bg-alt);
	border: 1px solid var(--cdm2026-border);
	border-radius: 10px;
	cursor: pointer;
	font: inherit;
	color: var(--cdm2026-ink);
	text-align: center;
	transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.cdm2026-team:hover,
.cdm2026-team:focus-visible {
	transform: translateY(-2px);
	border-color: var(--cdm2026-red);
	box-shadow: 0 4px 12px rgba(226, 0, 26, .15);
	outline: none;
}
.cdm2026-team:focus-visible { outline: 2px solid var(--cdm2026-red); outline-offset: 2px; }
.cdm2026-team__name {
	font-size: .8rem;
	font-weight: 600;
	line-height: 1.2;
}

/* Responsive : 2 groupes/ligne sur tablette, 1 colonne sur mobile. */
@media (max-width: 900px) {
	.cdm2026-guide { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.cdm2026-guide { grid-template-columns: 1fr; }
	.cdm2026-group__grid { grid-template-columns: repeat(2, 1fr); }
}

/* ======================================================================= *
 * Popup / Modale (accessible)
 * ======================================================================= */
.cdm2026-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
}
.cdm2026-modal.is-open { display: flex; }
.cdm2026-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .55);
}
.cdm2026-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 560px;
	max-height: 85vh;
	overflow-y: auto;
	background: var(--cdm2026-bg);
	border-radius: var(--cdm2026-radius);
	box-shadow: var(--cdm2026-shadow);
	padding: 24px;
	-webkit-overflow-scrolling: touch;
}
.cdm2026-modal__close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 36px;
	height: 36px;
	border: none;
	background: transparent;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: var(--cdm2026-muted);
	border-radius: 50%;
}
.cdm2026-modal__close:hover,
.cdm2026-modal__close:focus-visible {
	background: var(--cdm2026-bg-alt);
	color: var(--cdm2026-ink);
	outline: none;
}

.cdm2026-popup__header {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 16px;
	padding-right: 36px;
}
.cdm2026-popup__title {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 800;
}
.cdm2026-popup__desc {
	color: var(--cdm2026-ink);
	line-height: 1.6;
	margin-bottom: 18px;
}
.cdm2026-popup__desc-empty { color: var(--cdm2026-muted); font-style: italic; }

.cdm2026-popup__news {
	border-top: 1px solid var(--cdm2026-border);
	padding-top: 14px;
}
.cdm2026-popup__news-title {
	margin: 0 0 10px;
	font-size: 1rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: var(--cdm2026-red);
}
.cdm2026-popup__news-list { list-style: none; margin: 0; padding: 0; }
.cdm2026-popup__news-item {
	padding: 10px 0;
	border-bottom: 1px solid var(--cdm2026-border);
}
.cdm2026-popup__news-item:last-child { border-bottom: none; }
.cdm2026-popup__news-date,
.cdm2026-popup__news-cats {
	display: inline-block;
	font-size: .72rem;
	color: var(--cdm2026-muted);
	margin-right: 8px;
}
.cdm2026-popup__news-cats { color: var(--cdm2026-red); font-weight: 600; }
.cdm2026-popup__news-link {
	display: block;
	margin-top: 3px;
	font-weight: 700;
	color: var(--cdm2026-ink);
	text-decoration: none;
}
.cdm2026-popup__news-link:hover { color: var(--cdm2026-red); text-decoration: underline; }

.cdm2026-modal__loading {
	padding: 30px 0;
	text-align: center;
	color: var(--cdm2026-muted);
}

/* ======================================================================= *
 * MODULE 2 — Barre Coupe du Monde
 * Le rendu de la barre est désormais le « wcband » (réplique KOVASCORE) :
 * tout le style est dans assets/css/cdm2026-wcband.css (classes scopées
 * .cdm2026-wcband). Le conteneur .cdm2026-barre ne porte plus aucun style ici.
 * ======================================================================= */

/* ======================================================================= *
 * MODULE 4 — Widget live
 * ======================================================================= */
.cdm2026-widget {
	border: 1px solid var(--cdm2026-border);
	border-radius: var(--cdm2026-radius);
	overflow: hidden;
	background: var(--cdm2026-bg);
}
.cdm2026-widget__title {
	margin: 0;
	padding: 12px 16px;
	background: var(--cdm2026-red);
	color: #fff;
	font-size: 1rem;
	font-weight: 800;
}
.cdm2026-widget__section { padding: 14px 16px; }
.cdm2026-widget__section + .cdm2026-widget__section { border-top: 1px solid var(--cdm2026-border); }
.cdm2026-widget__heading {
	margin: 0 0 10px;
	font-size: .8rem;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--cdm2026-muted);
}
.cdm2026-widget__empty { color: var(--cdm2026-muted); font-style: italic; margin: 0; }

.cdm2026-match__live {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: .72rem;
	font-weight: 800;
	color: var(--cdm2026-red);
	text-transform: uppercase;
	margin-bottom: 8px;
}
.cdm2026-match__live-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--cdm2026-red);
	animation: cdm2026-pulse 1.2s ease-in-out infinite;
}
.cdm2026-match__teams {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 10px;
}
.cdm2026-match__team { display: flex; align-items: center; gap: 8px; }
.cdm2026-match__team:last-child { justify-content: flex-end; }
.cdm2026-match__team-name { font-weight: 700; }
.cdm2026-match__score {
	font-size: 1.25rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	min-width: 56px;
	text-align: center;
}

.cdm2026-standings {
	width: 100%;
	border-collapse: collapse;
	font-size: .82rem;
}
.cdm2026-standings__group {
	caption-side: top;
	text-align: left;
	margin: 0 0 8px;
	padding: 0;
	font-weight: 700;
	color: var(--cdm2026-ink);
}
.cdm2026-standings th,
.cdm2026-standings td {
	padding: 6px 4px;
	text-align: center;
	border-bottom: 1px solid var(--cdm2026-border);
}
/* En-têtes de colonnes (thead) : gris et discrets. */
.cdm2026-standings thead th { color: var(--cdm2026-muted); font-weight: 700; }
/* En-tête de ligne (nom d'équipe) : aligné à gauche, couleur de texte normale. */
.cdm2026-standings th.cdm2026-standings__team {
	text-align: left;
	font-weight: 600;
	color: var(--cdm2026-ink);
}
.cdm2026-standings__team span { vertical-align: middle; }
.cdm2026-standings__pts { font-weight: 800; }

/* ======================================================================= *
 * MODULE 4b — Widget « Matchs » (2e widget : matchs du jour par groupe + Voir plus)
 * ======================================================================= */
.cdm2026-matchs {
	position: relative;
	isolation: isolate;
	border: none;
	border-radius: var(--cdm2026-radius);
	overflow: hidden;
	background: var(--cdm2026-bg);
	color: var(--cdm2026-ink);
}
/* Bordure segmentée 4 couleurs (IDENTIQUE au bandeau de la page Coupe .cdm2026-cdm-band) :
   haut violet|—|jaune, côtés bleu / rouge, via un ::before masqué (anneau de 4px). */
.cdm2026-matchs::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	padding: 4px;
	border-radius: inherit;
	background:
		linear-gradient(90deg, #7c3aed 0%, #7c3aed 25%, transparent 25%, transparent 75%, #f4b81e 75%, #f4b81e 100%),
		linear-gradient(180deg, #2563eb 0%, #2563eb 50%, #e11d48 50%, #e11d48 100%) center / 50% 100% no-repeat;
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
}
/* Titre : même fond dégradé sombre que le bandeau de la page Coupe (texte blanc). */
.cdm2026-matchs__title {
	margin: 0;
	padding: 14px 16px;
	font-size: 1rem;
	font-weight: 800;
	color: #fff;
	background: linear-gradient(125deg, #0a1020 0%, #13203c 46%, #1b1733 78%, #221634 100%);
}
/* Barre de dates : pastilles défilables horizontalement (sidebar étroite). */
.cdm2026-matchs__daynav {
	display: flex;
	gap: 6px;
	padding: 10px 12px;
	overflow-x: auto;
	scrollbar-width: thin;
	border-bottom: 1px solid var(--cdm2026-border);
}
.cdm2026-matchs__daynav::-webkit-scrollbar { height: 6px; }
.cdm2026-matchs__day {
	flex: 0 0 auto;
	padding: 5px 10px;
	border-radius: 999px;
	border: 1px solid var(--cdm2026-border);
	background: var(--cdm2026-bg-alt);
	color: var(--cdm2026-ink);
	font-size: .78rem;
	font-weight: 600;
	white-space: nowrap;
	text-decoration: none;
}
.cdm2026-matchs__day.is-on {
	background: var(--cdm2026-red);
	border-color: var(--cdm2026-red);
	color: #fff;
}
.cdm2026-matchs__list { padding: 4px 16px 12px; }
.cdm2026-matchs__group-h {
	margin: 12px 0 6px;
	font-size: .78rem;
	font-weight: 700;
	color: var(--cdm2026-muted);
}
.cdm2026-matchs__group-h:first-child { margin-top: 6px; }
/* Ligne de match : 2 colonnes — équipes (à gauche) + méta date·heure/statut/stade (à DROITE). */
.cdm2026-matchs__match {
	display: flex;
	align-items: center;
	gap: 10px;
	color: inherit;
	text-decoration: none;
	padding: 8px;
	margin: 0 -8px;
	border-radius: 8px;
}
a.cdm2026-matchs__match { cursor: pointer; }
a.cdm2026-matchs__match:hover,
a.cdm2026-matchs__match:focus-visible { background: var(--cdm2026-bg-alt); }
.cdm2026-matchs__match + .cdm2026-matchs__match { border-top: 1px dashed var(--cdm2026-border); }
.cdm2026-matchs__teams { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cdm2026-matchs__team { display: flex; align-items: center; gap: 8px; }
.cdm2026-matchs__tn { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdm2026-matchs__sc {
	flex: 0 0 auto;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	min-width: 1.4em;
	text-align: end;
}
.cdm2026-matchs__team.is-win .cdm2026-matchs__tn,
.cdm2026-matchs__team.is-win .cdm2026-matchs__sc { font-weight: 800; }
.cdm2026-matchs__team:not(.is-win) .cdm2026-matchs__tn { font-weight: 600; }
/* Colonne méta À DROITE (date·heure + stade pour un match prévu ; statut sinon). */
.cdm2026-matchs__meta {
	flex: 0 0 auto;
	max-width: 46%;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 2px;
	text-align: end;
	font-size: .74rem;
	line-height: 1.25;
	color: var(--cdm2026-muted);
}
.cdm2026-matchs__ko { white-space: nowrap; }
.cdm2026-matchs__ft { font-weight: 700; }
.cdm2026-matchs__live {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-weight: 800;
	color: var(--cdm2026-red);
	text-transform: uppercase;
}
.cdm2026-matchs__live-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--cdm2026-red);
	animation: cdm2026-pulse 1.2s ease-in-out infinite;
}
.cdm2026-matchs__venue::before { content: "\1F4CD"; margin-inline-end: 3px; }
.cdm2026-matchs__more {
	display: block;
	padding: 11px 16px;
	text-align: center;
	font-weight: 700;
	text-decoration: none;
	color: var(--cdm2026-red);
	border-top: 1px solid var(--cdm2026-border);
}
.cdm2026-matchs__more:hover { background: var(--cdm2026-bg-alt); }

/* ======================================================================= *
 * MODULE 3 — Bouton de menu « COUPE DU MONDE »
 * Cible : item de menu portant la classe .cdm2026-menu-btn (sur le <li>).
 * On stylise le lien <a> à l'intérieur, et le cas où la classe est sur le <a>.
 * ======================================================================= */
.cdm2026-menu-btn > a,
li.cdm2026-menu-btn > a,
a.cdm2026-menu-btn {
	display: inline-block;
	position: relative;
	background: var(--cdm2026-red) !important;
	color: #fff !important;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .03em;
	text-decoration: none;
	padding: .45em 1.1em;
	border-radius: 999px;
	box-shadow: 0 0 0 rgba(226, 0, 26, .6);
	animation: cdm2026-blink 1.8s ease-in-out infinite;
}
/* Soulignement / barre rouge sous le bouton. */
.cdm2026-menu-btn > a::after,
li.cdm2026-menu-btn > a::after,
a.cdm2026-menu-btn::after {
	content: "";
	position: absolute;
	left: 14%;
	right: 14%;
	bottom: -5px;
	height: 3px;
	border-radius: 3px;
	background: var(--cdm2026-red);
}
.cdm2026-menu-btn > a:hover,
li.cdm2026-menu-btn > a:hover,
a.cdm2026-menu-btn:hover {
	background: var(--cdm2026-red-dark) !important;
}

/* ----------------------------------------------------------------------- *
 * Animations
 * ----------------------------------------------------------------------- */
@keyframes cdm2026-blink {
	0%, 100% {
		opacity: 1;
		box-shadow: 0 0 0 0 rgba(226, 0, 26, .55);
	}
	50% {
		opacity: .82;
		box-shadow: 0 0 16px 4px rgba(226, 0, 26, .55);
	}
}
@keyframes cdm2026-pulse {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(1.5); opacity: .5; }
}

/* ----------------------------------------------------------------------- *
 * RTL (arabe…) — ajustements directionnels. Les flex/grid suivent déjà `dir`,
 * on ne corrige que les propriétés physiques (marges, positions, alignements).
 * ----------------------------------------------------------------------- */
[dir="rtl"] .cdm2026-modal__close { right: auto; left: 12px; }
[dir="rtl"] .cdm2026-popup__header { padding-right: 0; padding-left: 36px; }
[dir="rtl"] .cdm2026-popup__news-date,
[dir="rtl"] .cdm2026-popup__news-cats { margin-right: 0; margin-left: 8px; }
[dir="rtl"] .cdm2026-standings td.cdm2026-standings__team,
[dir="rtl"] .cdm2026-standings th.cdm2026-standings__team { text-align: right; }
[dir="rtl"] .cdm2026-group__title { text-align: right; }

/* Respect de prefers-reduced-motion : on coupe les animations. */
@media (prefers-reduced-motion: reduce) {
	.cdm2026-menu-btn > a,
	li.cdm2026-menu-btn > a,
	a.cdm2026-menu-btn,
	.cdm2026-match__live-dot,
	.cdm2026-team {
		animation: none !important;
		transition: none !important;
	}
}
