/* =====================================================================
   TO13 — Classement SportsPress (league table)
   Même langage visuel que les pages calendrier/résultats :
   carte claire #f8f9fb / bordure #e4e7ed, navy #0B1530, lime #c2ff1f.

   Markup : theme/sportspress/league-table.php
   ===================================================================== */

.to13-standings {
	--to13-navy: #0B1530;
	--to13-lime: #c2ff1f;
	--to13-blue: #00509d;
	--to13-card: #f8f9fb;
	--to13-border: #e4e7ed;
	--to13-line: #edf0f4;
	--to13-ink: #1a1f2e;
	--to13-muted: #5b6470;
	margin: 0 0 24px;
}

/* ---------- En-tête (pastille façon « Match Day » du calendrier) ---------- */

.to13-standings__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px 16px;
	margin: 0 0 14px;
}

.to13-standings .to13-standings__title {
	display: inline-block;
	margin: 0;
	padding: 6px 14px;
	background: var(--to13-navy);
	color: var(--to13-lime);
	border-radius: 6px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.to13-standings__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: var(--to13-navy);
	text-decoration: none;
}

.to13-standings__link:hover,
.to13-standings__link:focus {
	color: var(--to13-blue);
}

/* ---------- Carte ---------- */

.to13-standings__card {
	background: #fff;
	border: 1px solid var(--to13-border);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(11, 21, 48, 0.04);
}

.to13-standings .to13-standings__table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: separate;
	border-spacing: 0;
	font-variant-numeric: tabular-nums;
}

/* ---------- En-têtes de colonnes ---------- */

.to13-standings .to13-standings__table th {
	padding: 12px 8px;
	background: var(--to13-navy);
	border: 0;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	white-space: nowrap;
}

.to13-standings .to13-standings__table th abbr {
	text-decoration: none;
	border: 0;
	cursor: help;
}

.to13-standings .to13-standings__table th.c-name {
	text-align: left;
	padding-left: 4px;
}

.to13-standings .to13-standings__table th.c-pts {
	color: var(--to13-lime);
}

/* ---------- Cellules ---------- */

.to13-standings .to13-standings__table td {
	padding: 9px 8px;
	background: #fff;
	border: 0;
	border-bottom: 1px solid var(--to13-line);
	color: var(--to13-ink);
	font-size: 14px;
	line-height: 1.3;
	text-align: center;
	vertical-align: middle;
}

.to13-standings .to13-standings__table tr:last-child td {
	border-bottom: 0;
}

.to13-standings .to13-standings__table td.c-name {
	text-align: left;
	padding-left: 4px;
}

.to13-standings .to13-standings__table tr:hover td {
	background: var(--to13-card);
}

/* Rang */

.to13-standings .to13-standings__table td.c-rank {
	width: 54px;
	padding-left: 12px;
	padding-right: 4px;
}

.to13-standings__rank {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	padding: 0 6px;
	border-radius: 6px;
	background: #f0f2f6;
	color: var(--to13-navy);
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
}

/* Équipe */

.to13-standings__team {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}

.to13-standings__logo {
	flex: 0 0 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
}

.to13-standings__logo img {
	display: block;
	width: auto;
	height: auto;
	max-width: 26px;
	max-height: 26px;
	object-fit: contain;
}

.to13-standings__name {
	min-width: 0;
	color: var(--to13-navy);
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

a.to13-standings__team:hover .to13-standings__name,
a.to13-standings__team:focus .to13-standings__name {
	color: var(--to13-blue);
}

/* Différentiel */

.to13-standings .to13-standings__table td.c-diff.is-positive {
	color: var(--to13-navy);
	font-weight: 600;
}

.to13-standings .to13-standings__table td.c-diff.is-negative {
	color: #8a93a0;
}

/* Points */

.to13-standings .to13-standings__table td.c-pts {
	padding-right: 12px;
	color: var(--to13-navy);
	font-size: 16px;
	font-weight: 800;
}

/* ---------- Zone qualificative (play-offs) ---------- */

.to13-standings .to13-standings__table tr.is-zone td.c-rank {
	box-shadow: inset 3px 0 0 var(--to13-blue);
}

/* ---------- Ligne Toulouse ---------- */

.to13-standings .to13-standings__table tr.is-to13 td {
	background: var(--to13-navy);
	border-bottom-color: var(--to13-navy);
	color: #fff;
}

.to13-standings .to13-standings__table tr.is-to13 td.c-rank {
	border-radius: 8px 0 0 8px;
	box-shadow: none;
}

.to13-standings .to13-standings__table tr.is-to13 td.c-pts {
	border-radius: 0 8px 8px 0;
	color: var(--to13-lime);
}

.to13-standings .to13-standings__table tr.is-to13 .to13-standings__rank {
	background: var(--to13-lime);
	color: var(--to13-navy);
}

.to13-standings .to13-standings__table tr.is-to13 .to13-standings__name {
	color: #fff;
	font-weight: 700;
}

.to13-standings .to13-standings__table tr.is-to13 td.c-diff.is-positive {
	color: #fff;
}

.to13-standings .to13-standings__table tr.is-to13 td.c-diff.is-negative {
	color: rgba(255, 255, 255, 0.6);
}

.to13-standings .to13-standings__table tr.is-to13:hover td {
	background: #101c3d;
	border-bottom-color: #101c3d;
}

/* ---------- Stats condensées (mobile uniquement) ---------- */

.to13-standings__meta {
	display: none;
}

/* ---------- Légende ---------- */

.to13-standings__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 12px 0 0;
	font-size: 12px;
	line-height: 1.5;
	color: var(--to13-muted);
}

.to13-standings__legend-item {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.to13-standings__legend i {
	display: block;
	flex: 0 0 auto;
	width: 12px;
	height: 12px;
	border-radius: 3px;
}

.to13-standings__legend i.is-zone {
	background: var(--to13-blue);
}

/* =====================================================================
   Mobile / tablette étroite : chaque ligne devient une carte,
   plus aucun scroll horizontal.
   ===================================================================== */

@media (max-width: 781px) {

	.to13-standings__card {
		background: none;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		overflow: visible;
	}

	.to13-standings .to13-standings__table,
	.to13-standings .to13-standings__table tbody,
	.to13-standings .to13-standings__table tr,
	.to13-standings .to13-standings__table td {
		display: block;
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
	}

	.to13-standings .to13-standings__table thead {
		display: none;
	}

	.to13-standings .to13-standings__table tr {
		display: flex;
		align-items: center;
		width: 100%;
		box-sizing: border-box;
		gap: 12px;
		margin: 0 0 10px;
		padding: 12px 14px;
		background: var(--to13-card);
		border: 1px solid var(--to13-border);
		border-radius: 10px;
		box-shadow: 0 1px 3px rgba(11, 21, 48, 0.04);
	}

	.to13-standings .to13-standings__table tr:last-child {
		margin-bottom: 0;
	}

	.to13-standings .to13-standings__table td {
		padding: 0;
		background: none;
		border: 0;
	}

	/* Colonnes détaillées masquées : l'info repasse dans .to13-standings__meta */
	.to13-standings .to13-standings__table td.c-p,
	.to13-standings .to13-standings__table td.c-w,
	.to13-standings .to13-standings__table td.c-d,
	.to13-standings .to13-standings__table td.c-l,
	.to13-standings .to13-standings__table td.c-pm,
	.to13-standings .to13-standings__table td.c-pe,
	.to13-standings .to13-standings__table td.c-diff,
	.to13-standings .to13-standings__table td.c-gf,
	.to13-standings .to13-standings__table td.c-ga,
	.to13-standings .to13-standings__table td.c-gd {
		display: none;
	}

	.to13-standings .to13-standings__table td.c-rank {
		flex: 0 0 auto;
		width: auto;
		max-width: none;
		padding: 0;
	}

	.to13-standings__rank {
		min-width: 30px;
		height: 30px;
		font-size: 14px;
	}

	.to13-standings .to13-standings__table td.c-name {
		flex: 1 1 0%;
		width: auto;
		min-width: 0;
		padding: 0;
		display: flex;
		flex-direction: column;
		gap: 5px;
	}

	.to13-standings__name {
		font-size: 15px;
		white-space: normal;
		overflow: visible;
		text-overflow: clip;
	}

	.to13-standings__logo,
	.to13-standings__logo img {
		flex-basis: 24px;
		width: 24px;
		height: 24px;
		max-width: 24px;
		max-height: 24px;
	}

	.to13-standings__logo img {
		width: auto;
		height: auto;
	}

	/* Ligne de stats sous le nom */
	.to13-standings__meta {
		display: flex;
		flex-wrap: wrap;
		min-width: 0;
		gap: 3px 10px;
		font-size: 11px;
		line-height: 1.4;
		color: var(--to13-muted);
	}

	.to13-standings__meta-item b {
		margin-right: 3px;
		color: var(--to13-ink);
		font-weight: 700;
	}

	/* Bloc points */
	.to13-standings .to13-standings__table td.c-pts {
		flex: 0 0 auto;
		width: auto;
		max-width: none;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		min-width: 46px;
		padding: 7px 8px;
		border-radius: 8px;
		background: var(--to13-navy);
		color: var(--to13-lime);
		font-size: 18px;
		font-weight: 800;
		line-height: 1;
	}

	.to13-standings .to13-standings__table td.c-pts::after {
		content: attr(data-label);
		margin-top: 3px;
		color: rgba(255, 255, 255, 0.6);
		font-size: 9px;
		font-weight: 700;
		letter-spacing: 0.6px;
		text-transform: uppercase;
	}

	/* Zone play-offs : liseré à gauche de la carte */
	.to13-standings .to13-standings__table tr.is-zone {
		border-left: 3px solid var(--to13-blue);
		padding-left: 12px;
	}

	.to13-standings .to13-standings__table tr.is-zone td.c-rank {
		box-shadow: none;
	}

	/* Carte Toulouse */
	.to13-standings .to13-standings__table tr.is-to13 {
		background: var(--to13-navy);
		border-color: var(--to13-navy);
	}

	.to13-standings .to13-standings__table tr.is-to13 td,
	.to13-standings .to13-standings__table tr.is-to13:hover td {
		background: none;
	}

	.to13-standings .to13-standings__table tr.is-to13 .to13-standings__meta {
		color: rgba(255, 255, 255, 0.7);
	}

	.to13-standings .to13-standings__table tr.is-to13 .to13-standings__meta-item b {
		color: #fff;
	}

	.to13-standings .to13-standings__table tr.is-to13 td.c-pts {
		background: var(--to13-lime);
		color: var(--to13-navy);
		border-radius: 8px;
	}

	.to13-standings .to13-standings__table tr.is-to13 td.c-pts::after {
		color: rgba(11, 21, 48, 0.65);
	}
}

@media (max-width: 360px) {

	.to13-standings .to13-standings__table tr {
		gap: 10px;
		padding: 11px 12px;
	}

	.to13-standings__name {
		font-size: 14px;
	}

	.to13-standings .to13-standings__table td.c-pts {
		min-width: 42px;
		font-size: 17px;
	}
}

/* ---------- Colonne « Forme » (5 derniers matchs) ---------- */

.to13-standings .to13-standings__table th.c-form,
.to13-standings .to13-standings__table td.c-form {
	padding-right: 12px;
	white-space: nowrap;
}

.to13-standings__form {
	display: inline-flex;
	align-items: center;
	gap: 3px;
}

.to13-standings__form-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border-radius: 5px;
	font-size: 10px;
	font-weight: 800;
	line-height: 1;
	cursor: default;
}

.to13-standings__form-pill.is-win {
	background: var(--to13-lime);
	color: var(--to13-navy);
}

.to13-standings__form-pill.is-draw {
	background: #d6dae0;
	color: var(--to13-navy);
}

.to13-standings__form-pill.is-loss {
	background: #e9ecf1;
	color: #8a93a0;
}

.to13-standings__form-empty {
	color: #b3bac4;
}

/* Ligne Toulouse : fond navy, il faut remonter le contraste des pastilles */
.to13-standings .to13-standings__table tr.is-to13 .to13-standings__form-pill.is-draw {
	background: rgba(255, 255, 255, 0.38);
	color: var(--to13-navy);
}

.to13-standings .to13-standings__table tr.is-to13 .to13-standings__form-pill.is-loss {
	background: rgba(255, 255, 255, 0.16);
	color: rgba(255, 255, 255, 0.75);
}

.to13-standings .to13-standings__table tr.is-to13 .to13-standings__form-empty {
	color: rgba(255, 255, 255, 0.5);
}

/* Mobile : la forme passe sur sa propre ligne, sous le nom et les points */
@media (max-width: 781px) {

	.to13-standings .to13-standings__table tr {
		flex-wrap: wrap;
	}

	.to13-standings .to13-standings__table td.c-form {
		display: flex;
		flex: 1 0 100%;
		width: 100%;
		max-width: 100%;
		margin: 9px 0 0;
		padding: 9px 0 0;
		border-top: 1px solid var(--to13-border);
	}

	.to13-standings .to13-standings__table tr.is-to13 td.c-form {
		border-top-color: rgba(255, 255, 255, 0.18);
	}

	.to13-standings__form-pill {
		width: 20px;
		height: 20px;
		font-size: 11px;
	}
}
