/* Rank change coloring */
.positive_rank_change {
	color: #1ec773;
}
.green-arrow {
	color: #1ec773;
}
.rank-down {
	color: #dc3545;
	font-weight: bold;
}
.points_value {
	font-weight: bold;
}
.negative_rank_change, .round_transfers_col {
	color: #ff4d4f;
}

/* Table column alignment by semantic class */
th.rank_col, td.rank_col {
	text-align: left;
}
th.player_col, td.player_col, th.entry_col, td.entry_col {
	text-align: left;
}
th.round_col, td.round_col {
	text-align: center;
}
th.points_col, td.points_col {
	text-align: right;
}

/* Reduce padding for round subcolumns */
table.league_standings td[class^="round_"] {
	padding-left: 0.1rem;
	padding-right: 0.1rem;
}

body {
	background: #00143C;
	color: #fff;
	font-family: 'Inter', sans-serif;
	margin: 0;
	padding: 0;
  font-size: 15px;
}
h1 {
	font-family: 'Sora', sans-serif;
	text-align: center;
	font-size: 2.2rem;
	margin-bottom: 1.5rem;
}
.logo-container {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	margin-bottom: 0.5rem;
	margin-top: 2rem;
}
.logo-container > div {
	width: 250px;
	max-width: 100vw;
}
table {
	margin: 2rem auto;
	border-collapse: collapse;
	font-size: 1rem;
	background: #1f295C;
	border-radius: 8px;
	overflow: hidden;
	max-width: 95vw;
}

.chart-container {
	margin: 2rem auto 0.5rem;
	text-align: center;
}

.stats-records-wrapper {
	display: flex;
	gap: 1.5rem;
	justify-content: center;
	margin: 2rem auto;
	max-width: 80vw;
}

.stats-records-wrapper .stats-container h2 {
	margin-top: 0;
}

.stats-records-wrapper .stats-container {
	flex: 1;
	margin: 0;
	max-width: none;
}

.stats-container {
	margin: 0.5rem auto;
	max-width: 60vw;
}

.stats-list {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.5rem 1rem;
	align-items: baseline;
	font-size: 1.1rem;
}

.stats-list dt {
	font-weight: bold;
	text-align: right;
	white-space: nowrap;
}

.stats-list dd {
	margin: 0;
	text-align: left;
}

th, td {
	padding: 0.7rem 1.2rem;
	text-align: center;
	line-height: 1rem;
}
th {
	background: #3E7DEE;
	color: #fff;
	font-family: 'Sora Regular', sans-serif;
	font-size: 1.1em;
}

tr:nth-child(even) {
	background: rgba(255, 255, 255, 0.05);
}
/*
tr:nth-child(odd) {
	background: #023493;
}
  */

@media (max-width: 768px) {
	table {
		font-size: 1rem;
	}
	th, td {
		padding: 0.5rem 0.7rem;
	}
	.stats-records-wrapper {
		flex-direction: column;
		max-width: 95vw;
	}
	.stats-container {
		max-width: 95vw;
	}
}

/* Logo SVG styling (no id="logo" in SVG) */
.logo-container > div > svg * {
	fill: #fff !important;
}
.logo-container > div > svg {
	width: 100% !important;
	height: auto !important;
	display: block;
}

/* league gameweek history styling */
.gw_history th,
.gw_history td {
	border: 1px solid rgba(255, 255, 255, 0.1)
}
.gw_history th {
	font-size: .9rem;
}
.gw_history th.participant {
	font-weight: normal;
	text-align: left;
	min-width: 170px;
}

.gw_history .manager_name {
	display: block;
}

.gw_history .team_name {
	display: block;
	font-size: .8rem;
	color: rgba(255, 255, 255, 0.7)
}

.gw_history th.golden_gameweek {
	background-color: #F06848;
}

.gw_history td {
	color: rgba(255, 255, 255, 0.8);
}

.gw_history td.round_rank_1 {
	font-weight: bold;
	color: #fff;
	text-decoration: underline;
	background-color: rgba(0,0,0,0.2);
}
.gw_history td.golden_gameweek.round_rank_1 {
	background-color: gold;
	color: #000;
}
.gw_history td.is_loser {
	background-image: url('assets/The Duck liten.png');
	background-repeat: no-repeat;
	background-position: top right;
	background-size: 20px auto;
}
.gw_history .team_header {
	float: left;
}
.gw_history .gw_header {
	float: right;
}
.gw_history th > .team_header, 
.gw_history th > .gw_header {
	display: inline-block;
	min-width: 3em;
}

.gw_history .gw_is_in_future,
.gw_history .gw_hidden {
	display: none;
}

/* Medal icons in standings */
.medal-icon {
	max-height: 18px;
}

/* ===== Narrative Article Page — Newspaper Edition ===== */

.narrative-page {
	--nr-paper: #F5F0E8;
	--nr-ink: #1C1917;
	--nr-accent: #8B1A1A;
	--nr-muted: #78716C;
	--nr-rule: #C4BAA8;
	--nr-highlight: #EDE8DD;
	background: var(--nr-paper);
	animation: narrativeFadeIn 0.6s ease-out;
}

body:has(.narrative-page) {
	background: #F5F0E8;
}

@keyframes narrativeFadeIn {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Hero — full-bleed image fading into paper */
.narrative-hero {
	position: relative;
	width: 100%;
	max-height: 520px;
	overflow: hidden;
}
.narrative-hero img {
	width: 100%;
	max-height: 520px;
	object-fit: cover;
	object-position: center 20%;
	display: block;
}
.narrative-hero-fade {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 45%;
	background: linear-gradient(to top, #F5F0E8 0%, rgba(245, 240, 232, 0.8) 40%, transparent 100%);
	pointer-events: none;
}

/* Header — newspaper masthead */
.narrative-header {
	text-align: center;
	padding: 0 1.5rem 0.5rem;
	margin-top: 3rem;
	position: relative;
	z-index: 1;
}
.narrative-header-rule {
	width: 64px;
	height: 2px;
	background: var(--nr-accent);
	margin: 0 auto 1rem;
}
.narrative-kicker {
	font-family: 'Sora', sans-serif;
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	color: var(--nr-muted);
	margin: 0 0 0.8rem;
}
.narrative-title {
	font-family: 'DM Serif Display', Georgia, serif;
	font-size: 2.8rem;
	color: var(--nr-ink);
	margin: 0 0 0.6rem;
	line-height: 1.12;
	letter-spacing: -0.015em;
}
.narrative-subtitle {
	font-family: 'Sora', sans-serif;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.22em;
	color: var(--nr-accent);
	margin: 0;
	font-weight: 700;
}
/* Gameweek navigation — arrows flanking subtitle */
.narrative-gw-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
}
.gw-nav-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	font-size: 1.6rem;
	line-height: 1;
	color: var(--nr-muted);
	text-decoration: none;
	border-radius: 50%;
	transition: color 0.2s, background 0.2s;
	user-select: none;
}
.gw-nav-arrow:hover {
	color: var(--nr-accent);
	background: var(--nr-highlight);
}
.gw-nav-arrow[hidden] {
	visibility: hidden;
}

/* Footer gameweek navigation */
.narrative-gw-nav-footer {
	padding: 1rem 0;
	margin-bottom: 0.8rem;
	border-bottom: 1px solid var(--nr-rule);
}
.gw-nav-link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0.4rem 1rem;
	font-family: 'Sora', sans-serif;
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--nr-muted);
	text-decoration: none;
	border-radius: 4px;
	transition: color 0.2s, background 0.2s;
}
.gw-nav-link:hover {
	color: var(--nr-accent);
	background: var(--nr-highlight);
}
.gw-nav-link[hidden] {
	display: none;
}

.narrative-byline {
	font-family: 'Source Serif 4', Georgia, serif;
	font-size: 0.85rem;
	color: var(--nr-muted);
	margin: 1.2rem 0 0;
}
.narrative-byline strong {
	color: var(--nr-ink);
	font-weight: 700;
}
.narrative-byline-title {
	color: var(--nr-muted);
	font-style: italic;
}

/* Nav — editorial links */
.narrative-nav {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.6rem;
	padding: 0.3rem 0;
	flex-wrap: wrap;
}
.narrative-nav a {
	color: var(--nr-muted);
	text-decoration: none;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-weight: 700;
	padding: 0.25rem 0;
	border-bottom: 1.5px solid transparent;
	transition: color 0.2s, border-color 0.2s;
}
.narrative-nav a:hover {
	color: var(--nr-ink);
	border-bottom-color: var(--nr-accent);
}
.narrative-nav-dot {
	color: var(--nr-rule);
	font-size: 1.1rem;
	line-height: 1;
}

/* Article body — newspaper serif typography */
.narrative-article {
	max-width: 660px;
	margin: 0 auto;
	padding: 1.5rem 1.5rem 3rem;
	font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
	font-size: 1.1rem;
	line-height: 1.78;
	color: var(--nr-ink);
}

/* Drop cap on the opening paragraph */
.narrative-article > p:first-child::first-letter {
	font-family: 'DM Serif Display', serif;
	float: left;
	font-size: 4.2rem;
	line-height: 0.78;
	padding-right: 0.12em;
	padding-top: 0.06em;
	color: var(--nr-accent);
}

.narrative-article h2 {
	font-family: 'DM Serif Display', serif;
	font-size: 1.45rem;
	color: var(--nr-ink);
	margin-top: 2.5rem;
	margin-bottom: 0.5rem;
	padding-left: 0;
	line-height: 1.3;
}

.narrative-article p {
	margin: 0 0 1.2rem;
}

.narrative-article strong {
	color: var(--nr-ink);
	font-weight: 700;
}

.narrative-article em {
	color: inherit;
}

/* Pull quotes — large newspaper style with quotation marks */
.narrative-article blockquote {
	position: relative;
	margin: 2.5rem -4rem 2.5rem -4rem;
	padding: 1.8rem 3rem 1.5rem 3.5rem;
	border-left: none;
	border-top: 2px solid var(--nr-ink);
	border-bottom: 1px solid var(--nr-rule);
	font-family: 'DM Serif Display', serif;
	font-size: 1.55rem;
	font-style: italic;
	color: var(--nr-ink);
	background: none;
	line-height: 1.45;
	text-align: center;
}
.narrative-article blockquote::before {
	content: '\201C';
	position: absolute;
	top: 0.55rem;
	left: 0.5rem;
	font-family: 'DM Serif Display', Georgia, serif;
	font-size: 4rem;
	line-height: 1;
	color: var(--nr-rule);
	font-style: normal;
}
.narrative-article blockquote::after {
	content: '\201D';
	position: absolute;
	bottom: 0.3rem;
	right: 0.5rem;
	font-family: 'DM Serif Display', Georgia, serif;
	font-size: 4rem;
	line-height: 1;
	color: var(--nr-rule);
	font-style: normal;
}
.narrative-article blockquote p {
	margin: 0;
}

/* Section dividers */
.narrative-article hr {
	border: none;
	height: 1px;
	background: var(--nr-rule);
	margin: 2.5rem 0;
}

/* Lists — compact with editorial dashes */
.narrative-article ul {
	margin: 1rem 0;
	padding-left: 0;
	list-style: none;
}
.narrative-article li {
	padding-left: 1.4rem;
	margin-bottom: 0.25rem;
	position: relative;
}
.narrative-article li::before {
	content: '\2014';
	position: absolute;
	left: 0;
	top: 0;
	color: var(--nr-muted);
}

/* Fact boxes — newspaper sidebar */
.narrative-article .fact-box {
	background: var(--nr-highlight);
	border: 1px solid var(--nr-rule);
	border-radius: 0;
	padding: 1.2rem 1.4rem;
	margin: 2rem 0;
	font-size: 0.92rem;
	line-height: 1.65;
}
.narrative-article .fact-box > p:first-child {
	font-family: 'Sora', sans-serif;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	color: var(--nr-accent);
	margin: 0 0 0.8rem;
	padding-bottom: 0.6rem;
	border-bottom: 1px solid var(--nr-rule);
	line-height: 1.3;
}
.narrative-article .fact-box > p:first-child strong {
	color: var(--nr-accent);
	font-weight: 700;
}
/* Override drop cap inside fact boxes */
.narrative-article .fact-box > p:first-child::first-letter {
	float: none;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	padding: 0;
	color: inherit;
}
.narrative-article .fact-box ul {
	margin: 0.4rem 0 0;
}
.narrative-article .fact-box li {
	margin-bottom: 0.2rem;
	font-size: 0.9rem;
}

/* Footer — compact colophon with nav */
.narrative-footer {
	max-width: 660px;
	margin: 0 auto;
	text-align: center;
	padding: 1.2rem 1.5rem 3rem;
	border-top: 1px solid var(--nr-rule);
}
.narrative-footer p {
	color: var(--nr-muted);
	font-size: 0.75rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	margin: 0.5rem 0 0;
}

/* 404 — not-found state */
.narrative-not-found {
	max-width: 660px;
	margin: 0 auto;
	padding: 2rem 1.5rem 3rem;
	text-align: center;
}
.narrative-not-found img {
	width: 220px;
	max-width: 60%;
	height: auto;
	border-radius: 8px;
	margin-bottom: 1.8rem;
	border: 1px solid var(--nr-rule);
}
.narrative-not-found h2 {
	font-family: 'DM Serif Display', Georgia, serif;
	font-size: 1.6rem;
	color: var(--nr-ink);
	margin: 0 0 1rem;
	line-height: 1.25;
}
.narrative-not-found p {
	font-family: 'Source Serif 4', Georgia, serif;
	font-size: 1.05rem;
	line-height: 1.7;
	color: var(--nr-muted);
	margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
	.narrative-hero {
		max-height: 380px;
	}
	.narrative-hero img {
		max-height: 380px;
	}
	.narrative-header {
		margin-top: -2rem;
	}
	.narrative-title {
		font-size: 2rem;
	}
	.narrative-subtitle {
		font-size: 0.7rem;
	}
	.narrative-nav {
		gap: 0.35rem;
	}
	.narrative-nav a {
		font-size: 0.65rem;
		letter-spacing: 0.08em;
	}
	.narrative-article {
		padding: 1rem 1.2rem 2rem;
		font-size: 1.02rem;
	}
	.narrative-article h2 {
		font-size: 1.25rem;
	}
	.narrative-article > p:first-child::first-letter {
		font-size: 3.2rem;
	}
	.narrative-article blockquote {
		margin-left: 0;
		margin-right: 0;
		padding: 1.2rem 1rem 1rem 2.5rem;
		font-size: 1.2rem;
	}
	.narrative-article blockquote::before {
		font-size: 3rem;
		left: 0.2rem;
		top: 0.4rem;
	}
	.narrative-article blockquote::after {
		font-size: 3rem;
		right: 0.2rem;
		bottom: 0.1rem;
	}
	.narrative-article .fact-box {
		padding: 1rem 1.1rem;
		font-size: 0.88rem;
	}
	.gw-nav-arrow {
		font-size: 1.4rem;
	}
	.gw-nav-link {
		font-size: 0.72rem;
		padding: 0.4rem 0.6rem;
	}
	.narrative-not-found {
		padding: 1.5rem 1.2rem 2rem;
	}
	.narrative-not-found img {
		width: 180px;
	}
	.narrative-not-found h2 {
		font-size: 1.3rem;
	}
	.narrative-not-found p {
		font-size: 0.95rem;
	}
}
