/**
 * Escrime Saint-Nom — Compétitions
 * La couleur du club arrive par --esc-green, injectée depuis les réglages.
 */

.esc {
	--esc-green: #31653e;
	--esc-passe: #7f8c8d;
	--esc-bord: #ddd;
	--esc-fond-doux: #f4f7f5;
	font-family: inherit;
	max-width: 900px;
	margin: auto;
	line-height: 1.5;
}

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

/* ── Éléments communs ─────────────────────────────────────────────────── */

.esc-titre-section {
	color: var(--esc-green);
	border-bottom: 2px solid var(--esc-green);
	padding-bottom: 10px;
	margin: 32px 0 16px;
}
.esc-titre-section--passe { color: var(--esc-passe); border-bottom-color: var(--esc-passe); }

.esc-vide { color: #999; font-style: italic; font-size: .9em; }

.esc-retour, .esc-carte__lien a { color: var(--esc-green); font-weight: bold; text-decoration: none; }
.esc-retour:hover, .esc-carte__lien a:hover { text-decoration: underline; }

.esc-erreur {
	padding: 16px;
	border: 1px solid #f0c4c4;
	border-left: 5px solid #d32f2f;
	background: #fdf5f5;
	border-radius: 4px;
}
.esc-erreur__detail { font-size: .85em; color: #8a5a5a; margin-bottom: 0; }

.esc-debug {
	margin-top: 40px;
	padding: 12px 15px;
	border: 1px dashed var(--esc-green);
	border-radius: 8px;
	background: var(--esc-fond-doux);
	color: #666;
	font-size: .75em;
}

.esc-centre { text-align: center; }

/* Bloc date réutilisable */
.esc-date {
	flex-shrink: 0;
	background: var(--esc-fond-doux);
	border: 1px solid var(--esc-green);
	border-radius: 6px;
	padding: 10px;
	min-width: 85px;
	text-align: center;
	color: var(--esc-green);
	display: flex;
	flex-direction: column;
	line-height: 1;
}
.esc-date__mois { font-size: .8em; text-transform: uppercase; font-weight: bold; }
.esc-date__jour { font-size: 1.6em; font-weight: 900; margin: 3px 0; }
.esc-date__annee { font-size: .8em; font-weight: bold; }

.esc-date--mini { min-width: 48px; padding: 4px; }
.esc-date--mini .esc-date__jour { font-size: 1.2em; margin: 2px 0 0; }
.esc-date--mini .esc-date__mois { font-size: .75em; }
.esc-date--mini .esc-date__annee { display: none; }

/* ── Filtres ──────────────────────────────────────────────────────────── */

.esc-filtres {
	margin-bottom: 30px;
	background: var(--esc-fond-doux);
	padding: 15px;
	border-radius: 8px;
	border: 1px solid #e0e6e2;
}
.esc-filtres__titre { margin: 0 0 10px; font-weight: bold; color: var(--esc-green); font-size: .9em; }
.esc-filtres__boutons { display: flex; gap: 10px; flex-wrap: wrap; }

.esc-filtre {
	padding: 6px 12px;
	border-radius: 20px;
	border: 1px solid var(--esc-green);
	background: #fff;
	color: var(--esc-green);
	cursor: pointer;
	font-size: .85em;
	line-height: 1.3;
}
.esc-filtre:hover { background: var(--esc-fond-doux); }
.esc-filtre.is-active { background: var(--esc-green); color: #fff; }

/* ── Carte de compétition ─────────────────────────────────────────────── */

.esc-carte {
	border: 1px solid var(--esc-bord);
	border-left: 6px solid var(--esc-green);
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 2px 4px rgba(0, 0, 0, .05);
	padding: 20px;
	margin-bottom: 15px;
	display: flex;
	gap: 20px;
	align-items: flex-start;
}
.esc-carte--passe { opacity: .75; border-left-color: var(--esc-passe); }
.esc-carte--passe .esc-date { border-color: var(--esc-passe); color: var(--esc-passe); }
.esc-carte--passe .esc-carte__titre { color: var(--esc-passe); }
.esc-carte--passe .esc-pill { color: var(--esc-passe); border-color: var(--esc-passe); }

.esc-carte__corps { flex-grow: 1; min-width: 0; }
.esc-carte__titre { margin: 0 0 5px; color: var(--esc-green); font-size: 1.25em; }
.esc-carte__lieu { margin: 0 0 10px; color: #666; font-size: .95em; }
.esc-carte__lien { margin: 12px 0 0; font-size: .85em; }

.esc-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.esc-pill {
	background: #fff;
	color: var(--esc-green);
	border: 1px solid var(--esc-green);
	padding: 1px 8px;
	border-radius: 12px;
	font-size: .7em;
	font-weight: bold;
}

/* ── Fiche détaillée ──────────────────────────────────────────────────── */

.esc-fiche__titre { color: var(--esc-green); margin-bottom: 10px; font-size: 2.2em; line-height: 1.2; }
.esc-fiche__date {
	font-size: 1.4em;
	color: #555;
	font-weight: 600;
	margin-bottom: 25px;
	padding: 10px 0;
	border-top: 1px solid #eee;
	border-bottom: 1px solid #eee;
}

.esc-info {
	margin-bottom: 25px;
	padding: 15px;
	background: #fff9c4;
	border-left: 5px solid #fbc02d;
	border-radius: 4px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, .05);
}
.esc-info__titre { margin: 0 0 10px; color: #856404; font-weight: bold; }
.esc-info__corps { color: #333; line-height: 1.6; }
.esc-info--alerte { background: #ffebee; border-left-color: #d32f2f; }
.esc-info--alerte .esc-info__titre { color: #c62828; }

.esc-pdf {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fdfdfd;
	color: #d32f2f;
	border: 2px solid #d32f2f;
	padding: 12px;
	border-radius: 8px;
	text-decoration: none;
	font-weight: bold;
	transition: background .2s;
}
.esc-pdf:hover { background: #fff5f5; }
.esc-pdf__icone { font-size: 1.5em; margin-right: 10px; }

.esc-lieu { margin-bottom: 25px; border: 1px solid var(--esc-bord); border-radius: 8px; overflow: hidden; }
.esc-lieu__entete {
	padding: 8px 15px;
	background: #f9f9f9;
	border-bottom: 1px solid var(--esc-bord);
	font-size: .9em;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}
.esc-lieu__entete a { color: var(--esc-green); font-weight: bold; text-decoration: none; }
.esc-lieu__carte { width: 100%; height: 200px; border: 0; display: block; }

/* Arbitrage */
.esc-arbitrage {
	margin: 20px 0;
	padding: 15px;
	background: #fdfdfd;
	border: 1px solid #e0e0e0;
	border-left: 5px solid #2c3e50;
	border-radius: 4px;
}
.esc-arbitrage__titre { margin: 0 0 10px; color: #2c3e50; font-size: 1.1em; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.esc-arbitrage__liste { list-style: none; padding: 0; margin: 0; }
.esc-arbitrage__liste li {
	margin-bottom: 6px;
	padding-bottom: 4px;
	border-bottom: 1px dotted #eee;
	display: flex;
	align-items: center;
	gap: 10px;
}
.esc-puce { background: #27ae60; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.esc-arbitrage__statut {
	margin-left: auto;
	font-size: .7em;
	color: #27ae60;
	font-weight: bold;
	text-transform: uppercase;
}

/* ── Épreuve ──────────────────────────────────────────────────────────── */

.esc-epreuve {
	border: 1px solid var(--esc-bord);
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 2px 5px rgba(0, 0, 0, .05);
	padding: 15px;
	margin-bottom: 25px;
}
.esc-epreuve__entete {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 15px;
	border-bottom: 1px solid #f0f0f0;
	padding-bottom: 12px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}
.esc-epreuve__titre { font-size: 1.2em; color: #333; }
.esc-epreuve__sexe { font-size: .85em; color: #666; margin-top: 2px; }
.esc-epreuve__horaires { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.esc-epreuve__terminee {
	color: #999;
	font-size: .75em;
	font-weight: bold;
	text-transform: uppercase;
	border: 1px solid #eee;
	padding: 3px 8px;
	border-radius: 4px;
}

.esc-tag { padding: 4px 10px; border-radius: 4px; font-size: .85em; font-weight: bold; color: #fff; white-space: nowrap; }
.esc-tag--appel { background: var(--esc-green); }
.esc-tag--scratch { background: #d32f2f; }
.esc-tag--prix { background: #fff; color: #27ae60; border: 1px solid #27ae60; }

.esc-resultats { background: #fafafa; padding: 12px; border-radius: 6px; overflow-x: auto; }
.esc-resultats__titre { margin-bottom: 10px; font-size: .85em; font-weight: bold; color: var(--esc-green); }

.esc-ligne { padding: 15px 0; border-bottom: 1px solid #eee; }
.esc-ligne:last-child { border-bottom: none; }
.esc-ligne__entete { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.esc-ligne__nom { font-size: 1.1em; color: #333; }
.esc-ligne__membres { font-size: .8em; font-weight: normal; color: #666; }
.esc-ligne__badges { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-left: 25px; }

.esc-classement {
	background: var(--esc-green);
	color: #fff;
	padding: 5px 12px;
	border-radius: 6px;
	font-weight: 900;
	font-size: 1.2em;
	white-space: nowrap;
	box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
}

.esc-badge { padding: 6px 12px; border-radius: 8px; border: 1px solid #ddd; min-width: 75px; text-align: center; background: #f8f9fa; color: #333; }
.esc-badge__label { font-size: .7em; display: block; text-transform: uppercase; font-weight: bold; opacity: .75; }
.esc-badge__valeur { font-size: 1.1em; font-weight: 900; }
.esc-badge--poule { background: #e8f5e9; border-color: #c8e6c9; color: #2e7d32; }
.esc-badge--place { background: #fff3e0; border-color: #ffe0b2; color: #e65100; }
.esc-badge--v { background: #e3f2fd; border-color: #bbdefb; color: #0d47a1; }
.esc-badge--d { background: #ffebee; border-color: #ffcdd2; color: #b71c1c; }

.esc-separateur { width: 1px; height: 30px; background: #ddd; margin: 0 5px; }

/* ── Widget colonne latérale ──────────────────────────────────────────── */

.esc-widget {
	width: 100%;
	max-width: 325px;
	background: #fff;
	border: 1px solid var(--esc-bord);
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 4px rgba(0, 0, 0, .05);
	line-height: 1.4;
}
.esc-widget__entete {
	background: var(--esc-green);
	color: #fff;
	padding: 12px;
	font-weight: bold;
	font-size: .9em;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: .5px;
}
.esc-widget__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border-bottom: 1px solid #eee;
	text-decoration: none;
	color: inherit;
	transition: background .2s;
}
.esc-widget__item:hover { background: #f9f9f9; }
.esc-widget__texte { overflow: hidden; flex-grow: 1; }
.esc-widget__titre { font-size: .9em; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #333; }
.esc-widget__meta { font-size: .75em; color: #666; margin-top: 3px; }
.esc-widget__armes { color: var(--esc-green); font-weight: bold; }
.esc-widget__sep { margin: 0 4px; opacity: .4; }
.esc-widget__vide { padding: 15px; font-size: .85em; color: #999; font-style: italic; margin: 0; }
.esc-widget__pied { padding: 12px; text-align: center; background: #fcfcfc; border-top: 1px solid #eee; }
.esc-widget__pied a { font-size: .85em; color: var(--esc-green); text-decoration: none; font-weight: bold; }

/* ── Tableaux (scores & bilan) ────────────────────────────────────────── */

.esc-tableau-conteneur { overflow-x: auto; }
.esc-tableau { width: 100%; border-collapse: collapse; font-size: .85em; }
.esc-tableau th {
	padding: 6px 10px;
	text-align: left;
	white-space: nowrap;
	background: var(--esc-fond-doux);
	color: var(--esc-green);
	font-size: .9em;
	text-transform: uppercase;
}
.esc-tableau td { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.esc-tableau tr:last-child td { border-bottom: none; }
.esc-tableau__date { color: #666; font-size: .9em; white-space: nowrap; }
.esc-tableau__compet { font-weight: 500; color: #333; }

.esc-scores__epreuve { margin-bottom: 28px; }
.esc-scores__titre { color: var(--esc-green); font-size: 1.1em; margin-bottom: 8px; }
.esc-scores__titre span { color: #888; font-weight: normal; font-size: .85em; }

/* ── Bilan de saison ──────────────────────────────────────────────────── */

.esc-bloc { margin-bottom: 12px; border: 1px solid var(--esc-bord); border-radius: 8px; overflow: hidden; }
.esc-bloc__entete {
	cursor: pointer;
	padding: 13px 18px;
	background: var(--esc-green);
	color: #fff;
	font-weight: bold;
	font-size: 1.05em;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	user-select: none;
	list-style: none;
}
.esc-bloc__entete::-webkit-details-marker { display: none; }
.esc-bloc__compte { font-size: .8em; opacity: .85; font-weight: normal; text-align: right; }
.esc-fleche { display: inline-block; transition: transform .2s; margin-right: 6px; }
.esc-bloc[open] .esc-fleche { transform: rotate(90deg); }
.esc-bloc__corps { padding: 12px 15px; background: #fafafa; }

.esc-tireur { margin: 12px 0; background: #fff; border: 1px solid #e8e8e8; border-radius: 6px; overflow: hidden; }
.esc-tireur__entete {
	padding: 9px 14px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	border-bottom: 1px solid #f0f0f0;
}
.esc-tireur__nom { font-weight: bold; color: #333; }
.esc-tireur__stats { display: flex; gap: 8px; align-items: center; }
.esc-tireur__record { background: var(--esc-green); color: #fff; padding: 3px 10px; border-radius: 4px; font-size: .78em; font-weight: bold; white-space: nowrap; }
.esc-tireur__compte { color: #aaa; font-size: .8em; white-space: nowrap; }

.esc-poule { display: block; font-weight: bold; white-space: nowrap; }
.esc-poule__place { color: #888; font-size: .85em; }

.esc-tag-tableau { padding: 2px 6px; border-radius: 3px; font-size: .8em; margin: 1px; display: inline-block; white-space: nowrap; }
.esc-tag-tableau--v { background: #e3f2fd; color: #0d47a1; }
.esc-tag-tableau--d { background: #ffebee; color: #b71c1c; }

.esc-arbitre__liste { margin: 0; padding: 10px 14px 6px; list-style: none; }
.esc-arbitre__liste li { padding: 5px 0; border-bottom: 1px solid #f5f5f5; font-size: .9em; display: flex; gap: 12px; color: #444; }
.esc-arbitre__liste li:last-child { border-bottom: none; }
.esc-arbitre__date { white-space: nowrap; color: #888; }

/* ── Petits écrans ────────────────────────────────────────────────────── */

@media (max-width: 600px) {
	.esc-carte { flex-direction: column; gap: 12px; }
	.esc-date { flex-direction: row; gap: 6px; align-items: baseline; justify-content: center; min-width: 0; }
	.esc-date__jour { font-size: 1.2em; margin: 0; }
	.esc-fiche__titre { font-size: 1.6em; }
	.esc-fiche__date { font-size: 1.1em; }
	.esc-epreuve__horaires { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
	.esc-ligne__badges { padding-left: 0; }
	.esc-ligne__entete { flex-wrap: wrap; }
}
