/*
Theme Name: iMagine Montessori 2026
Theme URI: https://imagine-montessori.fr/
Description: Thème enfant de Twenty Twenty-Five pour le site de l'école et collège iMagine Montessori. Reprend la charte du site historique : Chau Philomene One, Open Sans, Dosis, turquoise et palette gaie.
Author: iMagine Montessori
Template: twentytwentyfive
Version: 0.7.0
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: imma-2026
*/

/* ------------------------------------------------------------------
   1. Largeurs et rythme général
   ------------------------------------------------------------------ */

body {
	-webkit-font-smoothing: antialiased;
}

/* Le corps de texte historique : Open Sans 18px, interligne 1,75, gris moyen. */
.wp-site-blocks p {
	margin-block: 0 1.25em;
}

/* Les titres de section du site historique sont centrés et en capitales. */
.wp-site-blocks h2 {
	letter-spacing: 0.5px;
}

/* ------------------------------------------------------------------
   2. En-tête : barre blanche flottante, logo à gauche, menu à droite
   ------------------------------------------------------------------ */

/* En dessous de 992 px la barre reste dans le flux, comme sur l'ancien site :
   c'est le menu déroulant qui prend la main. */
.imma-entete {
	position: relative;
	background: transparent;
	padding: 8px 16px 0;
}

.imma-barre {
	background: #fff;
	border-radius: 28px;
	box-shadow: 0 8px 26px rgba(31, 79, 79, 0.16);
	padding: 8px 14px;
}

@media (min-width: 992px) {
	/* Sur ordinateur la barre flotte : détachée du haut, en pastille, et elle
	   s'efface quand on descend. Le script qui pose .imma-barre-cachee est
	   celui de l'extension imma-corrections-seo, partagé avec l'ancien site. */
	.imma-entete {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 9000;
		padding: 16px 20px 0;
		transition: transform 0.3s ease;
	}

	.imma-entete.imma-barre-cachee {
		transform: translateY(-130%);
	}

	/* La place que la barre fixe ne prend plus dans le flux. */
	.wp-site-blocks {
		padding-top: 134px;
	}

	.imma-barre {
		max-width: 1180px;
		margin: 0 auto;
		padding: 10px 18px 10px 24px;
		border-radius: 56px;
	}
}

/* Dans l'éditeur, une barre fixe n'aurait pas de sens. */
.editor-styles-wrapper .imma-entete {
	position: static;
}

.imma-barre .wp-block-site-logo img {
	width: 82px;
	height: auto;
}

/* Les entrées de menu : Dosis, grasse, capitales, turquoise foncé. */
.imma-entete .wp-block-navigation {
	font-family: Dosis, sans-serif;
	font-size: 18px;
	font-weight: 700;
	text-transform: uppercase;
}

.imma-entete .wp-block-navigation a,
.imma-entete .wp-block-navigation .wp-block-navigation-item__content {
	color: #3d7d7d;
	text-decoration: none;
}

.imma-entete .wp-block-navigation a:hover {
	color: #4da09e;
}

.imma-entete .wp-block-navigation .wp-block-navigation__submenu-container {
	background: #fff;
	border: 0;
	box-shadow: 0 8px 26px rgba(31, 79, 79, 0.16);
	border-radius: 6px;
	padding: 6px 0;
	font-size: 16px;
}

.imma-entete .wp-block-navigation .wp-block-navigation__submenu-container a {
	padding: 8px 18px;
}

/* Le menu déplié sur téléphone. Le bloc de navigation reprend l'alignement
   à droite voulu pour la barre du bureau : dans le panneau plein écran, les
   libellés viennent alors coller au bord et le bouton de fermeture se perd
   dans le coin. On recentre, et on lui donne de quoi être touché du pouce. */
@media (max-width: 991px) {
	.imma-entete .wp-block-navigation__responsive-container.is-menu-open {
		padding: 24px 20px 40px;
	}

	.imma-entete .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
		align-items: center;
		padding-top: 28px;
		width: 100%;
	}

	.imma-entete .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,
	.imma-entete .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item,
	.imma-entete .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
		align-items: center;
		text-align: center;
	}

	.imma-entete .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
		gap: 18px;
	}

	.imma-entete .wp-block-navigation__responsive-container-close {
		padding: 10px;
	}
}

/* ------------------------------------------------------------------
   3. La frise en dents de scie sous l'en-tête et le bandeau de titre
   ------------------------------------------------------------------ */

.imma-bandeau {
	background: #3d7d7d;
	color: #fff;
	text-align: center;
	padding: 48px 20px 36px;
	margin-top: -10px;
}

.imma-bandeau .wp-block-post-title,
.imma-bandeau h1 {
	color: #fff;
	font-family: "Chau Philomene One", sans-serif;
	font-size: 42px;
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin: 0;
}

.imma-dents {
	height: 12px;
	background-color: transparent;
	background-image:
		linear-gradient(135deg, #3d7d7d 50%, transparent 50%),
		linear-gradient(225deg, #3d7d7d 50%, transparent 50%);
	background-size: 24px 24px;
	background-repeat: repeat-x;
	background-position: 0 0;
}

/* ------------------------------------------------------------------
   4. Pied de page
   ------------------------------------------------------------------ */

.imma-pied {
	background: #fff;
	color: #999;
	font-size: 15px;
	padding-top: 50px;
	padding-bottom: 40px;
}

.imma-pied h2,
.imma-pied h3,
.imma-pied h4 {
	font-family: "Chau Philomene One", sans-serif;
	font-size: 18px;
	font-weight: 400;
	color: #343434;
	text-transform: uppercase;
	margin: 0 0 14px;
}

.imma-pied a {
	color: #999;
	text-decoration: none;
}

.imma-pied a:hover {
	color: #4da09e;
	text-decoration: underline;
}

.imma-pied ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.imma-pied li {
	margin-bottom: 8px;
	line-height: 1.5;
}

.imma-pied p {
	line-height: 1.6;
	margin-bottom: 10px;
}

.imma-pied-logo img {
	width: 90px;
	height: auto;
	margin-top: 10px;
}

/* La barre du bas, turquoise foncé, Dosis en capitales. */
.imma-pied-bas {
	background: #3d7d7d;
	color: #fff;
	font-family: Dosis, sans-serif;
	font-size: 13px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 24px 20px 20px;
}

.imma-pied-bas a {
	color: #fff;
	text-decoration: none;
}

.imma-pied-bas a:hover {
	text-decoration: underline;
}

.imma-pied-bas ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 22px;
	margin: 0;
	padding: 0;
}

.imma-pied-bas p {
	margin: 0;
}

/* ------------------------------------------------------------------
   5. Détails hérités : les réponses dépliables de la FAQ,
      les boutons et les séparateurs
   ------------------------------------------------------------------ */

.wp-block-details {
	border: 1px solid #eee;
	border-radius: 8px;
	padding: 14px 18px;
	margin-bottom: 14px;
	background: #fcfcfc;
}

.wp-block-details summary {
	font-family: "Chau Philomene One", sans-serif;
	font-size: 20px;
	color: #333;
	cursor: pointer;
}

.wp-block-details summary::marker {
	color: #4da09e;
}

.wp-block-separator {
	border-color: #eee;
	opacity: 1;
}

.wp-block-image img {
	border-radius: 6px;
}

/* ------------------------------------------------------------------
   6. Les listes d'articles et l'article seul
   ------------------------------------------------------------------ */

.imma-liste .imma-cartes {
	gap: 36px 30px;
}

.imma-liste .imma-cartes > li {
	border: 1px solid #eee;
	border-radius: 10px;
	overflow: hidden;
	padding-bottom: 18px;
	background: #fff;
	transition: box-shadow 0.2s ease;
}

.imma-liste .imma-cartes > li:hover {
	box-shadow: 0 8px 26px rgba(31, 79, 79, 0.16);
}

.imma-liste .imma-cartes .wp-block-post-featured-image {
	margin: 0 0 14px;
}

.imma-liste .imma-cartes .wp-block-post-featured-image img {
	border-radius: 0;
	width: 100%;
	object-fit: cover;
}

.imma-liste .imma-cartes .wp-block-post-date,
.imma-liste .imma-cartes .wp-block-post-title,
.imma-liste .imma-cartes .wp-block-post-excerpt {
	padding-inline: 18px;
}

.imma-liste .imma-cartes .wp-block-post-date {
	color: #aaa;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-family: Dosis, sans-serif;
	font-weight: 700;
	margin-bottom: 6px;
}

.imma-liste .imma-cartes .wp-block-post-title {
	line-height: 1.25;
	margin: 0 0 10px;
}

.imma-liste .imma-cartes .wp-block-post-title a {
	color: #333;
	text-decoration: none;
}

.imma-liste .imma-cartes .wp-block-post-title a:hover {
	color: #4da09e;
}

.imma-liste .imma-cartes .wp-block-post-excerpt__more-link {
	font-family: Dosis, sans-serif;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 13px;
}

/* La pagination et les liens vers l'article voisin. */
.wp-block-query-pagination {
	font-family: Dosis, sans-serif;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 14px;
}

.imma-voisins {
	font-family: Dosis, sans-serif;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 14px;
	gap: 20px;
}

.imma-date {
	color: #aaa;
	font-family: Dosis, sans-serif;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 20px;
}

/* Sur téléphone, une carte par ligne. */
@media (max-width: 781px) {
	.imma-liste .imma-cartes {
		grid-template-columns: 1fr !important;
	}
}

/* La page introuvable. */
.imma-404-chiffre {
	font-size: 92px;
	color: #4da09e;
	line-height: 1;
	margin: 0 0 20px;
}

.imma-404 .wp-block-search__input {
	border: 1px solid #ddd;
	border-radius: 24px 0 0 24px;
	padding: 12px 20px;
}

.imma-404 .wp-block-search__button {
	border-radius: 0 24px 24px 0;
	background: #4da09e;
	color: #fff;
	border: 0;
	font-family: Dosis, sans-serif;
	font-weight: 700;
	text-transform: uppercase;
	padding: 12px 22px;
}

/* Les affiches d'evenement du blog sont souvent en portrait : on les montre en
   entier plutot que de les rogner. Le !important est necessaire, le bloc Image
   mise en avant posant object-fit:cover en style en ligne. */
.imma-liste .imma-cartes .wp-block-post-featured-image img {
	object-fit: contain !important;
	background: #fff;
}

/* ------------------------------------------------------------------
   7. L'animation d'ouverture : l'arbre, la feuille, l'oiseau
   ------------------------------------------------------------------ */

/* Tant que la décision n'est pas prise, le voile n'existe pas : sans
   JavaScript, ou pour qui a demandé moins d'animations, rien ne s'affiche. */
.imma-voile {
	display: none;
}

.imma-ouvre .imma-voile {
	display: flex;
	position: fixed;
	inset: 0;
	z-index: 99999;
	align-items: center;
	justify-content: center;
	background: #fff;
	animation: imma-voile-sortie 0.45s ease 3.2s forwards;
}

.imma-voile--fini {
	animation: imma-voile-sortie 0.35s ease forwards !important;
}

/* Pendant la scène, la page ne défile pas sous le voile. */
.imma-ouvre body {
	overflow: hidden;
}

.imma-voile-scene {
	position: relative;
	width: 260px;
	height: 334px;
}

/* L'arbre pousse : il se découvre du pied vers la cime. */
.imma-voile-arbre {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	clip-path: inset(100% 0 0 0);
	animation: imma-pousse 1.15s cubic-bezier(0.22, 0.61, 0.36, 1) 0.05s forwards;
}

.imma-voile-arbre svg {
	display: block;
	height: 100%;
	width: auto;
}

/* La feuille et l'oiseau sont posés par-dessus, dans le même repère que
   l'arbre : les coordonnées sont celles du dessin, pas celles de l'écran. */
.imma-voile-vol {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.imma-voile-feuille,
.imma-voile-oiseau {
	opacity: 0;
}

.imma-voile-feuille {
	animation: imma-chute 1.05s ease-in 1.15s forwards;
}

.imma-voile-oiseau {
	animation: imma-envol 1.25s cubic-bezier(0.4, 0, 0.2, 1) 2.1s forwards;
}

@keyframes imma-pousse {
	from {
		clip-path: inset(100% 0 0 0);
	}
	to {
		clip-path: inset(0 0 0 0);
	}
}

/* Elle se détache du bord du houppier, tombe en tournant, et s'efface
   là où l'oiseau va paraître. */
@keyframes imma-chute {
	0% {
		transform: translate(170px, 92px) rotate(0deg) scale(1.6);
		opacity: 0;
	}
	18% {
		opacity: 1;
	}
	70% {
		transform: translate(156px, 150px) rotate(150deg) scale(1.6);
		opacity: 1;
	}
	100% {
		transform: translate(152px, 166px) rotate(200deg) scale(1.3);
		opacity: 0;
	}
}

/* Il naît à l'endroit exact où la feuille a disparu, grandit d'un coup,
   puis s'en va par le haut. */
@keyframes imma-envol {
	0% {
		transform: translate(152px, 166px) scale(0.3) rotate(8deg);
		opacity: 0;
	}
	22% {
		transform: translate(152px, 158px) scale(1.25) rotate(0deg);
		opacity: 1;
	}
	60% {
		transform: translate(196px, 96px) scale(1.1) rotate(-12deg);
		opacity: 1;
	}
	100% {
		transform: translate(246px, 24px) scale(0.9) rotate(-18deg);
		opacity: 0;
	}
}

@keyframes imma-voile-sortie {
	to {
		opacity: 0;
		visibility: hidden;
	}
}

/* Par sécurité : même si la classe était posée, on ne joue rien. */
@media (prefers-reduced-motion: reduce) {
	.imma-ouvre .imma-voile {
		display: none;
	}

	.imma-ouvre body {
		overflow: auto;
	}
}
