/**
 * Front-end — [stu_ranking]
 * Visual alinhado ao bloco `<style>` do sportech_generate_ranking (sportech-ranking.php).
 */

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking {
	/* Paleta igual ao ranking Sportech principal (fundos transparentes para herdar texto do tema). */
	--stu-ranking-sc-border: #333333;
	--stu-ranking-sc-accent: #fece35;
	--stu-ranking-sc-photo-empty: rgba(255, 255, 255, 0.08);
	/*
	 * Cor do nome (link) — alinhada ao texto das células numéricas em fundo escuro.
	 * Elementor/global kit aplica rosa em `a` + às vezes `-webkit-text-fill-color` / gradiente.
	 * Sobrescreve no próprio bloco: `--stu-ranking-sc-link-name-text: #111;` em páginas claras.
	 */
	--stu-ranking-sc-link-name-text: rgba(255, 255, 255, 0.95);
	/* Fundo das linhas ímpares (zebra) em páginas escuras; transparente nas pares. */
	--stu-ranking-sc-row-stripe: rgba(255, 255, 255, 0.025);

	margin-bottom: 1.25em;
	max-width: 100%;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-matrix {
	width: 100%;
	border-collapse: collapse;
	table-layout: auto;
	font-size: 14px;
	line-height: 1.4;
	margin-bottom: 0;
	border: none;
	background-color: transparent;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking:not(.stu-ranking-shortcode-ranking--mini) .stu-ranking-shortcode-matrix th,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking:not(.stu-ranking-shortcode-ranking--mini) .stu-ranking-shortcode-matrix td {
	padding: 8px;
	border: none;
	text-align: center;
	vertical-align: middle;
	background-color: inherit;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking:not(.stu-ranking-shortcode-ranking--mini) .stu-ranking-shortcode-matrix tbody td {
	background-color: transparent;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking:not(.stu-ranking-shortcode-ranking--mini) .stu-ranking-shortcode-matrix thead th {
	background-color: transparent !important;
	position: static;
	z-index: auto;
	font-weight: 700;
	line-height: 1.35;
	border: none;
	color: inherit;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking:not(.stu-ranking-shortcode-ranking--mini) .stu-ranking-shortcode-matrix thead th.stu-ranking-sc-head-blank {
	padding: 4px !important;
	font-weight: 400;
	line-height: 1;
	vertical-align: bottom;
	border-bottom: none;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	white-space: nowrap;
	word-wrap: normal !important;
}

/* Linhas alternadas (zebra) — cor nas células (Elementor força tr transparent !important). */
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking table.stu-ranking-shortcode-matrix tbody tr:nth-child(odd) > td {
	background-color: var(--stu-ranking-sc-row-stripe) !important;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking table.stu-ranking-shortcode-matrix tbody tr:nth-child(even) > td {
	background-color: transparent !important;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking table.stu-ranking-shortcode-matrix thead th {
	background-color: transparent !important;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-matrix .stu-ranking-sc-photo {
	width: 80px;
	min-width: 80px;
	max-width: 80px;
	padding: 6px !important;
	text-align: center !important;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-photo-wrap {
	position: relative;
	display: inline-block;
	vertical-align: middle;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-country-flag {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 14px !important;
	height: 9px !important;
	max-width: 14px !important;
	max-height: 9px !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	object-fit: cover;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-country-flag {
	width: 12px !important;
	height: 8px !important;
	max-width: 12px !important;
	max-height: 8px !important;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-matrix .stu-ranking-sc-pos {
	width: 3.75rem;
	font-weight: 700;
	padding: 8px !important;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-matrix .stu-ranking-sc-name {
	text-align: left !important;
	font-weight: 500;
	max-width: 220px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Link para perfil (`/skaters/{slug}/`). */
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-matrix tbody td.stu-ranking-sc-name > a.stu-ranking-sc-profile-link--name,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-matrix tbody td.stu-ranking-sc-name > a.stu-ranking-sc-profile-link--name:link,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-matrix tbody td.stu-ranking-sc-name > a.stu-ranking-sc-profile-link--name:visited,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-matrix tbody td.stu-ranking-sc-name > a.stu-ranking-sc-profile-link--name:hover,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-matrix tbody td.stu-ranking-sc-name > a.stu-ranking-sc-profile-link--name:focus,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-matrix tbody td.stu-ranking-sc-name > a.stu-ranking-sc-profile-link--name:active {
	color: var(--stu-ranking-sc-link-name-text) !important;
	text-decoration: none !important;
	-webkit-text-fill-color: currentColor !important;
	fill: currentColor !important;
	background-image: none !important;
	background-size: auto !important;
	background-clip: padding-box !important;
	-webkit-background-clip: padding-box !important;
	box-shadow: none !important;
	text-shadow: none !important;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-matrix td.stu-ranking-sc-name {
	color: var(--stu-ranking-sc-link-name-text);
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-sc-profile-link:focus-visible {
	outline: 2px solid var(--stu-ranking-sc-accent);
	outline-offset: 2px;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking a.stu-ranking-sc-profile-link--photo {
	display: inline-flex;
	vertical-align: middle;
	border-radius: 50%;
	text-decoration: none !important;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-matrix .stu-ranking-sc-evt,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-matrix .stu-ranking-sc-prior {
	font-variant-numeric: tabular-nums;
	min-width: 3rem;
	padding: 8px !important;
	color: inherit;
	font-weight: 500;
	font-size: inherit;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-matrix .stu-ranking-sc-tot {
	font-variant-numeric: tabular-nums;
	min-width: 3rem;
	padding: 8px !important;
	color: var(--stu-ranking-sc-accent);
	font-weight: 600;
	font-size: 18px;
}

/* Ano/coluna «total temporada» no cabeçalho — branco (herda tema), maior que etapas; amarelo só no corpo. */
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-matrix thead th.stu-ranking-sc-tot {
	color: inherit;
	font-size: 18px;
	font-weight: 700;
}

/* Container circular (foto) — mesmo tamanho que `.skater-photo` em sportech-ranking.php (40px). */

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-photo-circle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	min-width: 40px;
	max-width: 40px;
	height: 40px;
	min-height: 40px;
	max-height: 40px;
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
	vertical-align: middle;
	box-sizing: border-box;
	position: relative;
	isolation: isolate;
	background-color: transparent;
	border: none;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-photo-circle--empty {
	background-color: var(--stu-ranking-sc-photo-empty);
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-thumb {
	display: block;
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	vertical-align: top;
	/* Tamanho fixo: evita CLS e imagem “quadrada grande” antes do CSS do tema. */
	width: 40px !important;
	height: 40px !important;
	max-width: 40px !important;
	max-height: 40px !important;
	aspect-ratio: 1;
	object-fit: cover;
	object-position: center;
	border-radius: 50%;
	/* Fade-in após load (stu-ranking-shortcode-thumb.js inline). */
	opacity: 0;
	transition: opacity 0.22s ease;
	/* Sem transição no filtro: animar de `none` → grayscale produz flash colorido no 1.º paint. */
	filter: grayscale(100%);
	-webkit-filter: grayscale(100%);
	backface-visibility: hidden;
	transform: translateZ(0);
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-thumb.stu-ranking-shortcode-thumb--visible {
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {

	.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-thumb {
		opacity: 1;
		transition: none;
	}
}

/* Scroll horizontal quando houver muitas colunas de etapas */

.stu-ranking-shortcode-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

@media screen and (max-width: 768px) {

	.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-matrix {
		font-size: 13px;
	}

	.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-matrix th,
	.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-matrix td {
		padding: 6px 4px !important;
	}

	.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-photo-circle {
		width: 36px;
		min-width: 36px;
		max-width: 36px;
		height: 36px;
		min-height: 36px;
		max-height: 36px;
	}

	.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking .stu-ranking-shortcode-thumb {
		width: 36px !important;
		height: 36px !important;
		max-width: 36px !important;
		max-height: 36px !important;
	}
}

/* [stu_ranking_mini] — home: altura limitada, scroll vertical, sem scroll horizontal. */
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini {
	margin-bottom: 0;
	max-width: 100%;
	overflow-x: hidden;
	--stu-ranking-mini-max-h: min(23.5rem, 52vh);
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-mini-scroll {
	max-height: var(--stu-ranking-mini-max-h);
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

/* Vence Elementor (.elementor-… table { border: 1px solid black !important; }) — ranking completo. */
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking:not(.stu-ranking-shortcode-ranking--mini) table.stu-ranking-shortcode-matrix,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking:not(.stu-ranking-shortcode-ranking--mini) table.stu-ranking-shortcode-matrix thead,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking:not(.stu-ranking-shortcode-ranking--mini) table.stu-ranking-shortcode-matrix tbody,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking:not(.stu-ranking-shortcode-ranking--mini) table.stu-ranking-shortcode-matrix tr,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking:not(.stu-ranking-shortcode-ranking--mini) table.stu-ranking-shortcode-matrix th,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking:not(.stu-ranking-shortcode-ranking--mini) table.stu-ranking-shortcode-matrix td {
	border: none !important;
	border-width: 0 !important;
	border-style: none !important;
	border-color: transparent !important;
	outline: none !important;
	box-shadow: none !important;
}

/* Vence Elementor — mini ranking. */
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-mini-scroll table.stu-ranking-shortcode-matrix,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-mini-scroll table.stu-ranking-shortcode-matrix thead,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-mini-scroll table.stu-ranking-shortcode-matrix tbody,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-mini-scroll table.stu-ranking-shortcode-matrix tr,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-mini-scroll table.stu-ranking-shortcode-matrix th,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-mini-scroll table.stu-ranking-shortcode-matrix td {
	border: none !important;
	border-width: 0 !important;
	border-style: none !important;
	border-color: transparent !important;
	outline: none !important;
	box-shadow: none !important;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-matrix {
	table-layout: fixed;
	width: 100%;
	font-size: 14px;
	line-height: 1.35;
	border-collapse: collapse;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-mini-scroll table.stu-ranking-shortcode-matrix th,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-mini-scroll table.stu-ranking-shortcode-matrix td {
	padding: 6px 7px !important;
	text-align: center;
	vertical-align: middle;
	background-color: inherit;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-mini-scroll table.stu-ranking-shortcode-matrix tbody td {
	background-color: transparent;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-mini-scroll table.stu-ranking-shortcode-matrix thead th {
	background-color: transparent !important;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-matrix .stu-ranking-sc-pos {
	width: 2.5rem;
	min-width: 2.5rem;
	max-width: 2.5rem;
	padding-left: 8px !important;
	padding-right: 10px !important;
	font-size: 13px;
	text-align: center !important;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-matrix .stu-ranking-sc-photo {
	width: 3.75rem;
	min-width: 3.75rem;
	max-width: 3.75rem;
	padding: 4px 12px !important;
	text-align: center !important;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-matrix .stu-ranking-sc-photo .stu-ranking-shortcode-photo-wrap,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-matrix .stu-ranking-sc-photo .stu-ranking-shortcode-photo-circle,
.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-matrix .stu-ranking-sc-photo > a.stu-ranking-sc-profile-link--photo {
	display: inline-block;
	margin-left: auto;
	margin-right: auto;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-country-flag {
	position: absolute;
	bottom: 0;
	right: 0;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-photo-circle {
	width: 38px;
	min-width: 38px;
	max-width: 38px;
	height: 38px;
	min-height: 38px;
	max-height: 38px;
	border: none;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-thumb {
	width: 38px !important;
	height: 38px !important;
	max-width: 38px !important;
	max-height: 38px !important;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-matrix .stu-ranking-sc-name {
	max-width: none;
	width: auto;
	min-width: 0;
	padding-left: 16px !important;
	padding-right: 8px !important;
	font-size: 14px;
	text-align: left !important;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-matrix .stu-ranking-sc-tot {
	min-width: 0;
	width: 4.75rem;
	max-width: 4.75rem;
	padding-left: 4px !important;
	padding-right: 10px !important;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: -0.01em;
	white-space: nowrap;
}

@media screen and (max-width: 768px) {

	.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini {
		--stu-ranking-mini-max-h: min(21rem, 48vh);
	}

	.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-matrix {
		font-size: 13px;
	}

	.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-matrix .stu-ranking-sc-name {
		font-size: 13px;
		padding-left: 14px !important;
	}

	.stu-ranking-shortcode-wrap.stu-ranking-shortcode-ranking--mini .stu-ranking-shortcode-matrix .stu-ranking-sc-tot {
		font-size: 15px;
		width: 4.25rem;
		max-width: 4.25rem;
	}
}

.stu-ranking-shortcode-empty {
	padding: 0.5em 0;
	opacity: 0.75;
}
