/*
Theme Name: La Bottine filante
Theme URI: https://cpebottinefilante.org/
Author: UNNO
Description: Thème bloc sur mesure du CPE La Bottine filante. Aucune dépendance externe, polices hébergées localement.
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: bottine-filante
License: GPLv2 or later
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--marine);
	outline-offset: 3px;
	box-shadow: 0 0 0 6px var(--wp--preset--color--soleil);
	border-radius: 4px;
}

::selection { background: var(--wp--preset--color--soleil); color: var(--wp--preset--color--marine); }

img { height: auto; }
.wp-block-image.bf-photo img,
.bf-photo img { border-radius: var(--wp--custom--rayon--photo); }

.bf-lede { font-size: var(--wp--preset--font-size--moyen); line-height: 1.5; max-width: 34ch; }

/* ---------- En-tête ---------- */
.bf-entete {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255, 255, 255, .96);
	backdrop-filter: saturate(1.4) blur(8px);
	border-bottom: 1px solid #E3EDF3;
}
.admin-bar .bf-entete { top: 32px; }
@media (max-width: 782px) { .admin-bar .bf-entete { top: 0; position: relative; } }

.bf-marque { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--wp--preset--color--marine); }
.bf-marque img { width: 52px; height: 52px; object-fit: contain; }
.bf-marque__nom { font-family: var(--wp--preset--font-family--pinceau); font-size: 1.7rem; line-height: 1; }
.bf-marque__nom small { display: block; font-family: var(--wp--preset--font-family--quicksand); font-weight: 700; font-size: .8rem; color: var(--wp--preset--color--ardoise); letter-spacing: .01em; margin-top: .15rem; }

.bf-entete .wp-block-navigation a:where(:not(.wp-element-button)) { text-decoration: none; }
.bf-entete .wp-block-navigation .wp-block-navigation-item__content { padding: .35rem 0; position: relative; }
.bf-entete .wp-block-navigation .current-menu-item > a::after,
.bf-entete .wp-block-navigation a[aria-current="page"]::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 6px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 6' preserveAspectRatio='none'%3E%3Cpath d='M1 4 Q 15 0 30 3 T 59 2' fill='none' stroke='%23A0CF64' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
.bf-entete .wp-block-navigation__submenu-container {
	border: 0 !important; border-radius: var(--wp--custom--rayon--petit);
	box-shadow: 0 12px 30px rgba(0, 72, 117, .14); padding: .5rem !important; min-width: 230px !important;
}
.bf-entete .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: .5rem .75rem !important; }
.bf-bouton-entete .wp-block-button__link { padding: .65rem 1.2rem; font-size: 1rem; }
@media (max-width: 960px) { .bf-entete .bf-bouton-entete { display: none !important; } }
@media (max-width: 520px) {
	.bf-entete .bf-marque__nom { font-size: 1.4rem; }
	.bf-entete .bf-marque__nom small { display: none; }
	.bf-entete .bf-marque img { width: 42px; height: 42px; }
}

/* ---------- Accueil : héros et trajectoire ---------- */
.bf-heros { position: relative; overflow: hidden; }
.bf-heros__titre { font-size: var(--wp--preset--font-size--geant) !important; line-height: .95 !important; color: var(--wp--preset--color--ciel); }
.bf-heros__titre .bf-ligne2 { display: block; color: var(--wp--preset--color--ciel); }
.bf-heros__visuel { position: relative; }
.bf-heros__visuel .bf-bottine { position: relative; z-index: 2; width: min(100%, 520px); margin-inline: auto; display: block; transform: rotate(-6deg); }
.bf-trajet { position: absolute; z-index: 1; pointer-events: none; overflow: visible; }
.bf-heros .bf-trajet { right: 38%; bottom: 8%; width: 95%; height: auto; }
.bf-trajet path { fill: none; stroke: var(--wp--preset--color--pomme); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.bf-trajet .bf-etoile { fill: var(--wp--preset--color--soleil); stroke: var(--wp--preset--color--marine); stroke-width: 2.5; }
@media (prefers-reduced-motion: no-preference) {
	.bf-trajet path { stroke-dasharray: 1600; stroke-dashoffset: 1600; animation: bf-trace 2.2s .3s cubic-bezier(.6, .1, .2, 1) forwards; }
	.bf-trajet .bf-etoile { opacity: 0; transform-box: fill-box; transform-origin: center; animation: bf-etoile .6s 2.3s ease-out forwards; }
	.bf-heros .bf-bottine { animation: bf-envol 1.1s .1s cubic-bezier(.2, .9, .3, 1.2) both; }
}
@keyframes bf-trace { to { stroke-dashoffset: 0; } }
@keyframes bf-etoile { from { opacity: 0; transform: scale(.2) rotate(-40deg); } to { opacity: 1; transform: none; } }
@keyframes bf-envol { from { opacity: 0; transform: translate(-40px, 40px) rotate(-18deg); } to { opacity: 1; transform: rotate(-6deg); } }
@media (max-width: 781px) {
	.bf-heros .bf-trajet { right: auto; left: -10%; bottom: auto; top: -8%; width: 120%; opacity: .55; }
	.bf-heros__visuel .bf-bottine { width: 62%; }
}

/* ---------- Bandeau de titre des pages ---------- */
.bf-titre-page { position: relative; }
.bf-titre-page h1 { margin: 0; }
.bf-titre-page h1::after {
	content: ""; display: block; width: min(260px, 60%); height: 16px; margin-top: .35rem;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 16' preserveAspectRatio='none'%3E%3Cpath d='M3 11 C 50 2, 80 15, 130 8 S 215 3, 257 9' fill='none' stroke='%23A0CF64' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat left / 100% 100%;
}
.has-text-align-center.bf-titre-page h1::after, .bf-titre-page .has-text-align-center::after { margin-inline: auto; }

/* ---------- Accès rapides (nuages) ---------- */
.bf-acces { text-decoration: none; color: inherit; display: block; }
.bf-acces img { width: 150px; height: auto; margin-bottom: .75rem; transition: transform .25s ease; }
.bf-acces h3 { margin: 0 0 .35rem; }
.bf-acces p { margin: 0; color: var(--wp--preset--color--ardoise); }
.bf-acces:hover img { transform: translateY(-4px) rotate(-3deg); }
@media (prefers-reduced-motion: reduce) { .bf-acces:hover img { transform: none; } }
.bf-acces a { text-decoration: none; }
.bf-acces a::after { content: ""; position: absolute; inset: 0; }
.bf-acces-col { position: relative; }

/* ---------- Listes à pastilles ---------- */
.bf-pastilles { list-style: none; padding-left: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.bf-pastilles li { padding: .45rem 1rem .45rem 2rem; border-radius: 999px; background: var(--wp--preset--color--nuage); font-weight: 700; color: var(--wp--preset--color--marine); position: relative; }
.bf-pastilles li::before { content: ""; position: absolute; left: .8rem; top: 50%; width: .65rem; height: .65rem; border-radius: 50%; transform: translateY(-50%); background: var(--wp--preset--color--pomme); }
.bf-pastilles li:nth-child(4n+2)::before { background: var(--wp--preset--color--barbe-a-papa); }
.bf-pastilles li:nth-child(4n+3)::before { background: var(--wp--preset--color--soleil); box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--marine); }
.bf-pastilles li:nth-child(4n+4)::before { background: var(--wp--preset--color--ciel); }

.bf-trait-liste { list-style: none; padding-left: 0; }
.bf-trait-liste li { padding-left: 2.1rem; position: relative; margin-bottom: .6rem; }
.bf-trait-liste li::before {
	content: ""; position: absolute; left: 0; top: .55em; width: 1.4rem; height: .6rem;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 10'%3E%3Cpath d='M2 7 Q 8 1 13 5 T 22 3' fill='none' stroke='%23A0CF64' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ---------- Étapes (admission) ---------- */
.bf-etapes { counter-reset: etape; list-style: none; padding: 0; display: grid; gap: 1.25rem; }
.bf-etapes > li { counter-increment: etape; position: relative; padding: 1.25rem 1.5rem 1.25rem 4.75rem; background: var(--wp--preset--color--nuage); border-radius: var(--wp--custom--rayon--petit); }
.bf-etapes > li::before {
	content: counter(etape); position: absolute; left: 1.25rem; top: 1.1rem; width: 2.5rem; height: 2.5rem; border-radius: 50%;
	display: grid; place-items: center; background: var(--wp--preset--color--marine); color: #fff;
	font-family: var(--wp--preset--font-family--pinceau); font-size: 1.6rem; line-height: 1;
}
.bf-etapes strong { color: var(--wp--preset--color--marine); display: block; font-size: 1.15rem; }

/* ---------- Témoignages ---------- */
.bf-temoignages { columns: 3 280px; column-gap: 2rem; }
.bf-temoignage { break-inside: avoid; margin: 0 0 2rem; padding: 0; }
.bf-temoignage p { margin: 0; font-size: 1.15rem; font-weight: 600; line-height: 1.5; color: var(--wp--preset--color--marine); }
.bf-temoignage p::before { content: "«"; display: block; font-family: var(--wp--preset--font-family--pinceau); font-size: 4rem; line-height: .6; color: var(--wp--preset--color--barbe-a-papa); margin-bottom: .4rem; }
.bf-temoignage cite { display: block; margin-top: .6rem; font-style: normal; font-size: .95rem; color: var(--wp--preset--color--ardoise); }

/* ---------- Équipe ---------- */
.bf-equipe { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2rem 1.5rem; list-style: none; padding: 0; margin: 1.5rem 0 0; }
.bf-equipe--direction { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.bf-membre { text-align: center; }
.bf-membre__photo { width: 128px; aspect-ratio: 1; margin: 0 auto .8rem; border-radius: 50%; overflow: hidden; background: var(--wp--preset--color--nuage); display: grid; place-items: center; box-shadow: 0 0 0 5px #fff, 0 0 0 8px var(--bf-anneau, var(--wp--preset--color--pomme)); }
.bf-equipe--direction .bf-membre__photo { width: 168px; }
.bf-membre__photo img { width: 100%; height: 100%; object-fit: cover; }
.bf-membre__initiales { font-family: var(--wp--preset--font-family--pinceau); font-size: 2.6rem; color: var(--wp--preset--color--marine); }
.bf-membre:nth-child(4n+2) { --bf-anneau: var(--wp--preset--color--barbe-a-papa); }
.bf-membre:nth-child(4n+3) { --bf-anneau: var(--wp--preset--color--soleil); }
.bf-membre:nth-child(4n+4) { --bf-anneau: var(--wp--preset--color--ciel); }
.bf-membre__nom { font-weight: 700; color: var(--wp--preset--color--marine); margin: 0; line-height: 1.3; }
.bf-membre__poste { margin: .15rem 0 0; font-size: .95rem; color: var(--wp--preset--color--ardoise); }

/* ---------- Documents ---------- */
.bf-docs { list-style: none; padding: 0; margin: 1rem 0 0; border-top: 2px solid var(--wp--preset--color--nuage); }
.bf-docs li { border-bottom: 2px solid var(--wp--preset--color--nuage); }
.bf-docs a { display: grid; grid-template-columns: 2.25rem 1fr auto; align-items: center; gap: 1rem; padding: 1rem .5rem; text-decoration: none; color: var(--wp--preset--color--encre); font-weight: 700; }
.bf-docs a:hover { background: var(--wp--preset--color--nuage); }
.bf-docs a:hover .bf-docs__titre { text-decoration: underline; }
.bf-docs__icone { width: 2.25rem; height: 2.25rem; border-radius: 8px; background: var(--wp--preset--color--barbe-a-papa); color: var(--wp--preset--color--marine); display: grid; place-items: center; font-size: .7rem; font-weight: 800; }
.bf-docs__meta { font-size: .9rem; font-weight: 600; color: var(--wp--preset--color--ardoise); white-space: nowrap; }
.bf-docs-vide { color: var(--wp--preset--color--ardoise); }

/* ---------- Cartes d'installation ---------- */
.bf-installation { border-radius: var(--wp--custom--rayon--photo); }

/* ---------- Nouvelles ---------- */
.bf-nouvelles .wp-block-post-featured-image img { border-radius: var(--wp--custom--rayon--petit); aspect-ratio: 3 / 2; object-fit: cover; }
.bf-nouvelles .wp-block-post-title { font-family: var(--wp--preset--font-family--quicksand) !important; font-weight: 700 !important; font-size: 1.3rem !important; line-height: 1.3; }
.bf-nouvelles .wp-block-post-title a { text-decoration: none; }
.bf-nouvelles .wp-block-post-title a:hover { text-decoration: underline; }

/* ---------- Formulaire ---------- */
.bf-form { display: grid; gap: 1.1rem; }
.bf-form__rangee { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 640px) { .bf-form__rangee { grid-template-columns: 1fr; } }
.bf-form label { display: block; font-weight: 700; color: var(--wp--preset--color--marine); margin-bottom: .35rem; }
.bf-form label .bf-facultatif { font-weight: 500; color: var(--wp--preset--color--ardoise); }
.bf-form input[type=text], .bf-form input[type=email], .bf-form input[type=tel], .bf-form select, .bf-form textarea {
	width: 100%; box-sizing: border-box; font: inherit; color: var(--wp--preset--color--encre);
	padding: .75rem .9rem; border: 2px solid #C9D9E3; border-radius: var(--wp--custom--rayon--petit); background: #fff;
}
.bf-form textarea { min-height: 160px; resize: vertical; }
.bf-form input:focus, .bf-form select:focus, .bf-form textarea:focus { border-color: var(--wp--preset--color--marine); }
.bf-form__consentement { display: flex; gap: .7rem; align-items: flex-start; font-size: .98rem; }
.bf-form__consentement input { width: 1.25rem; height: 1.25rem; margin-top: .2rem; accent-color: var(--wp--preset--color--marine); flex: none; }
.bf-form__consentement label { font-weight: 500; color: var(--wp--preset--color--encre); margin: 0; }
.bf-form button { justify-self: start; cursor: pointer; border: 0; }
.bf-form__piege { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.bf-alerte { padding: 1rem 1.25rem; border-radius: var(--wp--custom--rayon--petit); font-weight: 600; }
.bf-alerte--erreur { background: #FDE8F1; color: #7A1745; border-left: 6px solid var(--wp--preset--color--barbe-a-papa); }
.bf-alerte--info { background: var(--wp--preset--color--nuage); color: var(--wp--preset--color--marine); }

/* ---------- Pied de page ---------- */
.bf-pied a { color: #fff; }
.bf-pied a:hover { color: var(--wp--preset--color--soleil); }
.bf-pied :focus-visible { outline-color: var(--wp--preset--color--soleil); box-shadow: none; }
.bf-pied .bf-marque__nom { color: #fff; }
.bf-pied .bf-marque__nom small { color: #CFE3EE; }
.bf-pied__titre { letter-spacing: .01em; color: var(--wp--preset--color--soleil) !important; }
.bf-pied a { overflow-wrap: normal; word-break: normal; }
.bf-pied__liste { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.bf-pied__petit { color: #CFE3EE; font-size: .9rem; }
.bf-pied__vague { display: block; width: 100%; height: 40px; color: var(--wp--preset--color--marine); margin-bottom: -1px; }

/* ---------- Divers ---------- */
.bf-deco { position: absolute; pointer-events: none; }
.bf-carte-lien { text-decoration: none; }
.wp-block-search__input { border-radius: 999px; border: 2px solid #C9D9E3; padding: .6rem 1rem; }
.wp-block-search__button { border-radius: 999px; }

/* ---------- Pages : grille alignée à gauche sur la largeur « wide » ---------- */
.bf-contenu > :where(p, h2, h3, h4, ul:not(.bf-equipe), ol, .wp-block-buttons, .wp-block-list, .wp-block-quote, .wp-block-table, form, .bf-alerte),
.bf-contenu > .alignfull.is-layout-constrained > :where(p, h2, h3, h4, ul, ol, .wp-block-buttons) {
	max-width: min(760px, 100%) !important;
	margin-left: max(0px, calc((100% - var(--wp--style--global--wide-size)) / 2)) !important;
	margin-right: auto !important;
}
.bf-contenu > .bf-equipe { margin-left: auto !important; margin-right: auto !important; }
.bf-lede { max-width: 46ch !important; }
.bf-contenu > .bf-docs { max-width: min(860px, 100%) !important; }

/* ---------- Connexion (Espace du personnel) ---------- */
#loginform { max-width: 420px; display: grid; gap: 1rem; margin-top: 1.5rem; }
#loginform p { margin: 0; }
#loginform label { display: block; font-weight: 700; color: var(--wp--preset--color--marine); margin-bottom: .35rem; }
#loginform input[type=text], #loginform input[type=password] {
	width: 100%; box-sizing: border-box; font: inherit; padding: .75rem .9rem;
	border: 2px solid #C9D9E3; border-radius: var(--wp--custom--rayon--petit);
}
#loginform .login-remember label { display: flex; gap: .6rem; align-items: center; font-weight: 500; color: var(--wp--preset--color--encre); }
#loginform .login-remember input { width: 1.2rem; height: 1.2rem; accent-color: var(--wp--preset--color--marine); }
#loginform input[type=submit] {
	font: inherit; font-weight: 700; cursor: pointer; border: 0; border-radius: 999px; padding: .8rem 1.6rem;
	background: var(--wp--preset--color--marine); color: #fff;
}
#loginform input[type=submit]:hover { background: var(--wp--preset--color--ciel); }

/* Classes de titres (évitent les styles en ligne, pour des blocs toujours valides dans l'éditeur) */
.bf-titre-pinceau { font-family: var(--wp--preset--font-family--pinceau) !important; font-weight: 400 !important; line-height: 1.12; }
.bf-titre-texte { font-family: var(--wp--preset--font-family--quicksand) !important; font-weight: 700 !important; }
