/* ===== Pages de ressources (exercices, vidéos, cartes mentales…) : boutons -> tuiles ===== */
#features br { display: none; }
#features .container header:not(.x) h2 { font-size: 1.15em; letter-spacing: 3px; }
#features .container > header, #features .container > div > header { margin: 3.2em 0 1.6em 0; }
#features .row > div > section > a.button header { margin: 0; }
#features .container header h2:after {
	content: ''; display: block; width: 3.2em; height: 4px; margin: 0.7em auto 0 auto;
	background: #5cc79a; border-radius: 2px;
}
#features .row { margin-bottom: 0; }
#features .row.aln-center { justify-content: center; }
#features .row > div > section { text-align: left; margin-bottom: 0.5em; }

/* La tuile */
#features .row > div > section > a.button.icon, #features .merci > div > a.button.icon {
	display: flex; align-items: center; gap: 1em; width: 100%; box-sizing: border-box;
	padding: 1.05em 1.2em; text-align: left; text-transform: none; letter-spacing: 0.02em;
	font-size: 1.05em; line-height: 1.35em; font-weight: 600;
	background: #fff; color: #444 !important; border: 2px solid #e5e5e5; border-radius: 6px;
	box-shadow: none; text-shadow: none;
	transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
#features .row > div > section > a.button.icon header, #features .merci > div > a.button.icon header { flex: 1; margin: 0; padding: 0; text-align: left; }
#features .row > div > section > a.button.icon:before, #features .merci > div > a.button.icon:before {
	flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
	width: 2.5em; height: 2.5em; margin: 0; padding: 0 !important; border-radius: 50%; top: 0; text-align: center; line-height: 1;
	background: #e8f7f0; color: #16855a; font-size: 1em; opacity: 1;
}
#features .row > div > section > a.button.icon:after, #features .merci > div > a.button.icon:after {
	font-family: 'Font Awesome 5 Free'; font-weight: 900; content: '\f061';
	color: #c9c9c9; font-size: .8em; transition: transform .2s ease, color .2s ease;
}
#features .row > div > section > a.button.icon:hover, #features .merci > div > a.button.icon:hover {
	background: #fff; border-color: #16855a; transform: translateY(-3px);
	box-shadow: 0.125em 0.175em 0 0 rgba(0,0,0,.125);
}
#features .row > div > section > a.button.icon:hover:before, #features .merci > div > a.button.icon:hover:before { background: #16855a; color: #fff; }
#features .row > div > section > a.button.icon:hover:after, #features .merci > div > a.button.icon:hover:after { color: #16855a; transform: translateX(4px); }
/* Icône selon le type de ressource */
#features a.button[href*="youtu"]:before { content: '\f144'; }              /* vidéo */
#features a.button[href*="1drv.ms/b"]:before { content: '\f15c'; }           /* document */
#features a.button[href*="learningapps"]:before { content: '\f12e'; }       /* activité interactive */
#features a.button[href*="genial"]:before { content: '\f11b'; }             /* jeu */
#features a.button[href$=".ggb"]:before, #features a.button[href*="informatique"]:before { content: '\f5ee'; }
#features a.button[href*="1drv.ms/f"]:before { content: '\f07b'; }          /* dossier */
#features a.button[href$=".ods"]:before { content: '\f0ce'; }              /* tableur */
#features a.button[href*="sharepoint"]:before { content: '\f019'; }        /* téléchargement */
#features a.button[href*="geogebra.org"]:before { content: '\f5ee'; }
#features .merci a.button[href*="maths-et-tiques"]:before, #features .merci a.button[href*="juliette"]:before { content: '\f0ac'; }  /* site web */
.merci > div > a.button.icon { text-align: left; }
/* Descriptions sous la tuile */
#features .row > div > section { font-size: .85em; color: #8a8a8a; line-height: 1.5em; }
#features .row > div > section iframe { margin-top: .8em; border: 2px solid #e5e5e5 !important; border-radius: 6px; background: #fff; }
/* Barre de navigation du chapitre */
.chap-onglets {
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6em;
	max-width: 46em; margin: 0 auto 2.4em auto; padding: 0; list-style: none;
}
.chap-onglets li { margin: 0; padding: 0; }
.chap-onglets a, .chap-onglets .off {
	display: flex; align-items: center; justify-content: center; gap: .55em; box-sizing: border-box; width: 100%;
	padding: .75em .6em; border-radius: 999px; border: 2px solid #e5e5e5; color: #878787; text-decoration: none;
	font-size: .8em; line-height: 1.2; text-transform: uppercase; letter-spacing: 1px; white-space: nowrap;
	font-family: 'Fredoka','Nunito',sans-serif; font-weight: 600; transition: all .2s ease;
}
.chap-onglets a:before, .chap-onglets .off:before { font-family: 'Font Awesome 5 Free'; font-weight: 900; color: #16855a; }
.chap-onglets .lecon:before { content: '\f518'; } .chap-onglets .exos:before { content: '\f303'; }
.chap-onglets .cartes:before { content: '\f542'; } .chap-onglets .videos:before { content: '\f144'; }
.chap-onglets a:hover { border-color: #16855a; color: #16855a; }
.chap-onglets a.actif { background: #16855a; border-color: #16855a; color: #fff; }
.chap-onglets a.actif:before { color: #fff; }
.chap-onglets .off { color: #c4c4c4; border-style: dashed; cursor: not-allowed; }
.chap-onglets .off:before { color: #d6d6d6; }
@media screen and (max-width: 640px) {
	.chap-onglets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Pages de chapitre : moins de blanc autour du titre */
body:has(.chap-onglets) #header > .container { padding: 6.5em 0 0.4em 0; }
body:has(.chap-onglets) #features { padding-top: 1.5em; }

/* ===== Remerciements (page Vidéos) ===== */
.merci { display: grid; grid-template-columns: repeat(auto-fit, minmax(17em, 1fr)); gap: 1.5em; max-width: 54em; margin: 0 auto; text-align: center; }
.merci > div { padding: 1.6em 1.4em; border: 2px solid #e5e5e5; border-radius: 6px; background: #fff; display: flex; flex-direction: column; gap: .8em; }
.merci strong { font-family: 'Fredoka', sans-serif; font-size: 1.2em; color: #444; }
.merci p { margin: 0; font-size: .92em; color: #878787; line-height: 1.6em; }
.merci a.button.icon { margin: 0; width: 100%; box-sizing: border-box; }

/* ===== Page Collège : les 4 niveaux ===== */
.niveaux-section { padding-top: 2em; }
.niveaux { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1.5em; text-align: center; }
.niveau {
	position: relative; display: flex; flex-direction: column; align-items: center; gap: .5em;
	padding: 1.8em 1.3em 1.4em; text-decoration: none; color: #666; background: #fff; border: 2px solid #e5e5e5; border-radius: 6px;
	transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.niveau:hover { transform: translateY(-5px); border-color: #16855a; box-shadow: 0.125em 0.175em 0 0 rgba(0,0,0,.125); color:#666; }
.niveau-num { font-family:'Fredoka',sans-serif; font-weight:700; font-size:3.6em; line-height:1; color:#16855a; text-shadow: .05em .075em 0 rgba(0,0,0,.1); }
.niveau-num sup { font-size:.38em; vertical-align: top; position: relative; top:.35em; }
.niveau-cycle { font-size:.72em; letter-spacing:2px; text-transform:uppercase; color:#16855a; }
.niveau-desc { font-size:.88em; line-height:1.6em; color:#878787; flex:1; }
.niveau-fl { margin-top:.4em; }
.niveau-fl:before { content:'\f061'; font-family:'Font Awesome 5 Free'; font-weight:900; font-size:.85em; color:#c9c9c9; display:inline-block; transition: transform .2s ease, color .2s ease; }
.niveau:hover .niveau-fl:before { color:#16855a; transform: translateX(4px); }
.niveau-go { margin-top:.6em; padding:.7em 1em; border-radius:4px; background:#16855a; color:#fff; font-size:.78em; letter-spacing:1px; text-transform:uppercase; font-family:'Fredoka',sans-serif; }
.niveau-go:before { margin-right:.6em; }
.niveau:hover .niveau-go { background:#45c48f; }
@media screen and (max-width: 1100px) { .niveaux { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media screen and (max-width: 560px) { .niveaux { grid-template-columns: 1fr; } }

/* Espacement des tuiles sur petits écrans */
@media screen and (max-width: 980px) {
	#features .row > div { padding-top: 0.9em; }
}
