/**
 * The OOM: TablePress leaderboard styles.
 *
 * Carries over the custom CSS that lived in the Twenty Twenty-Five global
 * styles (wide wrapper, horizontal scroll, frozen first two columns, top 10
 * cut line and leader trophy) so the leaderboards keep working in this theme.
 */

/* -----------------------------------------------------------
   Base TablePress look for every table on the site
----------------------------------------------------------- */
.tablepress {
	--oom-row-bg: var(--wp--preset--color--white);
	--oom-row-alt: #F7F5EE;
	--oom-row-hover: var(--wp--preset--color--secondary-light);
	--oom-head-bg: var(--wp--preset--color--primary-dark);
	--oom-head-text: var(--wp--preset--color--white);
	--oom-line: var(--wp--preset--color--border);

	--head-active-bg-color: var(--wp--preset--color--primary);
	--head-active-text-color: var(--wp--preset--color--white);
	--head-bg-color: var(--oom-head-bg);
	--head-text-color: var(--oom-head-text);
	--head-sort-arrow-color: var(--wp--preset--color--accent);
	--text-color: var(--wp--preset--color--contrast);
	--odd-bg-color: var(--oom-row-bg);
	--odd-text-color: var(--wp--preset--color--contrast);
	--even-bg-color: var(--oom-row-alt);
	--even-text-color: var(--wp--preset--color--contrast);
	--hover-bg-color: var(--oom-row-hover);
	--hover-text-color: var(--wp--preset--color--primary-dark);
	--border-color: var(--oom-line);
	--padding: 0.6rem 0.75rem;

	font-size: var(--wp--preset--font-size--small);
	font-variant-numeric: tabular-nums;
	background: var(--oom-row-bg);
	margin-bottom: 0;
}

.tablepress > :where(thead, tfoot) > tr > * {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	vertical-align: middle;
}

.tablepress > :where(tbody) > tr > * {
	vertical-align: middle;
}

/* Card shell around every table. */
.tablepress-table-description,
.dt-container,
.tablepress:not(.dt-container .tablepress) {
	border-radius: var(--wp--custom--radius--medium);
}

.dt-container {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--border);
	box-shadow: var(--wp--preset--shadow--soft);
	padding: var(--wp--preset--spacing--20);
	overflow: hidden;
}

.dt-container .dt-search input,
.dt-container .dt-length select {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--pill);
	padding: 0.4rem 0.9rem;
	background: var(--wp--preset--color--base);
	font: inherit;
}

.dt-container .dt-search input:focus {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 1px;
}

.dt-container .dt-paging .dt-paging-button.current {
	background: var(--wp--preset--color--primary) !important;
	border-color: var(--wp--preset--color--primary) !important;
	color: var(--wp--preset--color--white) !important;
	border-radius: var(--wp--custom--radius--small);
}

.dt-container .dt-info {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--x-small);
}

/* -----------------------------------------------------------
   OOM wrapper: wide leaderboard with horizontal scroll
----------------------------------------------------------- */
.oom-2026-wrapper {
	width: 100%;
	max-width: var(--wp--style--global--wide-size) !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

.oom-2026-wrapper > .wp-block-group__inner-container,
.oom-2026-wrapper > .wp-block-group__content,
.oom-2026-wrapper .is-layout-constrained {
	width: 100% !important;
	max-width: 100% !important;
}

.oom-2026-wrapper .dt-container,
.oom-2026-wrapper .dt-container .dt-container,
.oom-2026-wrapper .dt-container .dt-layout-row,
.oom-2026-wrapper .dt-container .dt-layout-cell,
.oom-2026-wrapper .dt-container .dt-scroll,
.oom-2026-wrapper .dt-container .dt-scroll-head,
.oom-2026-wrapper .dt-container .dt-scroll-body,
.oom-2026-wrapper .dt-container .dt-scroll-foot {
	width: 100% !important;
	max-width: 100% !important;
}

/* Table can be wider than its container. */
.oom-2026-wrapper #tablepress-1 {
	width: max-content !important;
	min-width: 100% !important;
	max-width: none !important;
}

/* Scroll horizontally inside the card, never the page. */
.oom-2026-wrapper .dt-scroll-body,
.oom-2026-wrapper .tablepress-scroll-wrapper,
.oom-2026-wrapper .dt-layout-table {
	overflow-x: auto !important;
	-webkit-overflow-scrolling: touch;
}

.oom-2026-wrapper #tablepress-1_wrapper .dt-scroll-body {
	overflow-y: auto !important;
}

.oom-2026-wrapper #tablepress-1 th,
.oom-2026-wrapper #tablepress-1 td {
	white-space: nowrap;
}

/* -----------------------------------------------------------
   Freeze the first two columns (name + rank)
----------------------------------------------------------- */
.oom-2026-wrapper .freeze-first-col {
	border-collapse: separate;
	border-spacing: 0;
}

.oom-2026-wrapper .freeze-first-col th:nth-child(1),
.oom-2026-wrapper .freeze-first-col td:nth-child(1) {
	position: sticky;
	left: 0;
	z-index: 4;
	background: var(--oom-row-bg);
	font-weight: 600;
	color: var(--wp--preset--color--primary-dark);
}

.oom-2026-wrapper .freeze-first-col tbody tr:nth-child(even) td:nth-child(1) {
	background: var(--oom-row-alt);
}

.oom-2026-wrapper .freeze-first-col tbody tr:hover td:nth-child(1) {
	background: var(--oom-row-hover);
}

.oom-2026-wrapper .freeze-first-col thead th:nth-child(1),
.oom-2026-wrapper .freeze-first-col thead th:nth-child(2) {
	background: var(--oom-head-bg);
	color: var(--oom-head-text);
}

.oom-2026-wrapper .freeze-first-col thead th:nth-child(1) {
	z-index: 6;
}

.oom-2026-wrapper .freeze-first-col thead th:nth-child(2) {
	z-index: 5;
}

/* Divider after the frozen columns. */
.oom-2026-wrapper .freeze-first-col th:nth-child(2)::after,
.oom-2026-wrapper .freeze-first-col td:nth-child(2)::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	width: 1px;
	height: 100%;
	background: rgba(10, 52, 40, 0.14);
	pointer-events: none;
}

/* -----------------------------------------------------------
   Main leaderboard (table 1)
----------------------------------------------------------- */
.tablepress-id-1 th,
.tablepress-id-1 td {
	border-right: 1px solid var(--wp--preset--color--border);
}

.tablepress-id-1 th:last-child,
.tablepress-id-1 td:last-child {
	border-right: none;
}

.tablepress-id-1 td:not(.column-1),
.tablepress-id-1 th:not(.column-1) {
	text-align: center;
}

/* Running total stands out. */
.tablepress-id-1 tbody td.column-3 {
	font-weight: 700;
	color: var(--wp--preset--color--primary);
}

/* Top 10 cut line. */
.oom-2026-wrapper tr.row-10 th,
.oom-2026-wrapper tr.row-10 td {
	border-bottom: 3px solid var(--wp--preset--color--accent);
}

/* Trophy next to the current leader's name. */
#tablepress-1 tbody tr:nth-child(1) td:first-child::after {
	content: " \1F3C6";
	display: inline-block;
	filter: grayscale(100%);
}
