/*
Theme Name:   OACP Valais
Description:  Thème enfant de Twenty Twenty-Five — charte Formation Continue OACP Entreprise.
Template:     twentytwentyfive
Version:      1.0.0
Text Domain:  oacp
*/

/* Texte en Open Sans Light (300) : le gras doit viser une vraie graisse, pas « bolder » (= 400) */
strong, b { font-weight: 700; }

/* En-tête collant : reste en haut au défilement, se compacte une fois le haut de page dépassé */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 100;
	background: var(--wp--preset--color--base);
	transition: box-shadow 0.4s ease;
}
header.wp-block-template-part .wp-block-site-logo img { transition: width 0.4s ease; }
header.wp-block-template-part .alignwide { transition: padding 0.4s ease; }
header.wp-block-template-part.est-colle { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12); }
header.wp-block-template-part.est-colle .wp-block-site-logo img { width: 140px !important; height: auto; }
header.wp-block-template-part.est-colle .alignwide { padding-top: 0.4rem !important; padding-bottom: 0.4rem !important; }
@media (max-width: 600px) {
	/* barre d'admin non collante sur mobile : l'en-tête se colle tout en haut */
	.wp-site-blocks > header.wp-block-template-part { top: 0; }
}

/* Formulaire d'inscription (Contact Form 7) */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="date"],
.wpcf7 input[type="number"],
.wpcf7 select,
.wpcf7 textarea {
	width: 100%;
	padding: 0.1em 0.12em;
	margin-bottom: 0.9em;   /* écart avec le libellé du champ suivant */
	border: 1px solid var(--wp--preset--color--accent-1);
	border-radius: 2px;
	font: inherit;
	font-size: calc(1em - 2px);
}
.wpcf7 input[type="submit"] {
	padding: 0.8em 2em;
	border: 0;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-family: var(--wp--preset--font-family--open-sans); font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	cursor: pointer;
}
.wpcf7 input[type="submit"]:hover { background: var(--wp--preset--color--accent-1); }
.wpcf7 fieldset { border: 0; padding: 0; margin: 1.5em 0 0; }
.wpcf7 legend { font-family: var(--wp--preset--font-family--open-sans); font-weight: 600; text-transform: uppercase; margin-bottom: 0.5em; }

/* Champ piège anti-spam : hors écran, jamais affiché */
.oacp-piege { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Cours complet (extension de limite de places) */
.oacp-complet {
	padding: 1em 1.2em;
	background: var(--wp--preset--color--accent-2);
	border-left: 4px solid var(--wp--preset--color--contrast);
}

/* ---------- Effets (accueil et liens) ---------- */

/* Liens : pas de soulignement, couleur plus claire au survol avec transition */
body a:not(.wp-element-button) {
	text-decoration: none;
	transition: color 0.5s ease;
}
body a:not(.wp-element-button):hover,
body a:not(.wp-element-button):focus-visible {
	text-decoration: none;
	color: var(--wp--preset--color--accent-1);
}
/* Sur fond sombre (pied de page, bandeau) : blanc adouci */
body .has-base-color a:not(.wp-element-button):hover,
body .has-base-color a:not(.wp-element-button):focus-visible {
	color: rgba(255, 255, 255, 0.7);
}

/* Grille des formations : voile blanc en fondu au survol */
.oacp-grille .wp-block-post-featured-image { position: relative; overflow: hidden; }
.oacp-grille .wp-block-post-featured-image::after {
	content: "";
	position: absolute;
	inset: 0;
	background: #fff;
	opacity: 0;
	transition: opacity 0.5s ease;
	pointer-events: none;
}
.oacp-grille .wp-block-post:hover .wp-block-post-featured-image::after { opacity: 0.35; }

/* Bandeau d'accueil : entrée du texte en glissé */
@keyframes oacp-slide-in {
	from { opacity: 0; transform: translateX(-40px); }
	to   { opacity: 1; transform: none; }
}
.oacp-hero > * { animation: oacp-slide-in 0.9s ease-out both; }
.oacp-hero > :nth-child(2) { animation-delay: 0.15s; }
.oacp-hero > :nth-child(3) { animation-delay: 0.3s; }
.oacp-hero .oacp-theme { animation: oacp-slide-in 0.9s ease-out both; }
.oacp-hero .oacp-theme:nth-child(1) { animation-delay: 0.45s; }
.oacp-hero .oacp-theme:nth-child(2) { animation-delay: 0.6s; }
.oacp-hero .oacp-theme:nth-child(3) { animation-delay: 0.75s; }

/* Thèmes 2027 : cadre sombre transparent */
.oacp-theme {
	padding: var(--wp--preset--spacing--40);
	background: rgba(0, 0, 0, 0.45);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 4px;
}

/* ---------- Pages ---------- */

/* Bande grise pleine largeur avec le titre de la page */
.oacp-titre-page .wp-block-post-title {
	margin: 0;
	font-family: var(--wp--preset--font-family--open-sans); font-weight: 600;
	font-size: clamp(1.62rem, 3.15vw, 2.34rem);
	text-transform: uppercase;
	letter-spacing: 0.042em;
}
.oacp-titre-page .wp-block-post-title::after {
	content: "";
	display: block;
	width: 60px;
	height: 3px;
	margin-top: 0.35em;
	background: var(--wp--preset--color--turquoise);
}

/* Titre de section (style « Section OACP ») : centré entre deux filets */
.wp-block-heading.is-style-section {
	display: flex;
	align-items: center;
	gap: 0.9em;
	margin-top: var(--wp--preset--spacing--60);
	margin-bottom: var(--wp--preset--spacing--40);
	font-size: calc(var(--wp--preset--font-size--x-large) * 0.9); /* taille h2 de Twenty Twenty-Five -10 % */
	text-transform: uppercase;
	letter-spacing: 0.056em;
	text-align: center;
}
.wp-block-heading.is-style-section::before,
.wp-block-heading.is-style-section::after {
	content: "";
	flex: 1;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--wp--preset--color--turquoise));
}
.wp-block-heading.is-style-section::after { background: linear-gradient(90deg, var(--wp--preset--color--turquoise), transparent); }
.wp-block-post-content > .wp-block-heading.is-style-section:first-child,
.alignfull > .wp-block-heading.is-style-section:first-child { margin-top: 0; }

/* Filtre des formations par thème */
.oacp-filtre {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5em;
	margin-bottom: var(--wp--preset--spacing--50);
}
.oacp-filtre button {
	padding: 0.5em 1.2em;
	border: 1px solid var(--wp--preset--color--accent-5);
	border-radius: 2px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--open-sans); font-weight: 600;
	font-size: 0.95rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	cursor: pointer;
	transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease;
}
.oacp-filtre button:hover { border-color: var(--wp--preset--color--turquoise); color: var(--wp--preset--color--turquoise-fonce); }
.oacp-filtre button.est-actif { background: var(--wp--preset--color--turquoise); border-color: var(--wp--preset--color--turquoise); color: #fff; }
@keyframes oacp-fondu { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
.oacp-grille .wp-block-post.oacp-apparition { animation: oacp-fondu 0.5s ease both; }
.oacp-grille .wp-block-post[hidden] { display: none; }

/* Liens « s'inscrire » des dates disponibles : turquoise de l'accueil, plus clair au survol */
body .oacp-dates a:not(.wp-element-button) { color: var(--wp--preset--color--turquoise-fonce); font-weight: 700; }
body .oacp-dates a:not(.wp-element-button):hover,
body .oacp-dates a:not(.wp-element-button):focus-visible { color: #5FD0DE; }

/* Icônes des autres formations (reprises de l'ancien thème) */
.oacp-icone { color: var(--wp--preset--color--turquoise); line-height: 0; }

/* Page Contact : bloc adresse centré, texte small */
.oacp-adresse { text-align: center; }
.oacp-adresse p { font-size: var(--wp--preset--font-size--small); }

/* Règlements : icône à gauche, titre et texte à droite ; texte petit et justifié */
.oacp-regle {
	display: grid;
	grid-template-columns: 36px 1fr;
	column-gap: 0.9em;
	align-content: start;
}
.wp-block-column.oacp-regle > * { grid-column: 2; margin-block-start: 0; }
.oacp-regle > .oacp-icone { grid-column: 1; grid-row: 1 / span 10; padding-top: 0.15em; }
.oacp-regle > .oacp-icone svg { width: 36px; height: 36px; }
.oacp-regle > .wp-block-heading { margin-bottom: 0.4em; }
.oacp-regle > p {
	margin-bottom: 0.6em;
	font-size: var(--wp--preset--font-size--small);
	text-align: justify;
	hyphens: auto;
}

@media (prefers-reduced-motion: reduce) {
	.oacp-grille .wp-block-post.oacp-apparition { animation: none; }
	.oacp-hero > *, .oacp-hero .oacp-theme { animation: none; }
	body a:not(.wp-element-button), .oacp-grille .wp-block-post-featured-image::after { transition: none; }
}
