/**
 * Grandis — styles d'animation
 *
 * Les états initiaux des apparitions (opacity:0 / translate) ont été retirés :
 * ils sont désormais posés par GSAP dans js/app.js. Deux raisons :
 *  - le CSS masquait le contenu tant que le JS n'avait pas ajouté `.active-trigger`,
 *    donc une erreur JS rendait la page blanche ;
 *  - la cascade reposait sur des transition-delay nth-child(1..5), donc plafonnée
 *    à 5 éléments — le stagger GSAP n'a pas cette limite.
 */

/* Titre et contenu de sous-catégorie */
.subcategory-title, .subcategory-content {
	transition: 0.5s all cubic-bezier(0.43, 0.195, 0.02, 1);
}
.subcategory-content {
	opacity: 0;
	display: none;
}
.subcategory-content.active, .subcategory-title.active {
	opacity: 1;
	display: block !important;
}

/* Effet de survol pour les logos et les liens de bouton */
.logos a img, .wp-block-button__link, button {
	transition: all 0.35s;
}
.logos a:hover img {
	transform: scale(1.05);
}

/* --------------------------------------------------------------------------
 * Cartes d'actualités — survol
 * `(hover:hover) and (pointer:fine)` plutôt qu'une largeur : évite le survol
 * « collant » sur tablette/mobile tactile, où le style resterait après un tap.
 * Le zoom de l'image est rogné par la couverture (overflow:clip, radius 30px).
 * ----------------------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
	.wp-block-post {
		transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1);
	}
	.wp-block-post:hover {
		transform: translateY(-6px);
	}

	.wp-block-post .wp-block-cover {
		transition: box-shadow 0.35s ease;
	}
	.wp-block-post:hover .wp-block-cover {
		box-shadow: 0 16px 32px rgba(35, 48, 40, 0.18);
	}

	.wp-block-post .wp-block-cover__image-background {
		transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
	}
	.wp-block-post:hover .wp-block-cover__image-background {
		transform: scale(1.07);
	}

	.wp-block-post h2 {
		transition: color 0.3s ease;
	}
	.wp-block-post:hover h2 {
		color: #41ae96;
	}
}

/* --------------------------------------------------------------------------
 * Liens — soulignement animé au survol
 * Le trait est un dégradé posé en background (et non un ::after) : il suit les
 * retours à la ligne, ne modifie pas le flux et n'exige pas de position:relative.
 * Exclusions : boutons, logo, cartes-liens et liens enveloppant une image/SVG,
 * qui ont déjà leur propre effet.
 * ----------------------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
	:is(header, footer, .entry-content, .wp-block-post-content) a:not(.wp-element-button):not(.wp-block-button__link):not(.wp-block-tiptip-hyperlink-group-block):not(.custom-logo-link):not(:has(img)):not(:has(svg)):not(:has(figure)) {
		background-image: linear-gradient(currentColor, currentColor);
		background-repeat: no-repeat;
		background-position: 0 100%;
		background-size: 0% 2px;
		transition: background-size 0.35s cubic-bezier(0.2, 0.7, 0.3, 1);
	}
	:is(header, footer, .entry-content, .wp-block-post-content) a:not(.wp-element-button):not(.wp-block-button__link):not(.wp-block-tiptip-hyperlink-group-block):not(.custom-logo-link):not(:has(img)):not(:has(svg)):not(:has(figure)):hover {
		background-size: 100% 2px;
	}

	/* Pas de soulignement là où le lien n'est pas un texte courant : les entrées du
	   sous-menu « Nos offres » sont des cartes colorées, le fil d'Ariane est un repère,
	   et les pastilles de l'entête ont déjà un fond. */
	.wp-block-navigation__submenu-container a,
	.ariane a,
	.wp-block-navigation__submenu-container a:hover,
	.ariane a:hover {
		background-image: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-post,
	.wp-block-post .wp-block-cover,
	.wp-block-post .wp-block-cover__image-background {
		transition: none !important;
	}
	.wp-block-post:hover,
	.wp-block-post:hover .wp-block-cover__image-background {
		transform: none !important;
	}
	:is(header, footer, .entry-content, .wp-block-post-content) a {
		transition: none !important;
	}
}

/* Menu déroulant avec transition */
.gw-mm-item .gw-mm-item__dropdown-wrapper {
	opacity: 0;
	transition: 0.5s opacity cubic-bezier(0.43, 0.195, 0.02, 1);
}
.gw-mm-item:hover .gw-mm-item__dropdown-wrapper {
	opacity: 1;
	min-height: auto;
}
.gw-mm-item:hover .gw-mm-item__dropdown-wrapper  .gw-mm-item__dropdown-wrapper{
	width: 100vw !important;
}

/* Styles spécifiques au mobile */
@media (max-width: 650px) {
	body:not(.wp-admin) .activite {
		-webkit-mask-image: url(../img/mask_arrow_mobile.svg);
		mask-image: url(../img/mask_arrow_mobile.svg);
		-webkit-mask-position: center;
		padding-bottom: 80px !important;
	}
	.single-agence .reverse-mobile {
		flex-direction: column-reverse;
	}
}
