/**
 * Ettan Football Stats — standings + top scorers tables.
 * Inherits the sportadmin-cards theme tokens where available (color palette,
 * card radius), with sensible fallbacks so it also looks right standalone.
 */

.efs-block {
	--efs-border: var(--wp--preset--color--border, #e6e8eb);
	--efs-radius: var(--wp--custom--card-radius, 6px);
	--efs-head-bg: var(--wp--preset--color--primary, #1f2937);
	--efs-head-text: var(--wp--preset--color--vit, #fff);
	--efs-zebra: color-mix(in srgb, currentColor 4%, transparent);

	/* Full-width section like the theme's card rows (.section-fullwidth):
	   break out to viewport width, content stays at content-size. */
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	/* Scale with the global section-spacing preset, a touch tighter than a full
	   theme section (adjacent sections each add padding). */
	padding-block: calc(var(--wp--custom--section-spacing, clamp(2.5rem, 5vw, 4rem)) * 0.8);
}

/* Inner content constrained to the page content-size, centered. */
.efs-block > .efs-inner {
	max-width: var(--wp--style--global--content-size, 1200px);
	margin-inline: auto;
}

/* Mobile: side padding so content never touches the viewport edge
   (mirrors .section-fullwidth > * padding). */
@media (max-width: 781px) {
	.efs-block > .efs-inner {
		padding-inline: var(--wp--preset--spacing--50, 1rem);
	}
}

/* League toggle (Norra/Södra) */
.efs-league-toggle {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1.25rem;
}

.efs-league-toggle__btn {
	padding: 0.45rem 1.1rem;
	border: 1px solid var(--efs-border);
	border-radius: 9999px;
	background: var(--wp--preset--color--chip-inactive-bg, #f5f6f7);
	color: var(--wp--preset--color--chip-inactive-text, #111);
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.efs-league-toggle__btn--active {
	background: var(--wp--preset--color--chip-active-bg, #1f2937);
	color: var(--wp--preset--color--chip-active-text, #fff);
	border-color: transparent;
}

.efs-league-panel[hidden] {
	display: none;
}

/* Header bar: section title left, league toggle right (same row). */
.efs-header-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	flex-wrap: wrap;
	margin-bottom: 1.25rem;
}

.efs-header-bar .efs-block__title,
.efs-header-bar .efs-league-toggle {
	margin-bottom: 0;
}

/* "Visa alla"-link, placed below the content, right-aligned. */
.efs-block__all,
.efs-fixtures__all {
	margin: 1.25rem 0 0;
	text-align: right;
}

.efs-link-all {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-weight: 700;
	text-decoration: none;
	color: var(--wp--preset--color--primary, #1f2937);
}

.efs-link-all:hover {
	text-decoration: underline;
}

.efs-block__title {
	display: flex;
	align-items: baseline;
	gap: 0.5em;
	margin: 0 0 0.75rem;
}

.efs-block__season {
	font-size: 0.7em;
	font-weight: 400;
	opacity: 0.6;
}

.efs-block__message {
	padding: 1rem;
	border: 1px dashed var(--efs-border);
	border-radius: var(--efs-radius);
	color: var(--wp--preset--color--text-secondary, #6b7280);
	font-size: 0.9rem;
	margin: 0;
}

/* Horizontal scroll on narrow screens, hidden scrollbar (theme convention). */
.efs-table-scroll {
	overflow-x: auto;
	scrollbar-width: none;
	border: 1px solid var(--efs-border);
	border-radius: var(--efs-radius);
}
.efs-table-scroll::-webkit-scrollbar {
	display: none;
}

.efs-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.925rem;
	background: var(--wp--preset--color--vit, #fff);
}

/* Fixed column widths so the table layout is identical for both leagues — only
   the content changes when toggling, the columns never "jump". The team column
   takes the remaining space (long names ellipsis via .efs-team__name). */
.efs-table--standings,
.efs-table--leaderboard {
	table-layout: fixed;
}

.efs-table--standings {
	min-width: 34rem; /* keep columns readable; the wrapper scrolls on mobile */
}

.efs-table--standings .efs-col-goals { width: 4.5rem; }
.efs-table--standings .efs-col-pts { width: 3rem; }
.efs-table--standings thead th:not([class]) { width: 2.75rem; } /* S V O F */
.efs-table--leaderboard .efs-col-pts { width: 5.5rem; }

.efs-table thead th {
	background: var(--efs-head-bg);
	color: var(--efs-head-text);
	font-weight: 600;
	text-align: center;
	padding: 0.6rem 0.5rem;
	white-space: nowrap;
}

.efs-table th.efs-col-team {
	text-align: left;
}

.efs-table tbody td {
	padding: 0.55rem 0.5rem;
	text-align: center;
	border-top: 1px solid var(--efs-border);
	font-variant-numeric: tabular-nums;
}

.efs-table tbody tr:nth-child(even) {
	background: var(--efs-zebra);
}

.efs-col-rank {
	width: 2.5rem;
	color: var(--wp--preset--color--text-secondary, #6b7280);
}

.efs-col-team {
	text-align: left !important;
}

.efs-col-goals {
	white-space: nowrap;
}

.efs-col-pts {
	font-weight: 800;
}

.efs-team {
	display: flex; /* fill the (fixed-width) cell so the name can truncate */
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
	max-width: 100%;
}

.efs-team__logo {
	flex: 0 0 auto;
	object-fit: contain;
}

.efs-team__photo {
	border-radius: 50%;
}

.efs-team__name {
	min-width: 0; /* allow the flex item to shrink → ellipsis instead of overflow */
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Editor: ServerSideRender wrapper shouldn't add extra chrome. */
.editor-styles-wrapper .efs-block .components-server-side-render {
	margin: 0;
}

/* ---------- Team-stats: chips ---------- */
.efs-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1.25rem;
}

.efs-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.4rem 0.8rem;
	border: 1px solid var(--efs-border);
	border-radius: 9999px;
	background: var(--wp--preset--color--chip-inactive-bg, #f5f6f7);
	color: var(--wp--preset--color--chip-inactive-text, #111);
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.efs-chip:hover {
	border-color: var(--efs-head-bg);
}

.efs-chip--active {
	background: var(--wp--preset--color--chip-active-bg, #1f2937);
	color: var(--wp--preset--color--chip-active-text, #fff);
	border-color: transparent;
}

.efs-chip__logo {
	object-fit: contain;
}

/* ---------- Team-stats: card ---------- */
.efs-team-card-slot.efs-loading {
	opacity: 0.5;
	transition: opacity 0.15s;
}

.efs-team-card__head {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1.25rem;
}

.efs-team-card__logo {
	object-fit: contain;
}

.efs-team-card__name {
	margin: 0 0 0.35rem;
}

.efs-form {
	display: inline-flex;
	gap: 0.2rem;
}

.efs-form__item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.25rem;
	height: 1.25rem;
	border-radius: 4px;
	font-size: 0.7rem;
	font-weight: 800;
	color: #fff;
}

.efs-form--w { background: var(--wp--preset--color--success, #16a34a); }
.efs-form--d { background: var(--wp--preset--color--text-secondary, #6b7280); }
.efs-form--l { background: var(--wp--preset--color--error, #dc2626); }

.efs-stat-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0.75rem;
}

@media (max-width: 782px) {
	.efs-stat-grid { grid-template-columns: repeat(2, 1fr); }
}

.efs-stat {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	padding: 0.85rem;
	border: 1px solid var(--efs-border);
	border-radius: var(--efs-radius);
	background: var(--wp--preset--color--vit, #fff);
}

.efs-stat__rank {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.6rem;
	height: 1.25rem;
	padding: 0 0.4rem;
	border-radius: 9999px;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1;
	background: color-mix(in srgb, currentColor 9%, transparent);
	color: var(--wp--preset--color--text-secondary, #6b7280);
}

.efs-stat__rank--top {
	background: var(--wp--preset--color--accent, #2563eb);
	color: var(--wp--preset--color--vit, #fff);
}

.efs-stat__rank--first {
	background: var(--wp--preset--color--primary, #1f2937);
	color: var(--wp--preset--color--vit, #fff);
}

.efs-stat__value {
	font-size: 1.5rem;
	font-weight: 800;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.efs-stat__label {
	font-size: 0.75rem;
	color: var(--wp--preset--color--text-secondary, #6b7280);
}

.efs-stat__sub {
	font-size: 0.72rem;
	opacity: 0.75;
}

.efs-team-card__note {
	margin: 1rem 0 0;
	font-size: 0.85rem;
	color: var(--wp--preset--color--text-secondary, #6b7280);
}

/* ---------- Diverging "goals per period" chart ---------- */
.efs-charts {
	margin-top: 1.75rem;
}

.efs-charts__title {
	display: block;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--wp--preset--color--text-secondary, #6b7280);
	margin-bottom: 0.5rem;
}

.efs-dchart__legend {
	display: flex;
	gap: 1.25rem;
	margin-bottom: 0.75rem;
	font-size: 0.78rem;
	font-weight: 600;
}

.efs-dchart__key {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.efs-dchart__key::before {
	content: "";
	width: 0.7rem;
	height: 0.7rem;
	border-radius: 2px;
	display: inline-block;
}

.efs-dchart__key--for::before { background: var(--efs-head-bg); }
.efs-dchart__key--against::before { background: var(--wp--preset--color--error, #dc2626); }

.efs-dchart__row {
	display: flex;
	gap: 0.4rem;
	height: 80px;
}

.efs-dchart__col {
	flex: 1;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.efs-dchart__row--top .efs-dchart__col { justify-content: flex-end; }
.efs-dchart__row--bottom .efs-dchart__col { justify-content: flex-start; }

.efs-dchart__bar {
	width: 100%;
	min-height: 2px;
	position: relative;
}

.efs-dchart__bar--for {
	background: var(--efs-head-bg);
	border-radius: 3px 3px 0 0;
}

.efs-dchart__bar--against {
	background: var(--wp--preset--color--error, #dc2626);
	border-radius: 0 0 3px 3px;
}

.efs-dchart__n {
	position: absolute;
	left: 0;
	right: 0;
	text-align: center;
	font-size: 0.65rem;
	font-weight: 700;
	color: var(--wp--preset--color--body-text, #111);
}

.efs-dchart__row--top .efs-dchart__n { top: -1.15rem; }
.efs-dchart__row--bottom .efs-dchart__n { bottom: -1.15rem; }

.efs-dchart__axis {
	display: flex;
	gap: 0.4rem;
	border-top: 1px solid var(--efs-border);
	border-bottom: 1px solid var(--efs-border);
	background: color-mix(in srgb, currentColor 3%, transparent);
}

.efs-dchart__label {
	flex: 1;
	text-align: center;
	font-size: 0.6rem;
	color: var(--wp--preset--color--text-secondary, #6b7280);
	padding: 0.3rem 0;
	white-space: nowrap;
}

/* ---------- Leaderboard ---------- */
.efs-table--leaderboard td {
	text-align: left;
}

.efs-table--leaderboard .efs-col-rank {
	text-align: center;
}

/* Results/Kommande tab toggle (mode = both) */
.efs-mode-toggle {
	display: inline-flex;
	gap: 0.25rem;
	margin-bottom: 1rem;
	padding: 0.25rem;
	border-radius: 9999px;
	background: color-mix(in srgb, currentColor 7%, transparent);
}

.efs-mode-toggle__btn {
	padding: 0.4rem 1rem;
	border: 0;
	border-radius: 9999px;
	background: transparent;
	color: inherit;
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.efs-mode-toggle__btn--active {
	background: var(--wp--preset--color--primary, #1f2937);
	color: var(--wp--preset--color--vit, #fff);
}

.efs-mode-panel[hidden] {
	display: none;
}

/* ---------- Fixtures / results row ---------- */
.efs-fixtures__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem 1.5rem;
	flex-wrap: wrap;
	margin-bottom: 0.9rem;
}

.efs-fixtures__head .efs-block__title {
	margin-bottom: 0;
}

.efs-fixtures__row {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 0.75rem;
}

.efs-match {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 0.85rem 1rem;
	border: 1px solid var(--efs-border);
	border-radius: var(--efs-radius);
	background: var(--wp--preset--color--vit, #fff);
}

.efs-match__meta {
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--wp--preset--color--text-secondary, #6b7280);
}

.efs-match__teams {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.efs-match__row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.efs-match__logo {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	object-fit: contain;
}

.efs-match__name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 0.95rem;
}

.efs-match__row--winner .efs-match__name {
	font-weight: 700;
}

.efs-match__score {
	flex: 0 0 auto;
	font-variant-numeric: tabular-nums;
	font-weight: 800;
	font-size: 1rem;
}

.efs-match__venue {
	font-size: 0.72rem;
	color: var(--wp--preset--color--text-secondary, #6b7280);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Mobile: horizontal scroll like the theme's card rows. */
@media (max-width: 600px) {
	.efs-fixtures__row {
		display: flex;
		overflow-x: auto;
		scrollbar-width: none;
	}
	.efs-fixtures__row::-webkit-scrollbar { display: none; }
	.efs-match { flex: 0 0 78%; }
}

/* ---------- Full calendar (schedule + results) ---------- */
.efs-cal {
	border: 1px solid var(--efs-border);
	border-radius: var(--efs-radius);
	overflow: hidden;
}

.efs-cal__round + .efs-cal__round {
	border-top: 1px solid var(--efs-border);
}

.efs-cal__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 1rem;
	cursor: pointer;
	list-style: none;
	font-weight: 700;
	background: color-mix(in srgb, currentColor 3%, transparent);
}

.efs-cal__summary::-webkit-details-marker { display: none; }

.efs-cal__summary::after {
	content: "";
	width: 0.55rem;
	height: 0.55rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s;
	opacity: 0.6;
	flex: 0 0 auto;
	margin-left: auto;
}

.efs-cal__round[open] .efs-cal__summary::after {
	transform: rotate(-135deg);
}

.efs-cal__round-date {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--wp--preset--color--text-secondary, #6b7280);
}

.efs-cal__matches {
	padding: 0.25rem 0;
}

.efs-cal__row {
	display: grid;
	grid-template-columns: 4.75rem 1fr 3.5rem 1fr;
	align-items: center;
	gap: 0.75rem;
	padding: 0.5rem 1rem;
	border-top: 1px solid var(--efs-border);
}

.efs-cal__date {
	font-size: 0.72rem;
	color: var(--wp--preset--color--text-secondary, #6b7280);
	white-space: nowrap;
}

.efs-cal__team {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	min-width: 0;
}

.efs-cal__team--away {
	flex-direction: row-reverse;
	text-align: right;
}

.efs-cal__logo {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	object-fit: contain;
}

.efs-cal__name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.efs-cal__team.is-winner .efs-cal__name {
	font-weight: 700;
}

.efs-cal__score {
	text-align: center;
	font-variant-numeric: tabular-nums;
	font-weight: 800;
	white-space: nowrap;
}

.efs-cal__vs {
	color: var(--wp--preset--color--text-secondary, #6b7280);
	font-weight: 400;
}

/* ---------- Calendar round pager ---------- */
.efs-cal--pager {
	border: 0;
	border-radius: 0;
	overflow: visible;
}

/* Toolbar: filters (left) + round nav (right) on one row. */
.efs-cal__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.6rem 1rem;
	margin-bottom: 1.25rem;
}

.efs-cal__nav {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.efs-cal__nav-btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.4rem;
	height: 2.4rem;
	border: 0;
	border-radius: 9999px;
	background: transparent;
	color: var(--wp--preset--color--primary, #1f2937);
	cursor: pointer;
	transition: background 0.15s, opacity 0.15s;
}

.efs-cal__nav-btn:hover:not(:disabled) {
	background: color-mix(in srgb, currentColor 8%, transparent);
}

.efs-cal__nav-btn:disabled {
	opacity: 0.25;
	cursor: default;
}

.efs-cal__nav-btn::before {
	content: "";
	display: block;
	width: 0.6rem;
	height: 0.6rem;
	border-right: 2.5px solid currentColor;
	border-bottom: 2.5px solid currentColor;
}

.efs-cal__prev::before {
	transform: rotate(135deg);
	margin-left: 4px;
}

.efs-cal__next::before {
	transform: rotate(-45deg);
	margin-right: 4px;
}

/* Compact, content-width round selector — centered between the arrows, with a
   custom chevron that has breathing room from the right edge. */
.efs-cal__select {
	flex: 0 1 auto;
	max-width: 100%;
	text-align: center;
	text-align-last: center;
	padding: 0.6rem 2.4rem 0.6rem 1.6rem;
	border: 1px solid var(--efs-border);
	border-radius: 9999px;
	background-color: var(--wp--preset--color--vit, #fff);
	background-image: linear-gradient( 45deg, transparent 50%, currentColor 50% ), linear-gradient( 135deg, currentColor 50%, transparent 50% );
	background-position: right 1.1rem center, right 0.85rem center;
	background-size: 0.3rem 0.3rem, 0.3rem 0.3rem;
	background-repeat: no-repeat;
	color: var(--wp--preset--color--primary, #1f2937);
	font-size: 0.95rem;
	font-weight: 700;
	cursor: pointer;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

/* Filter selects (Säsong + Lag), left side of the toolbar. */
.efs-cal__filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
}

.efs-cal__season-select,
.efs-cal__team-select {
	padding: 0.55rem 2.4rem 0.55rem 1.1rem;
	border: 1px solid var(--efs-border);
	border-radius: 9999px;
	background-color: var(--wp--preset--color--vit, #fff);
	background-image: linear-gradient( 45deg, transparent 50%, currentColor 50% ), linear-gradient( 135deg, currentColor 50%, transparent 50% );
	background-position: right 1.1rem center, right 0.85rem center;
	background-size: 0.3rem 0.3rem, 0.3rem 0.3rem;
	background-repeat: no-repeat;
	color: var(--wp--preset--color--primary, #1f2937);
	font-size: 0.9rem;
	font-weight: 700;
	cursor: pointer;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

.efs-cal__team-select {
	max-width: 100%;
	text-overflow: ellipsis;
}

.efs-cal-wrap.efs-loading {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.15s;
}

.efs-cal__rounds {
	border: 1px solid var(--efs-border);
	border-radius: var(--efs-radius);
	overflow: hidden;
}

/* Flat team-match list (single card, scrolls on long seasons). */
.efs-cal--list .efs-cal__matches {
	border: 1px solid var(--efs-border);
	border-radius: var(--efs-radius);
	overflow: hidden;
	padding: 0;
}

.efs-cal--list .efs-cal__row:first-child {
	border-top: 0;
}

/* Date/round column: just bolder text, no background. Day on the left; the
   kickoff time for unplayed matches moves to the score column (no extra row,
   so the row height never jumps). */
.efs-cal__date {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 0.1rem;
}

.efs-cal__round-tag {
	font-size: 0.58rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--wp--preset--color--text-secondary, #6b7280);
}

.efs-cal__day {
	font-size: 0.78rem;
	font-weight: 700;
	white-space: nowrap;
	color: var(--wp--preset--color--body-text, #111);
}

/* Kickoff time shown in the score column for unplayed matches. */
.efs-cal__score .efs-cal__kickoff {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--wp--preset--color--text-secondary, #6b7280);
}

.efs-cal--pager .efs-cal__round:not(.is-active) {
	display: none;
}

.efs-cal--pager .efs-cal__matches {
	padding: 0;
}

.efs-cal--pager .efs-cal__row:first-child {
	border-top: 0;
}

@media (max-width: 600px) {
	.efs-cal__row {
		grid-template-columns: 1fr 3.5rem 1fr;
	}
	.efs-cal__date {
		grid-column: 1 / -1;
		order: -1;
	}
}

/* ---------- YouTube video grid (single row, like the news row) ---------- */
.efs-yt__grid {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, 1fr);
	gap: 1.25rem;
}

.efs-yt__card {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	text-decoration: none;
	color: inherit;
}

.efs-yt__thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--efs-radius);
	background: color-mix(in srgb, currentColor 8%, transparent);
}

.efs-yt__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.efs-yt__card:hover .efs-yt__thumb img {
	transform: scale(1.05);
}

/* Play button overlay (CSS triangle in a circle) */
.efs-yt__play {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 3.25rem;
	height: 3.25rem;
	border-radius: 50%;
	background: color-mix(in srgb, var(--wp--preset--color--primary, #1f2937) 85%, transparent);
	transition: background 0.2s, transform 0.2s;
}

.efs-yt__play::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 0.6rem 0 0.6rem 1rem;
	border-color: transparent transparent transparent var(--wp--preset--color--vit, #fff);
	transform: translateX(0.12rem);
}

.efs-yt__card:hover .efs-yt__play {
	background: var(--wp--preset--color--primary, #1f2937);
	transform: scale(1.08);
}

.efs-yt__title {
	font-weight: 700;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.efs-yt__meta {
	font-size: 0.78rem;
	color: var(--wp--preset--color--text-secondary, #6b7280);
}

@media (max-width: 781px) {
	/* One row that scrolls horizontally on mobile (like the card/news rows). */
	.efs-yt__grid {
		grid-auto-columns: 78%;
		overflow-x: auto;
		scrollbar-width: none;
		gap: 0.85rem;
	}
	.efs-yt__grid::-webkit-scrollbar { display: none; }
	.efs-yt__play { width: 2.5rem; height: 2.5rem; }
	.efs-yt__title { font-size: 0.9rem; }
}

/* ---------- Mobile: compact standings (#, Lag, S, P) + "show all" toggle ---------- */
.efs-cols-more__cb { display: none; }   /* hidden control, toggled via its label */
.efs-cols-more { display: none; }       /* desktop: full table, no toggle */

@media (max-width: 640px) {
	/* Compact default: hide V, O, F, Mål (columns 4–7); keep #, Lag, S, P. */
	.efs-table--standings { min-width: 0; }
	.efs-table--standings :is(th, td):nth-child(n+4):nth-child(-n+7) { display: none; }

	.efs-cols-more {
		display: inline-flex;
		align-items: center;
		gap: 0.35rem;
		margin-top: 0.75rem;
		cursor: pointer;
		font-weight: 700;
		font-size: 0.85rem;
		color: var(--wp--preset--color--primary, #1f2937);
	}
	.efs-cols-more__hide { display: none; }

	/* Expanded: reveal every column and let the table size to its content
	   (full team names, no truncation) — the wrapper scrolls sideways. */
	.efs-cols-more__cb:checked ~ .efs-table-scroll .efs-table--standings {
		table-layout: auto;
		width: max-content;
		min-width: 100%;
	}
	.efs-cols-more__cb:checked ~ .efs-table-scroll .efs-table--standings :is(th, td) { display: table-cell; }
	.efs-cols-more__cb:checked ~ .efs-table-scroll .efs-team__name {
		overflow: visible;
		text-overflow: clip;
	}
	.efs-cols-more__cb:checked ~ .efs-cols-more .efs-cols-more__show { display: none; }
	.efs-cols-more__cb:checked ~ .efs-cols-more .efs-cols-more__hide { display: inline; }
}

/* ---------- Live match badge ---------- */
.efs-match--live {
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--error, #dc2626);
}

.efs-match--live .efs-match__meta {
	color: var(--wp--preset--color--error, #dc2626);
	font-weight: 800;
}

.efs-live-dot {
	display: inline-block;
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: var(--wp--preset--color--error, #dc2626);
	vertical-align: middle;
	margin-right: 0.15rem;
	animation: efs-live-pulse 1.4s ease-in-out infinite;
}

@keyframes efs-live-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.25; }
}

/* Live cards show a score per team row (JS injects .efs-match__score). */
.efs-match--live .efs-match__row,
.efs-match--ended .efs-match__row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.efs-cal__row--live {
	background: color-mix(in srgb, var(--wp--preset--color--error, #dc2626) 8%, transparent);
}
.efs-cal__row--live .efs-cal__date {
	color: var(--wp--preset--color--error, #dc2626);
	font-weight: 800;
}

/* ---------- Statistik hub (efs-stats: tabs + league) ---------- */
.efs-stats__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	flex-wrap: wrap;
	margin-bottom: 1.5rem;
}

.efs-stats__head .efs-league-toggle {
	margin-bottom: 0;
}

.efs-stats__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	border-bottom: 2px solid var(--efs-border);
}

.efs-stats__tab {
	appearance: none;
	border: 0;
	background: transparent;
	padding: 0.6rem 1rem;
	margin-bottom: -2px;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--wp--preset--color--text-secondary, #6b7280);
	border-bottom: 2px solid transparent;
	cursor: pointer;
	transition: color 0.15s, border-color 0.15s;
}

.efs-stats__tab:hover {
	color: var(--wp--preset--color--primary, #1f2937);
}

.efs-stats__tab--active {
	color: var(--wp--preset--color--primary, #1f2937);
	border-bottom-color: var(--wp--preset--color--primary, #1f2937);
}

.efs-stats__panel[hidden] {
	display: none;
}

/* Right-side controls in the head: season selector + league toggle. */
.efs-stats__controls {
	display: flex;
	align-items: center;
	gap: 0.75rem 1rem;
	flex-wrap: wrap;
}

.efs-season-select {
	padding: 0.5rem 1.4rem;
	border: 1px solid var(--efs-border);
	border-radius: 9999px;
	background: var(--wp--preset--color--vit, #fff);
	font-size: 0.9rem;
	font-weight: 700;
	cursor: pointer;
}

.efs-league-panel.efs-loading {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.15s;
}

/* ---------- Overview = top-lists grouped by category ---------- */
.efs-overview__cat + .efs-overview__cat {
	margin-top: 2.5rem;
}

.efs-overview__cat-title {
	margin: 0 0 1rem;
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--text-secondary, #6b7280);
}

.efs-leaderboard-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
}

@media (max-width: 900px) {
	.efs-leaderboard-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

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

.efs-leaderboard-card {
	display: flex;
	flex-direction: column;
	padding: 1.5rem 1.75rem 1rem;
	background: var(--wp--preset--color--vit, #fff);
	border-radius: var(--wp--custom--card-radius, 12px);
	box-shadow: 0 1px 2px rgba(17, 17, 17, 0.04), 0 1px 12px rgba(17, 17, 17, 0.05);
}

.efs-leaderboard-card__title {
	margin: 0 0 0.65rem;
	padding-bottom: 0.7rem;
	border-bottom: 1px solid color-mix(in srgb, currentColor 8%, transparent);
	font-size: 1rem;
	font-weight: 700;
	color: var(--wp--preset--color--primary, #1f2937);
}

/* Clean list: no boxed table-scroll, no zebra, hairline dividers. */
.efs-overview .efs-table-scroll {
	border: 0;
	border-radius: 0;
	overflow: visible;
}

.efs-overview .efs-table--leaderboard {
	table-layout: auto;
	width: 100%;
	background: transparent;
	font-size: 0.95rem;
}

.efs-overview .efs-table--leaderboard tbody tr {
	background: transparent;
}

.efs-overview .efs-table--leaderboard tbody tr + tr td {
	border-top: 1px solid color-mix(in srgb, currentColor 8%, transparent);
}

.efs-overview .efs-table--leaderboard td {
	padding: 0.62rem 0;
	border-top: 0;
	vertical-align: middle;
}

/* Rank as a soft circular badge; #1 gets the brand accent. */
.efs-overview .efs-table--leaderboard .efs-col-rank {
	width: 2.25rem;
	padding-right: 0.6rem;
}

.efs-overview .efs-rank-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.55rem;
	height: 1.55rem;
	border-radius: 9999px;
	background: var(--wp--preset--color--ljus, #f5f6f7);
	color: var(--wp--preset--color--text-secondary, #6b7280);
	font-size: 0.8rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.efs-overview .efs-table--leaderboard tbody tr:first-child .efs-rank-badge {
	background: var(--wp--preset--color--primary, #1f2937);
	color: var(--wp--preset--color--vit, #fff);
}

.efs-overview .efs-table--leaderboard .efs-col-team {
	width: 100%;
	font-weight: 500;
}

.efs-overview .efs-table--leaderboard tbody tr:first-child .efs-col-team {
	font-weight: 700;
}

.efs-overview .efs-team__name {
	white-space: normal; /* let names wrap instead of truncating to "Hammarb…" */
}

.efs-overview .efs-table--leaderboard .efs-col-pts {
	padding-left: 0.75rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	color: var(--wp--preset--color--primary, #1f2937);
	white-space: nowrap;
}

/* ---------- Team logo banner ---------- */
.efs-logo-banner {
	--efs-logo-h: 48px;
	text-align: center;
}

.efs-logo-banner__title {
	margin: 0 0 1.25rem;
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--text-secondary, #6b7280);
}

.efs-logo-banner__track {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: clamp(1rem, 3vw, 2.5rem);
}

.efs-logo-banner__item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.efs-logo-banner__logo {
	height: var(--efs-logo-h);
	width: auto;
	max-width: calc(var(--efs-logo-h) * 1.6);
	object-fit: contain;
	transition: transform 0.15s ease, filter 0.2s ease, opacity 0.2s ease;
}

.efs-logo-banner__item:hover .efs-logo-banner__logo {
	transform: scale(1.08);
}

/* Optional monochrome variant: grey at rest, full colour on hover. */
.efs-logo-banner--gray .efs-logo-banner__logo {
	filter: grayscale(1);
	opacity: 0.65;
}

.efs-logo-banner--gray .efs-logo-banner__item:hover .efs-logo-banner__logo {
	filter: grayscale(0);
	opacity: 1;
}

/* Logo banner — single-row strip (header-style), scrolls sideways on overflow. */
.efs-logo-banner-block--strip {
	padding-block: 0.6rem;
}

/* Strip uses the full viewport width (no content-size constraint) so logos
   spread edge-to-edge instead of scrolling inside an empty padded box. */
.efs-logo-banner-block--strip > .efs-inner {
	max-width: none;
	padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.efs-logo-banner--strip .efs-logo-banner__track {
	flex-wrap: nowrap;
	justify-content: space-between;
	overflow-x: auto;
	scrollbar-width: none;
	gap: clamp(0.85rem, 2.5vw, 1.75rem);
	-webkit-overflow-scrolling: touch;
}

.efs-logo-banner--strip .efs-logo-banner__track::-webkit-scrollbar {
	display: none;
}

.efs-logo-banner--strip .efs-logo-banner__item {
	flex: 0 0 auto;
}

/* Site-specific (ettanfotboll): the team-logo strip replaces the theme's partner
   banner in the header. Hide the partner banner; slim the strip into the header. */
.site-header .partner-banner {
	display: none !important;
}

.site-header .efs-logo-banner-block {
	border-bottom: 1px solid var(--wp--preset--color--border, #e6e8eb);
}

/* Scroll behaviour: shift the whole sticky header up by the strip's height so
   the strip slides above the viewport while the menu bar stays at the top. Uses
   `top` (not height) → no reflow, no jitter. The .efs-strip-away class is toggled
   on the sticky wrapper by assets/js/header-strip.js; --efs-strip-h is the
   measured strip height. Smooth on desktop + mobile (theme disables the wrapper
   transition on mobile, so we re-enable it here). */
.header-sticky-wrapper {
	transition: top 0.3s ease;
}

.header-sticky-wrapper.efs-strip-away {
	top: calc( var(--wp-admin--admin-bar--height, 0px) - var(--efs-strip-h, 0px) ) !important;
}

/* ---------- Team directory (Lagen list) ---------- */
.efs-club-list {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var(--efs-border);
	border-radius: var(--efs-radius);
	overflow: hidden;
	background: var(--wp--preset--color--vit, #fff);
}

.efs-club-list__item + .efs-club-list__item {
	border-top: 1px solid var(--efs-border);
}

.efs-club-list__link {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding: 0.7rem 1rem;
	text-decoration: none;
	color: inherit;
	transition: background 0.15s;
}

.efs-club-list__link:hover {
	background: color-mix(in srgb, currentColor 5%, transparent);
}

.efs-club-list__logo {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.efs-club-list__logo img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.efs-club-list__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

.efs-club-list__name {
	font-weight: 700;
}

.efs-club-list__meta {
	font-size: 0.8rem;
	color: var(--wp--preset--color--text-secondary, #6b7280);
}

.efs-club-list__rank {
	flex: 0 0 auto;
	font-variant-numeric: tabular-nums;
	font-weight: 800;
	color: var(--wp--preset--color--text-secondary, #6b7280);
}

.efs-club-list__arrow {
	flex: 0 0 auto;
	width: 0.5rem;
	height: 0.5rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
	opacity: 0.4;
}

/* ---------- Club detail ---------- */
.efs-club-detail__back {
	margin: 0 0 1rem;
}

.efs-club-detail__back a {
	text-decoration: none;
	font-weight: 700;
	color: var(--wp--preset--color--primary, #1f2937);
}

.efs-club-head {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.efs-club-head__logo {
	flex: 0 0 auto;
	object-fit: contain;
}

.efs-club-head__name {
	margin: 0 0 0.25rem;
}

.efs-club-head__facts {
	margin: 0;
	font-size: 0.9rem;
	color: var(--wp--preset--color--text-secondary, #6b7280);
}

.efs-club-detail__stats {
	margin-bottom: 2rem;
}

/* The page header already shows crest + name, so hide the stats card's own
   logo/name here and keep just the form row. */
.efs-club-detail .efs-team-card__logo,
.efs-club-detail .efs-team-card__name {
	display: none;
}

.efs-club-detail .efs-team-card__head {
	margin-bottom: 1rem;
}

.efs-club-detail__matches {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5rem;
}

.efs-club-fixtures__title {
	margin: 0 0 0.75rem;
	font-size: 1rem;
}

@media (max-width: 781px) {
	.efs-club-detail__matches {
		grid-template-columns: 1fr;
	}
}

.efs-club-head__contact {
	margin: 0.5rem 0 0;
	font-size: 0.9rem;
}

.efs-club-head__link {
	font-weight: 700;
	text-decoration: none;
	color: var(--wp--preset--color--primary, #1f2937);
}

.efs-club-head__link:hover {
	text-decoration: underline;
}

.efs-club-head__sep {
	color: var(--wp--preset--color--text-secondary, #6b7280);
}
