/* cpt-entities.css — NET-NEW rules for the sports-intelligence CPT templates.
 *
 * The shared design system (.ent-*, .ss-*, .md-*, .mh-*, .lb-*, .ecc-*, .table-wrap,
 * .season-wrap, .section, .subscribe.band, CSS vars) lives in site.css, which the
 * integrator (A7) copies into the theme and enqueues on the CPT singles + archives.
 * Per CPT-CONTRACT §8, NO agent edits site.css — this file holds ONLY genuinely new UI
 * that the static site never had. Currently that is the related-rail (§6.4): the
 * "Teammates" rail on player pages and the "More from Round N" rail on match pages.
 *
 * Enqueue this AFTER site.css on the CPT templates (it relies on site.css's CSS vars).
 */

/* ---------- related rail (net-new, CPT-CONTRACT §6.4) ---------- */
.ent-rail {
	margin-top: 34px;
	padding-top: 22px;
	border-top: 1px solid var(--line);
}
.ent-rail .ss-eyebrow {
	margin-top: 0;
}
.ent-rail-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 10px;
	margin-top: 4px;
}
.ent-rail-card {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 11px 14px;
	background: var(--navy-2);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm, 10px);
	color: var(--cream);
	text-decoration: none;
	transition: border-color .15s ease, background .15s ease;
	min-width: 0;
}
.ent-rail-card:hover {
	border-color: var(--line-strong);
	background: var(--navy-3, var(--navy-2));
	color: var(--cream);
}
.ent-rail-card .ent-dot {
	flex: none;
}
.ent-rail-nm {
	font-weight: 600;
	flex: 1;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ent-rail-meta {
	color: var(--cream-dim);
	font-size: .8rem;
	white-space: nowrap;
	flex: none;
}
.ent-rail-v {
	font-family: var(--font-display, var(--f-display, inherit));
	font-weight: 600;
	color: var(--gold);
	font-size: 1rem;
	flex: none;
}

@media (max-width: 600px) {
	.ent-rail-grid {
		grid-template-columns: 1fr;
	}
}

/* ---------- Bricks reset guard (net-new — the static site never had to fight Bricks) ----------
 *
 * On WordPress these CPT surfaces render INSIDE the Bricks theme, whose
 * bricks/assets/css/frontend-layer.min.css ships unscoped bare-element resets that the
 * standalone static site never had to contend with:
 *     tbody { text-align:center }   td { width:30px }   table { width:100% }
 *     li { display:flex }           ul { transform:translate(20px); transition; will-change }
 *     button { ... }                input { line-height:40px; width:100% }
 * site.css loads after frontend-layer and wins on most of these, but the bare-element /
 * pseudo leaks (esp. `td{width:30px}`, `li{display:flex}`, the `ul` transform/transition,
 * and form-control sizing) are fragile across Bricks updates and can silently squash the
 * leaderboard table columns / tile rows / search input. These rules re-assert the static
 * design intent at a higher specificity, scoped to the entity wrappers only, so a future
 * Bricks bump can never distort the sports-intelligence pages. Visual no-ops when site.css
 * already wins; load order keeps this AFTER site.css (enqueued as tpg-cpt-entities-css). */

/* Tables — neutralise td{width:30px}, tbody{text-align:center}, table{width:100%} leaks.
 * Covers .ent-table (player/club archives + singles) AND .ss-ladder (the /season page,
 * whose wrapper is plain .season-wrap — no .ent — exactly like the static reference). */
.season-wrap .ent-table,
.season-wrap .ss-ladder { width: 100%; table-layout: auto; }
.season-wrap .ent-table tbody,
.season-wrap .ss-ladder tbody { text-align: inherit; }
.season-wrap .ent-table td,
.season-wrap .ent-table th,
.season-wrap .ss-ladder td,
.season-wrap .ss-ladder th { width: auto; }
.season-wrap .ent-table td.ent-rk { width: 2.4em; }

/* Leaderboard tile lists — neutralise the global ul transform/transition + keep li flow. */
.season-wrap.ent .lb-list,
.season-wrap.ent .ent-rail-grid {
	transform: none;
	transition: none;
	will-change: auto;
	left: auto;
	right: auto;
}
.season-wrap.ent .lb-list { list-style: none; margin: 0; padding: 0; }
.season-wrap.ent .lb-list li {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 7px 0;
	width: auto;
}

/* Controls — Bricks' near-global `input:not([type=submit]),select,textarea` rule
 * (line-height:40px; width:100%; padding:0 12px; border-width:1px) outranks site.css's
 * single-class `.lb-search`, flattening the rounded search pill. Re-assert the static
 * pill (padding:10px 15px; 2px border; pill radius) at a winning specificity. Also keep
 * the grade-tab / pager buttons auto-width (Bricks restyles bare `button`). */
.season-wrap.ent .lb-search {
	width: auto;
	height: auto;
	line-height: normal;
	padding: 10px 15px;
	border-width: 2px;
	border-radius: 999px;
}
.season-wrap.ent .lb-tab,
.season-wrap.ent .lb-page-btn {
	width: auto;
	height: auto;
	margin: 0;
}

/* Club archive cards are <a>, not affected by li{display:flex}; keep the grid intact. */
.season-wrap.ent .ent-club-grid { list-style: none; }
