/*
 * Shared styles of every page: colors, reset and site header.
 */

:root {
	--ink: #0b1f3a;
	--ink-soft: #4a5a70;
	--accent: #ffd23f;
	--correct: #0b6b48;
	--wrong: #b42318;
	--bg: #eef1f5;
	--surface: #ffffff;
	--line: #d5dbe3;
	--muted: #8a96a6;
	--radius: 12px;
	--gap-height: 44px;
	--font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	height: 100%;
}

body {
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font);
	font-weight: 500;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}

button {
	font: inherit;
	color: inherit;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	/* No margin: a hidden paragraph after a full-height page would make it scroll. */
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Site header: site title on the left, competition badge on the right. */

.masthead {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
	background: var(--ink);
	color: #fff;
}

.masthead__title {
	margin: 0;
	font-size: 17px;
	font-weight: 800;
	letter-spacing: -0.01em;
}

/* The site title leads back to the splash screen. */
.masthead__home {
	color: inherit;
	text-decoration: none;
}

/* "Timeline.": the full stop in the accent color, as in the icon. */
.masthead__dot {
	color: var(--accent);
}

.masthead__home:hover {
	opacity: 0.85;
}

.masthead__home:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 3px;
	border-radius: 4px;
}

/* Right side of the header: language switcher, then the competition badge. */
.masthead__end {
	display: flex;
	align-items: center;
	gap: 14px;
}

.masthead__langs {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* Flags: the current language is fully visible and outlined, the others dimmed. */
.masthead__langs a {
	display: block;
	padding: 2px;
	border-radius: 4px;
	line-height: 0;
	opacity: 0.45;
	transition: opacity 0.15s;
}

.masthead__langs img {
	display: block;
	width: 24px;
	height: 16px;
	border-radius: 2px;
	object-fit: cover;
}

.masthead__langs a:hover {
	opacity: 1;
}

.masthead__langs a[aria-current="page"] {
	opacity: 1;
	box-shadow: 0 0 0 2px #fff;
}

.masthead__langs a:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
}

/* Account icon, after the flags: a bust, linked to the login form (menu.js). */
.masthead__account {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: -4px;
	border-radius: 50%;
	color: #fff;
	transition: background-color 0.15s;
}

.masthead__account svg {
	fill: currentColor;
}

.masthead__account:hover,
.masthead__account[aria-current="page"] {
	background: rgba(255, 255, 255, 0.16);
}

.masthead__account:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
}

.masthead__badge {
	flex: none;
	margin: 0;
	padding: 4px 10px;
	border-radius: 6px;
	background: var(--accent);
	color: var(--ink);
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	line-height: 1.2;
}


/* Site menu: burger button before the title, links dropping down under it (app/js/menu.js). */

.masthead__menu {
	position: relative;
	flex: none;
	display: flex;
}

/* The title follows the burger; the free space goes after it. */
.masthead__menu + .masthead__title {
	margin-right: auto;
}

.menu-toggle {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	margin: -4px 0 -4px -8px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: none;
	color: #fff;
	cursor: pointer;
}

.menu-toggle:hover,
.menu-toggle[aria-expanded="true"] {
	background: rgba(255, 255, 255, 0.12);
}

.menu-toggle:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 0;
}

/* Three bars: the span is the middle one, its pseudo-elements the others. */
.menu-toggle__bars,
.menu-toggle__bars::before,
.menu-toggle__bars::after {
	display: block;
	width: 20px;
	height: 2px;
	border-radius: 1px;
	background: currentColor;
}

.menu-toggle__bars {
	position: relative;
}

.menu-toggle__bars::before,
.menu-toggle__bars::after {
	content: "";
	position: absolute;
	left: 0;
}

.menu-toggle__bars::before {
	top: -6px;
}

.menu-toggle__bars::after {
	top: 6px;
}

.menu {
	position: absolute;
	top: calc(100% + 12px);
	left: -8px;
	z-index: 100;
	min-width: 220px;
	padding: 6px;
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: 0 16px 40px rgba(11, 31, 58, 0.28);
	animation: menu-in 0.15s ease-out both;
}

.menu[hidden] {
	display: none;
}

.menu__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.menu__link {
	display: flex;
	align-items: center;
	min-height: 48px;
	padding: 0 14px;
	border-radius: 8px;
	color: var(--ink);
	font-size: 17px;
	font-weight: 700;
	text-decoration: none;
}

.menu__link:hover {
	background: var(--bg);
}

.menu__link:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: -3px;
}

/* Current page: a yellow mark on the left. */
.menu__link[aria-current="page"] {
	box-shadow: inset 4px 0 0 var(--accent);
	background: var(--bg);
}

/* Language switcher (app/js/menu.js): the flags in a row from 600 px; below, the flag of the
   current language opens a dropdown of the six languages, with their names. Without the
   script, the flags stay in a row. */
.masthead__lang-toggle,
.masthead__lang-name {
	display: none;
}

.masthead__lang-list {
	display: flex;
	align-items: center;
	gap: 8px;
}

@media (max-width: 599px) {
	.masthead__langs--dropdown {
		position: relative;
	}

	.masthead__langs--dropdown .masthead__lang-toggle {
		display: flex;
		align-items: center;
		gap: 5px;
		margin: -4px;
		padding: 6px 4px;
		border: 0;
		border-radius: 6px;
		background: none;
		color: #fff;
		cursor: pointer;
	}

	.masthead__lang-toggle:hover,
	.masthead__lang-toggle[aria-expanded="true"] {
		background: rgba(255, 255, 255, 0.12);
	}

	.masthead__lang-toggle:focus-visible {
		outline: 3px solid var(--accent);
		outline-offset: 0;
	}

	.masthead__lang-toggle img {
		box-shadow: 0 0 0 2px #fff;
	}

	/* A small triangle pointing down. */
	.masthead__lang-caret {
		width: 0;
		height: 0;
		border-top: 5px solid currentColor;
		border-right: 4px solid transparent;
		border-left: 4px solid transparent;
	}

	.masthead__langs--dropdown .masthead__lang-list {
		position: absolute;
		top: calc(100% + 12px);
		right: -8px;
		z-index: 100;
		display: none;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		min-width: 180px;
		padding: 6px;
		border-radius: var(--radius);
		background: var(--surface);
		box-shadow: 0 16px 40px rgba(11, 31, 58, 0.28);
		animation: menu-in 0.15s ease-out both;
	}

	.masthead__langs--dropdown.is-open .masthead__lang-list {
		display: flex;
	}

	.masthead__langs--dropdown .masthead__lang-list a {
		display: flex;
		align-items: center;
		gap: 12px;
		min-height: 44px;
		padding: 0 12px;
		border-radius: 8px;
		color: var(--ink);
		font-size: 16px;
		font-weight: 700;
		line-height: 1.2;
		text-decoration: none;
		opacity: 1;
	}

	.masthead__langs--dropdown .masthead__lang-list a:hover {
		background: var(--bg);
	}

	.masthead__langs--dropdown .masthead__lang-list a:focus-visible {
		outline: 3px solid var(--accent);
		outline-offset: -3px;
	}

	/* Current language: a yellow mark on the left, as in the menu. */
	.masthead__langs--dropdown .masthead__lang-list a[aria-current="page"] {
		box-shadow: inset 4px 0 0 var(--accent);
		background: var(--bg);
	}

	.masthead__langs--dropdown .masthead__lang-list img {
		width: 24px;
		height: 16px;
	}

	.masthead__langs--dropdown .masthead__lang-name {
		display: inline;
	}
}

@keyframes menu-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.menu,
	.masthead__lang-list {
		animation: none;
	}
}

/* Phones: burger, title, flag of the language and badge must still fit on one line, down to 320 px. */
@media (max-width: 439px) {
	.masthead {
		gap: 8px;
		padding-right: 12px;
		padding-left: 12px;
	}

	.masthead__title {
		font-size: 15px;
		white-space: nowrap;
	}

	.menu-toggle {
		width: 34px;
		margin-left: -6px;
	}

	.masthead__end {
		gap: 6px;
	}

	.masthead__langs {
		gap: 0;
	}

	.masthead__langs img {
		width: 18px;
		height: 12px;
	}

	/* "Champions League" is shortened to "Champions" so that the badge still fits. */
	.masthead__badge-more {
		display: none;
	}

	.masthead__badge {
		padding: 4px 7px;
		font-size: 11px;
		letter-spacing: 0.04em;
	}
}

@media (min-width: 960px) {
	.masthead__title {
		font-size: 22px;
	}

	.masthead__badge {
		font-size: 13px;
		padding: 5px 12px;
	}
}

/* The cookie entry of the menu is a button: same look as the links. */
button.menu__link {
	width: 100%;
	border: 0;
	background: none;
	font-family: inherit;
	text-align: left;
	cursor: pointer;
}

/* Cookie banner (app/js/consent.js): fixed at the bottom until the visitor chooses. */
.consent {
	position: fixed;
	right: 12px;
	bottom: calc(12px + env(safe-area-inset-bottom));
	left: 12px;
	z-index: 200;
	max-width: 560px;
	margin: 0 auto;
	padding: 16px;
	border-radius: var(--radius);
	background: var(--ink);
	color: #fff;
	box-shadow: 0 16px 40px rgba(11, 31, 58, 0.35);
}

.consent[hidden] {
	display: none;
}

.consent__text {
	margin: 0 0 12px;
	font-size: 15px;
	line-height: 1.4;
}

.consent__actions {
	display: flex;
	gap: 8px;
}

.consent__button {
	flex: 1;
	min-height: 44px;
	border: 2px solid var(--accent);
	border-radius: 8px;
	background: transparent;
	color: #fff;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
}

.consent__button:hover {
	background: var(--accent);
	color: var(--ink);
}

.consent__button:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

/* Site footer (app/js/menu.js): the links of the menu and the partner site, on one line that
   wraps on small screens (spaced, without separators, so that a wrapped line starts clean). At the bottom of the screen on short pages: the page wrappers are
   flex columns of the full height. */
.site-footer {
	margin-top: auto;
	padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
	background: var(--ink);
	color: #fff;
}

/* Always one line: the text shrinks with the screen, and scrolls sideways as a last resort. */
.site-footer__links {
	display: flex;
	align-items: center;
	justify-content: safe center;
	gap: 0 clamp(2px, 1.2vw, 14px);
	margin: 0;
	padding: 0;
	overflow-x: auto;
	list-style: none;
	white-space: nowrap;
	scrollbar-width: none;
}

.site-footer__links > li {
	flex: none;
}

/* Links and the Cookies button look the same. */
.site-footer__link {
	display: block;
	padding: 6px 3px;
	line-height: 20px;
	border: 0;
	background: none;
	color: rgba(255, 255, 255, 0.75);
	font-family: inherit;
	font-size: clamp(10px, 3.05vw, 13px);
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

/* Optical centering: the box is trimmed to the capital letters, without the room left for the
   accents above and the descenders below, so the words sit in the middle of the band. */
@supports (text-box: trim-both cap alphabetic) {
	.site-footer__link {
		padding: 12px 3px;
		text-box: trim-both cap alphabetic;
	}
}

/* Wide screens: the links always fit, no scrolling area. */
@media (min-width: 720px) {
	.site-footer__links {
		overflow: visible;
	}
}

.site-footer__link:hover,
.site-footer__link[aria-current="page"] {
	color: #fff;
	text-decoration: underline;
	text-decoration-color: var(--accent);
	text-underline-offset: 3px;
}

.site-footer__link:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 0;
	border-radius: 4px;
}
