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

.stu-rm-shortcode-wrap.stu-rm-shortcode-ranking {
	/* Paleta igual ao ranking Sportech principal (fundos transparentes para herdar texto do tema). */
	--stu-rm-sc-border: #333333;
	--stu-rm-sc-accent: #fece35;
	--stu-rm-sc-photo-empty: rgba(255, 255, 255, 0.08);
	/* Anel tracejado do placeholder (fundos claros na página / células). */
	--stu-rm-sc-photo-ring: rgba(0, 0, 0, 0.38);
	/*
	 * 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-rm-sc-link-name-text: #111;` em páginas claras.
	 */
	--stu-rm-sc-link-name-text: rgba(255, 255, 255, 0.95);

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

.stu-rm-shortcode-wrap.stu-rm-shortcode-ranking .stu-rm-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-rm-shortcode-wrap.stu-rm-shortcode-ranking .stu-rm-shortcode-matrix th,
.stu-rm-shortcode-wrap.stu-rm-shortcode-ranking .stu-rm-shortcode-matrix td {
	padding: 8px;
	border: 1px solid var(--stu-rm-sc-border);
	text-align: center;
	vertical-align: middle;
	background-color: transparent !important;
}

.stu-rm-shortcode-wrap.stu-rm-shortcode-ranking .stu-rm-shortcode-matrix thead th {
	background-color: transparent !important;
	position: static;
	z-index: auto;
	font-weight: 700;
	line-height: 1.35;
	border: 1px solid var(--stu-rm-sc-border);
	color: inherit;
}

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

.stu-rm-shortcode-wrap.stu-rm-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;
}

.stu-rm-shortcode-wrap.stu-rm-shortcode-ranking .stu-rm-shortcode-matrix tbody tr {
	background-color: transparent !important;
}

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

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

.stu-rm-shortcode-wrap.stu-rm-shortcode-ranking .stu-rm-shortcode-matrix .stu-rm-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-rm-shortcode-wrap.stu-rm-shortcode-ranking .stu-rm-shortcode-matrix tbody td.stu-rm-sc-name > a.stu-rm-sc-profile-link--name,
.stu-rm-shortcode-wrap.stu-rm-shortcode-ranking .stu-rm-shortcode-matrix tbody td.stu-rm-sc-name > a.stu-rm-sc-profile-link--name:link,
.stu-rm-shortcode-wrap.stu-rm-shortcode-ranking .stu-rm-shortcode-matrix tbody td.stu-rm-sc-name > a.stu-rm-sc-profile-link--name:visited,
.stu-rm-shortcode-wrap.stu-rm-shortcode-ranking .stu-rm-shortcode-matrix tbody td.stu-rm-sc-name > a.stu-rm-sc-profile-link--name:hover,
.stu-rm-shortcode-wrap.stu-rm-shortcode-ranking .stu-rm-shortcode-matrix tbody td.stu-rm-sc-name > a.stu-rm-sc-profile-link--name:focus,
.stu-rm-shortcode-wrap.stu-rm-shortcode-ranking .stu-rm-shortcode-matrix tbody td.stu-rm-sc-name > a.stu-rm-sc-profile-link--name:active {
	color: var(--stu-rm-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-rm-shortcode-wrap.stu-rm-shortcode-ranking .stu-rm-shortcode-matrix td.stu-rm-sc-name {
	color: var(--stu-rm-sc-link-name-text);
}

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

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

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

.stu-rm-shortcode-wrap.stu-rm-shortcode-ranking .stu-rm-shortcode-matrix .stu-rm-sc-tot {
	font-variant-numeric: tabular-nums;
	min-width: 3rem;
	padding: 8px !important;
	color: var(--stu-rm-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-rm-shortcode-wrap.stu-rm-shortcode-ranking .stu-rm-shortcode-matrix thead th.stu-rm-sc-tot {
	color: inherit;
	font-size: 18px;
	font-weight: 700;
}

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

.stu-rm-shortcode-wrap.stu-rm-shortcode-ranking .stu-rm-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;
	/*
	 * Tracejado na borda exterior: visível desde o 1.º frame (não fica por baixo da <img>).
	 * box-sizing border-box mantém o disco em 40×40.
	 */
	border: 1px dashed var(--stu-rm-sc-photo-ring);
}

.stu-rm-shortcode-wrap.stu-rm-shortcode-ranking .stu-rm-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%;
	/* Escondida até load/error (stu-rm-shortcode-thumb.js inline) — mostra o tracejado. */
	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-rm-shortcode-wrap.stu-rm-shortcode-ranking .stu-rm-shortcode-thumb.stu-rm-shortcode-thumb--visible {
	opacity: 1;
}

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

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

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

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

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

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

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

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

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

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