/**
 * Page Boost · « Ce qui fait la différence chez Stravos. » (Moez, 2026-11-01).
 * Sans maquette Figma : charte du site. Deux sections (Moez, 2026-11-02) : « Ce qui fait la
 * différence » (H2 + texte, .stravos-difference), puis « Ce que Stravos vous garantit, avec
 * chaque talent. » (H2) et quatre garanties (H4 + texte) avec icône animée
 * (assets/img/garantie-*.svg) et couleur (orange, rose, rouge, jaune).
 * Mise en page retenue (proposition C, Moez 2026-11-01) : les quatre cartes autour du S de
 * Stravos (« vous bénéficiez de tout Stravos »). Arrivée à l'écran (assets/js/guarantees.js) :
 * le S seul, les cartes sortent de derrière lui et rejoignent leur place (départs décalés au
 * hasard), le cercle se dessine autour du S, puis quatre traits en pointillés partent du S
 * vers le coin intérieur de chaque carte et avancent en continu.
 */

/* « Ce qui fait la différence chez Stravos » : section à part (titre + texte), séparée des
   garanties (Moez, 2026-11-02). */
.stravos-difference,
.stravos-guarantees {
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	margin-block: 0;
	padding: var(--wp--preset--spacing--section) var(--wp--preset--spacing--gutter) !important;
}

.stravos-difference > *,
.stravos-difference .wp-block-group > *,
.stravos-guarantees > *,
.stravos-guarantees .wp-block-group > * {
	margin-block: 0;
}

.stravos-difference__inner,
.stravos-guarantees__inner {
	width: 100%;
	max-width: var(--wp--style--global--content-size);
}

.stravos-guarantees__head {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.stravos-guarantees__lead {
	font-size: var(--wp--preset--font-size--text-main);
	line-height: 1.5;
	color: var(--wp--preset--color--white-70);
}

.stravos-guarantees__sub {
	font-size: var(--wp--preset--font-size--heading-2);
	font-weight: 500;
	line-height: 1.1;
	color: var(--wp--preset--color--white);
}

.stravos-guarantees__list {
	margin: 0 !important;
	padding: 0;
	list-style: none;
}

/* ---------- Garantie (commun) ---------- */

.stravos-guarantee {
	--stravos-accent: var(--wp--preset--color--digital-orange);
	--stravos-accent-rgb: 255, 151, 69;

	position: relative;
	isolation: isolate;
	box-sizing: border-box;
	margin: 0 !important;
}

.stravos-guarantee.is-accent-pink {
	--stravos-accent: var(--wp--preset--color--accent-pink);
	--stravos-accent-rgb: 255, 20, 111;
}

.stravos-guarantee.is-accent-red {
	--stravos-accent: var(--wp--preset--color--impact-red);
	--stravos-accent-rgb: 255, 67, 67;
}

.stravos-guarantee.is-accent-yellow {
	--stravos-accent: #ffad3b;
	--stravos-accent-rgb: 255, 173, 59;
}

.stravos-guarantee h4 {
	margin: 0;
	font-size: var(--wp--preset--font-size--heading-5);
	font-weight: 500;
	line-height: 1.2;
	color: var(--wp--preset--color--white);
}

.stravos-guarantee p {
	margin: 0;
	font-size: var(--wp--preset--font-size--text-main);
	line-height: 1.4;
	color: var(--wp--preset--color--white-70);
}

.stravos-guarantee__icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 64px;
	height: 64px;
	color: var(--wp--preset--color--white);
	background: var(--wp--custom--color--white-05);
	border: 1px solid var(--stravos-accent);
	border-radius: var(--wp--custom--radius--main);
	transition: box-shadow 500ms var(--wp--custom--transition--easing);
}

.stravos-guarantee-icon {
	display: block;
	width: 40px;
	height: 40px;
	overflow: visible;
}

.stravos-guarantee:hover .stravos-guarantee__icon {
	box-shadow: 0 0 24px rgba(var(--stravos-accent-rgb), 0.35);
}

/* ---------- En-tête et cartes ---------- */

.stravos-guarantees__head {
	align-items: center;
	max-width: 860px;
	margin-inline: auto !important;
	text-align: center;
}

.stravos-guarantees__sub {
	margin: 0 0 64px !important;
	text-align: center;
}

.stravos-guarantees__list {
	position: relative;
	isolation: isolate;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 200px;
	row-gap: 64px;
}

/* Icône → titre 32 px, titre → texte 16 px (hiérarchie, Moez). */
.stravos-guarantee {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-content: start;
	row-gap: 16px;
	padding: 32px;
	overflow: hidden;
	background: #121212;
	border: 1px solid var(--wp--preset--color--space-black-light);
	border-radius: var(--wp--custom--radius--big);
	transition:
		border-color 500ms var(--wp--custom--transition--easing),
		transform 900ms cubic-bezier(0.22, 1, 0.36, 1) var(--stravos-g-delay, 0ms),
		opacity 600ms ease-out var(--stravos-g-delay, 0ms);
}

/* Espace icône → titre : 32 px, référence du bloc « Pour ceux qui ont une vision » de Build (Moez, 2026-11-02). (16 px d'écart + 16 px). */
.stravos-guarantee > .stravos-guarantee__icon {
	margin-bottom: 16px !important;
}

.stravos-guarantee__icon {
	margin-bottom: 16px;
}

/* Cartes de droite : icône et textes alignés à droite, vers le centre. */
.stravos-guarantee:nth-child(even) {
	justify-items: end;
	text-align: right;
}

/* Lueur de la couleur de la garantie depuis le coin de l'icône, au survol. */
.stravos-guarantee::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: radial-gradient(ellipse 60% 90% at 0% 0%, rgba(var(--stravos-accent-rgb), 0.16), transparent 70%);
	opacity: 0;
	transition: opacity 500ms var(--wp--custom--transition--easing);
}

.stravos-guarantee:nth-child(even)::before {
	background: radial-gradient(ellipse 60% 90% at 100% 0%, rgba(var(--stravos-accent-rgb), 0.16), transparent 70%);
}

.stravos-guarantee:hover {
	border-color: var(--stravos-accent);
}

.stravos-guarantee:hover::before {
	opacity: 1;
}

/* ---------- Centre : S de Stravos, cercle et traits ---------- */

.stravos-guarantees__hub {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.stravos-guarantees__links {
	position: absolute;
	inset: 0;
	z-index: -1;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.stravos-guarantees__links path {
	fill: none;
	stroke: var(--wp--preset--color--digital-orange);
	stroke-width: 1.5;
	stroke-dasharray: 4 6;
	opacity: 0.8;
}

/* Disque opaque (les traits ne se voient pas à travers), au-dessus des cartes au départ. */
.stravos-guarantees__core {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 120px;
	height: 120px;
	background: #121212;
	border-radius: 50%;
	box-shadow: 0 0 48px rgba(255, 151, 69, 0.35), inset 0 0 24px rgba(255, 151, 69, 0.15);
	transform: translate(-50%, -50%);
	transition: background-color 600ms ease-out, box-shadow 600ms ease-out;
}

.stravos-guarantees__core img {
	position: relative;
	width: 40px;
	height: auto;
}

.stravos-guarantees__ring {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	transform: rotate(-90deg);
}

.stravos-guarantees__ring circle {
	fill: none;
	stroke: var(--wp--preset--color--digital-orange);
	stroke-width: 1;
	stroke-dasharray: 101 101;
	transition: stroke-dashoffset 800ms cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---------- Séquence d'arrivée (classes posées par guarantees.js) ---------- */

/* Départ : S seul ; cartes cachées derrière lui ; ni cercle, ni disque, ni traits. */
@media (min-width: 1024px) {
	.stravos-guarantees.is-intro .stravos-guarantee {
		opacity: 0;
		transform: translate(var(--stravos-g-x, 0), var(--stravos-g-y, 0)) scale(0.3);
	}
}

.stravos-guarantees.is-intro .stravos-guarantees__core {
	background-color: transparent;
	box-shadow: none;
}

.stravos-guarantees.is-intro .stravos-guarantees__ring circle {
	stroke-dashoffset: 101;
}

.stravos-guarantees.is-instant .stravos-guarantee,
.stravos-guarantees.is-instant .stravos-guarantees__core,
.stravos-guarantees.is-instant .stravos-guarantees__ring circle {
	transition: none !important;
}

/* Fin de la séquence : transitions des cartes rendues au survol. */
.stravos-guarantees.is-settled .stravos-guarantee {
	transition: border-color 500ms var(--wp--custom--transition--easing);
}

/* ---------- Animations des icônes ---------- */

.stravos-guarantee-icon__dot,
.stravos-guarantee-icon__north,
.stravos-guarantee-icon__check,
.stravos-guarantee-icon__gem {
	color: var(--stravos-accent);
}

.stravos-guarantee-icon__needle {
	transform-box: view-box;
	transform-origin: 24px 24px;
}

.stravos-guarantee-icon__north {
	stroke: var(--stravos-accent);
}

.stravos-guarantee-icon__check {
	stroke: var(--stravos-accent);
	stroke-width: 2;
	stroke-dasharray: 100;
}

.stravos-guarantee-icon__ribbon {
	transform-box: fill-box;
	transform-origin: 50% 0;
}

.stravos-guarantee-icon__medal {
	transform-box: fill-box;
	transform-origin: center;
	stroke: var(--stravos-accent);
}

.stravos-guarantee-icon__drop,
.stravos-guarantee-icon__gem {
	transform-box: fill-box;
	transform-origin: center;
}

@media (prefers-reduced-motion: no-preference) {
	/* Communication : trois points qui « écrivent » l'un après l'autre. */
	.stravos-guarantee-icon__dot {
		animation: stravos-g-dot 1.2s ease-in-out infinite;
	}

	.stravos-guarantee-icon__dot.is-d2 {
		animation-delay: 0.15s;
	}

	.stravos-guarantee-icon__dot.is-d3 {
		animation-delay: 0.3s;
	}

	/* Autonomie : l'aiguille cherche le cap puis se stabilise. */
	.stravos-guarantee-icon__needle {
		animation: stravos-g-needle 3s cubic-bezier(0.45, 0, 0.55, 1) infinite;
	}

	/* Ownership : badge de récompense, la coche se dessine dedans, les rubans ondulent. */
	.stravos-guarantee-icon__check {
		animation: stravos-g-check 2.4s cubic-bezier(0.65, 0, 0.35, 1) infinite;
	}

	.stravos-guarantee-icon__ribbon {
		animation: stravos-g-ribbon 2.4s ease-in-out infinite;
	}

	.stravos-guarantee-icon__ribbon.is-right {
		animation-direction: reverse;
	}

	.stravos-guarantee-icon__medal {
		animation: stravos-g-medal 2.4s ease-in-out infinite;
	}

	/* Sélection : beaucoup de candidats entrent, un seul sort de l'entonnoir. */
	.stravos-guarantee-icon__drop {
		animation: stravos-g-drop 2.4s ease-in infinite;
	}

	.stravos-guarantee-icon__drop.is-p2 {
		animation-delay: 0.2s;
	}

	.stravos-guarantee-icon__drop.is-p3 {
		animation-delay: 0.4s;
	}

	.stravos-guarantee-icon__drop.is-p4 {
		animation-delay: 0.6s;
	}

	.stravos-guarantee-icon__gem {
		animation: stravos-g-gem 2.4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
	}

	/* Pointillés du centre vers les garanties. */
	.stravos-guarantees__links path {
		animation: stravos-g-links 0.9s linear infinite;
	}

	/* Au survol : deux fois plus rapide. */
	.stravos-guarantee:hover .stravos-guarantee-icon * {
		animation-duration: 1.2s;
	}

	.stravos-guarantee:hover .stravos-guarantee-icon__dot {
		animation-duration: 0.6s;
	}
}

@keyframes stravos-g-dot {
	0%,
	60%,
	100% {
		opacity: 0.3;
		transform: translateY(0);
	}

	30% {
		opacity: 1;
		transform: translateY(-2px);
	}
}

@keyframes stravos-g-needle {
	0%,
	100% {
		transform: rotate(0deg);
	}

	20% {
		transform: rotate(-35deg);
	}

	40% {
		transform: rotate(25deg);
	}

	55% {
		transform: rotate(-8deg);
	}

	70% {
		transform: rotate(3deg);
	}

	80% {
		transform: rotate(0deg);
	}
}

@keyframes stravos-g-check {
	0% {
		stroke-dashoffset: 100;
	}

	40%,
	80% {
		stroke-dashoffset: 0;
		opacity: 1;
	}

	100% {
		stroke-dashoffset: 0;
		opacity: 0;
	}
}

@keyframes stravos-g-ribbon {
	0%,
	100% {
		transform: rotate(0deg);
	}

	50% {
		transform: rotate(4deg);
	}
}

@keyframes stravos-g-medal {
	0%,
	100% {
		transform: scale(1);
	}

	45% {
		transform: scale(1.06);
	}
}

@keyframes stravos-g-drop {
	0% {
		opacity: 0;
		transform: translateY(-4px);
	}

	15% {
		opacity: 1;
	}

	45% {
		opacity: 0;
		transform: translateY(12px);
	}

	100% {
		opacity: 0;
		transform: translateY(12px);
	}
}

@keyframes stravos-g-gem {
	0%,
	30% {
		opacity: 0;
		transform: translateY(0);
	}

	40% {
		opacity: 1;
	}

	75% {
		opacity: 1;
		transform: translateY(32px);
	}

	100% {
		opacity: 0;
		transform: translateY(34px);
	}
}

@keyframes stravos-g-links {
	to {
		stroke-dashoffset: -10;
	}
}

@media (prefers-reduced-motion: reduce) {
	.stravos-guarantee,
	.stravos-guarantee::before,
	.stravos-guarantee::after,
	.stravos-guarantee h4,
	.stravos-guarantee p,
	.stravos-guarantees__core,
	.stravos-guarantees__ring circle {
		transition: none;
	}
}

/* ---------- Tablette et mobile ---------- */

/*
 * Moins de 1024 px (Moez, 2026-11-01) : une colonne ; le S se place entre « Une autonomie
 * réelle » et « L'ownership dans l'ADN ». Quand il arrive à l'écran, son cercle se dessine, puis
 * deux traits partent du S vers ces deux cartes, et deux autres les relient aux cartes voisines
 * (autonomie → communication, ownership → sélection) : les quatre garanties viennent de Stravos.
 */
@media (max-width: 1023.98px) {
	.stravos-guarantees__list {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 40px;
		max-width: 640px;
		margin-inline: auto !important;
	}

	.stravos-guarantee:nth-child(n + 3) {
		order: 2;
	}

	.stravos-guarantees__hub {
		position: static;
		order: 1;
		display: flex;
		justify-content: center;
		padding-block: 24px;
	}

	.stravos-guarantees__core {
		position: relative;
		top: auto;
		left: auto;
		width: 104px;
		height: 104px;
		transform: none;
	}

	.stravos-guarantee:nth-child(even) {
		justify-items: start;
		text-align: left;
	}

	.stravos-guarantee:nth-child(even)::before {
		background: radial-gradient(ellipse 60% 90% at 0% 0%, rgba(var(--stravos-accent-rgb), 0.16), transparent 70%);
	}
}

@media (max-width: 781.98px) {
	.stravos-guarantees__sub {
		margin: 0 0 40px !important;
	}

	.stravos-guarantee {
		padding: 24px;
	}

	.stravos-guarantee__icon {
		width: 56px;
		height: 56px;
	}

	.stravos-guarantee-icon {
		width: 34px;
		height: 34px;
	}
}
