/*
Theme Name: Olepsys
Theme URI: https://olepsys.fr/
Author: Groupe Écho
Description: Thème de blocs sur mesure d'Olepsys, centre de formation du Groupe Écho. Mêmes couleurs, polices et composants que le thème Groupe Écho (noir et or).
Version: 0.2.1
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: olepsys
*/

/*
 * Couleurs, polices, tailles, espacements : theme.json (variables --wp--preset--*).
 * Ce fichier ne contient que ce que theme.json ne sait pas exprimer : mises en page, contours de texte, survols.
 * Base reprise du thème Groupe Écho, réduite aux composants utilisés ici.
 */

:root {
	--noir: var(--wp--preset--color--noir);
	--charbon: var(--wp--preset--color--charbon);
	--trait: var(--wp--preset--color--trait);
	--or: var(--wp--preset--color--or);
	--or-vif: var(--wp--preset--color--or-vif);
	--or-sombre: var(--wp--preset--color--or-sombre);
	--ivoire: var(--wp--preset--color--ivoire);
	--gris: var(--wp--preset--color--gris);
	--titre: var(--wp--preset--font-family--titre);
	--texte: var(--wp--preset--font-family--texte);
	--italique: var(--wp--preset--font-family--italique);
	--bande: var(--wp--preset--spacing--bande);
	--colonnes: var(--wp--preset--spacing--colonnes);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; height: auto; }
a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--or-vif); outline-offset: 3px; }
p { margin: 0 0 1rem; max-width: 62ch; }
ul, ol { margin: 0; padding: 0; }
[id] { scroll-margin-top: 100px; }
h1, h2, h3, h4 { word-spacing: .12em; margin: 0 0 1.25rem; }
h1, h2, h3 { -webkit-text-stroke: .022em currentColor; }
h1 em, h2 em, h3 em { -webkit-text-stroke: 0; }
em { font-family: var(--italique); font-style: italic; font-weight: 300; text-transform: none; letter-spacing: 0; color: var(--or); }
.skip { position: absolute; left: -999px; top: 0; background: var(--or); color: #000; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.wrap { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: 24px; }
.band { padding-block: var(--bande); }
.band.charbon { background: var(--charbon); }
.lead { font-size: var(--wp--preset--font-size--lead); color: var(--ivoire); max-width: 56ch; line-height: 1.5; }
.muted { color: var(--gris); }
.surtitre { font-weight: 700; text-transform: uppercase; letter-spacing: .18em; color: var(--or); font-size: .92rem; margin: 0 0 1.1rem; }

/* Boutons */
.btn { display: inline-block; background: var(--or); color: #000; font-weight: 700; text-decoration: none; padding: 1rem 1.7rem; border: 2px solid var(--or); box-shadow: 6px 6px 0 var(--or-sombre); }
.btn, .wp-block-button__link { transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover { background: var(--or-vif); border-color: var(--or-vif); color: #000; box-shadow: 3px 3px 0 var(--or-sombre); }
.btn:hover, .wp-block-button__link:hover { transform: translate(3px, 3px); }
.is-style-ghost .wp-block-button__link { background: transparent; color: var(--or); box-shadow: none; }
.is-style-ghost .wp-block-button__link:hover { background: var(--or); color: #000; transform: none; box-shadow: none; }
.wp-block-button .wp-block-button__link { display: block; }
.wp-block-buttons.actions { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: var(--wp--preset--spacing--actions); }

/* En-tête */
.site-header { position: sticky; top: 0; z-index: 50; background: #000; border-bottom: 1px solid var(--or-sombre); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 84px; }
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { height: 52px; width: auto; }
.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a { color: var(--ivoire); text-decoration: none; font-weight: 600; font-size: var(--wp--preset--font-size--petit); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--or); }
.nav .btn { color: #000; padding: .8rem 1.3rem; }
.nav .btn:hover { color: #000; }
.menu-btn { display: none; background: none; border: 2px solid var(--or); color: var(--or); padding: .5rem .9rem; font: inherit; font-weight: 700; cursor: pointer; }

/* Méga menu Formations */
.nav { align-self: stretch; }
.mm-wrap { align-self: stretch; display: flex; align-items: center; }
.nav .mm-btn { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0; background: none; border: 0; font: inherit; font-weight: 600; font-size: var(--wp--preset--font-size--petit); color: var(--ivoire); cursor: pointer; }
.nav .mm-btn:hover, .nav .mm-btn[aria-expanded="true"] { color: var(--or); }
button.mm-btn::after { content: ""; width: .45em; height: .45em; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-.1em) rotate(45deg); }
button.mm-btn[aria-expanded="true"]::after { transform: translateY(.1em) rotate(-135deg); }
.mm { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #000; border-top: 1px solid var(--or-sombre); border-bottom: 2px solid var(--or); }
.mm.ouvert { display: block; }
.mm-in { max-width: 1280px; margin-inline: auto; padding: 2rem 24px 1.5rem; }
.mm-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
.mm ul { list-style: none; }
.nav .mm li a { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 44px; padding-block: .25rem; line-height: 1.3; }
.nav .mm li a:hover, .nav .mm-tout a:hover { color: var(--or); }
.mm-voir { display: none; }
.mm-d { flex: none; font-weight: 400; color: var(--gris); white-space: nowrap; }
.nav .mm-titre { display: flex; align-items: center; min-height: 44px; margin-bottom: .5rem; border-bottom: 1px solid var(--or-sombre); color: var(--or); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.nav .mm-titre:hover { color: var(--or-vif); }
.mm-tout { margin: 1.25rem 0 0; padding-top: .75rem; border-top: 1px solid var(--trait); max-width: none; }
.nav .mm-tout a { display: inline-flex; align-items: center; min-height: 44px; color: var(--or); font-weight: 700; }
.mm-tout a::after { content: " →"; white-space: pre; }
@media (min-width: 1081px) {
	.mm-col summary { display: none; }
	.mm-col::details-content { content-visibility: visible; }
	/* Panneau aéré, et décollé du contenu : le reste de la page est estompé et flouté. */
	.mm { background: var(--charbon); border-bottom-width: 1px; }
	.mm.ouvert::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 100vh; background: rgb(0 0 0 / .72); backdrop-filter: blur(3px); pointer-events: none; }
	.mm-in { padding: 3rem 24px 2.25rem; }
	.mm-cols { gap: 3.5rem; }
	.nav .mm-titre { margin-bottom: 1rem; border-bottom-color: var(--trait); font-size: .82rem; }
	.nav .mm li a { padding-block: .45rem; font-weight: 500; }
	.mm-tout { margin-top: 2.25rem; }
}

/* Hero (texte seul : aucune image à charger) */
.hero { position: relative; overflow: hidden; border-bottom: 4px solid var(--or); padding-block: clamp(4rem, 11vw, 9rem); }
.hero > .wrap { position: relative; z-index: 2; }
.hero::after { content: "Former"; position: absolute; right: -.04em; bottom: -.22em; z-index: 0; font-family: var(--titre); font-weight: 900; text-transform: uppercase; font-size: clamp(8rem, 26vw, 24rem); line-height: 1; color: transparent; -webkit-text-stroke: 2px var(--trait); pointer-events: none; }
.hero h1 { font-size: var(--wp--preset--font-size--hero); overflow-wrap: break-word; max-width: 13em; line-height: .96; margin-bottom: 1.6rem; }
.hero h1 em { font-size: 1.08em; }
.hero .lead { font-size: clamp(1.15rem, 1.8vw, 1.45rem); font-weight: 500; max-width: 40ch; }

/* En-tête de page intérieure */
.pagehead { position: relative; overflow: hidden; padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(2.5rem, 5vw, 4rem); border-bottom: 4px solid var(--or); }
.pagehead h1 { font-size: clamp(1.9rem, 4.6vw, 3.9rem); max-width: 18em; line-height: 1; overflow-wrap: break-word; }
.pagehead .lead { max-width: 52ch; }
.fil { font-size: .92rem; color: var(--gris); margin-bottom: 1.5rem; }
.fil a { color: var(--gris); }
.fil a:hover { color: var(--or); }
.stage { display: inline-block; background: var(--or); color: #000; padding: .3rem .8rem; font-size: .9rem; font-weight: 700; margin-bottom: 1.25rem; }

/* Cartes de catégories */
.cartes { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 3rem; border: 1px solid var(--or-sombre); }
.carte { position: relative; padding: 2rem 1.6rem 2.2rem; border-right: 1px solid var(--or-sombre); display: flex; flex-direction: column; transition: background .15s; }
.carte:last-child { border-right: 0; }
.carte:hover { background: var(--charbon); }
.carte .n { font-family: var(--titre); font-weight: 900; font-size: 4rem; line-height: 1; color: transparent; -webkit-text-stroke: 2px var(--or); margin: 0 0 1rem; }
.carte h3 { font-size: clamp(1.2rem, 1.6vw, 1.45rem); line-height: 1.05; margin-bottom: 1rem; }
.carte h3 a { color: var(--ivoire); text-decoration: none; }
.carte h3 a::after { content: ""; position: absolute; inset: 0; } /* toute la carte est cliquable */
.carte:hover h3 a { color: var(--or); }
.carte p { color: var(--gris); }
.carte .carte-nb { margin: auto 0 0; color: var(--or); font-weight: 700; }

/* Liste des formations */
.groupe { margin-top: 3.5rem; }
.groupe:first-of-type { margin-top: 2.5rem; }
.groupe-titre { font-size: clamp(1.5rem, 2.6vw, 2.1rem); border-bottom: 2px solid var(--or-sombre); padding-bottom: 1rem; }
.groupe-titre a { color: var(--ivoire); text-decoration: none; }
.groupe-titre a:hover { color: var(--or); }
.fcartes { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 1.5rem; }
.fcarte { position: relative; display: flex; flex-direction: column; border: 1px solid var(--or-sombre); padding: 1.6rem; background: var(--noir); transition: border-color .15s, transform .15s; }
.fcarte:hover { border-color: var(--or); transform: translateY(-3px); }
.fcarte-titre { font-family: var(--texte); font-weight: 700; -webkit-text-stroke: 0; font-size: 1.12rem; line-height: 1.2; text-transform: none; letter-spacing: 0; margin-bottom: .8rem; }
.fcarte-titre a { color: var(--ivoire); text-decoration: none; }
.fcarte-meta { color: var(--gris); margin-bottom: 1.4rem; }
.fcarte-lien { margin-top: auto; color: var(--or); font-weight: 700; text-decoration: none; }
.fcarte-lien::after { content: " →"; }
.fcarte-lien::before { content: ""; position: absolute; inset: 0; }

/* Déroulé d'une session */
.etapes { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--colonnes); margin-top: 3rem; counter-reset: m; }
.etapes .etape { counter-increment: m; display: grid; grid-template-columns: 4rem 1fr; padding: 1.5rem 0; border-top: 1px solid var(--or-sombre); }
.etapes .etape::before { content: counter(m, decimal-leading-zero); grid-row: 1 / span 2; font-family: var(--titre); font-weight: 900; font-size: 2rem; color: var(--or); line-height: 1; }
.etapes .etape > * { grid-column: 2; }
.etapes h3 { margin: 0 0 .3rem; font-size: 1.2rem; }
.etapes p { margin: 0; color: var(--gris); }

/* Fiche formation */
.fiche { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.fiche-band { padding-top: clamp(2.5rem, 5vw, 4rem); }
.fiche-liste { margin: 0; border-bottom: 1px solid var(--or-sombre); }
.fiche-ligne { display: grid; grid-template-columns: 14rem 1fr; gap: 1rem 2rem; padding: 1.4rem 0; border-top: 1px solid var(--or-sombre); }
.fiche-liste dt { color: var(--or); font-weight: 700; }
.fiche-liste dd { margin: 0; }
.fiche-liste dd p { margin: 0 0 .5rem; max-width: 60ch; }
.fiche-liste dd p:last-child { margin-bottom: 0; }
.liste-fiche { list-style: none; margin: 0 0 .5rem; }
.liste-fiche li { position: relative; padding: .25rem 0 .25rem 1.6rem; }
.liste-fiche li::before { content: ""; position: absolute; left: 0; top: 1rem; width: .9rem; height: 3px; background: var(--or); }
.h-section { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin: 3.5rem 0 1.25rem; }
.fiche-aside { position: sticky; top: 108px; border: 2px solid var(--or); padding: 1.8rem; }
.fiche-aside h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.fiche-tel { font-family: var(--titre); font-weight: 900; font-size: 1.8rem; margin-bottom: 1rem; }
.fiche-tel a { color: var(--ivoire); text-decoration: none; }
.fiche-tel a:hover { color: var(--or); }
.fiche-aside .actions { margin-top: 1.5rem; }
.contenu-article { max-width: 46rem; }
.contenu-article :is(ul, ol) { margin: 0 0 1rem; padding-left: 1.4rem; }
.contenu-article li { margin-bottom: .4rem; }

/* Indicateurs de résultats */
.indicateurs { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.indicateurs li { border: 1px solid var(--or-sombre); padding: 1.4rem; display: flex; flex-direction: column; gap: .35rem; }
.indicateurs strong { color: var(--or); }
.indicateurs .valeur { font-family: var(--titre); font-weight: 900; font-size: 1.35rem; line-height: 1.15; }
.indicateurs .base { color: var(--gris); font-size: var(--wp--preset--font-size--petit); }
.indicateurs .calcul { color: var(--gris); font-size: var(--wp--preset--font-size--petit); margin-top: .4rem; }
.indicateurs .calcul em { font-family: var(--texte); font-style: normal; font-weight: 700; color: var(--gris); }

/* Appel à l'action final */
.cta-final { border-top: 4px solid var(--or); background: var(--charbon); }
.cta-final h2 { font-size: clamp(1.9rem, 4vw, 3.4rem); line-height: 1.05; max-width: 14em; overflow-wrap: break-word; margin-top: 0; }

/* Pied de page */
.site-footer { background: var(--charbon); border-top: 4px solid var(--or); padding: 4.5rem 0 2rem; font-size: var(--wp--preset--font-size--petit); }
.pied { display: grid; grid-template-columns: 1.4fr 1.4fr 1fr 1fr; gap: 2.5rem; }
.pied h2 { font-family: var(--texte); font-weight: 700; -webkit-text-stroke: 0; font-size: .9rem; letter-spacing: .16em; margin-bottom: 1rem; color: var(--or); line-height: 1; }
.pied ul { list-style: none; }
.pied li { padding: .2rem 0; }
.pied a { color: var(--ivoire); text-decoration: none; }
.pied a:hover { color: var(--or); }
.pied img { width: 190px; height: auto; margin-bottom: 1rem; }
.bas { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--trait); color: var(--gris); }
.bas p { margin: 0; }

/* Points de rupture */
@media (max-width: 1080px) {
	.nav { position: absolute; left: 0; right: 0; top: 84px; background: #000; border-bottom: 2px solid var(--or); flex-direction: column; align-items: flex-start; padding: 1.5rem 24px 2rem; gap: 1.2rem; display: none; }
	.nav.ouvert { display: flex; }
	.menu-btn { display: block; }
	.nav { gap: 0; }
	.nav > a:not(.btn) { display: flex; align-items: center; min-height: 44px; }
	.nav .btn { margin-top: 1rem; }
	.mm-wrap { flex-direction: column; align-items: stretch; width: 100%; }
	.nav .mm-btn { justify-content: space-between; }
	.mm { position: static; background: none; border: 0; }
	.mm-in { padding: 0 0 0 1rem; }
	.mm-cols { display: block; }
	.mm-nom { display: none; }
	.mm-voir { display: inline; }
	.nav .mm-titre { min-height: 44px; margin: 0; border: 0; text-transform: none; letter-spacing: 0; font-weight: 400; }
	.nav .mm-voir::after { content: " →"; white-space: pre; }
	.mm-col summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; cursor: pointer; font-weight: 700; color: var(--or); border-bottom: 1px solid var(--trait); list-style: none; }
	.mm-col summary::-webkit-details-marker { display: none; }
	.mm-col summary::after { content: "+"; font-size: 1.25rem; }
	.mm-col[open] summary::after { content: "\2212"; }
	.cartes { grid-template-columns: 1fr 1fr; }
	.carte:nth-child(2) { border-right: 0; }
	.carte:nth-child(-n+2) { border-bottom: 1px solid var(--or-sombre); }
	.fcartes { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
	.fiche { grid-template-columns: minmax(0, 1fr); }
	.fiche-aside { position: static; order: -1; }
	.fiche-ligne { grid-template-columns: 1fr; gap: .4rem; }
	.etapes { grid-template-columns: 1fr; }
	.pied { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
	.cartes, .fcartes, .indicateurs, .pied { grid-template-columns: 1fr; }
	.carte { border-right: 0; border-bottom: 1px solid var(--or-sombre); }
	.carte:last-child { border-bottom: 0; }
	.hero::after { display: none; }
	.logo img { height: 40px; }
	.btn, .wp-block-button .wp-block-button__link { padding: .95rem 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.btn, .wp-block-button__link, .fcarte, .carte { transition: none; }
	.fcarte:hover { transform: none; }
}

/* FAQ en accordéon */
.faq h2 { margin-bottom: 2rem; }
.faq-liste { max-width: 62rem; border-bottom: 1px solid var(--or-sombre); }
.faq-item { border-top: 1px solid var(--or-sombre); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 44px; padding: 1.2rem 0; cursor: pointer; font-weight: 700; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; flex: none; font-size: 1.5rem; line-height: 1; color: var(--or); }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item summary:hover { color: var(--or); }
.faq-rep { padding: 0 0 1.4rem; }
.faq-rep p { margin: 0; color: var(--gris); }

/* Formulaire de contact (Forminator) : bouton d'envoi comme .btn */
.forminator-button-submit { display: inline-block; cursor: pointer; background: var(--or); color: #000; font: inherit; font-weight: 700; padding: 1rem 1.7rem; border: 2px solid var(--or); box-shadow: 6px 6px 0 var(--or-sombre); transition: transform .15s, box-shadow .15s, background .15s; }
.forminator-button-submit:hover { background: var(--or-vif); border-color: var(--or-vif); box-shadow: 3px 3px 0 var(--or-sombre); transform: translate(3px, 3px); }
@media (prefers-reduced-motion: reduce) { .forminator-button-submit { transition: none; } }

/* Mascotte : les fichiers ont un fond blanc, fondu (multiply) dans un cadre or ; le pelage noir reste noir */
.mascotte { margin: 0; width: min(100%, 400px); aspect-ratio: 4 / 5; overflow: hidden; background: var(--or); border: 1px solid var(--or-sombre); box-shadow: 14px 14px 0 var(--or-sombre); }
.mascotte img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.hero-grille, .cta-grille { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: var(--colonnes); align-items: center; }
.hero-grille > *, .cta-grille > * { margin: 0; min-width: 0; }
.cta-texte > :first-child { margin-top: 0; }
.cta-grille { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); }
.hero-mascotte { width: 100%; justify-self: end; }
/* Accueil : mascotte détourée (PNG/WebP transparent), sans cadre ni fond */
.hero-mascotte.mascotte { background: none; border: 0; box-shadow: none; overflow: visible; }
.hero-mascotte.mascotte img { object-fit: contain; mix-blend-mode: normal; }
.cta-mascotte { width: 100%; max-width: 320px; justify-self: end; }
.pagehead .cta-grille { align-items: end; }

/* Repères sous le hero : tarif, effectif, certification */
.chiffres { background: var(--charbon); border-bottom: 1px solid var(--trait); }
.chiffres ul { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); }
.chiffres li { padding: 1.9rem 1.5rem 1.9rem 0; border-right: 1px solid var(--trait); margin-right: 1.5rem; }
.chiffres li:last-child { border-right: 0; margin-right: 0; }
.chiffres strong { display: block; font-family: var(--titre); font-weight: 900; font-size: 1.5rem; text-transform: uppercase; color: var(--or); line-height: 1.1; }
.chiffres span { color: var(--gris); }
@media (max-width: 980px) {
	.hero-grille, .cta-grille { grid-template-columns: 1fr; }
	.hero-mascotte { max-width: 260px; justify-self: start; }
	.cta-mascotte { max-width: 220px; justify-self: start; }
}
@media (max-width: 620px) {
	.chiffres ul { grid-template-columns: 1fr; }
	.chiffres li { border-right: 0; margin-right: 0; padding: 1.1rem 0; border-bottom: 1px solid var(--trait); }
	.chiffres li:last-child { border-bottom: 0; }
}
