/**
 * Services page: expandable service cards, work-method variants.
 *
 * Markup (core blocks only): a .ww-svc-grid group holding, in source order,
 * card 1, panel 1, card 2, panel 2... Cards are .ww-svc-card groups, panels
 * are .ww-svc-panel sections carrying the service anchor (#creation...).
 * With `grid-auto-flow: dense` every card fills the first free cell while a
 * full-width panel drops to the row right below the card that owns it, on
 * 4, 2 and 1 columns alike.
 *
 * Without JavaScript every panel stays visible (anchor links still work).
 * services-cards.js adds .ww-svc-js on <html> early, wraps each panel's
 * content in .ww-svc-panel__clip > .ww-svc-panel__box and animates the
 * panel height through grid-template-rows (0fr -> 1fr).
 */

.ww-svc-grid {
	--ww-svc-ink: var(--wp--preset--color--ww-teal-700, #194e4f);
	--ww-svc-deep: #123636;
	--ww-svc-soft: var(--wp--preset--color--ww-cloud-200, #d6f1ef);
	--ww-svc-mint: var(--wp--preset--color--ww-mint-300, #b7e2df);
	--ww-svc-sun: var(--wp--preset--color--ww-sun, #f5c542);
	--ww-svc-gap: 1.25rem;
	--ww-svc-speed: 0.45s;
	--ww-svc-ease: cubic-bezier(0.4, 0, 0.2, 1);
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-auto-flow: row dense;
	column-gap: var(--ww-svc-gap);
	row-gap: 0;
	align-items: stretch;
}

/* Rows are spaced by the cards' own bottom margin, so a closed (0-height)
   panel row adds no gap. */
.ww-svc-grid > * {
	margin-top: 0 !important;
	margin-bottom: var(--ww-svc-gap) !important;
}

@media (max-width: 1024px) {
	.ww-svc-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.ww-svc-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Cards */
.ww-svc-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1.25rem 1.25rem 1rem;
	background: #fff;
	border: 2px solid var(--ww-svc-soft);
	border-radius: 1rem;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.ww-svc-card > * {
	margin-block: 0 !important;
}

.ww-svc-card .ww-svc-card__img {
	margin-inline: auto !important;
}

.ww-svc-card .ww-svc-card__img img {
	width: 132px;
	height: 132px;
	object-fit: contain;
}

.ww-svc-card .ww-svc-card__title {
	font-size: clamp(1.15rem, 1rem + 0.5vw, 1.35rem);
	line-height: 1.25;
	color: var(--ww-svc-deep);
}

.ww-svc-card p {
	font-size: 0.97rem;
}

.ww-svc-card .ww-svc-card__more {
	margin-top: auto !important;
	padding-top: 0.5rem;
}

.ww-svc-card .ww-svc-card__more a {
	font-weight: 700;
	color: var(--ww-svc-ink);
}

.ww-svc-js .ww-svc-card {
	cursor: pointer;
}

.ww-svc-js .ww-svc-card:hover {
	border-color: var(--ww-svc-mint);
	box-shadow: 0 10px 24px -14px rgba(18, 54, 54, 0.45);
	transform: translateY(-2px);
}

.ww-svc-card__toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	align-self: flex-start;
	padding: 0.5rem 0.95rem;
	font: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--ww-svc-ink);
	background: var(--ww-svc-soft);
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.ww-svc-card__toggle::after {
	content: "";
	width: 0.55em;
	height: 0.55em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-0.15em) rotate(45deg);
	transition: transform var(--ww-svc-speed) var(--ww-svc-ease);
}

.ww-svc-card__toggle[aria-expanded="true"]::after {
	transform: translateY(0.1em) rotate(-135deg);
}

.ww-svc-card__toggle:focus-visible,
.ww-svc-panel__close:focus-visible {
	outline: 3px solid var(--ww-svc-sun);
	outline-offset: 3px;
}

.ww-svc-card.is-active {
	border-color: var(--ww-svc-ink);
	box-shadow: 0 12px 28px -16px rgba(18, 54, 54, 0.55);
}

.ww-svc-card.is-active .ww-svc-card__toggle {
	color: #fff;
	background: var(--ww-svc-ink);
}

/* Panels: static fallback (no JavaScript) */
.ww-svc-panel {
	grid-column: 1 / -1;
	padding: clamp(1.25rem, 1rem + 2vw, 2.5rem) !important;
	color: #fff;
	background: var(--ww-svc-deep);
	border-radius: 1rem;
	scroll-margin-top: 6rem;
}

/* Panels: animated mode. services-cards.js drives the height between 0 and
   the measured content height, then hands over to height:auto
   (.is-settled) so the panel still reflows when the viewport changes. */
.ww-svc-js .ww-svc-panel {
	height: 0;
	overflow: hidden;
	padding: 0 !important;
	margin-bottom: 0 !important;
	background: none;
	border-radius: 0;
	visibility: hidden;
	transition: height var(--ww-svc-speed) var(--ww-svc-ease), visibility 0s linear var(--ww-svc-speed);
}

.ww-svc-js .ww-svc-panel.is-open {
	visibility: visible;
	transition: height var(--ww-svc-speed) var(--ww-svc-ease), visibility 0s;
}

.ww-svc-js .ww-svc-panel.is-open.is-settled {
	height: auto;
}

.ww-svc-panel__box {
	margin-bottom: var(--ww-svc-gap);
	padding: clamp(1.25rem, 1rem + 2vw, 2.5rem);
	background: var(--ww-svc-deep);
	border-radius: 1rem;
	opacity: 0;
	transform: translateY(-0.75rem);
	transition: opacity 0.3s ease, transform var(--ww-svc-speed) var(--ww-svc-ease);
}

.ww-svc-panel.is-open .ww-svc-panel__box {
	opacity: 1;
	transform: none;
	transition: opacity 0.35s ease 0.1s, transform var(--ww-svc-speed) var(--ww-svc-ease);
}

/* Panel content */
.ww-svc-panel h3 {
	font-size: 1.1rem;
	margin: 1.75rem 0 0.5rem !important;
	color: var(--ww-svc-mint);
}

.ww-svc-panel .wp-block-column > h3:first-child {
	margin-top: 0 !important;
}

.ww-svc-panel p,
.ww-svc-panel ul {
	margin-top: 0 !important;
	margin-bottom: 0.75rem !important;
}

.ww-svc-panel a {
	color: #fff;
	text-decoration-color: var(--ww-svc-sun);
	text-underline-offset: 0.2em;
}

.ww-svc-panel ul {
	padding-left: 1.2rem;
}

.ww-svc-panel li {
	margin-bottom: 0.35rem;
}

.ww-svc-panel li::marker {
	color: var(--ww-svc-sun);
}

.ww-svc-panel .wp-block-columns {
	gap: clamp(1.25rem, 3vw, 3rem);
	margin-bottom: 0.5rem;
}

.ww-svc-panel .ww-svc-panel__links {
	margin-top: 0.5rem !important;
	padding-top: 1rem;
	border-top: 1px solid rgba(255, 255, 255, 0.2);
	font-size: 0.95rem;
}

.ww-svc-panel__close {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-top: 0.5rem;
	padding: 0.45rem 0.9rem;
	font: inherit;
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--ww-svc-deep);
	background: var(--ww-svc-mint);
	border: 0;
	border-radius: 999px;
	cursor: pointer;
}

/* The panel only receives focus programmatically (so screen readers land on
   it); its open state and the active card already show where we are. */
.ww-svc-panel:focus,
.ww-svc-panel:focus-visible {
	outline: none;
}

.ww-svc-card {
	scroll-margin-top: 6rem;
}

.ww-svc-noanim,
.ww-svc-noanim .ww-svc-panel__box {
	transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.ww-svc-card,
	.ww-svc-card__toggle::after,
	.ww-svc-js .ww-svc-panel,
	.ww-svc-js .ww-svc-panel.is-open,
	.ww-svc-panel__box,
	.ww-svc-panel.is-open .ww-svc-panel__box {
		transition: none;
	}

	.ww-svc-js .ww-svc-card:hover {
		transform: none;
	}
}

.ww-svc-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* --------------------------------------------------------------------------
 * Hero variants
 * ----------------------------------------------------------------------- */

.ww-svc-hero .ww-svc-hero__art img {
	width: min(240px, 100%);
	height: auto;
	margin-inline: auto;
	display: block;
}

.ww-svc-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding: 0 !important;
	list-style: none;
}

.ww-svc-chips li {
	margin: 0;
	padding: 0.35rem 0.85rem;
	font-size: 0.92rem;
	font-weight: 700;
	color: var(--wp--preset--color--ww-teal-700, #194e4f);
	background: #fff;
	border: 1px solid var(--wp--preset--color--ww-mint-300, #b7e2df);
	border-radius: 999px;
}

/* Label shown on the draft to tell variants apart. */
.ww-variant-label {
	display: inline-block;
	margin-bottom: 0.75rem !important;
	padding: 0.2rem 0.6rem;
	font-size: 0.8rem !important;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #5a3d00;
	background: #fde7a8;
	border-radius: 0.35rem;
}

/* --------------------------------------------------------------------------
 * Work-method variants (ordered list, one <li> per step, title in <strong>)
 * ----------------------------------------------------------------------- */

.ww-steps {
	--ww-steps-ink: var(--wp--preset--color--ww-teal-700, #194e4f);
	--ww-steps-deep: #123636;
	--ww-steps-soft: var(--wp--preset--color--ww-cloud-200, #d6f1ef);
	--ww-steps-mint: var(--wp--preset--color--ww-mint-300, #b7e2df);
	--ww-steps-sun: var(--wp--preset--color--ww-sun, #f5c542);
	counter-reset: ww-step;
	list-style: none;
	margin-top: 1.5rem !important;
	margin-bottom: 2rem !important;
	padding: 0 !important;
}

.ww-steps > li {
	position: relative;
	counter-increment: ww-step;
	margin: 0;
}

.ww-steps > li strong {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 1.05rem;
	color: var(--ww-steps-deep);
}

/* A. Horizontal timeline */
.ww-steps--timeline {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 1.25rem;
}

/* !important: a theme rule zeroes the top padding of a list's first item,
   which put step 1's title under its number badge. */
.ww-steps--timeline > li {
	padding: 3.75rem 0 0 !important;
}

.ww-steps--timeline > li::before {
	content: counter(ww-step);
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	font-weight: 800;
	font-size: 1.15rem;
	color: #fff;
	background: var(--ww-steps-ink);
	border: 4px solid var(--ww-steps-soft);
	border-radius: 50%;
}

.ww-steps--timeline > li::after {
	content: "";
	position: absolute;
	top: 1.3rem;
	left: 2.75rem;
	right: -1.25rem;
	height: 3px;
	background: repeating-linear-gradient(90deg, var(--ww-steps-mint) 0 10px, transparent 10px 16px);
}

.ww-steps--timeline > li:last-child::after {
	display: none;
}

/* Desktop: text centred under its badge, the dotted link running from one
   badge's edge to the next (badge 2.75rem wide, column gap 1.25rem). */
@media (min-width: 901px) {
	.ww-steps--timeline > li {
		text-align: center;
	}

	.ww-steps--timeline > li::before {
		left: 50%;
		transform: translateX(-50%);
	}

	.ww-steps--timeline > li::after {
		left: calc(50% + 1.375rem);
		right: calc(-50% - 1.25rem + 1.375rem);
	}
}

@media (max-width: 900px) {
	.ww-steps--timeline {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}

	.ww-steps--timeline > li {
		padding: 0 0 1.5rem 4rem !important;
	}

	.ww-steps--timeline > li::after {
		top: 2.75rem;
		bottom: 0;
		left: 1.3rem;
		right: auto;
		width: 3px;
		height: auto;
		background: repeating-linear-gradient(180deg, var(--ww-steps-mint) 0 10px, transparent 10px 16px);
	}
}

/* B. Zigzag path */
.ww-steps--zigzag {
	position: relative;
	display: grid;
	gap: 1rem;
	max-width: 900px;
	margin-inline: auto !important;
}

.ww-steps--zigzag::before {
	content: "";
	position: absolute;
	top: 1rem;
	bottom: 1rem;
	left: 50%;
	width: 3px;
	transform: translateX(-50%);
	background: repeating-linear-gradient(180deg, var(--ww-steps-mint) 0 10px, transparent 10px 16px);
}

.ww-steps--zigzag > li {
	width: calc(50% - 2.5rem);
	padding: 1.1rem 1.25rem 1.1rem 4.25rem;
	background: #fff;
	border: 2px solid var(--ww-steps-soft);
	border-radius: 1rem;
}

.ww-steps--zigzag > li:nth-child(even) {
	justify-self: end;
}

.ww-steps--zigzag > li::before {
	content: counter(ww-step);
	position: absolute;
	top: 50%;
	left: 1rem;
	transform: translateY(-50%);
	font-size: 2.6rem;
	font-weight: 900;
	line-height: 1;
	color: transparent;
	-webkit-text-stroke: 2px var(--ww-steps-ink);
}

.ww-steps--zigzag > li::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 1rem;
	height: 1rem;
	background: var(--ww-steps-sun);
	border: 3px solid #fff;
	border-radius: 50%;
	box-shadow: 0 0 0 2px var(--ww-steps-ink);
	transform: translateY(-50%);
}

.ww-steps--zigzag > li:nth-child(odd)::after {
	right: calc(-2.5rem - 0.5rem);
}

.ww-steps--zigzag > li:nth-child(even)::after {
	left: calc(-2.5rem - 0.5rem);
}

@media (max-width: 760px) {
	.ww-steps--zigzag::before {
		left: 1.4rem;
	}

	.ww-steps--zigzag > li,
	.ww-steps--zigzag > li:nth-child(even) {
		width: auto;
		margin-left: 3rem;
		justify-self: stretch;
	}

	.ww-steps--zigzag > li:nth-child(odd)::after,
	.ww-steps--zigzag > li:nth-child(even)::after {
		left: -2.15rem;
		right: auto;
	}
}

/* C. Cards with arrows */
.ww-steps--cards {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 2rem;
}

.ww-steps--cards > li {
	padding: 1.25rem 1.1rem 1.1rem;
	background: var(--ww-steps-deep);
	border-radius: 1rem;
	color: #fff;
	overflow: visible;
}

.ww-steps--cards > li strong {
	color: var(--ww-steps-mint);
}

.ww-steps--cards > li::before {
	content: "0" counter(ww-step);
	display: block;
	margin-bottom: 0.6rem;
	font-size: 2rem;
	font-weight: 900;
	line-height: 1;
	color: var(--ww-steps-sun);
}

.ww-steps--cards > li:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 50%;
	right: -1.45rem;
	width: 0.9rem;
	height: 0.9rem;
	border-top: 3px solid var(--ww-steps-ink);
	border-right: 3px solid var(--ww-steps-ink);
	transform: translateY(-50%) rotate(45deg);
}

@media (max-width: 900px) {
	.ww-steps--cards {
		grid-template-columns: minmax(0, 1fr);
		gap: 1.75rem;
	}

	.ww-steps--cards > li:not(:last-child)::after {
		top: auto;
		right: auto;
		bottom: -1.3rem;
		left: 50%;
		transform: translateX(-50%) rotate(135deg);
	}
}

/* Timeline type scale: step titles above the body text (the list inherited a
   larger size than the <strong>), and on desktop every title reserves two
   lines so the descriptions start on the same baseline. */
.ww-steps--timeline > li {
	font-size: 0.95rem;
	line-height: 1.55;
}

.ww-steps--timeline > li strong {
	font-size: 1.12rem;
	font-weight: 800;
	line-height: 1.3;
}

@media (min-width: 901px) {
	.ww-steps--timeline > li strong {
		display: flex;
		align-items: flex-end;
		justify-content: center;
		min-height: 2.6em;
		margin-bottom: 0.5rem;
	}
}

/* Toggle v2 -- the "Découvrir le détail" button must read as a button:
   closed = solid dark teal / white text, open = sun yellow / dark text,
   lighter teal when the card is hovered, chevron nudging down on hover. */
.ww-svc-card__toggle {
	color: #fff;
	background: var(--ww-svc-ink);
	box-shadow: 0 6px 14px -10px rgba(18, 54, 54, 0.8);
}

.ww-svc-js .ww-svc-card:hover .ww-svc-card__toggle[aria-expanded="false"],
.ww-svc-card__toggle[aria-expanded="false"]:hover {
	background: var(--wp--preset--color--ww-teal-500, #2f7375);
}

.ww-svc-card.is-active .ww-svc-card__toggle {
	color: var(--ww-svc-deep);
	background: var(--ww-svc-sun);
}

@keyframes ww-svc-nudge {
	0%,
	100% {
		transform: translateY(-0.15em) rotate(45deg);
	}

	50% {
		transform: translateY(0.12em) rotate(45deg);
	}
}

.ww-svc-js .ww-svc-card:hover .ww-svc-card__toggle[aria-expanded="false"]::after {
	animation: ww-svc-nudge 0.9s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
	.ww-svc-js .ww-svc-card:hover .ww-svc-card__toggle[aria-expanded="false"]::after {
		animation: none;
	}
}