/* ============================================================
   Destins climatiques – feuille de styles principale
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
	--optimiste: #16a34a;
	--median: #ea580c;
	--pessimiste: #dc2626;
	--bg: #f0f6ff;
	--card-bg: #ffffff;
	--border: #e2e8f0;
	--text: #1e293b;
	--text-muted: #64748b;
	--accent: #0ea5e9;
	--accent-hover: #0284c7;
	--radius: 0.75rem;
	--shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ── Reset ──────────────────────────────────────────────────── */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: system-ui, sans-serif;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--text);
	background: var(--bg);
}

a {
	color: var(--accent);
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}

.container {
	width: min(960px, 100% - 2rem);
	margin-inline: auto;
	padding-block: 2rem;
}

/* ── Header ─────────────────────────────────────────────────── */
.home-header {
	text-align: center;
	padding-block: 2.5rem 1.5rem;
}
.home-header h1 {
	font-size: 2rem;
	color: var(--accent);
	margin-bottom: 0.5rem;
}
.home-header p {
	color: var(--text-muted);
}

/* ── Index : tuiles stats ───────────────────────────────────── */
.info-header {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1.5rem;
	margin: 2rem 0;
}
.stat-card {
	background: var(--card-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.5rem;
	text-align: center;
	box-shadow: var(--shadow);
}
.stat-card .icon {
	font-size: 2rem;
	display: block;
	margin-bottom: 0.5rem;
}
.stat-card h3 {
	font-size: 1.1rem;
	font-weight: 600;
	margin-bottom: 0.25rem;
	color: var(--accent);
}
.stat-card p {
	font-size: 0.9rem;
	color: var(--text-muted);
}

/* ── Boutons ────────────────────────────────────────────────── */
.btn-primary,
.btn-start {
	display: inline-block;
	padding: 0.9rem 2.5rem;
	background: var(--accent);
	color: #fff;
	border-radius: 0.5rem;
	font-weight: 600;
	border: none;
	cursor: pointer;
	transition: background 0.2s;
}
.btn-primary:hover,
.btn-start:hover {
	background: var(--accent-hover);
	text-decoration: none;
}

.btn-select {
	display: block;
	width: 100%;
	text-align: center;
	background: var(--accent);
	color: #fff;
	padding: 0.75rem;
	border-radius: var(--radius);
	font-weight: 600;
	border: none;
	cursor: pointer;
	transition: background 0.2s;
	margin-top: auto;
}
.btn-select:hover {
	filter: brightness(0.9);
	text-decoration: none;
}

.btn-secondary {
	padding: 0.6rem 1.25rem;
	border: 1px solid var(--border);
	border-radius: 0.5rem;
	background: transparent;
	cursor: pointer;
	font-size: 0.9rem;
	color: var(--text);
	transition: background 0.15s;
}
.btn-secondary:hover {
	background: var(--bg);
	text-decoration: none;
}

.btn-back-home {
	display: inline-block;
	font-size: 0.9rem;
	color: var(--text-muted);
}

/* ── Grilles génériques ─────────────────────────────────────── */
.character-grid,
.impacts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1.5rem;
}

.character-card,
.impact-card {
	background: var(--card-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.5rem;
	box-shadow: var(--shadow);
}

/* ── Grille scénarios ───────────────────────────────────────── */
.scenario-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1.5rem;
	margin-top: 2rem;
}

.scenario-card {
	background: var(--card-bg);
	border: 2px solid var(--border);
	border-radius: var(--radius);
	padding: 1.5rem;
	box-shadow: var(--shadow);
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

/* Bordures colorées par type */
.scenario-card.scenario-type-optimiste {
	border-color: var(--optimiste);
}
.scenario-card.scenario-type-median {
	border-color: var(--median);
}
.scenario-card.scenario-type-pessimiste {
	border-color: var(--pessimiste);
}

/* Boutons colorés par type */
.scenario-card.scenario-type-optimiste .btn-select {
	background: var(--optimiste);
}
.scenario-card.scenario-type-median .btn-select {
	background: var(--median);
}
.scenario-card.scenario-type-pessimiste .btn-select {
	background: var(--pessimiste);
}

.scenario-desc {
	font-size: 0.9rem;
	color: var(--text-muted);
	line-height: 1.5;
}

/* Stats température dans les cartes scénario */
.scenario-stats {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}
.scenario-stats p {
	font-size: 0.8rem;
	color: var(--text-muted);
}
.scenario-stats p strong {
	display: block;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--text);
}

/* ── Layout parcours ────────────────────────────────────────── */
.story-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 1.5rem;
	background: var(--card-bg);
	border-bottom: 1px solid var(--border);
	position: sticky;
	top: 0;
	z-index: 100;
}

.story-layout {
	display: grid;
	grid-template-columns: 280px 1fr;
	min-height: calc(100vh - 120px);
}

.sidebar {
	padding: 1.5rem;
	background: var(--card-bg);
	border-right: 1px solid var(--border);
}

.story-content {
	padding: 1.5rem 2rem;
	overflow-y: auto;
}

/* ── Timeline ───────────────────────────────────────────────── */
.timeline {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.timeline-item {
	display: block;
	background: var(--card-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1rem;
	transition: all 0.2s ease;
	text-decoration: none;
	color: var(--text);
}
.timeline-item:hover {
	border-color: var(--accent);
	box-shadow: var(--shadow);
	transform: translateX(4px);
	text-decoration: none;
	cursor: pointer;
}
.timeline-item.active {
	background: var(--accent);
	color: #fff;
	border-color: var(--accent);
}

/* ── Personnage sidebar ─────────────────────────────────────── */
.char-svg-container svg {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	border: 2px solid #333;
	background: rgba(0, 0, 0, 0.05);
	padding: 5px;
	margin: 0 auto 10px;
	display: block;
}
.char-name {
	font-size: 1.2rem;
	font-weight: 700;
	text-align: center;
}
.char-location {
	font-size: 0.85rem;
	color: var(--text-muted);
	text-align: center;
}

/* ── Contenu narratif ───────────────────────────────────────── */
.story-image,
.scenario-img {
	width: 100%;
	max-height: 400px;
	object-fit: cover;
	border-radius: var(--radius);
	margin-bottom: 1.5rem;
	box-shadow: var(--shadow);
}

.narrative {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	font-size: 0.95rem;
}
.narrative p {
	line-height: 1.75;
}
.narrative hr {
	border: none;
	border-top: 1px solid var(--border);
}

/* ── Impacts ────────────────────────────────────────────────── */
.impacts-title {
	font-weight: 600;
	margin-block: 1.5rem 0.75rem;
}
.impact-block {
	margin-top: 15px;
	padding: 10px;
	background: #f9f9f9;
	border-left: 4px solid #333;
	border-radius: 4px;
}
.impact-block strong {
	color: #000;
}
.impact-name {
	font-weight: 700;
	margin-bottom: 0.5rem;
}
.impact-desc {
	font-size: 0.9rem;
	color: var(--text-muted);
}

/* ── Navigation bas ─────────────────────────────────────────── */
.story-nav-bottom {
	display: flex;
	justify-content: space-between;
	padding-block: 1.5rem;
	margin-top: 1.5rem;
	border-top: 1px solid var(--border);
}

/* ── Fin de parcours ────────────────────────────────────────── */
.story-end {
	text-align: center;
	padding: 2rem;
}
.story-end .checkmark {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--accent);
	color: #fff;
	font-size: 1.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-inline: auto;
	margin-bottom: 1rem;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
	.story-layout {
		grid-template-columns: 1fr;
	}
	.sidebar {
		border-right: none;
		border-bottom: 1px solid var(--border);
	}
	.character-grid,
	.scenario-grid,
	.impacts-grid {
		grid-template-columns: 1fr;
	}
}

/* ── Warning box ────────────────────────────────────────────── */
.warning-box {
	background: #fff7ed;
	border: 1px solid #fed7aa;
	padding: 1rem;
	border-radius: var(--radius);
	margin-top: 1rem;
	color: #92400e;
}

/* ── Section de fin ─────────────────────────────────────────── */
.end-section {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 1.5rem;
	padding: 2rem 0;
}

.end-checkmark {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: linear-gradient(135deg, #0ea5e9, #16a34a);
	color: #fff;
	font-size: 1.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

.end-section h2 {
	font-size: 1.3rem;
	font-weight: 700;
}

.end-section > p {
	max-width: 520px;
	color: var(--text-muted);
	line-height: 1.7;
}

.end-sources {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	background: var(--card-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.25rem;
	text-align: left;
	max-width: 560px;
	width: 100%;
}

.end-sources-icon {
	font-size: 1.5rem;
	flex-shrink: 0;
}

.end-sources strong {
	display: block;
	margin-bottom: 0.4rem;
}

.end-sources a {
	color: var(--accent);
	font-size: 0.9rem;
}

.btn-end-character {
	display: inline-block;
	padding: 0.85rem 2rem;
	background: linear-gradient(90deg, #0ea5e9, #16a34a);
	color: #fff;
	border-radius: var(--radius);
	font-weight: 600;
	width: 100%;
	max-width: 400px;
	text-align: center;
}
.btn-end-character:hover {
	filter: brightness(0.9);
	text-decoration: none;
}
