/*
 * Team Fixtures Manager – frontend.
 * Colours come from the active theme (Extendable presets on menikeas.com.cy),
 * with the site's values as fallbacks. Override any of them in Football → Settings.
 */
.tfm {
	--tfm-primary: var(--wp--preset--color--primary, #007ddb);
	--tfm-on-primary: #fff;
	--tfm-ink: var(--wp--preset--color--foreground, #12141d);
	--tfm-ink-alt: var(--wp--preset--color--foreground-alt, #4b4b4b);
	--tfm-navy: #143852;
	--tfm-tint: var(--wp--preset--color--tertiary, #f5f7fa);
	--tfm-bg: var(--wp--preset--color--background, #fff);
	--tfm-line: color-mix(in srgb, var(--tfm-ink) 12%, transparent);
	--tfm-own-bg: color-mix(in srgb, var(--tfm-primary) 10%, var(--tfm-bg));
	--tfm-win: #1e9e5a;
	--tfm-draw: #8c8c8c;
	--tfm-loss: #d0342c;
	--tfm-radius: 0;
	--tfm-logo: 56px;

	color: var(--tfm-ink);
	font-family: inherit;
	line-height: 1.4;
	box-sizing: border-box;
	max-width: 100%;
}
.tfm *,
.tfm *::before,
.tfm *::after { box-sizing: inherit; }

.tfm .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	border: 0;
	white-space: nowrap;
}

.tfm .tfm-title { margin: 0 0 16px; font-family: inherit; font-weight: 600; text-align: center; }
.tfm-empty {
	text-align: center;
	color: var(--tfm-ink-alt);
	padding: 32px 16px;
	background: var(--tfm-tint);
	margin: 0;
}

/* ---------- Tabs (season / competition) ---------- */
.tfm-tabs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0 0 22px;
}
.tfm .tfm-tab,
.tfm .tfm-tab:visited {
	display: inline-block;
	padding: 8px 16px;
	border: 1px solid var(--tfm-primary);
	border-radius: var(--tfm-radius);
	color: var(--tfm-primary);
	background: var(--tfm-bg);
	font-weight: 500;
	font-size: 14px;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color .15s, color .15s;
}
.tfm .tfm-tab:hover,
.tfm .tfm-tab:focus-visible { background: var(--tfm-own-bg); color: var(--tfm-primary); }
.tfm .tfm-tab.is-active,
.tfm .tfm-tab.is-active:visited { background: var(--tfm-primary); color: var(--tfm-on-primary); }

/* ---------- Month headers ---------- */
.tfm .tfm-month {
	font-family: inherit;
	line-height: 1.3;
	margin: 26px 0 0;
	padding: 0 0 6px;
	border-bottom: 2px solid var(--tfm-primary);
	color: var(--tfm-navy);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.tfm .tfm-month:first-child { margin-top: 0; }

/* ---------- Match cards ---------- */
.tfm-card {
	display: grid;
	gap: 12px;
	padding: 22px 16px;
	border-bottom: 1px solid var(--tfm-line);
	text-align: center;
	background: var(--tfm-bg);
}
.tfm-list > .tfm-card:nth-of-type(even) { background: var(--tfm-tint); }
.tfm-card__meta {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	font-size: 13px;
	color: var(--tfm-ink-alt);
}
.tfm-card__date { color: var(--tfm-ink); font-weight: 600; font-size: 14px; }
.tfm-card__comp {
	display: block;
	color: var(--tfm-primary);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .05em;
	text-transform: uppercase;
	margin: 0;
}
.tfm-card__tbc { font-style: italic; }
.tfm-card__teams {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 12px;
}
.tfm-team {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	min-width: 0;
	font-weight: 600;
	text-align: center;
}
.tfm-team__name { overflow-wrap: anywhere; }
.tfm-team.is-own .tfm-team__name { color: var(--tfm-navy); }
.tfm-card__center { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 70px; }
.tfm-vs { color: var(--tfm-ink-alt); font-weight: 500; font-size: 14px; }
.tfm-score {
	display: inline-flex;
	gap: 8px;
	font-size: 32px;
	font-weight: 800;
	line-height: 1;
	color: var(--tfm-ink);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.tfm-score__sep { font-weight: 600; }
.tfm-score__extra { font-size: 12px; color: var(--tfm-ink-alt); }
.tfm-card__venue {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	font-size: 12px;
	color: var(--tfm-ink-alt);
	margin: 0;
}

/* Logos */
.tfm-logo {
	width: var(--tfm-logo);
	height: var(--tfm-logo);
	object-fit: contain;
	flex: 0 0 auto;
	display: block;
}
.tfm-logo--placeholder {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--tfm-navy);
	color: #fff;
	font-weight: 800;
	font-size: calc(var(--tfm-logo) * .32);
	line-height: 1;
	letter-spacing: .02em;
}
.tfm-logo--sm { --tfm-logo: 26px; }
.tfm-logo--lg { --tfm-logo: 72px; }
.tfm-logo--xl { --tfm-logo: 96px; }

/* Buttons */
.tfm .tfm-button,
.tfm .tfm-button:visited {
	justify-self: center;
	display: inline-block;
	padding: 8px 18px;
	border-radius: var(--tfm-radius);
	background: var(--tfm-primary);
	color: var(--tfm-on-primary);
	font-weight: 500;
	font-size: 13px;
	line-height: 1.3;
	text-decoration: none;
	transition: filter .15s;
}
.tfm .tfm-button:hover,
.tfm .tfm-button:focus-visible { color: var(--tfm-on-primary); filter: brightness(.9); }
.tfm a:focus-visible { outline: 2px solid var(--tfm-primary); outline-offset: 2px; }

/* W / D / L badges */
.tfm-card__outcome { display: flex; justify-content: center; }
.tfm-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: var(--tfm-radius);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
}
.tfm-badge--sm { width: 18px; height: 18px; font-size: 10px; }
.tfm-badge--w { background: var(--tfm-win); }
.tfm-badge--d { background: var(--tfm-draw); }
.tfm-badge--l { background: var(--tfm-loss); }

/* Status tags */
.tfm-tag {
	display: inline-block;
	margin-top: 4px;
	padding: 2px 8px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: #fff;
	background: var(--tfm-ink-alt);
}
.tfm-tag--postponed { background: #b7791f; }
.tfm-tag--cancelled,
.tfm-tag--abandoned { background: var(--tfm-loss); }
.tfm-card.is-postponed .tfm-card__date,
.tfm-card.is-cancelled .tfm-card__date { text-decoration: line-through; }

/* Compact */
.tfm--compact .tfm-card { padding: 12px; gap: 8px; }
.tfm--compact { --tfm-logo: 36px; }
.tfm--compact .tfm-score { font-size: 22px; }

/* ---------- League table ---------- */
.tfm-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tfm-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	margin: 0;
	font-variant-numeric: tabular-nums;
}
.tfm-table thead th {
	background: var(--tfm-navy);
	color: #fff;
	font-weight: 600;
	padding: 10px 6px;
	text-align: center;
	border: 0;
	white-space: nowrap;
}
.tfm-table abbr { text-decoration: none; border: 0; cursor: help; }
.tfm-table td,
.tfm-table tbody th {
	padding: 9px 6px;
	text-align: center;
	border: 0;
	border-bottom: 1px solid var(--tfm-line);
	font-weight: 400;
}
.tfm-table tbody tr:nth-child(even) { background: var(--tfm-tint); }
.tfm-table .tfm-col-team { text-align: left; width: 40%; }
.tfm-table .tfm-col-pos { width: 40px; }
.tfm-table .tfm-col-pts { font-weight: 800; }
.tfm-table thead .tfm-col-pts { font-weight: 700; }
.tfm-table-team { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.tfm-name-short { display: none; }
.tfm-deduct-mark { color: var(--tfm-loss); font-weight: 700; }
.tfm-form { display: inline-flex; gap: 2px; }
.tfm-table tbody tr.is-own {
	background: var(--tfm-own-bg);
	box-shadow: inset 4px 0 0 var(--tfm-primary);
}
.tfm-table tbody tr.is-own td,
.tfm-table tbody tr.is-own th { font-weight: 700; color: var(--tfm-navy); }
.tfm-table tbody tr.tfm-zone-top .tfm-col-pos { box-shadow: inset 4px 0 0 var(--tfm-win); }
.tfm-table tbody tr.tfm-zone-bottom .tfm-col-pos { box-shadow: inset 4px 0 0 var(--tfm-loss); }
.tfm-table-foot { font-size: 12px; color: var(--tfm-ink-alt); margin-top: 10px; }
.tfm-table-foot p { margin: 4px 0; }
.tfm-zones-legend { display: flex; gap: 16px; flex-wrap: wrap; }
.tfm-zone-key::before {
	content: "";
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-right: 6px;
	vertical-align: -1px;
}
.tfm-zone-key--top::before { background: var(--tfm-win); }
.tfm-zone-key--bottom::before { background: var(--tfm-loss); }

/* ---------- Next match ---------- */
.tfm-next {
	text-align: center;
	padding: 24px 16px;
	background: var(--tfm-tint);
	display: grid;
	gap: 10px;
	justify-items: center;
}
.tfm-next p { margin: 0; }
.tfm-next__label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--tfm-primary);
}
.tfm-next__teams {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 16px;
	width: 100%;
	max-width: 520px;
}
.tfm-next__date { font-weight: 600; }

/* ---------- Single match page ---------- */
.tfm-hero {
	text-align: center;
	padding: 28px 16px;
	background: var(--tfm-tint);
	margin-bottom: 24px;
}
.tfm-hero__comp {
	margin: 0 0 16px;
	color: var(--tfm-primary);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.tfm-hero__teams {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 16px;
	max-width: 640px;
	margin: 0 auto;
	font-size: 18px;
}
.tfm-hero__center { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tfm-score--xl { font-size: 48px; }
.tfm-hero__facts {
	list-style: none;
	margin: 20px 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 24px;
	font-size: 14px;
}
.tfm .tfm-hero__facts a { color: var(--tfm-primary); }
.tfm-match-nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-top: 32px;
	padding-top: 16px;
	border-top: 1px solid var(--tfm-line);
}
.tfm.tfm-match-nav a { display: flex; flex-direction: column; gap: 2px; color: var(--tfm-ink); text-decoration: none; }
.tfm-match-nav a span { font-size: 12px; color: var(--tfm-primary); font-weight: 600; }
.tfm-match-nav__next { text-align: right; }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
	.tfm { --tfm-logo: 44px; }
	.tfm-card { padding: 18px 12px; }
	.tfm-score { font-size: 26px; gap: 6px; }
	.tfm-card__center { min-width: 56px; }
	.tfm-table { font-size: 13px; }
	.tfm-table td,
	.tfm-table tbody th { padding: 8px 4px; }
	.tfm-table .tfm-hide-sm { display: none; }
	.tfm-table .tfm-col-team { width: auto; }
	.tfm-table-team { gap: 6px; }
	.tfm-hero__teams { font-size: 15px; gap: 10px; }
	.tfm-logo--xl { --tfm-logo: 64px; }
	.tfm-score--xl { font-size: 36px; }
}
@media (max-width: 420px) {
	.tfm-name-full { display: none; }
	.tfm-name-short { display: inline; }
}
