/* ============================================
   Histoire pour enfant — gabarit graphique
   Émis par le SaaS dans contenu_html, stylé ici.
   ============================================ */

.histoire-enfant {
	font-family: "Quicksand", "Comic Sans MS", sans-serif;
	color: #3d3d5c;
	line-height: 1.7;
	max-width: 780px;
	margin: 0 auto;
	transition: background 0.3s, color 0.3s;
}

/* === Tabs version longue / courte === */
.histoire-enfant .he-tabs {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin: 0 0 1.2rem;
	flex-wrap: wrap;
}
.histoire-enfant .he-tab {
	background: #f5f0ff;
	color: #5c5c8a;
	border: 2px solid #e6e6f5;
	border-radius: 22px;
	padding: 10px 22px;
	font-size: 1rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.2s;
	line-height: 1.2;
}
.histoire-enfant .he-tab:hover:not(.he-tab-active) {
	background: #ebe2ff;
	border-color: #d9c8ff;
}
.histoire-enfant .he-tab.he-tab-active {
	background: linear-gradient(135deg, #a78bfa, #7c3aed);
	color: #fff;
	border-color: #7c3aed;
	box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}
.histoire-enfant .he-tab-icon {
	margin-right: 6px;
}

/* === Meta (âge / lecture / mode nuit) === */
.histoire-enfant .he-meta {
	display: flex;
	gap: 1rem;
	justify-content: center;
	align-items: center;
	margin: 0 0 1.5rem;
	font-size: 0.9rem;
	color: #7a7aa8;
	flex-wrap: wrap;
}
.histoire-enfant .he-meta span {
	background: #fff7e6;
	padding: 6px 14px;
	border-radius: 20px;
	border: 1px dashed #ffd9a8;
}
.histoire-enfant .he-night-toggle {
	background: #fff7e6;
	border: 1px dashed #ffd9a8;
	border-radius: 20px;
	padding: 6px 14px;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
	transition: background 0.2s;
}
.histoire-enfant .he-night-toggle:hover {
	background: #ffeec8;
}

/* === Intro / scènes / morale === */
.histoire-enfant .he-intro {
	font-size: 1.15rem;
	font-style: italic;
	text-align: center;
	margin: 1.5rem 0;
	color: #5c5c8a;
}
.histoire-enfant .he-scene {
	margin: 2rem 0;
	padding: 1.5rem;
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 4px 18px rgba(120, 80, 180, 0.08);
	transition: background 0.3s, box-shadow 0.3s;
}
.histoire-enfant .he-scene-img {
	margin: 0 0 1rem;
	text-align: center;
}
.histoire-enfant .he-scene-img img {
	max-width: 100%;
	height: auto;
	border-radius: 14px;
	box-shadow: 0 6px 22px rgba(80, 50, 140, 0.12);
	transition: filter 0.3s;
}
.histoire-enfant .he-scene-text p {
	font-size: 1.05rem;
	margin: 0.7rem 0;
}
.histoire-enfant .he-morale {
	margin: 2.5rem 0;
	padding: 1.5rem 1.8rem;
	background: linear-gradient(135deg, #fff4d6 0%, #ffe0e9 100%);
	border-radius: 18px;
	text-align: center;
	transition: background 0.3s, color 0.3s;
}
.histoire-enfant .he-morale h2 {
	font-size: 1.4rem;
	color: #c0466b;
	margin: 0 0 0.6rem;
	border: none;
	padding: 0;
}
.histoire-enfant .he-morale p {
	font-size: 1.05rem;
	font-style: italic;
	margin: 0;
}

/* === Quiz wrapper (le contenu vient de histoireenfant-quiz.js) === */
.histoire-enfant .he-quiz {
	margin: 2.5rem 0;
	padding: 1.5rem 1.2rem;
	background: linear-gradient(135deg, #e8f4ff 0%, #f4ecff 100%);
	border-radius: 18px;
	transition: background 0.3s, color 0.3s;
}
.histoire-enfant .he-quiz > h2 {
	color: #5c5c8a;
	font-size: 1.4rem;
	text-align: center;
	margin: 0 0 1rem;
	border: none;
	padding: 0;
}

/* === Affiliation === */
.histoire-enfant .he-affi {
	margin: 2.5rem 0 1rem;
	padding: 1.2rem 0;
	border-top: 2px dashed #d8d8f0;
}
.histoire-enfant .he-affi h2 {
	color: #5c5c8a;
	font-size: 1.3rem;
}
.histoire-enfant .he-affi-intro {
	color: #7a7aa8;
	font-style: italic;
	margin: 0.5rem 0 1rem;
}

/* === Mode "version courte" : bascule via JS sur la classe parent === */
.histoire-enfant.short-mode .he-scenes-long,
.histoire-enfant.short-mode .he-quiz {
	display: none;
}
.histoire-enfant:not(.short-mode) .he-scenes-short {
	display: none;
}

/* === Responsive === */
@media (max-width: 600px) {
	.histoire-enfant .he-scene { padding: 1rem; }
	.histoire-enfant .he-meta { flex-direction: column; align-items: center; gap: 0.4rem; }
	.histoire-enfant .he-tab { padding: 9px 18px; font-size: 0.95rem; }
}

/* ============================================
   Mode nuit (lecture en chambre d'enfant)
   ============================================ */
.histoire-enfant.night-mode {
	background: #1a1f3a;
	color: #e8d8c0;
	padding: 1.2rem;
	border-radius: 18px;
}
.histoire-enfant.night-mode .he-meta { color: #b8a888; }
.histoire-enfant.night-mode .he-meta span {
	background: #2a2f50;
	border-color: #454a70;
	color: #c8b89e;
}
.histoire-enfant.night-mode .he-night-toggle {
	background: #2a2f50;
	border-color: #454a70;
	color: #fff;
}
.histoire-enfant.night-mode .he-night-toggle:hover { background: #3a3f60; }
.histoire-enfant.night-mode .he-tab {
	background: #2a2f50;
	color: #c8b89e;
	border-color: #454a70;
}
.histoire-enfant.night-mode .he-tab:hover:not(.he-tab-active) {
	background: #3a3f60;
	border-color: #6c5fb5;
}
.histoire-enfant.night-mode .he-tab.he-tab-active {
	background: linear-gradient(135deg, #6c5fb5, #4c3f8f);
	border-color: #6c5fb5;
	color: #fff;
}
.histoire-enfant.night-mode .he-intro { color: #d8c8a8; }
.histoire-enfant.night-mode .he-scene {
	background: #252b4d;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.histoire-enfant.night-mode .he-scene-img img {
	filter: brightness(0.88) sepia(0.05);
	box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
}
.histoire-enfant.night-mode .he-morale {
	background: linear-gradient(135deg, #2d2552 0%, #3a2640 100%);
	color: #f0d8c0;
}
.histoire-enfant.night-mode .he-morale h2 { color: #ffb6c8; }
.histoire-enfant.night-mode .he-quiz {
	background: linear-gradient(135deg, #1f2548 0%, #2a2552 100%);
	color: #e8d8c0;
}
.histoire-enfant.night-mode .he-quiz > h2 { color: #c8b8e8; }
.histoire-enfant.night-mode .he-affi { border-top-color: #454a70; }
.histoire-enfant.night-mode .he-affi h2 { color: #c8b8d8; }
.histoire-enfant.night-mode .he-affi-intro { color: #a89a82; }
