/**
 * ICC team rankings embed (shortcode).
 *
 * @package ISPV2
 */

.isp-icc-rankings-inline.isp-icc-shell {
	box-sizing: border-box;
	max-width: 100%;
	width: 100%;
	margin: 0;
	padding: 0;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	font-size: 14px;
	color: #111827;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
}

.isp-icc {
	margin: 0;
	padding: 0;
	background: transparent;
	border: none;
	box-shadow: none;
}

.isp-icc__card {
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.isp-icc__card-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 16px;
	padding: 14px 16px;
	background: #f9fafb;
	border-bottom: 1px solid #e5e7eb;
}

.isp-icc__card-title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: #111827;
}

.isp-icc__updated {
	font-size: 12px;
	color: #6b7280;
	white-space: nowrap;
}

.isp-icc__table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.isp-icc__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.isp-icc__th {
	text-align: left;
	padding: 10px 14px;
	font-weight: 600;
	color: #374151;
	background: #f9fafb;
	border-bottom: 1px solid #e5e7eb;
	white-space: nowrap;
}

.isp-icc__th--num {
	text-align: right;
}

.isp-icc__th--pos {
	width: 72px;
}

.isp-icc__td {
	padding: 12px 14px;
	border-bottom: 1px solid #e5e7eb;
	color: #111827;
	vertical-align: middle;
}

.isp-icc__td--num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.isp-icc__td--team {
	font-weight: 500;
}

.isp-icc__flag {
	display: inline-block;
	margin-right: 8px;
	font-size: 1.15em;
	line-height: 1;
	vertical-align: -0.1em;
}

.isp-icc__team-mark {
	display: inline-flex;
	align-items: center;
	margin-right: 8px;
	vertical-align: middle;
}

.isp-icc__team-logo {
	display: block;
	width: 22px;
	height: 22px;
	object-fit: contain;
	border-radius: 2px;
}

.isp-icc__tr:last-child .isp-icc__td {
	border-bottom: none;
}

.isp-icc__empty {
	padding: 20px 14px;
	text-align: center;
	color: #6b7280;
}

/* Tabbed widget (Test / ODI / T20) — same palette as single-table embed */
.isp-icc__card--tabbed {
	overflow: visible;
}

.isp-icc__tablist-wrap {
	background: #f9fafb;
	border-bottom: 1px solid #e5e7eb;
	padding: 10px 12px 0;
}

.isp-icc__tablist {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 8px;
	margin: 0;
	padding: 0;
}

.isp-icc__tab {
	margin: 0;
	padding: 8px 14px;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	color: #6b7280;
	background: #fff;
	border: 1px solid #d1d5db;
	border-bottom: none;
	border-radius: 8px 8px 0 0;
	cursor: pointer;
	transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.isp-icc__tab:hover {
	color: #111827;
	border-color: #9ca3af;
}

.isp-icc__tab[aria-selected='true'] {
	color: #111827;
	background: #fff;
	border-color: #e5e7eb;
	box-shadow: 0 -1px 0 #fff;
	position: relative;
	z-index: 1;
	margin-bottom: -1px;
	padding-bottom: 9px;
}

.isp-icc__tabpanel[hidden] {
	display: none;
}

.isp-icc__card-head--panel {
	border-top: none;
}

@media (max-width: 480px) {
	.isp-icc__th,
	.isp-icc__td {
		padding: 8px 10px;
		font-size: 12px;
	}

	.isp-icc__updated {
		white-space: normal;
	}

	.isp-icc__tab {
		padding: 7px 10px;
		font-size: 12px;
	}
}

/* Player rankings — category pills (Batters / Bowlers tabs): horizontal scroll, scrollbar hidden */
.isp-icc-shell--player .isp-icc__tablist--player {
	flex-wrap: nowrap;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
	gap: 6px;
	padding-bottom: 2px;
}

.isp-icc-shell--player .isp-icc__tablist--player::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

/* Player table wrapper: column layout so table stays full width above the control */
.isp-icc__table-wrap--player-rankings-collapsible {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
	box-sizing: border-box;
}

.isp-icc__table-wrap .isp-icc__player-rankings-table-scroll {
	width: 100%;
	min-width: 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* Player table: default ~10 rows, “Show more” ~50; scroll works, scrollbar hidden */
.isp-icc__table-wrap--player-rankings-collapsible .isp-icc__player-rankings-table-scroll {
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.isp-icc__table-wrap--player-rankings-collapsible .isp-icc__player-rankings-table-scroll::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

/*
 * Row-height budget (table cells + borders): ~3rem per row works better than 2.75rem for ICC tables.
 * Collapsed: clip ~10 rows, no vertical scroll.
 * Expanded: must be clearly taller than collapsed — never use min(85vh, 50 rows) alone or short
 * viewports only gain ~1–2 rows vs collapsed. Floor = max(~24 row budget, 90vh), cap = 50 rows.
 */
.isp-icc__table-wrap--player-rankings-collapsible:not(.is-expanded) .isp-icc__player-rankings-table-scroll {
	max-height: calc(10 * 3rem);
	overflow-x: auto;
	overflow-y: hidden;
}

.isp-icc__table-wrap--player-rankings-collapsible.is-expanded .isp-icc__player-rankings-table-scroll {
	max-height: min(
		calc(50 * 3rem),
		max(calc(24 * 3rem), 90vh)
	);
	overflow-x: auto;
	overflow-y: auto;
}

/* Show more / less — blue text link, comfortable tap target, light hover wash */
.isp-icc__player-rankings-more {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	/*margin-top: 12px;*/
	padding: 10px 12px;
	min-height: 44px;
	box-sizing: border-box;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	color: #2563eb;
	background: transparent;
	border: none;
	border-radius: 8px;
	box-shadow: none;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	white-space: nowrap;
	text-decoration: underline;
	text-decoration-color: rgba(37, 99, 235, 0.45);
	text-underline-offset: 5px;
	-webkit-tap-highlight-color: transparent;
	outline: none;
	transition: color 0.15s ease, background 0.15s ease, text-decoration-color 0.15s ease;
}

.isp-icc__player-rankings-more:hover {
	color: #1d4ed8;
	text-decoration-color: #2563eb;
	background: #eff6ff;
}

.isp-icc__player-rankings-more:active {
	color: #1e40af;
	text-decoration-color: #1d4ed8;
	background: #dbeafe;
}

.isp-icc__player-rankings-more:focus:not(:focus-visible) {
	outline: none;
	box-shadow: none;
}

.isp-icc__player-rankings-more:focus-visible {
	outline: 2px solid #3b82f6;
	outline-offset: 4px;
	border-radius: 2px;
}

.isp-icc__tab--player {
	flex: 0 0 auto;
	white-space: nowrap;
	font-size: 12px;
	padding: 7px 12px;
}

.isp-icc__th--player-name,
.isp-icc__td--player-name {
	min-width: 7.5rem;
}

.isp-icc__th--country,
.isp-icc__td--country {
	width: 22%;
}

.isp-icc__player-name {
	font-weight: 500;
}
