/* Campeonato Slot – estilos públicos.
 * Personaliza los colores desde tu tema redefiniendo estas variables:
 * .cslot { --cslot-accent: #0a5cff; }
 */
/* Variables */
.cslot-frame, .cslot {
	--cslot-accent: #d62828;
	--cslot-ink: #1d1f24;
	--cslot-muted: #6b7280;
	--cslot-line: #e5e7eb;
	--cslot-bg: #ffffff;
	--cslot-soft: #f6f7f9;
	--cslot-gold: #e9b949;
	--cslot-silver: #b7bcc4;
	--cslot-bronze: #c88a55;
	--cslot-radius: 10px;
	color: var(--cslot-ink);
	margin: 1.5em 0;
	font-variant-numeric: tabular-nums;
}
.cslot *, .cslot *::before, .cslot *::after { box-sizing: border-box; }
.cslot .cslot-title { margin: 0 0 .6em; line-height: 1.2; }
.cslot .cslot-subtitle { margin: 1.2em 0 .5em; font-size: 1.15em; }
.cslot .cslot-note, .cslot-empty p { color: var(--cslot-muted); font-size: .9em; }
.cslot .cslot-round {
	display: inline-block; font-size: .75em; font-weight: 700; letter-spacing: .06em;
	text-transform: uppercase; color: var(--cslot-cat, var(--cslot-accent));
}

/* ---------- Ancho: siempre el máximo que permite la página ---------- */
.cslot-frame { display: block; box-sizing: border-box; width: 100%; max-width: 100%; margin: 1.5em auto; clear: both; }
.cslot-frame > .cslot, .cslot .cslot { margin: 0; width: 100%; }
/* Temas de bloques: el contenido se limita al «ancho de texto»; usamos el ancho amplio del tema. */
.is-layout-constrained > .cslot-frame.cslot-w-pagina,
.is-layout-flow > .cslot-frame.cslot-w-pagina,
.entry-content > .cslot-frame.cslot-w-pagina {
	width: 100%;
	max-width: var(--wp--style--global--wide-size, 100%) !important;
	margin-left: auto !important;
	margin-right: auto !important;
}
.cslot-frame.cslot-w-fijo,
.is-layout-constrained > .cslot-frame.cslot-w-fijo,
.entry-content > .cslot-frame.cslot-w-fijo {
	width: 100%;
	max-width: min(100%, var(--cslot-max, 1500px)) !important;
	margin-left: auto !important;
	margin-right: auto !important;
}
.cslot-tabs, .cslot-panel, .cslot-table-wrap { width: 100%; box-sizing: border-box; }

/* ---------- Pestañas ---------- */
.cslot-tablist {
	display: flex; flex-wrap: wrap; gap: .25em; margin: 0 0 1em;
	border-bottom: 2px solid var(--cslot-line);
}
.cslot-tablist .cslot-tab {
	appearance: none; background: none; border: 0; border-bottom: 3px solid transparent;
	margin: 0 0 -2px; padding: .6em 1em; font: inherit; font-weight: 600;
	color: var(--cslot-muted); cursor: pointer; border-radius: 0;
}
.cslot-tablist .cslot-tab:hover { color: var(--cslot-ink); background: none; }
.cslot-tablist .cslot-tab[aria-selected="true"] { color: var(--cslot-ink); border-bottom-color: var(--cslot-accent); }
.cslot-tablist .cslot-tab:focus-visible { outline: 2px solid var(--cslot-accent); outline-offset: 2px; }
.cslot-tabs:not(.cslot-js) .cslot-tablist { display: none; }
.cslot-js > .cslot-panel { display: none; }
.cslot-js > .cslot-panel.is-active { display: block; }
.cslot-js > .cslot-panel > .cslot-panel-title { display: none; }
.cslot-panel-title { font-size: 1.15em; margin: 1.2em 0 .5em; }

/* ---------- Casillas de categoría (clasificación) ---------- */
.cslot-tabs-cards > .cslot-tablist {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .75em;
	border: 0; margin-bottom: 1.25em;
}
.cslot-tabs-cards > .cslot-tablist .cslot-tab {
	--cslot-cat: var(--cslot-accent);
	display: flex; flex-direction: column; align-items: flex-start; gap: .3em; text-align: left;
	margin: 0; padding: .9em 1em; border: 2px solid var(--cslot-line); border-top: 5px solid var(--cslot-cat);
	border-radius: var(--cslot-radius); background: var(--cslot-bg); color: var(--cslot-ink); font-weight: 400;
	transition: box-shadow .15s, transform .15s;
}
.cslot-tabs-cards > .cslot-tablist .cslot-tab:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); transform: translateY(-1px); background: var(--cslot-bg); }
.cslot-tabs-cards > .cslot-tablist .cslot-tab[aria-selected="true"] {
	border-color: var(--cslot-cat); background: color-mix(in srgb, var(--cslot-cat) 8%, #fff);
	box-shadow: 0 0 0 1px var(--cslot-cat);
}
.cslot-card-name { font-size: 1.15em; font-weight: 800; }
.cslot-card-leader { font-size: .88em; }
.cslot-card-label { font-size: .75em; text-transform: uppercase; letter-spacing: .05em; color: var(--cslot-muted); font-weight: 700; }
.cslot-card-meta { font-size: .78em; color: var(--cslot-muted); }

/* ---------- Calendario por categorías ---------- */
.cslot-cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1em; align-items: start; }
.cslot-cat-card {
	--cslot-cat: var(--cslot-accent);
	background: var(--cslot-bg); border: 1px solid var(--cslot-line); border-top: 5px solid var(--cslot-cat);
	border-radius: var(--cslot-radius); overflow: hidden;
}
.cslot-cat-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5em; padding: .75em 1em .5em; }
.cslot-cat-head h3 { margin: 0; font-size: 1.2em; }
.cslot-cat-progress { font-size: .78em; color: var(--cslot-muted); white-space: nowrap; }
.cslot-race-list { list-style: none; margin: 0; padding: 0; }
.cslot-race-item { margin: 0; border-top: 1px solid var(--cslot-line); }
.cslot .cslot-race-link {
	display: grid; grid-template-columns: 1fr auto; grid-template-areas: "line badge" "sub badge" "notes badge";
	align-items: center; column-gap: .75em; padding: .6em 1em; color: inherit; text-decoration: none;
}
.cslot a.cslot-race-link:hover { background: color-mix(in srgb, var(--cslot-cat) 7%, #fff); }
.cslot-race-line { grid-area: line; }
.cslot-race-sep { color: var(--cslot-muted); }
.cslot-race-when { white-space: nowrap; }
.cslot-race-sub { grid-area: sub; font-size: .85em; color: var(--cslot-muted); }
.cslot-race-notes { grid-area: notes; font-style: italic; }
.cslot-race-link .cslot-badge { grid-area: badge; }
.cslot-race-item.is-next { box-shadow: inset 4px 0 0 var(--cslot-cat); }
.cslot-race-item.is-cancelled .cslot-race-line { text-decoration: line-through; color: var(--cslot-muted); }
.cslot-badge {
	display: inline-block; padding: .3em .8em; border-radius: 999px; font-size: .78em; font-weight: 600;
	background: var(--cslot-soft); color: var(--cslot-muted); white-space: nowrap;
}
.cslot-badge-done { background: var(--cslot-cat, var(--cslot-accent)); color: #fff; }
.cslot-badge-next { background: color-mix(in srgb, var(--cslot-cat, var(--cslot-accent)) 15%, #fff); color: var(--cslot-ink); }
.cslot-badge-postponed { background: #fff4d6; color: #8a5a00; }
.cslot-badge-cancelled { background: #fde2e2; color: #9b1c1c; }

/* ---------- Resultados ---------- */
.cslot-back { margin: 0 0 1em; }
.cslot-back a { text-decoration: none; font-weight: 600; }
.cslot-results-head { margin-bottom: 1.2em; padding-bottom: .8em; border-bottom: 3px solid var(--cslot-cat, var(--cslot-accent)); }
.cslot-results-head .cslot-title { margin: .1em 0 .2em; }

/* ---------- Tablas ---------- */
.cslot-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--cslot-line); border-radius: var(--cslot-radius); }
.cslot table.cslot-table { width: 100%; border-collapse: collapse; margin: 0; border: 0; font-size: .95em; background: var(--cslot-bg); }
.cslot-table th, .cslot-table td { padding: .6em .75em; border: 0; border-bottom: 1px solid var(--cslot-line); text-align: left; vertical-align: middle; }
.cslot-table thead th {
	background: var(--cslot-ink); color: #fff; font-size: .78em; font-weight: 700;
	text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.cslot-table thead th abbr { text-decoration: none; border: 0; cursor: help; }
.cslot-table tbody tr:last-child td { border-bottom: 0; }
.cslot-table tbody tr:nth-child(even) td { background: var(--cslot-soft); }
.cslot-table tbody tr:hover td { background: #eef2ff; }
.cslot-table .cslot-num { text-align: right; white-space: nowrap; }
.cslot-table .cslot-col-pos { width: 3.2em; text-align: center; }
.cslot-table .cslot-col-driver { font-weight: 600; white-space: nowrap; }
.cslot-table .cslot-col-team, .cslot-table .cslot-col-car { color: var(--cslot-muted); white-space: nowrap; }
.cslot-table td.cslot-col-points { font-size: 1.05em; }
.cslot-table td.cslot-col-points { background: color-mix(in srgb, var(--cslot-cat, var(--cslot-accent)) 8%, transparent) !important; }
.cslot-pos {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 1.9em; height: 1.9em; border-radius: 50%; font-weight: 700; font-size: .9em;
}
.cslot-p1 .cslot-pos { background: var(--cslot-gold); color: #3d2c00; }
.cslot-p2 .cslot-pos { background: var(--cslot-silver); color: #22262c; }
.cslot-p3 .cslot-pos { background: var(--cslot-bronze); color: #2e1a08; }
.cslot-table td.cslot-fastest { color: #7c3aed; font-weight: 700; }
.cslot-table td.cslot-fastest::after { content: " ⏱"; }
.cslot-table td.cslot-win { font-weight: 700; }
.cslot-table td.cslot-discarded { color: var(--cslot-muted); }
.cslot-table td.cslot-absent { color: #c4c8cf; }
.cslot-table .cslot-col-race { font-size: .9em; min-width: 2.8em; }

/* Columnas por carril: vueltas arriba, mejor vuelta del carril debajo */
.cslot-table .cslot-col-lane { text-align: center; line-height: 1.15; }
.cslot-lane-laps { display: block; font-weight: 600; }
.cslot-lane-time { display: block; font-size: .78em; color: var(--cslot-muted); }
.cslot-lane-best { color: var(--cslot-ink); font-weight: 700; }
.cslot-lane-bad { text-decoration: line-through; opacity: .5; cursor: help; }

@media (max-width: 640px) {
	.cslot-tabs-cards > .cslot-tablist { grid-template-columns: 1fr 1fr; }
	.cslot-table th, .cslot-table td { padding: .5em .5em; }
	.cslot-table { font-size: .88em; }
}

/* Neutraliza los estilos de botón del tema (bordes/contornos al pulsar) en pestañas y casillas */
.cslot-tablist .cslot-tab:focus { outline: none; }
.cslot-tablist .cslot-tab:focus-visible { outline: 2px solid var(--cslot-accent); outline-offset: 2px; }
.cslot-tabs-tabs > .cslot-tablist .cslot-tab,
.cslot-tabs-tabs > .cslot-tablist .cslot-tab:focus,
.cslot-tabs-tabs > .cslot-tablist .cslot-tab:active {
	border-top: 0; border-left: 0; border-right: 0; box-shadow: none; background: none; text-decoration: none;
}

/* ---------- Resultados abiertos desde el calendario ---------- */
.cslot-results-area { margin-top: 1.25em; }
.cslot-inline-result[hidden] { display: none; }
.cslot-inline-result {
	position: relative; scroll-margin-top: 90px;
	border: 1px solid var(--cslot-line); border-radius: var(--cslot-radius); padding: 1em 1.1em 1.1em; background: var(--cslot-bg);
	animation: cslot-in .2s ease-out;
}
@keyframes cslot-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cslot .cslot-close {
	appearance: none; border: 1px solid var(--cslot-line); background: var(--cslot-bg);
	color: var(--cslot-ink); border-radius: 999px; padding: .3em .9em; font: inherit; font-size: .85em; font-weight: 600; cursor: pointer;
}
.cslot .cslot-close:hover { background: var(--cslot-soft); }

.cslot-race-item.is-open { background: color-mix(in srgb, var(--cslot-cat) 10%, #fff); box-shadow: inset 4px 0 0 var(--cslot-cat); }
.cslot-race-item.is-open .cslot-badge-done { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--cslot-cat); }

/* Tablas anchas: aviso de desplazamiento y nombre del piloto siempre visible */
.cslot-table-wrap.is-scrollable { position: relative; }
.cslot-table-wrap.is-scrollable::before {
	content: "Desliza la tabla → para ver más columnas"; display: block; position: sticky; left: 0;
	padding: .35em .75em; font-size: .78em; color: var(--cslot-muted); background: var(--cslot-soft); border-bottom: 1px solid var(--cslot-line);
}
@media (max-width: 900px) {
	.cslot-table-wrap.is-scrollable .cslot-col-pos { position: sticky; left: 0; z-index: 2; background: var(--cslot-bg); box-sizing: border-box; width: 3em; min-width: 3em; max-width: 3em; padding-left: .25em; padding-right: .25em; }
	.cslot-table-wrap.is-scrollable .cslot-col-driver { position: sticky; left: 3em; z-index: 2; background: var(--cslot-bg); box-shadow: 4px 0 6px -4px rgba(0,0,0,.2); max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
	.cslot-table-wrap.is-scrollable thead .cslot-col-pos, .cslot-table-wrap.is-scrollable thead .cslot-col-driver { background: var(--cslot-ink); }
	.cslot-table-wrap.is-scrollable tbody tr:nth-child(even) .cslot-col-pos, .cslot-table-wrap.is-scrollable tbody tr:nth-child(even) .cslot-col-driver { background: var(--cslot-soft); }
}

/* ---------- Botones de descarga PDF ---------- */
.cslot-results { position: relative; }
.cslot-head-actions { position: absolute; top: 0; right: 0; display: flex; gap: .5em; align-items: center; }
.cslot-results-head { padding-right: 15em; }
.cslot .cslot-pdf {
	display: inline-flex; align-items: center; gap: .4em; padding: .35em .9em; border-radius: 999px;
	background: var(--cslot-cat, var(--cslot-accent)); color: #fff; font-size: .85em; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.cslot .cslot-pdf:hover, .cslot .cslot-pdf:focus { filter: brightness(.92); color: #fff; }
.cslot-table-toolbar { display: flex; justify-content: flex-end; margin: 0 0 .6em; }
@media (max-width: 640px) {
	.cslot-head-actions, .cslot-results.is-inline .cslot-head-actions { position: static; margin-bottom: .8em; justify-content: flex-end; }
	.cslot-results-head { padding-right: 0; }
}

.cslot-table td.cslot-lap-invalid { color: var(--cslot-muted); cursor: help; }

/* Carreras canceladas en la clasificación general: columna visible, sin puntos */
.cslot-table thead th.cslot-col-cancelled { color: rgba(255,255,255,.55); text-decoration: line-through; }
.cslot-table td.cslot-cancelled-cell,
.cslot-table tbody tr:nth-child(even) td.cslot-cancelled-cell {
	background: repeating-linear-gradient(135deg, var(--cslot-soft), var(--cslot-soft) 4px, #e6e8ec 4px, #e6e8ec 6px);
}
.cslot-cancel-swatch {
	display: inline-block; width: 1.4em; height: .9em; margin-right: .4em; vertical-align: -.1em; border-radius: 2px;
	background: repeating-linear-gradient(135deg, var(--cslot-soft), var(--cslot-soft) 3px, #d9dce1 3px, #d9dce1 5px);
}
