/**
 * Club Hockey — default front-end styles.
 * Deliberately light-touch and theme-friendly: everything is class-prefixed (chl-*)
 * and uses CSS custom properties so a theme can override colours in one place, or
 * dequeue the `club-hockey` stylesheet entirely and style from scratch.
 */
:root {
	--chl-accent: #123c6b;
	--chl-accent-contrast: #ffffff;
	--chl-border: #e2e4e7;
	--chl-muted: #5f646b;  /* AA (>=4.5:1) on white and on --chl-row-alt */
	--chl-row-alt: #f6f7f8;
	--chl-radius: 8px;
}

.chl-comp-head { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.chl-comp-logo { max-height: 48px; width: auto; }
.chl-comp-name { margin: 0; }

.chl-table { width: 100%; border-collapse: collapse; margin: 0 0 1.5em; font-size: 0.95rem; }
.chl-table th, .chl-table td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--chl-border); }
.chl-table thead th { background: var(--chl-accent); color: var(--chl-accent-contrast); font-weight: 600; }
.chl-table tbody tr:nth-child(even) { background: var(--chl-row-alt); }
.chl-table .chl-team, .chl-table .chl-pname { text-align: left; font-weight: 600; }
.chl-league-table .chl-pos { color: var(--chl-muted); width: 2em; }
.chl-table .chl-pts { font-weight: 700; }

.chl-empty { color: var(--chl-muted); font-style: italic; }

/* Fixtures & results */
.chl-matchlist { list-style: none; margin: 0 0 1.5em; padding: 0; }
.chl-match { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--chl-border);
	border-radius: var(--chl-radius); margin-bottom: 10px; }
.chl-match-link { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; }
.chl-match-date { color: var(--chl-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; text-align: center; }
.chl-fixture { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.chl-side { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 700; }
.chl-side .chl-name { overflow-wrap: normal; word-break: keep-all; }
.chl-side.chl-away { flex-direction: row-reverse; text-align: right; }
.chl-badge { width: 40px; height: 40px; object-fit: contain; flex: none; border-radius: 4px; }
.chl-badge--mono { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
	border-radius: 50%; background: var(--chl-accent); color: #fff; font-weight: 800; font-size: 0.85rem; line-height: 1; }
.chl-mid { justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.chl-score { background: var(--chl-accent); color: var(--chl-accent-contrast);
	padding: 4px 14px; border-radius: 4px; font-weight: 800; font-size: 1.1rem; }
.chl-vs { color: var(--chl-muted); font-weight: 600; }
.chl-outcome { font-size: 0.65rem; color: var(--chl-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.chl-match-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.chl-venue { color: var(--chl-muted); font-size: 0.85rem; display: inline-flex; align-items: center; gap: 8px; }
.chl-venue-name::before { content: "\1F4CD"; margin-right: 5px; }
.chl-venue-link { color: var(--chl-muted); text-decoration: none; }
.chl-venue-link:hover { color: var(--chl-accent); text-decoration: underline; }
.chl-tickets { align-self: center; display: inline-block; background: var(--chl-accent); color: var(--chl-accent-contrast);
	padding: 6px 16px; border-radius: 4px; text-decoration: none; font-size: 0.85rem; font-weight: 700; }

/* Crest in the league table */
.chl-league-table .chl-team { display: flex; align-items: center; gap: 8px; }
.chl-table .chl-badge, .chl-table .chl-badge--mono { width: 24px; height: 24px; font-size: 0.65rem; }

/* Squad — image cards grouped by position */
.chl-squad-group { margin: 1.2em 0 0.6em; text-transform: uppercase; letter-spacing: 0.03em; }
.chl-squad-cards { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 16px; padding: 0; margin: 0 0 1.5em; }
/* Cards fill their cell so every tile is the same height (matched to the tallest). */
.chl-squad-card { display: flex; }
.chl-squad-card a { flex: 1; display: flex; flex-direction: column; text-decoration: none; color: inherit; border-radius: var(--chl-radius);
	overflow: hidden; background: var(--chl-row-alt); border: 1px solid var(--chl-border); transition: transform .15s, border-color .15s; }
.chl-squad-card a:hover { transform: translateY(-4px); border-color: var(--chl-accent); }
.chl-card-media { position: relative; display: block; aspect-ratio: 3 / 3.4; overflow: hidden;
	background: linear-gradient(160deg, var(--chl-accent) 0%, rgba(0,0,0,0.55) 100%); background-size: cover; background-position: center; }
.chl-card-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.chl-card-photo--ph { display: flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: 800;
	color: rgba(255,255,255,0.9); z-index: 1; }
.chl-card-badge { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: 78%; height: auto;
	opacity: 0.18; z-index: 0; pointer-events: none; object-fit: contain; }
.chl-card-badge--mono { display: flex; align-items: center; justify-content: center; aspect-ratio: 1;
	font-size: 5.5rem; font-weight: 900; color: rgba(255,255,255,0.16); }
.chl-card-number { position: absolute; right: 10px; bottom: 6px; font-size: 4.5rem; font-weight: 800; line-height: 1;
	color: rgba(255,255,255,0.22); z-index: 1; }
.chl-card-media .chl-cap { position: absolute; left: 10px; top: 10px; z-index: 2; font-size: 0.7rem;
	background: var(--chl-accent); color: var(--chl-accent-contrast); padding: 1px 7px; border-radius: 3px; font-weight: 700; }
.chl-card-media { flex: 0 0 auto; }
.chl-card-body { flex: 1 1 auto; display: block; padding: 12px 14px; }
/* Reserve two lines for the name so 1- and 2-line names align the position label. */
.chl-card-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	min-height: 2.4em; line-height: 1.2; font-weight: 800; text-transform: uppercase; letter-spacing: 0.01em; }
.chl-card-pos { display: block; color: var(--chl-muted); font-size: 0.85rem; }

/* Player profile — hero */
.chl-player-hero { position: relative; overflow: hidden; border-radius: 10px; background: var(--chl-accent);
	background-size: cover; background-position: center; margin-bottom: 20px; }
.chl-player-hero::before { content: ""; position: absolute; inset: 0; z-index: 0;
	background: linear-gradient(90deg, rgba(6,12,18,0.85) 0%, rgba(6,12,18,0.5) 45%, rgba(6,12,18,0.1) 100%); }
.chl-hero-badge { position: absolute; right: 0; top: 50%; transform: translateY(-50%); height: 86%; width: auto;
	max-width: 46%; opacity: 0.16; z-index: 0; pointer-events: none; object-fit: contain; }
.chl-hero-badge--mono { display: flex; align-items: center; justify-content: center; height: 86%; aspect-ratio: 1;
	font-size: 12rem; font-weight: 900; color: rgba(255,255,255,0.12); }
.chl-hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto; align-items: end;
	gap: 20px; min-height: 340px; padding: 28px 32px 0; }
.chl-hero-text { padding-bottom: 28px; position: relative; z-index: 1; }
.chl-hero-number { display: inline-block; font-size: 1.6rem; font-weight: 800; color: #fff; opacity: 0.85; }
.chl-hero-number::before { content: "#"; opacity: 0.6; }
.chl-hero-name { margin: 4px 0 6px; color: #fff; line-height: 0.92; }
.chl-hero-first { display: block; font-size: 1.6rem; font-weight: 500; text-transform: uppercase; opacity: 0.9; }
.chl-hero-last { display: block; font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 800; text-transform: uppercase; }
.chl-hero-pos { color: #dfe7ee; margin: 0; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.9rem; }
.chl-hero-photo-wrap { align-self: end; position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: flex-end; }
.chl-hero-photo { display: block; max-height: 300px; width: auto; max-width: 100%; object-fit: contain; }
.chl-hero-flag { position: absolute; left: 6px; bottom: 18px; z-index: 3; width: 46px; height: 46px; border-radius: 50%;
	overflow: hidden; border: 1px solid #000; box-shadow: 0 2px 6px rgba(0,0,0,0.45); }
.chl-hero-flag img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chl-hero-photo--ph { display: flex; align-items: flex-end; justify-content: center; width: 200px; height: 260px;
	font-size: 5rem; font-weight: 800; color: rgba(255,255,255,0.25); }
.chl-hero-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr);
	background: rgba(0,0,0,0.35); }
.chl-stat-tile { text-align: center; padding: 12px 6px; border-left: 1px solid rgba(255,255,255,0.12); }
.chl-stat-tile:first-child { border-left: 0; }
.chl-stat-num { display: block; font-size: 1.8rem; font-weight: 800; color: #fff; }
.chl-stat-label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: #cdd8e2; }
.chl-player-body { padding: 4px 2px; }
.chl-player-facts th { text-align: left; width: 40%; }

/* Player sponsors */
.chl-psp-label { display: block; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em;
	color: rgba(255,255,255,0.7); margin-bottom: 5px; }
.chl-main-sponsor { margin-top: 16px; }
.chl-main-sponsor img.chl-psp-logo { max-height: 62px; width: auto; background: #fff; padding: 7px 12px; border-radius: 6px; }
.chl-main-sponsor .chl-psp-name { color: #fff; font-weight: 800; font-size: 1.2rem; }
.chl-player-sponsors { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
	background: rgba(0,0,0,0.28); padding: 14px 16px; align-items: center; }
.chl-psp--small { display: flex; flex-direction: column; align-items: center; text-align: center; }
.chl-psp--small img.chl-psp-logo { max-height: 38px; width: auto; background: #fff; padding: 5px 8px; border-radius: 4px; }
.chl-psp--small .chl-psp-name { color: #fff; font-weight: 700; font-size: 0.9rem; }
.chl-sponsor-now { display: inline-block; border: 1px dashed rgba(255,255,255,0.5); color: #fff; padding: 7px 12px;
	border-radius: 4px; text-decoration: none; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; }
.chl-sponsor-now:hover { border-color: var(--chl-accent); color: var(--chl-accent); }
.chl-main-sponsor .chl-sponsor-now { font-size: 0.8rem; padding: 9px 16px; }
@media (max-width: 640px) {
	.chl-hero-inner { grid-template-columns: 1fr; }
	.chl-hero-photo-wrap { display: none; }
	.chl-hero-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Match page */
.chl-match-header { display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 1.4rem;
	font-weight: 700; margin-bottom: 6px; }
.chl-scoreline { background: var(--chl-accent); color: var(--chl-accent-contrast); padding: 4px 16px; border-radius: 6px; }
.chl-match-meta { text-align: center; color: var(--chl-muted); }
.chl-video { position: relative; margin: 1em 0; }
.chl-video iframe { width: 100%; aspect-ratio: 16/9; height: auto; }
.chl-scorers { list-style: none; padding: 0; }
.chl-scorers li { padding: 4px 0; border-bottom: 1px solid var(--chl-border); }
.chl-ga { color: var(--chl-muted); font-size: 0.85rem; }

/* Sponsors */
.chl-sponsors { list-style: none; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; padding: 0; }
.chl-sponsors img { max-height: 70px; width: auto; }

/* Country flag */
.chl-flag { display: inline-block; width: 22px; height: 16px; vertical-align: -3px; margin-right: 6px; border-radius: 2px;
	object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,0.25); }
.chl-nat { display: inline-flex; align-items: center; }

/* Career: per-season / per-club breakdown */
.chl-player-career .chl-team { white-space: nowrap; }
.chl-total { font-weight: 800; }
.chl-total td { border-top: 2px solid var(--chl-border); }

/* Widgets — equal-height, consistent boxes */
.chl-widget { border: 1px solid var(--chl-border); border-radius: var(--chl-radius); padding: 14px 16px; margin-bottom: 1em;
	height: 100%; box-sizing: border-box; display: flex; flex-direction: column; }
.chl-widget h4 { margin: 0 0 12px; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.04em; color: var(--chl-muted); }
/* Make the three home-page widgets line up as equal columns */
.chl-strip > .wp-block-column { display: flex; }
.chl-strip .chl-widget { width: 100%; }

/* Inside a widget: keep the centred horizontal match; just drop the inner border
   and vertically centre it in the equal-height box. */
.chl-widget .chl-matchlist { margin: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.chl-widget .chl-match { border: 0; padding: 0; margin: 0; }

/* Top scorer with photo */
.chl-scorer { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.chl-scorer-photo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; object-position: top center;
	flex: none; background: var(--chl-accent); }
.chl-scorer-photo--ph { display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; }
.chl-scorer-name { display: block; font-weight: 800; }
.chl-scorer-pts { display: block; color: var(--chl-muted); font-size: 0.85rem; }

@media (max-width: 600px) {
	.chl-match-date { min-width: 0; width: 100%; }
	.chl-player-head { flex-direction: column; }
}

/* ---- Hall of Fame / Previous players grid ---- */
.chl-players-grid {
	list-style: none; margin: 0; padding: 0;
	display: grid; gap: 16px;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.chl-player-tile a {
	display: flex; flex-direction: column; text-decoration: none; color: inherit;
	background: var(--chl-card-bg, #fff); border-radius: 10px; overflow: hidden;
	box-shadow: 0 1px 3px rgba(0,0,0,.12); height: 100%;
}
.chl-player-tile a:hover { box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.chl-tile-media { display: block; aspect-ratio: 1/1; background: var(--chl-tile-bg, #e9edf2); }
.chl-tile-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.chl-tile-photo--ph {
	display: flex; align-items: center; justify-content: center;
	font-size: 2.4rem; font-weight: 800; color: #fff;
	background: var(--chl-tile-ph, #9aa7b4);
}
.chl-tile-body { padding: 10px 12px; }
.chl-tile-name { display: block; font-weight: 700; line-height: 1.2; }
.chl-tile-name img { width: 18px; height: auto; margin-right: 6px; vertical-align: -3px; border-radius: 2px; }
.chl-tile-pos { display: block; font-size: .82rem; opacity: .7; margin-top: 2px; }

/* ---- Season landing page ---- */
.chl-season-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 18px; }
.chl-season-title { margin: 0; }
.chl-season-badge {
	font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
	padding: 4px 10px; border-radius: 999px; background: #d7f5df; color: #0a7a33;
}
.chl-season > section { margin: 26px 0; }
.chl-season-tables { display: grid; gap: 22px; }

/* ---- Team landing page ---- */
.chl-team-head { display: flex; align-items: center; gap: 14px; margin: 0 0 20px; }
.chl-team-head .chl-crest { width: 56px; height: 56px; }
.chl-team-title { margin: 0; }
.chl-team-page > section, .chl-team-cols { margin: 26px 0; }
.chl-team-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 700px) { .chl-team-cols { grid-template-columns: 1fr; } }

/* ---- Player slider (current players): every card the same size ---- */
.chl-squad-cards.chl-slider {
	display: flex; flex-wrap: nowrap; gap: 14px; align-items: stretch;
	overflow-x: auto; scroll-snap-type: x mandatory;
	padding-bottom: 10px; -webkit-overflow-scrolling: touch;
}
.chl-squad-cards.chl-slider .chl-squad-card {
	flex: 0 0 auto; width: 180px; scroll-snap-align: start;
}
.chl-squad-cards.chl-slider::-webkit-scrollbar { height: 8px; }
.chl-squad-cards.chl-slider::-webkit-scrollbar-thumb { background: rgba(0,0,0,.25); border-radius: 4px; }

/* ---- Slider arrows + season selector ---- */
.chl-slider-wrap { position: relative; }
.chl-slider-nav {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
	width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
	background: var(--chl-accent, #ff2d55); color: #fff; font-size: 1.5rem; line-height: 1;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 2px 10px rgba(0,0,0,.35); transition: opacity .15s, transform .15s;
}
.chl-slider-nav:hover { transform: translateY(-50%) scale(1.08); }
.chl-slider-prev { left: -6px; }
.chl-slider-next { right: -6px; }
.chl-slider-nav[disabled] { opacity: 0; pointer-events: none; }
/* Hide arrows entirely when the track isn't scrollable. */
.chl-slider-wrap:not(.is-scrollable) .chl-slider-nav { display: none; }
@media (max-width: 700px) { .chl-slider-prev { left: 2px; } .chl-slider-next { right: 2px; } }

.chl-season-select { margin-left: auto; }
.chl-season-select select { padding: 5px 8px; border-radius: 6px; }
.chl-team-head { flex-wrap: wrap; }

/* ---- Match lineups: starting-line banner + stats ---- */
.chl-lineups { margin: 24px 0; }
.chl-team-lineup { margin: 0 0 28px; }
.chl-lineup-hero { border-radius: 10px; overflow: hidden; margin: 0 0 12px; }
.chl-lineup-hero-inner { padding: 16px 18px 18px; }
.chl-lineup-hero h4 { margin: 0 0 12px; color: #fff; text-transform: uppercase; letter-spacing: 0.03em; }
.chl-starting-faces { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.chl-sf a { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: #fff; width: 76px; }
.chl-sf-media { position: relative; width: 72px; height: 72px; }
.chl-sf-photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: top center;
	border: 2px solid rgba(255,255,255,0.85); background: rgba(255,255,255,0.1); display: block; }
.chl-sf-photo--ph { display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.4rem; color: #fff; }
.chl-sf-no { position: absolute; right: -4px; bottom: -4px; min-width: 22px; height: 22px; padding: 0 4px;
	display: flex; align-items: center; justify-content: center; border-radius: 11px;
	background: var(--chl-accent); color: var(--chl-accent-contrast); font-size: 0.72rem; font-weight: 800; }
.chl-sf-nm { font-size: 0.78rem; font-weight: 700; text-align: center; line-height: 1.1;
	text-transform: uppercase; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }

.chl-lineup-table { font-size: 0.92rem; }
.chl-lineup-table .chl-pname { text-align: left; }
.chl-lineup-table .chl-ppos { color: var(--chl-muted); font-size: 0.78rem; margin-left: 6px; }
.chl-lineup-table .chl-pno { white-space: nowrap; }
.chl-lineup-table tr.chl-starter td { font-weight: 700; }
.chl-start-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--chl-accent);
	margin-right: 6px; vertical-align: middle; }
.chl-goalies { margin: 10px 0 0; }
.chl-goalies h5 { margin: 8px 0 6px; text-transform: uppercase; letter-spacing: 0.03em; font-size: 0.85rem; }
.chl-goalies ul { list-style: none; margin: 0; padding: 0; }
.chl-goalies li { padding: 4px 0; }
.chl-goalies .chl-pno { font-weight: 700; }

/* ---- Starting-line row + Player of the Match (extreme right) ---- */
.chl-lineup-row { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.chl-lineup-row .chl-starting-faces { flex: 1 1 auto; }
.chl-potm-star { margin-left: auto; text-align: center; flex: 0 0 auto; align-self: stretch;
	display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
	padding-left: 20px; border-left: 1px solid rgba(255,255,255,0.25); }
.chl-potm-label { display: block; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
	color: var(--chl-accent); margin-bottom: 8px; }
.chl-potm-link { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: #fff; }
.chl-potm-media { width: 96px; height: 96px; }
.chl-potm-photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; object-position: top center;
	border: 3px solid var(--chl-accent); display: block; }
.chl-potm-photo--ph { display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.8rem;
	color: #fff; background: rgba(255,255,255,0.12); }
.chl-potm-name { font-weight: 800; text-transform: uppercase; font-size: 0.85rem; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }
@media (max-width: 600px) { .chl-potm-star { margin: 12px 0 0; border-left: 0; padding-left: 0; } }

/* ---- Match sponsor (top of the match page) ---- */
.chl-match-sponsor { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 4px 0 16px; }
.chl-ms-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--chl-muted); }
.chl-ms-logo { max-height: 56px; width: auto; background: #fff; padding: 6px 12px; border-radius: 6px; display: block; }
.chl-ms-name { font-weight: 700; }

/* ---- Netminder rows at the top of the lineup grid ---- */
.chl-lineup-table .chl-goalie-stats { text-align: left; color: var(--chl-muted); font-weight: 600; white-space: nowrap; }
.chl-lineup-table .chl-goalie-row .chl-ppos { color: var(--chl-accent); font-weight: 700; }
.chl-lineup-table .chl-goalie-row td { background: rgba(127,127,127,0.06); }
.chl-video { margin: 26px 0 0; }

/* Netminder table sits just above the skater table (its accent header is the "bar"). */
.chl-netminder-table { margin-bottom: 8px; }

/* Align the netminder table with the skater table (identical 8-column grid). */
.chl-lineup-table { table-layout: fixed; width: 100%; }
.chl-lineup-table th:nth-child(1), .chl-lineup-table td:nth-child(1) { width: 7%; }
.chl-lineup-table th:nth-child(2), .chl-lineup-table td:nth-child(2) { width: 33%; }
.chl-lineup-table th:nth-child(n+3), .chl-lineup-table td:nth-child(n+3) { width: 10%; }
.chl-lineup-table .chl-pname { white-space: normal; overflow: hidden; text-overflow: ellipsis; }

/* ---- Match events: period breakdown + goals/penalties ---- */
.chl-match-events { margin: 18px 0; }
.chl-periods { max-width: 440px; margin: 0 auto 22px; }
.chl-ev-block { margin: 16px 0; }
.chl-ev-block h4 { text-align: center; text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 8px; }
.chl-ev-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.chl-ev-list { list-style: none; margin: 0; padding: 0; }
.chl-ev-list li { padding: 3px 0; }
.chl-ev-away { text-align: right; }
.chl-ev-clock { color: var(--chl-muted); font-variant-numeric: tabular-nums; margin-right: 4px; }
.chl-ev-assist { color: var(--chl-muted); font-size: 0.9em; }
.chl-ev-min { color: var(--chl-accent); font-weight: 700; }
.chl-ev-inf { color: var(--chl-muted); font-size: 0.9em; }
@media (max-width: 600px) { .chl-ev-cols { grid-template-columns: 1fr; } .chl-ev-away { text-align: left; } }

/* ---- Dual-nationality split flag ---- */
.chl-flag2 { position: relative; display: inline-block; width: 24px; height: 18px; margin-right: 6px;
	vertical-align: -3px; border-radius: 2px; overflow: hidden; }
.chl-flag2 img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.chl-flag2-a { -webkit-clip-path: polygon(0 0, 100% 0, 0 100%); clip-path: polygon(0 0, 100% 0, 0 100%); }
.chl-flag2-b { -webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%); clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.chl-hero-flag--2 img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---- Sortable stats-table headers ---- */
.chl-sortable-th { cursor: pointer; user-select: none; -webkit-user-select: none; white-space: nowrap; }
.chl-sortable-th:hover { filter: brightness(1.08); }
.chl-sortable-th.is-asc::after { content: " \25B2"; font-size: 0.65em; opacity: 0.85; }
.chl-sortable-th.is-desc::after { content: " \25BC"; font-size: 0.65em; opacity: 0.85; }

/* ---- Match events timeline (goals/penalties grouped by period, two-sided) ---- */
.chl-period { margin: 18px 0; }
.chl-period-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
	border-bottom: 2px solid var(--chl-accent); padding-bottom: 6px; margin-bottom: 8px; }
.chl-period-label { justify-self: start; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 800; }
.chl-period-score { justify-self: center; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.chl-timeline { list-style: none; margin: 0; padding: 0; }
.chl-tl { display: flex; align-items: center; gap: 9px; padding: 5px 0; }
.chl-tl-away { flex-direction: row-reverse; text-align: right; }
.chl-tl-ico { flex: none; vertical-align: middle; color: var(--chl-accent); }
.chl-tl-time { color: var(--chl-muted); font-variant-numeric: tabular-nums; min-width: 46px; }
.chl-period-none { color: var(--chl-muted); font-style: italic; padding: 6px 0; margin: 0; text-align: center; }
.chl-tl-oppo { }

/* ---- Add-to-calendar + head-to-head ---- */
.chl-match-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; align-items: center; }
.chl-cal { display: inline-block; padding: 6px 16px; border-radius: 4px; text-decoration: none; font-size: 0.85rem; font-weight: 700;
	border: 1px solid var(--chl-accent); color: var(--chl-accent); }
.chl-cal:hover { background: var(--chl-accent); color: var(--chl-accent-contrast); }
/* Match page: Buy Tickets / Buy a Stream / shirt / Add to calendar all on one row, uniform buttons. */
.chl-match-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: 10px; margin: 16px 0 20px; }
.chl-match-actions > a { margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 11px 20px; font-size: 0.9rem; font-weight: 700; line-height: 1.2; border-radius: 4px; text-decoration: none; white-space: nowrap; }
.chl-match-actions .chl-cal { border: 1px solid var(--chl-accent); color: var(--chl-accent); background: transparent; }
.chl-match-actions .chl-cal:hover { background: var(--chl-accent); color: var(--chl-accent-contrast); }
.chl-btn-ico { flex: none; }
.chl-h2h { margin: 22px 0; }
.chl-h2h h3 { text-align: center; }
.chl-h2h-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 8px 0 12px; }
.chl-h2h-team { font-weight: 800; text-transform: uppercase; }
.chl-h2h-team--away { text-align: right; }
.chl-h2h-tally { text-align: center; font-variant-numeric: tabular-nums; }
.chl-h2h-tally b { font-size: 1.3rem; }
.chl-h2h-tally span { color: var(--chl-muted); font-size: 0.75rem; margin: 0 6px 0 2px; }
.chl-h2h-list { list-style: none; margin: 0 auto; padding: 0; max-width: 520px; }
.chl-h2h-list li { padding: 3px 0; }
.chl-h2h-list a { text-decoration: none; display: flex; gap: 8px; align-items: baseline; justify-content: center; }
.chl-h2h-date { color: var(--chl-muted); font-size: 0.8rem; min-width: 72px; }

/* ---- Accessibility helpers ---- */
/* Visually-hidden but screen-reader-available text (matches WP core .screen-reader-text so
   visually-hidden headings/labels emitted by the plugin work even under a block theme). */
.chl-content .screen-reader-text,
.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; width: 1px; margin: -1px; padding: 0; overflow: hidden;
	position: absolute !important; word-wrap: normal !important;
}
.screen-reader-text:focus {
	background: #fff; clip: auto; clip-path: none; color: #111; display: block;
	height: auto; width: auto; padding: 12px 16px; z-index: 100000; left: 8px; top: 8px;
}

/* Visible keyboard focus for the plugin's custom controls (WCAG 2.4.7 AA). */
.chl-slider-nav:focus-visible,
.chl-season-select select:focus-visible,
.chl-sortable-th:focus-visible,
.chl-squad-card a:focus-visible,
.chl-match:focus-visible,
.chl-player-card a:focus-visible {
	outline: 3px solid var(--chl-accent, #123c6b);
	outline-offset: 2px;
}

/* Sortable stats-table headers: show they are interactive + which way they're sorted. */
.chl-sortable-th { cursor: pointer; }
.chl-sortable-th[aria-sort="ascending"]::after { content: " \25B2"; font-size: 0.7em; }
.chl-sortable-th[aria-sort="descending"]::after { content: " \25BC"; font-size: 0.7em; }

/* EliteProspects button beside a player's name (transparent PNG logo uploaded in Club Hockey → Settings).
   No background chip — the uploaded logo shows on its own transparent background. */
.chl-ep-link { display: inline-flex; align-items: center; justify-content: center; margin-top: 12px;
	min-width: 36px; min-height: 36px; line-height: 0; opacity: .95;
	transition: transform .12s ease, opacity .12s ease; }
.chl-ep-link:hover { transform: translateY(-1px); opacity: 1; }
.chl-ep-link:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 8px; }
.chl-ep-logo { width: 34px; height: 34px; object-fit: contain; display: block; }
/* Text fallback (only shown if no logo has been uploaded yet) as an outlined pill on the dark banner. */
.chl-ep-text { font: 800 .68rem/1 "Oswald", sans-serif; letter-spacing: .02em; text-transform: uppercase;
	color: #fff; padding: 6px 10px; border: 1px solid rgba(255,255,255,0.5); border-radius: 8px; white-space: nowrap; }

/* Top Players widget — leaders for goals / assists / points / save %; two per line. */
.chl-tp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px; margin-top: 4px; }
.chl-top-players .chl-tp-row { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 11px;
	padding: 6px 0; text-decoration: none; color: inherit; min-width: 0; }
@media (max-width: 480px) { .chl-tp-grid { grid-template-columns: 1fr; } }
.chl-tp-photo { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: top center; display: block; }
.chl-tp-photo--ph { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%;
	background: var(--chl-accent, #111); color: #fff; font-weight: 700; font-size: .9rem; }
.chl-tp-meta { display: flex; flex-direction: column; min-width: 0; }
.chl-tp-cat { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; opacity: .7; }
.chl-tp-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chl-tp-val { font-weight: 800; font-size: 1.05rem; color: var(--chl-accent, inherit); }

/* ==========================================================================
   Responsive layer — mobile + tablet
   ========================================================================== */

/* Wide data tables scroll horizontally rather than overflowing the page.
   (JS wraps league/stats/career/lineup tables in .chl-scrollx.) */
.chl-scrollx { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chl-scrollx > table { margin-bottom: 0; }

/* Tablet */
@media (max-width: 900px) {
	.chl-hero-inner { min-height: 300px; padding: 22px 22px 0; }
	.chl-hero-last { font-size: clamp(2.2rem, 8vw, 3.4rem); }
	.chl-lineup-row { gap: 16px; }
}

/* Large phone */
@media (max-width: 720px) {
	/* keep multi-column tables legible: let them scroll at a sensible min width */
	.chl-scrollx .chl-league-table,
	.chl-scrollx .chl-lineup-table,
	.chl-scrollx .chl-netminder-table,
	.chl-scrollx .chl-player-career,
	.chl-scrollx .chl-team-table,
	.chl-scrollx .chl-stats { min-width: 560px; }
	.chl-table { font-size: 0.9rem; }
	.chl-table th, .chl-table td { padding: 7px 8px; }
	.chl-hero-inner { min-height: 260px; }
}

/* Phone */
@media (max-width: 600px) {
	.chl-match-header { font-size: 1.15rem; gap: 12px; flex-wrap: wrap; }
	.chl-sponsors { gap: 14px; }
	.chl-sponsors img { max-height: 52px; }
	.chl-potm-media, .chl-potm-photo { width: 78px; height: 78px; }
	.chl-potm-photo--ph { font-size: 1.4rem; }
	.chl-fixture { gap: 8px; }
	.chl-side { gap: 8px; }
	.chl-badge, .chl-badge--mono { width: 34px; height: 34px; }
	.chl-hero-stats .chl-stat-num { font-size: 1.4rem; }
	.chl-player-sponsors { grid-template-columns: repeat(2, 1fr); }
}

/* Small phone */
@media (max-width: 400px) {
	.chl-hero-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
	.chl-hero-last { font-size: clamp(1.9rem, 9vw, 2.4rem); }
	.chl-sf a { width: 62px; }
	.chl-sf-media, .chl-sf-photo { width: 58px; height: 58px; }
	.chl-starting-faces { gap: 10px; }
	.chl-squad-cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* Let fixture/result rows shrink and team names wrap on small screens (no horizontal overflow). */
.chl-fixture, .chl-side, .chl-scrollx, .chl-match, .chl-match-link { min-width: 0; }
@media (max-width: 600px) { .chl-side .chl-name { overflow-wrap: anywhere; word-break: normal; } }

/* ---- Shop "buy" buttons (Shopify link or embedded shortcode) ---- */
.chl-shop-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 9px 18px;
	background: var(--chl-btn-bg, var(--chl-accent, #123c6b)); color: var(--chl-btn-text, var(--chl-accent-contrast, #fff)); border-radius: 6px;
	text-decoration: none; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; font-size: .85rem; }
.chl-shop-btn:hover, .chl-shop-btn:focus { filter: brightness(1.08); color: var(--chl-btn-text, var(--chl-accent-contrast, #fff)); }
.chl-shop-ico { width: 18px; height: 18px; flex: none; }
.chl-shop-embed { margin-top: 12px; }
.chl-match-shop { text-align: center; margin: 8px 0 14px; }

/* ---- Rotating adverts (image + link) ---- */
.chl-adverts { position: relative; margin: 0 0 24px; border-radius: var(--chl-radius, 8px); overflow: hidden; }
.chl-advert-slide { display: block; }
.chl-advert-slide[hidden] { display: none; }
.chl-advert-link { display: block; }
.chl-advert-img { width: 100%; height: auto; display: block; }

/* ---- Home/Away diagonal corner ribbon, tucked into the TOP-RIGHT CORNER of the box ---- */
.chl-match { position: relative; overflow: hidden; }
/* In the home strip, anchor + clip the ribbon to the outer box corner (each box holds one game),
   so it sits in the very corner across the top + side rather than half-way down the card. */
.chl-next-fixture, .chl-latest-result { position: relative; overflow: hidden; }
.chl-next-fixture .chl-match, .chl-latest-result .chl-match { position: static; overflow: visible; }
.chl-ribbon { position: absolute; top: 20px; right: -52px; width: 170px; z-index: 3; pointer-events: none;
	transform: rotate(45deg); text-align: center; padding: 5px 0;
	font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35); }
.chl-ribbon--home { background: var(--chl-accent, #123c6b); color: #fff; }  /* fallback when the team has no colours */
.chl-ribbon--away { background: #39414d; color: #fff; }

/* Two stacked fixtures in the Next-fixtures box get a divider between them. */
.chl-widget .chl-matchlist .chl-match + .chl-match { border-top: 1px solid var(--chl-border); margin-top: 16px; padding-top: 16px; }

/* Fixture action row — Buy Tickets (first) + Buy a Stream on one line, forced to equal width. */
.chl-match-btns { display: flex; gap: 8px; width: 100%; align-self: stretch; }
.chl-match-btns > .chl-tickets, .chl-match-btns > .chl-shop-btn {
	flex: 1 1 0; min-width: 0; margin: 0; align-self: auto; justify-content: center; text-align: center;
	padding: 8px 10px; font-size: 0.8rem; line-height: 1.2; white-space: nowrap; }

/* ---- Home-strip boxes: stack the match vertically so team names don't collide with the
   crest/score in the narrow 4-across boxes ---- */
.chl-next-fixture .chl-fixture, .chl-latest-result .chl-fixture { grid-template-columns: 1fr; gap: 8px; justify-items: center; }
.chl-next-fixture .chl-side, .chl-latest-result .chl-side { justify-content: center; text-align: center; width: 100%; }
.chl-next-fixture .chl-side.chl-away, .chl-latest-result .chl-side.chl-away { flex-direction: row; text-align: center; }
.chl-next-fixture .chl-side .chl-name, .chl-latest-result .chl-side .chl-name { overflow-wrap: normal; }
.chl-next-fixture .chl-match-link, .chl-latest-result .chl-match-link { gap: 12px; }
.chl-next-fixture .chl-match-foot, .chl-latest-result .chl-match-foot { width: 100%; margin-top: 2px; }
/* Top Players: one leader per row so the label + value never overlap in the narrow box. */
.chl-top-players .chl-tp-grid { grid-template-columns: 1fr; }

/* ===== Cup progression bracket ===== */
.chl-cup-scroll{overflow-x:auto;padding:34px 2px 12px}
.chl-bracket{position:relative;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(180px,1fr);gap:0 26px}
.chl-wires{position:absolute;inset:0;pointer-events:none;z-index:0}
.chl-wire{fill:none;stroke:var(--chl-accent,#123c6b);stroke-opacity:.5;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.chl-bracket .chl-col{position:relative;z-index:1;display:flex;flex-direction:column;justify-content:space-around;gap:16px}
.chl-bracket .chl-col--final{justify-content:center}
.chl-bracket .chl-rlabel{position:absolute;top:-30px;left:0;right:0;text-align:center;font-size:.66rem;letter-spacing:.14em;text-transform:uppercase;color:var(--chl-muted);font-weight:800}
.chl-cup-match{display:block;text-decoration:none;color:inherit;background:var(--chl-box-bg,var(--wp--preset--color--surface,#141d2a));border:1px solid var(--chl-border);border-radius:10px;overflow:hidden;transition:transform .12s ease,border-color .12s ease,box-shadow .12s ease}
.chl-cup-match:hover,.chl-cup-match:focus-visible{transform:translateY(-2px);border-color:var(--chl-accent);box-shadow:0 8px 22px rgba(0,0,0,.4);outline:none}
.chl-cup-match:focus-visible{box-shadow:0 0 0 2px var(--chl-accent)}
.chl-cup-team{display:grid;grid-template-columns:32px 1fr auto;align-items:center;gap:10px;padding:8px 11px}
.chl-cup-team+.chl-cup-team{border-top:1px solid var(--chl-border)}
.chl-cup-team .chl-badge,.chl-cup-team .chl-badge--mono{width:30px;height:30px}
.chl-cup-tn{font-size:.84rem;font-weight:600;line-height:1.15}
.chl-cup-sc{font-size:.92rem;font-weight:800;color:var(--chl-muted);font-variant-numeric:tabular-nums;min-width:16px;text-align:right}
.chl-cup-team.win{background:rgba(255,255,255,.04);box-shadow:inset 3px 0 0 var(--chl-accent)}
.chl-cup-team.win .chl-cup-tn{font-weight:800}
.chl-cup-team.win .chl-cup-sc{color:var(--chl-accent)}
.chl-cup-team.lose{opacity:.55}
.chl-cup-ot{display:inline-block;margin-left:6px;font-size:.56rem;font-weight:800;letter-spacing:.06em;color:var(--chl-accent);border:1px solid var(--chl-accent);border-radius:4px;padding:0 4px;vertical-align:middle;opacity:.85}
.chl-cup-match--final{border-color:var(--chl-accent);box-shadow:0 0 0 1px var(--chl-accent),0 10px 30px rgba(0,0,0,.45)}
.chl-cup-final-wrap{display:flex;flex-direction:column;gap:14px}
.chl-champ{display:flex;flex-direction:column;align-items:center;gap:5px;text-align:center}
.chl-cup-svg{width:50px;height:58px;color:var(--chl-accent);filter:drop-shadow(0 6px 12px rgba(0,0,0,.35))}
.chl-champ-lbl{font-size:.62rem;letter-spacing:.2em;text-transform:uppercase;color:var(--chl-accent);font-weight:800}
.chl-champ-who{font-weight:800}
@media (max-width:600px){.chl-bracket{grid-auto-columns:minmax(160px,1fr);gap:0 18px}}
