/*
 * Page d'accueil : styles complémentaires à main.css (thème Strongly Typed).
 * Même palette que le site : brique #16855a, corail #5cc79a, gris #878787, filets #e5e5e5.
 */

.accueil-section {
	position: relative;
	background: #fff;
	text-align: center;
	padding: 5em 0;
}

#features.accueil-section {
	padding-top: 2.5em;
	padding-bottom: 4em;
}

.defi-saisie {
	display: flex;
	align-items: baseline;
	gap: 0.5em;
	margin: 0;
}

.defi-fleche {
	color: #16855a;
	font-weight: 700;
}

.accueil-section > .container > header {
	margin: 0 0 2.5em 0;
}

.accueil-gris {
	background: #f7f7f7;
	border-top: solid 2px #e5e5e5;
	border-bottom: solid 2px #e5e5e5;
}

.accueil-intro {
	max-width: 40em;
	margin: -1em auto 2.5em auto;
	text-align: center;
	color: #666;
	line-height: 1.7em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
	outline: 3px solid #5cc79a;
	outline-offset: 3px;
}

/* ---------- 1. Choix de la classe ---------- */

.classes {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.75em;
	max-width: 60em;
	margin: 0 auto;
	padding: 0;
}

a.classe {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 2.25em 1em 2em 1em;
	background: #fff;
	border: solid 2px #e5e5e5;
	border-radius: 4px;
	text-decoration: none;
	color: #878787;
	transition: background-color 0.25s ease-in-out, border-color 0.25s ease-in-out, color 0.25s ease-in-out, box-shadow 0.25s ease-in-out;
}

a.classe .classe-num {
	font-family: 'Fredoka', 'Nunito', 'Segoe UI', Arial, sans-serif;
	font-weight: 700;
	font-size: 3.25em;
	line-height: 1;
	color: #16855a;
	text-shadow: 0.05em 0.075em 0 rgba(0, 0, 0, 0.1);
	transition: color 0.25s ease-in-out;
}

a.classe .classe-num sup {
	font-size: 0.45em;
	vertical-align: super;
	line-height: 0;
	text-shadow: none;
}

a.classe .classe-nom {
	margin-top: 1em;
	font-weight: 600;
	font-size: 0.9em;
	letter-spacing: 3px;
	text-transform: uppercase;
}

a.classe:hover,
a.classe:focus-visible {
	background: #16855a;
	border-color: #16855a;
	color: #fff;
	box-shadow: 0.125em 0.175em 0 0 rgba(0, 0, 0, 0.125);
}

a.classe:hover .classe-num,
a.classe:focus-visible .classe-num {
	color: #fff;
}

.classes-note {
	margin: 1.75em 0 0 0;
	font-size: 0.85em;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: #878787;
}

/* ---------- Recherche de chapitre ---------- */

.chapitre-recherche {
	max-width: 36em;
	margin: 0 auto 3em auto;
	text-align: left;
}

.chapitre-recherche label {
	display: block;
	margin: 0 0 0.7em 0;
	font-size: 0.85em;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: #878787;
}

#recherche-chapitre {
	display: block;
	width: 100%;
	box-sizing: border-box;
	background: #f7f7f7;
	border: solid 2px #e5e5e5;
	border-radius: 4px;
	padding: 0.85em 1em;
	font-size: 1em;
	color: #555;
	transition: background-color 0.25s ease-in-out, border-color 0.25s ease-in-out;
}

#recherche-chapitre:focus {
	background: #fff;
	border-color: #5cc79a;
	outline: 0;
}

.resultats {
	margin: 1.25em 0 0 0;
	padding: 0;
}

.resultats li {
	margin: 0 0 0.6em 0;
	padding: 0;
}

.resultats a {
	display: flex;
	align-items: baseline;
	gap: 0.9em;
	padding: 0.7em 1em;
	background: #fff;
	border: solid 2px #e5e5e5;
	border-radius: 4px;
	color: #666;
	text-decoration: none;
	line-height: 1.4em;
	transition: border-color 0.25s ease-in-out, box-shadow 0.25s ease-in-out;
}

.resultats a:hover,
.resultats a:focus-visible {
	border-color: #16855a;
	box-shadow: 0.125em 0.175em 0 0 rgba(0, 0, 0, 0.125);
}

.resultats .pastille-classe {
	flex: 0 0 auto;
	min-width: 2.2em;
	text-align: center;
	background: #878787;
	color: #fff;
	border-radius: 4px;
	padding: 0.15em 0.5em;
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 2px;
}

.resultats-info {
	margin: 1em 0 0 0;
	font-size: 0.9em;
	color: #878787;
	text-align: center;
}

/* ---------- Apprendre par soi-même ---------- */

.apprendre-grille {
	container-type: inline-size;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	grid-template-rows: auto auto auto 1fr;   /* image / étiquette / titre / texte : mêmes hauteurs d'une carte à l'autre */
	column-gap: 1.75em;
	row-gap: 0;
	text-align: left;
}

a.apprendre-carte {
	display: grid;
	grid-template-rows: subgrid;
	grid-row: span 4;
	background: #fff;
	border: solid 2px #e5e5e5;
	border-radius: 4px;
	overflow: hidden;
	text-decoration: none;
	color: #878787;
	transition: transform 0.25s ease-in-out, border-color 0.25s ease-in-out, box-shadow 0.25s ease-in-out;
}

a.apprendre-carte:hover,
a.apprendre-carte:focus-visible {
	transform: translateY(-4px);
	border-color: #16855a;
	box-shadow: 0.125em 0.175em 0 0 rgba(0, 0, 0, 0.125);
}

.apprendre-image {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #f0f0f0;
	border-bottom: solid 2px #e5e5e5;
}

.apprendre-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease-in-out;
}

a.apprendre-carte:hover .apprendre-image img {
	transform: scale(1.04);
}

.apprendre-corps {
	display: contents;
}

.apprendre-tag {
	display: block;
	padding: 1.5rem 1.5rem 0 1.5rem;
	font-size: 0.75em;
	letter-spacing: 3px;
	text-transform: uppercase;
	white-space: nowrap;
	color: #16855a;
	margin: 0;
}

.apprendre-corps h3 {
	margin: 0;
	padding: 1.1rem 1.5rem 0 1.5rem;
	font-size: 0.95em;                 /* repli pour les anciens navigateurs */
	font-size: min(0.95em, calc(1.6cqw - 3.7px));   /* le titre s'adapte à la largeur disponible : toujours sur une ligne */
	text-align: left;
	letter-spacing: 0.12em;
	line-height: 1.6;
	white-space: nowrap;
	color: #666;
}

.apprendre-texte {
	display: block;
	padding: 0.75rem 1.5rem 1.75rem 1.5rem;
	line-height: 1.7em;
	font-size: 0.95em;
}

/* ---------- 2. Défi du jour ---------- */

.defi-date {
	margin: -1em 0 1.75em 0;
	text-align: center;
	font-size: 0.85em;
	letter-spacing: 3px;
	text-transform: uppercase;
	color: #878787;
}

.defi-niveaux {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75em;
	margin: 0 0 2.25em 0;
	padding: 0;
}

button.niveau sup {
	font-size: 0.6em;
	vertical-align: super;
	line-height: 0;
}

button.niveau {
	display: inline-block;
	width: auto;
	background: #fff;
	color: #878787 !important;
	border: solid 2px #e5e5e5;
	border-radius: 4px;
	box-shadow: none;
	text-shadow: none;
	padding: 1em 1.9em;
	font-size: 1.2em;
	line-height: 1;
	letter-spacing: 2px;
	cursor: pointer;
}

button.niveau:hover {
	background: #fff;
	color: #16855a !important;
	border-color: #16855a;
}

button.niveau[aria-pressed="true"] {
	background: #16855a;
	color: #fff !important;
	border-color: #16855a;
	box-shadow: 0.125em 0.175em 0 0 rgba(0, 0, 0, 0.125);
}

.defi-carte {
	max-width: 44em;
	margin: 0 auto;
	padding: 2.5em 2.5em 2em 2.5em;
	background: #fff;
	border: solid 2px #e5e5e5;
	border-radius: 4px;
	text-align: left;
}

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

.defi-liste > li {
	padding: 1.25em 0;
	border-top: solid 2px #f0f0f0;
}

.defi-liste > li:first-child {
	border-top: 0;
	padding-top: 0;
}

.defi-ligne {
	display: grid;
	grid-template-columns: 1fr 9em;
	gap: 1em;
	align-items: center;
}

.defi-q {
	display: flex;
	align-items: flex-start;
	gap: 0.6em;
	font-size: 1.1em;
	line-height: 1.7em;
	color: #666;
}

.defi-q > span:last-child {
	display: block;
}

.defi-q strong {
	color: #16855a;
	font-weight: 700;
	white-space: nowrap;
}

.defi-q .defi-n {
	display: inline-block;
	flex: 0 0 auto;
	min-width: 1.4em;
	font-family: 'Fredoka', 'Nunito', 'Segoe UI', Arial, sans-serif;
	font-weight: 700;
	color: #16855a;
}

.defi-ligne input[type="text"] {
	display: block;
	width: 100%;
	box-sizing: border-box;
	background: transparent;
	box-shadow: none;
	border: 0;
	border-bottom: dashed 2px #c9c9c9;
	border-radius: 0;
	padding: 0.3em 0.2em;
	font-size: 1.15em;
	text-align: center;
	color: #16855a;
	font-weight: 600;
}

.defi-ligne input[type="text"]:focus {
	border-bottom: solid 2px #5cc79a;
	outline: 0;
}

.defi-liste li.juste input[type="text"] {
	border-color: #3c8d5a;
	background: transparent;
}

.defi-liste li.faux input[type="text"] {
	border-color: #c0392b;
	background: transparent;
}

.defi-retour {
	margin: 0.8em 0 0 0;
	font-size: 0.95em;
	line-height: 1.6em;
	color: #666;
}

.defi-retour:empty {
	display: none;
}

.defi-retour strong {
	color: #16855a;
}

.defi-liste li.faux .defi-retour strong {
	color: #c0392b;
}

.defi-retour button.lien {
	display: inline;
	width: auto;
	background: none;
	border: 0;
	border-bottom: dotted 1px #878787;
	border-radius: 0;
	box-shadow: none;
	padding: 0;
	margin-left: 0.4em;
	font-size: 1em;
	letter-spacing: 0;
	text-transform: none;
	color: #878787 !important;
	cursor: pointer;
}

.defi-corrige {
	display: block;
	margin-top: 0.4em;
	color: #878787;
}

.defi-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1em;
	justify-content: center;
	margin: 2em 0 0 0;
}

.defi-actions .button {
	width: auto;
	height: auto;
	line-height: 1.2;
	padding: 1.15em 2.4em;
	font-size: 1.1em;
}

.defi-actions button.defi-secondaire {
	background: #fff;
	color: #878787 !important;
	border: solid 2px #e5e5e5;
	box-shadow: none;
}

.defi-actions button.defi-secondaire:hover {
	background: #fff;
	color: #16855a !important;
	border-color: #16855a;
}

.defi-score {
	min-height: 1.6em;
	margin: 1.5em 0 0 0;
	text-align: center;
	font-weight: 600;
	letter-spacing: 2px;
	text-transform: uppercase;
	font-size: 0.9em;
	color: #878787;
}

.defi-ia {
	margin: 1.25em 0 0 0;
	text-align: right;
	font-size: 0.7em;
	line-height: 1.4em;
	color: #a0a0a0;
}

.defi-score.bravo {
	color: #3c8d5a;
}

.frac {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	vertical-align: middle;
	margin: 0 0.2em;
	line-height: 1.15;
	font-size: 0.95em;
}

.frac > span:first-child {
	border-bottom: solid 1.5px currentColor;
	padding: 0 0.25em 0.05em 0.25em;
}

.frac > span:last-child {
	padding: 0.05em 0.25em 0 0.25em;
}

/* ---------- 4. Vitrine des outils ---------- */

.vitrine {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2.5em 1.75em;
	text-align: center;
	margin: 0 0 3em 0;
}

.vitrine > .carte {
	margin: 0;
}

.vitrine-actions {
	margin: 0;
}

/* ---------- Qui suis-je ---------- */

.bio {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 3em;
	align-items: stretch;
	max-width: 60em;
	margin: 0 auto;
}

.bio-intro {
	font-weight: 600;
	color: #16855a;
}

.bio-texte p {
	line-height: 1.8em;
}

.bio-auteur h3 {
	margin: 0 0 0.75em 0;
}

.bio-texte,
.bio-auteur {
	display: flex;
	flex-direction: column;
	text-align: center;
	background: #f7f7f7;
	border: solid 2px #e5e5e5;
	border-radius: 4px;
	padding: 2em;
	height: 100%;
	box-sizing: border-box;
}

.bio-texte .carte-icone,
.bio-auteur .carte-icone {
	width: 3.25em;
	height: 3.25em;
	margin: 0 auto 1em auto;
	font-size: 1.3em;
}

.bio-texte h3 {
	margin: 0 0 0.75em 0;
}

.bio-texte p,
.bio-auteur p {
	line-height: 1.7em;
}

.bio-auteur p {
	line-height: 1.7em;
}

.bio-lien {
	margin: auto 0 0 0;
	padding-top: 1.5em;
}

.bio-livres {
	list-style: none;
	margin: 0 0 0.5em 0;
	padding: 0;
}

.bio-livres li {
	margin: 0.5em 0 0 0;
	padding: 0.6em 1em;
	background: #fff;
	border: solid 2px #e5e5e5;
	border-radius: 4px;
	color: #666;
}

.bio-texte p,
.bio-auteur p {
	text-align: left;
}
.bio-texte p.bio-lien,
.bio-auteur p.bio-lien {
	text-align: center;
}

@media screen and (max-width: 980px) {
	.apprendre-grille {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: none;
		row-gap: 1.75em;
		max-width: 28em;
		margin: 0 auto;
	}
	a.apprendre-carte {
		grid-template-rows: auto;
		grid-row: auto;
	}
	.apprendre-corps h3 {
		font-size: min(0.95em, 3.9cqw);
	}
	.vitrine {
		grid-template-columns: 1fr;
	}
	.bio {
		grid-template-columns: 1fr;
	}
}

/* ---------- Mobile ---------- */

@media screen and (max-width: 736px) {
	.accueil-section {
		padding: 3.5em 0;
	}
	.classes {
		grid-template-columns: 1fr 1fr;
		gap: 1em;
	}
	a.classe {
		padding: 1.5em 0.5em 1.25em 0.5em;
	}
	a.classe .classe-num {
		font-size: 2.5em;
	}
	a.classe .classe-nom {
		letter-spacing: 2px;
	}
	.defi-carte {
		padding: 1.75em 1.25em 1.5em 1.25em;
	}
	.defi-ligne {
		grid-template-columns: 1fr;
	}
	.defi-actions .button {
		width: 100%;
	}
	.vitrine {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	a.classe,
	.resultats a,
	#recherche-chapitre {
		transition: none;
	}
}



/* Recherche remontée sur la page d'accueil */
#header > .container {
	padding-bottom: 2em;
}

#features.accueil-section {
	padding-top: 1.25em;
}

.chapitre-recherche {
	margin-bottom: 2em;
}

/* ---------- Liens en tuile (remplacent les anciens boutons) ---------- */
.tuile-lien {
	display: flex; align-items: center; gap: 1em; box-sizing: border-box; width: 100%; max-width: 24em; margin: 0 auto;
	padding: 1.05em 1.2em; text-align: left; text-decoration: none; border-bottom: 2px solid #e5e5e5;
	font-size: 1.05em; line-height: 1.35em; font-weight: 600; color: #444;
	background: #fff; border: 2px solid #e5e5e5; border-radius: 6px;
	transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.tuile-lien:hover { color: #444; border-color: #16855a; transform: translateY(-3px); box-shadow: 0.125em 0.175em 0 0 rgba(0,0,0,.125); }
.tuile-lien .tuile-txt { flex: 1; }
.tuile-lien .tuile-ico, .tuile-lien .tuile-fl:before, .tuile-lien .tuile-ico:before { font-family: 'Font Awesome 5 Free'; font-weight: 900; }
.tuile-lien .tuile-ico {
	flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 2.5em; height: 2.5em; border-radius: 50%;
	background: #e8f7f0; color: #16855a; transition: background-color .2s ease, color .2s ease;
}
.tuile-lien:hover .tuile-ico { background: #16855a; color: #fff; }
.tuile-lien.t-outils .tuile-ico:before { content: '\f7d9'; }
.tuile-lien.t-jeux .tuile-ico:before { content: '\f11b'; }
#jeux .vitrine > .carte-phare { border-color: #f2b01e; box-shadow: 0 0 0 3px #fff3cf; }
.tuile-lien.t-externe .tuile-ico:before { content: '\f35d'; }
.tuile-lien .tuile-fl:before { content: '\f061'; color: #c9c9c9; font-size: .8em; display: inline-block; transition: transform .2s ease, color .2s ease; }
.tuile-lien:hover .tuile-fl:before { color: #16855a; transform: translateX(4px); }
p.bio-lien .tuile-lien { max-width: 22em; }


/* ---------- Rappel du défi du jour : une bulle sous la barre du haut, à droite (rien n'est caché) ---------- */

.defi-rappel {
	position: fixed;
	top: 10.4em;
	right: 1.6em;
	z-index: 900;
	font-size: 0.7em;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0.8em;
	width: 12.5em;
	padding: 1.3em 1em 1.1em 1em;
	background: #fff;
	border: solid 2px #16855a;
	border-radius: 14px;
	box-shadow: 0 0.35em 1.4em rgba(0, 0, 0, 0.25);
	color: #444;
	line-height: 1.3;
	transform: translateX(130%);
	transition: transform 0.55s cubic-bezier(.2, 1.3, .4, 1);
}

.defi-rappel.visible {
	transform: translateX(0);
	animation: defi-rappel-pulse 2.6s ease-in-out 1.5s infinite;
}

.defi-rappel-ico {
	flex: none;
	width: 3.2em;
	height: 3.2em;
	border-radius: 50%;
	background: #16855a;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2em;
}

.defi-rappel-ico:before { margin: 0; }

.defi-rappel-txt { flex: 1; display: flex; flex-direction: column; gap: 0.25em; font-size: 0.95em; }
.defi-rappel-txt strong { color: #16855a; font-size: 1.05em; }

.defi-rappel .defi-rappel-go {
	flex: none;
	background: #16855a;
	color: #fff !important;
	border: 0 !important;
	border-radius: 999px;
	padding: 0.55em 1.4em;
	margin-top: 0.2em;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.defi-rappel .defi-rappel-go:hover { background: #0f6a47; }

.defi-rappel .defi-rappel-x {
	position: absolute;
	top: -0.7em;
	left: -0.7em;
	display: block !important;
	width: 1.8em !important;
	height: 1.8em !important;
	min-width: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border: solid 2px #16855a !important;
	border-radius: 50% !important;
	background: #fff !important;
	color: #16855a !important;
	font-size: 1.05em !important;
	line-height: 1.5em !important;
	text-indent: 0 !important;
	text-align: center;
	cursor: pointer;
	box-shadow: none !important;
}

.defi-rappel .defi-rappel-x:hover { background: #e8f7f0 !important; }

@keyframes defi-rappel-pulse {
	0%, 100% { transform: translateX(0) scale(1); }
	50% { transform: translateX(0) scale(1.04); }
}

/* Écrans étroits : la bulle passe en bas de l'écran pour ne rien cacher en haut */
@media screen and (max-width: 1100px) {
	.defi-rappel {
		top: auto;
		font-size: 1em;
		bottom: 0.9em;
		right: 0.9em;
		left: 0.9em;
		width: auto;
		max-width: none;
		flex-direction: row;
		text-align: left;
		padding: 0.9em 0.8em 0.9em 1em;
		transform: translateY(150%);
	}
	.defi-rappel-ico { width: 2.6em; height: 2.6em; font-size: 1.05em; }
	.defi-rappel.visible { transform: translateY(0); animation-name: defi-rappel-pulse-bas; }
	@keyframes defi-rappel-pulse-bas {
		0%, 100% { transform: translateY(0) scale(1); }
		50% { transform: translateY(0) scale(1.03); }
	}
}

@media (prefers-reduced-motion: reduce) {
	.defi-rappel { transition: opacity 0.2s; }
	.defi-rappel.visible { animation: none; }
}
