/* ==========================================================================
   BLOOP — Étapes de commande [bloop_steps]
   Fichier : bloop_css/shortcode_steps.css
   Va avec : bloop_inc/shortcode_steps.php + bloop_js/shortcode_steps.js

   3 post-its épinglés en zigzag, reliés par des tirets (SVG calculé en JS).
   Fonds en aplat (comme les cartes boutique), titres en --main-dark.
   Les 3 tuiles ont le même design : punaise + numéro + titre en --main-dark.
   Animation au scroll (rejouée à chaque retour à l'écran) : la carte monte du bas, la punaise
   tombe par-dessus, puis le tiret se dessine vers l'étape suivante.
   ========================================================================== */

.bloop-steps {
	--bl-st-frame: #fff;                                   /* cadre extérieur du post-it */
	--bl-st-line: var(--main-dark);                        /* couleur des tirets */
	--bl-st-needle: #a8a19a;                               /* aiguille de la punaise */
	--bl-st-stagger: 0.35s;                                /* décalage entre 2 étapes */
	--bl-st-shadow: 0 14px 30px -20px rgba(104, 76, 1, 0.28);
	--bl-st-num-font: "Mynerve - Regular", "Mynerve", cursive;

	position: relative;
	max-width: 960px;
	margin: 0 auto;
	padding: 40px 0 10px;
}

/* Variantes de couleur
   ========================================================================== */

/* Même design pour les 3 tuiles : rouge Bloop + fond boutique */
.bloop-steps .bl-step {
	--bl-st-accent: var(--main-dark);
	--bl-st-bg: var(--main-light-contrast);
}

/* Tirets (SVG généré en JS, derrière les cartes)
   ========================================================================== */

.bloop-steps__lines {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
	z-index: 0;
}

.bloop-steps .bl-steps-line {
	fill: none;
	stroke: var(--bl-st-line);
	stroke-width: 1.6;
	stroke-dasharray: 6 7;
	stroke-linecap: round;
	opacity: 0.4;
}

/* Masque qui "dessine" le tiret (pathLength = 1) */
.bloop-steps .bl-steps-mask {
	fill: none;
	stroke: #fff;
	stroke-width: 10;
	stroke-dasharray: 1 1;
	stroke-dashoffset: 0;
}

/* Liste / disposition en zigzag (desktop)
   ========================================================================== */

.bloop-steps .bloop-steps__list {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.bloop-steps .bl-step {
	--rot: -4deg;
	--pin-rot: 14deg;

	position: relative;
	width: 44%;
	margin: 0;
	padding: 0 !important;
	list-style: none !important;
	transform: rotate(var(--rot));
}

.bloop-steps .bl-step::marker {
	content: none;
}

.bloop-steps .bl-step:nth-child(odd) {
	align-self: flex-start;
	margin-left: 3%;
}

.bloop-steps .bl-step:nth-child(even) {
	--rot: 3.5deg;
	--pin-rot: -12deg;
	align-self: flex-end;
	margin-right: 3%;
}

.bloop-steps .bl-step:nth-child(3) {
	--rot: -2.5deg;
	--pin-rot: 10deg;
}

.bloop-steps .bl-step + .bl-step {
	margin-top: -70px;
}

/* Points d'accroche des tirets (invisibles) */
.bloop-steps .bl-step__anchor {
	position: absolute;
	width: 1px;
	height: 1px;
	visibility: hidden;
	pointer-events: none;
}
.bloop-steps .bl-step__anchor[data-anchor="top"]    { top: 6px;     left: 50%; }
.bloop-steps .bl-step__anchor[data-anchor="bottom"] { bottom: 14px; left: 50%; }
.bloop-steps .bl-step__anchor[data-anchor="left"]   { left: 14px;   top: 50%; }
.bloop-steps .bl-step__anchor[data-anchor="right"]  { right: 14px;  top: 50%; }

/* Post-it (aplats, pas de dégradé)
   ========================================================================== */

.bloop-steps .bl-step__card {
	position: relative;
	padding: 12px;
	background: var(--bl-st-frame);
	border-radius: 30px;
	box-shadow: var(--bl-st-shadow);
}

.bloop-steps .bl-step__note {
	position: relative;
	padding: clamp(26px, 3vw, 36px) clamp(22px, 2.6vw, 32px) clamp(24px, 2.8vw, 32px);
	background: var(--bl-st-bg);
	border-radius: 22px;
	color: var(--noir);
}

.bloop-steps .bl-step__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.bloop-steps .bl-step__num {
	font-family: var(--bl-st-num-font);
	font-style: normal;
	font-weight: 400;
	font-size: clamp(28px, 3.2vw, 36px);
	line-height: 1;
	color: var(--bl-st-accent);
}

.bloop-steps .bl-step__icon {
	display: block;
	width: 42px !important;
	height: 42px !important;
	object-fit: contain;
	flex-shrink: 0;
}

.bloop-steps .bl-step__title {
	margin: 0 0 10px;
	padding: 0 !important;
	font-size: clamp(18px, 2.2vw, 24px);
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--main-dark) !important;
}

.bloop-steps .bl-step__desc {
	margin: 0;
	padding: 0 !important;
	font-size: 15px;
	line-height: 1.55;
	color: var(--noir);
}

/* Punaise (SVG mat : tête, collerette, aiguille — couleur = --bl-st-accent)
   ========================================================================== */

.bloop-steps .bl-step__pin {
	position: absolute;
	top: -30px;
	left: 50%;
	z-index: 3;
	display: block;
	width: 40px;
	height: 64px;
	transform: translateX(-50%);
	filter: drop-shadow(3px 4px 3px rgba(51, 51, 51, 0.2));
}

.bloop-steps .bl-step__pin svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
	transform: rotate(var(--pin-rot));
	transform-origin: 50% 95%; /* pivote autour de la pointe */
}

.bloop-steps .bl-pin__head   { fill: var(--bl-st-accent); }
.bloop-steps .bl-pin__shade  { fill: #000; opacity: 0.18; }
.bloop-steps .bl-pin__light  { fill: #fff; opacity: 0.22; }
.bloop-steps .bl-pin__needle { fill: var(--bl-st-needle); }
.bloop-steps .bl-pin__needle-shade { fill: #000; opacity: 0.22; }

/* Animation au scroll
   is-armed   : ajouté tout de suite par le petit script inline (état caché)
   is-visible : ajouté par le JS quand la section arrive à l'écran
   is-visible est retiré quand la section sort de l'écran → l'animation rejoue au retour.
   ========================================================================== */

.bloop-steps.is-armed .bl-step__card {
	opacity: 0;
	transform: translateY(70px);
}

.bloop-steps.is-armed .bl-step__pin {
	opacity: 0;
}

.bloop-steps.is-armed .bl-steps-mask {
	stroke-dashoffset: 1;
}

.bloop-steps.is-visible .bl-step__card {
	animation: bl-step-card-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
	animation-delay: calc(var(--i) * var(--bl-st-stagger));
}

.bloop-steps.is-visible .bl-step__pin {
	animation: bl-step-pin-drop 0.7s cubic-bezier(0.3, 0.7, 0.4, 1) both;
	animation-delay: calc(var(--i) * var(--bl-st-stagger) + 0.3s);
}

.bloop-steps.is-visible .bl-steps-mask {
	stroke-dashoffset: 0;
	transition: stroke-dashoffset 0.9s ease;
	transition-delay: var(--d, 0s);
}

@keyframes bl-step-card-in {
	from {
		opacity: 0;
		transform: translateY(70px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes bl-step-pin-drop {
	0% {
		opacity: 0;
		transform: translate(-50%, -60px);
	}
	60% {
		opacity: 1;
		transform: translate(-50%, 4px);
	}
	80% {
		transform: translate(-50%, -2px);
	}
	100% {
		opacity: 1;
		transform: translate(-50%, 0);
	}
}

/* Responsive
   ========================================================================== */

/* Tablette */
@media (max-width: 980px) {
	.bloop-steps .bl-step {
		width: 54%;
	}

	.bloop-steps .bl-step:nth-child(odd) {
		margin-left: 0;
	}

	.bloop-steps .bl-step:nth-child(even) {
		margin-right: 0;
	}

	.bloop-steps .bl-step + .bl-step {
		margin-top: -30px;
	}
}

/* Mobile : une colonne centrée, tirets verticaux */
@media (max-width: 767px) {
	.bloop-steps {
		padding-top: 36px;
	}

	.bloop-steps .bl-step,
	.bloop-steps .bl-step:nth-child(odd),
	.bloop-steps .bl-step:nth-child(even) {
		--rot: -2deg;
		align-self: center;
		width: 100%;
		max-width: 380px;
		margin-left: 0;
		margin-right: 0;
	}

	.bloop-steps .bl-step:nth-child(even) {
		--rot: 2deg;
	}

	.bloop-steps .bl-step:nth-child(3) {
		--rot: -1.5deg;
	}

	.bloop-steps .bl-step + .bl-step {
		margin-top: 70px;
	}

	.bloop-steps .bl-step__card {
		padding: 10px;
		border-radius: 28px;
	}

	.bloop-steps .bl-step__pin {
		width: 34px;
		height: 54px;
		top: -38px;
	}

	.bloop-steps.is-armed .bl-step__card {
		transform: translateY(50px);
	}
}

/* Accessibilité : animations réduites
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.bloop-steps .bl-step__card,
	.bloop-steps .bl-step__pin {
		opacity: 1 !important;
		animation: none !important;
	}

	.bloop-steps .bl-step__card {
		transform: none !important;
	}

	.bloop-steps .bl-steps-mask {
		stroke-dashoffset: 0 !important;
		transition: none !important;
	}
}