/* ==========================================================================
   Styles globaux - Thème Dark Sport Auto / Formule 1
   ========================================================================== */

:root {
	--bg-primary: #0d1117;
	--bg-surface: #161b22;
	--bg-elevated: #1f2630;
	--border-color: #30363d;
	--text-primary: #f0f6fc;
	--text-muted: #9ca3af;
	--f1-red: #e10600;
	--f1-red-hover: #ff1e14;
	--accent-gold: #f59e0b;
	--radius-md: 10px;
	--radius-lg: 14px;
	--container-max: 1180px;
	--transition-fast: 0.2s ease;
}

/* Bascule Thème Clair / Sombre 100 % CSS + suivi automatique du thème système */
.theme-toggle {
	display: none;
}

@media (prefers-color-scheme: light) {
	body:not(:has(#theme-toggle:checked)) {
		--bg-primary: #f1f5f9;
		--bg-surface: #ffffff;
		--bg-elevated: #e2e8f0;
		--border-color: #cbd5e1;
		--text-primary: #0f172a;
		--text-muted: #475569;
		background-image:
			radial-gradient(circle at 15% 10%, rgba(225, 6, 0, 0.06), transparent 35%),
			radial-gradient(circle at 85% 20%, rgba(54, 113, 198, 0.06), transparent 40%);
	}

	body:not(:has(#theme-toggle:checked)) .site-header {
		background-color: rgba(255, 255, 255, 0.94);
	}
}

body:has(#theme-toggle:checked) {
	--bg-primary: #f1f5f9;
	--bg-surface: #ffffff;
	--bg-elevated: #e2e8f0;
	--border-color: #cbd5e1;
	--text-primary: #0f172a;
	--text-muted: #475569;
	background-image:
		radial-gradient(circle at 15% 10%, rgba(225, 6, 0, 0.06), transparent 35%),
		radial-gradient(circle at 85% 20%, rgba(54, 113, 198, 0.06), transparent 40%);
}

body:has(#theme-toggle:checked) .site-header {
	background-color: rgba(255, 255, 255, 0.94);
}

body:has(#theme-toggle:checked) .hero-f1 {
	background: linear-gradient(135deg, #ffffff 0%, #fef2f2 60%, #fee2e2 100%);
}

body:has(#theme-toggle:checked) .f1-card {
	background: var(--bg-surface);
}

body:has(#theme-toggle:checked) .theme-label-dark {
	display: none;
}

body:has(#theme-toggle:checked) .theme-label-light {
	display: inline;
}

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

html {
	scroll-behavior: smooth;
}

html,
body {
	margin: 0;
	padding: 0;
	min-height: 100vh;
	background-color: var(--bg-primary);
	background-image:
		radial-gradient(circle at 15% 10%, rgba(225, 6, 0, 0.09), transparent 35%),
		radial-gradient(circle at 85% 20%, rgba(54, 113, 198, 0.07), transparent 40%);
	color: var(--text-primary);
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	line-height: 1.6;
}

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

@keyframes pulseBadge {
	0%, 100% {
		box-shadow: 0 0 0 0 rgba(225, 6, 0, 0.45);
	}
	50% {
		box-shadow: 0 0 0 6px rgba(225, 6, 0, 0);
	}
}

body {
	display: flex;
	flex-direction: column;
}

main {
	flex: 1;
	width: 100%;
	max-width: var(--container-max);
	margin: 0 auto;
	padding: 2rem 1.25rem 3rem;
}

h1,
h2,
h3 {
	margin-top: 0;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

h1 {
	font-size: clamp(1.75rem, 3.2vw, 2.6rem);
}

h2 {
	font-size: clamp(1.3rem, 2.2vw, 1.75rem);
}

p {
	color: var(--text-muted);
}

a {
	color: #58a6ff;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

:focus-visible {
	outline: 2px solid var(--f1-red);
	outline-offset: 2px;
}

img {
	max-width: 100%;
	height: auto;
}

.section-header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
	margin: 2.5rem 0 1.25rem;
	padding-bottom: 0.6rem;
	border-bottom: 2px solid transparent;
	border-image: linear-gradient(90deg, var(--f1-red) 0%, var(--f1-red) 90px, var(--border-color) 90px) 1;
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.6rem 1.15rem;
	background-color: var(--f1-red);
	color: #ffffff;
	border: none;
	border-radius: 6px;
	font-weight: 700;
	font-size: 0.95rem;
	cursor: pointer;
	text-decoration: none;
	transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.btn:hover {
	background-color: var(--f1-red-hover);
	text-decoration: none;
	transform: translateY(-1px);
}

.btn-outline {
	background-color: transparent;
	border: 1px solid var(--border-color);
	color: var(--text-primary);
}

.btn-outline:hover {
	background-color: var(--bg-elevated);
	border-color: var(--text-muted);
}

.badge {
	display: inline-block;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 700;
	background-color: var(--bg-elevated);
	border: 1px solid var(--border-color);
	color: var(--text-primary);
}

.badge-red {
	background-color: rgba(225, 6, 0, 0.16);
	border-color: var(--f1-red);
	color: #ff6b66;
}

.badge-gold {
	background-color: rgba(245, 158, 11, 0.16);
	border-color: var(--accent-gold);
	color: #fbbf24;
}

body:has(#theme-toggle:checked) .badge-gold {
	color: #b45309;
}

@media (max-width: 768px) {
	main {
		padding: 1.25rem 1rem 2rem;
	}
}

/* Bannière de mise en avant du Live */
.top-live-banner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.65rem 1rem;
	padding: 0.55rem 1.25rem;
	background: linear-gradient(90deg, rgba(225, 6, 0, 0.22), rgba(225, 6, 0, 0.08) 50%, rgba(225, 6, 0, 0.22));
	border-bottom: 1px solid rgba(225, 6, 0, 0.45);
	color: var(--text-primary);
	font-size: 0.88rem;
	text-decoration: none;
	transition: background-color var(--transition-fast);
}

.top-live-banner:hover {
	background-color: rgba(225, 6, 0, 0.16);
	text-decoration: none;
}

.top-live-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.15rem 0.6rem;
	border-radius: 999px;
	background-color: var(--f1-red);
	color: #ffffff;
	font-size: 0.74rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.top-live-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background-color: #ffffff;
	animation: pulseBadge 1.5s infinite;
}

.top-live-cta {
	color: #ff6b66;
	font-weight: 700;
}

body:has(#theme-toggle:checked) .top-live-cta {
	color: var(--f1-red);
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
