/**
 * core/group — "card" and "band" styles, feature icon badge, section helpers.
 */

/* ---------------------------------------------------------------------------
 * Card (range card, feature card)
 * ------------------------------------------------------------------------- */

.wp-block-group.is-style-card {
	border: var(--wp--custom--stroke--thin) solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--md);
	background-color: var(--wp--preset--color--base);
	padding: var(--wp--preset--spacing--md);
	transition: border-color var(--wp--custom--transition);
}

/* Only a clickable card (with a .card__link) reacts on hover: a card without
   a page (range in preparation, aside) must not look like a link. */
.wp-block-group.is-style-card.is-clickable:hover,
.wp-block-group.is-style-card.is-clickable:focus-within {
	border-color: var(--wp--preset--color--primary);
}

/* Card visual: full-bleed image on top, 16/9 (Figma 416 × 230). */
.wp-block-group.is-style-card > .wp-block-image:first-child,
.wp-block-group.is-style-card > .card__media {
	/* !important: the constrained layout of the card forces auto side margins and the content width. */
	margin: calc(-1 * var(--wp--preset--spacing--md)) calc(-1 * var(--wp--preset--spacing--md)) var(--wp--preset--spacing--md) !important;
	max-width: none;
}

.wp-block-group.is-style-card > .wp-block-image:first-child img,
.wp-block-group.is-style-card > .card__media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: var(--wp--custom--radius--md) var(--wp--custom--radius--md) 0 0;
}

/* Empty image placeholder in the card keeps the 16/9 slot. */
.wp-block-group.is-style-card > .wp-block-image:first-child:not(:has(img)) {
	aspect-ratio: 16 / 9;
	background-color: var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--radius--md) var(--wp--custom--radius--md) 0 0;
}

.wp-block-group.is-style-card .card__text {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

/* "Explorer la gamme" link with arrow-right 22 px. */
.wp-block-group.is-style-card .card__link a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}

.wp-block-group.is-style-card .card__link a::after {
	content: "";
	width: 22px;
	height: 22px;
	background-color: currentColor;
	-webkit-mask: url("../../icons/arrow-right.svg") center / contain no-repeat;
	mask: url("../../icons/arrow-right.svg") center / contain no-repeat;
	transition: transform var(--wp--custom--transition);
}

/* The whole card reacts on hover (border), so the link text does not underline. */
.wp-block-group.is-style-card .card__link a:hover,
.wp-block-group.is-style-card:hover .card__link a {
	text-decoration: none;
}

.wp-block-group.is-style-card .card__link a:hover::after,
.wp-block-group.is-style-card:hover .card__link a::after {
	transform: translateX(3px);
}

/* Whole card clickable while the link stays the accessible target. */
.wp-block-group.is-style-card.is-clickable {
	position: relative;
}

.wp-block-group.is-style-card.is-clickable .card__link a::before {
	content: "";
	position: absolute;
	inset: 0;
}

/* ---------------------------------------------------------------------------
 * Band (graphite section): hero, footer, CTA band
 * ------------------------------------------------------------------------- */

.wp-block-group.is-style-band {
	background-color: var(--wp--preset--color--graphite);
	color: var(--wp--preset--color--on-dark-soft);
	padding-top: var(--wp--preset--spacing--xxl);
	padding-bottom: var(--wp--preset--spacing--xxl);
}

.wp-block-group.is-style-band :is(h1, h2, h3, h4, h5, h6) {
	color: var(--wp--preset--color--on-dark);
}

.wp-block-group.is-style-band p {
	color: var(--wp--preset--color--on-dark-soft);
}

.wp-block-group.is-style-band .has-muted-color,
.wp-block-group.is-style-band .is-style-mono,
.wp-block-group.is-style-band figcaption {
	color: var(--wp--preset--color--on-dark-muted);
}

.wp-block-group.is-style-band .is-style-eyebrow {
	color: var(--wp--preset--color--on-dark-accent);
}

.wp-block-group.is-style-band a:not(.wp-block-button__link) {
	color: var(--wp--preset--color--on-dark);
}

.wp-block-group.is-style-band a:not(.wp-block-button__link):hover {
	color: var(--wp--preset--color--on-dark-accent);
}

.wp-block-group.is-style-band a:focus-visible,
.wp-block-group.is-style-band button:focus-visible {
	outline-color: var(--wp--preset--color--on-dark);
}

.wp-block-group.is-style-band hr.wp-block-separator:not(.brand-rule):not(.is-style-brand-rule) {
	border-color: var(--wp--custom--color--on-dark-border);
	color: var(--wp--custom--color--on-dark-border);
}

.wp-block-group.is-style-band .wp-block-list li::marker {
	color: var(--wp--preset--color--on-dark-accent);
}

/* Nested band inside a band: no double padding. */
.wp-block-group.is-style-band .wp-block-group.is-style-band {
	padding-top: 0;
	padding-bottom: 0;
}

/* ---------------------------------------------------------------------------
 * Hero (hero-graphite pattern): text column + full-height visual with the
 * caption overlaid on a graphite gradient. Below 1 100 px the visual goes
 * under the text, full width, flush with the bottom of the band.
 * ------------------------------------------------------------------------- */

.wp-block-group.hero {
	padding-bottom: 0;
}

.hero .hero__text h1 {
	font-size: min(var(--wp--preset--font-size--heading-1), 3.75rem);
}

.hero .hero__media .wp-block-image {
	position: relative;
	margin: 0;
	height: 100%;
}

.hero .hero__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}

.hero .hero__media figcaption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	margin: 0;
	padding: var(--wp--preset--spacing--xl) var(--wp--preset--spacing--md) var(--wp--preset--spacing--md);
	background: linear-gradient(transparent, rgb(16 31 48 / 0.85));
	color: var(--wp--preset--color--on-dark-soft);
	font-size: var(--wp--preset--font-size--caption);
	line-height: 1.5;
	text-align: left;
}

.hero .hero__media figcaption strong {
	display: block;
	margin-bottom: var(--wp--preset--spacing--xs);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--on-dark);
}

@media (max-width: 1099px) {
	/* Stack the two columns (core only stacks below 782 px). */
	.hero .wp-block-columns {
		flex-wrap: wrap !important;
	}

	.hero .wp-block-column {
		flex-basis: 100% !important;
	}

	.hero .hero__text {
		padding-bottom: var(--wp--preset--spacing--md);
	}

	.hero .hero__media {
		margin-left: calc(-1 * var(--wp--style--root--padding-left));
		margin-right: calc(-1 * var(--wp--style--root--padding-right));
	}

	.hero .hero__media img {
		aspect-ratio: 13 / 11;
	}
}

@media (max-width: 599px) {
	.hero .hero__text .wp-block-button,
	.hero .hero__text .wp-block-button__link {
		width: 100%;
	}
}

@media (min-width: 1100px) {
	.wp-block-group.hero {
		padding-top: 0;
	}

	.hero .hero__text {
		padding-top: var(--wp--preset--spacing--xxl);
		padding-bottom: var(--wp--preset--spacing--xxl);
	}

	/* Bleed to the right edge of the viewport (1 440 px design): the figure is
	   wider than its column by the root padding. */
	.hero .hero__media .wp-block-image {
		width: calc(100% + var(--wp--style--root--padding-right));
		min-height: 560px;
	}

	.hero .hero__media img {
		position: absolute;
		inset: 0;
	}

	.hero .hero__media figcaption {
		padding-left: var(--wp--preset--spacing--lg);
		padding-right: var(--wp--preset--spacing--lg);
	}
}

/* Plain variant: transparent product shots (trimmed HQ photos) sit on the
   graphite itself, so they are shown whole rather than cover-cropped. */
.hero:not(.hero--photo) .hero__media img {
	object-fit: contain;
}

/* Scene photo variant (hero--photo, home page): the daylight photo would clash
   with the graphite band as a contained rectangle, so it bleeds to the right
   edge of the viewport whatever the width, is slightly toned down and fades
   into the graphite on its left and top edges. Studio product shots (range
   pages) keep the plain variant. */
.wp-block-group.hero--photo {
	overflow-x: clip;
}

.hero--photo .hero__media img {
	filter: saturate(0.88) brightness(0.94);
	object-position: 62% 50%;
}

.hero--photo .hero__media .wp-block-image::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(180deg, rgb(16 31 48 / 0.35), rgb(16 31 48 / 0) 30%);
}

.hero--photo .hero__media figcaption {
	z-index: 2;
}

@media (min-width: 1100px) {
	/* Up to the viewport edge: root padding below the wide size, half the
	   remaining space beyond it (100vw counts the scrollbar, hence the clip). */
	.hero--photo .hero__media .wp-block-image {
		width: calc(100% + max(var(--wp--style--root--padding-right), (100vw - var(--wp--style--global--wide-size)) / 2));
	}

	.hero--photo .hero__media .wp-block-image::before {
		background:
			linear-gradient(90deg, var(--wp--preset--color--graphite) 0%, rgb(16 31 48 / 0.6) 14%, rgb(16 31 48 / 0) 42%),
			linear-gradient(180deg, rgb(16 31 48 / 0.35), rgb(16 31 48 / 0) 30%);
	}
}

/* ---------------------------------------------------------------------------
 * Section head (grid-cards-3 pattern): intro on the left, button on the right,
 * bottom-aligned; the button wraps under the intro on narrow screens.
 * ------------------------------------------------------------------------- */

.wp-block-group.section-head > .section-head__intro {
	flex: 1 1 560px;
	min-width: 0;
}

@media (max-width: 599px) {
	.wp-block-group.section-head .section-head__action,
	.wp-block-group.section-head .section-head__action .wp-block-button,
	.wp-block-group.section-head .section-head__action .wp-block-button__link {
		width: 100%;
	}
}

/* ---------------------------------------------------------------------------
 * Feature (features-3 pattern): bare Lucide icon in brand colour, text beside it.
 * The icon is a 24 px core/spacer with class "icon-mask icon-<name>" (see
 * core-spacer.css), kept at full width in the flex row and centred on the
 * title line (H3 at body size, line-height 1.15).
 * ------------------------------------------------------------------------- */

.wp-block-group.feature .feature__icon {
	color: var(--wp--preset--color--primary);
	flex-shrink: 0;
	margin-top: calc((1.15rem - 24px) / 2);
}

.is-style-band .wp-block-group.feature .feature__icon {
	color: var(--wp--preset--color--on-dark-accent);
}

/* ---------------------------------------------------------------------------
 * Service (services-3 pattern): top rule, big Lucide icon, H3, text. On graphite.
 * ------------------------------------------------------------------------- */

.wp-block-group.service {
	border-top: var(--wp--custom--stroke--thin) solid var(--wp--custom--color--on-dark-border);
	padding-top: var(--wp--preset--spacing--md);
}

.wp-block-group.service .service__icon {
	color: var(--wp--preset--color--primary);
}

.is-style-band .wp-block-group.service .service__icon {
	color: var(--wp--preset--color--on-dark-accent);
}

/* ---------------------------------------------------------------------------
 * Doc row (docs-list pattern): icon + text + button on one line.
 * ------------------------------------------------------------------------- */

.wp-block-group.doc-row .doc-row__icon {
	color: var(--wp--preset--color--primary);
	flex-shrink: 0;
}

.wp-block-group.doc-row .doc-row__meta {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}

/* The text takes the remaining width and wraps; the button never drops below it. */
@media (min-width: 600px) {
	.wp-block-group.doc-row {
		flex-wrap: nowrap !important;
	}

	.wp-block-group.doc-row > .doc-row__main {
		flex: 1 1 0;
		min-width: 0;
	}

	.wp-block-group.doc-row > .doc-row__action {
		flex-shrink: 0;
	}
}

@media (max-width: 599px) {
	.wp-block-group.doc-row .doc-row__action {
		width: 100%;
	}
}

/* ---------------------------------------------------------------------------
 * Steps (steps-4 pattern): big Barlow number, tabular figures.
 * ------------------------------------------------------------------------- */

.step__number {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 2rem;
	font-weight: 600;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	color: var(--wp--preset--color--primary);
	margin-bottom: var(--wp--preset--spacing--sm);
}

.is-style-band .step__number {
	color: var(--wp--preset--color--on-dark-accent);
}

/* ---------------------------------------------------------------------------
 * Breadcrumb bar (breadcrumb pattern, in the Page template)
 * ------------------------------------------------------------------------- */

.wp-block-group.breadcrumb-bar {
	border-bottom: var(--wp--custom--stroke--thin) solid var(--wp--preset--color--border);
}

.breadcrumb__list {
	list-style: none;
	margin: 0;
	padding: 12px 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}

.breadcrumb__item + .breadcrumb__item::before {
	content: "/";
	margin-right: 8px;
	color: var(--wp--preset--color--border);
}

.breadcrumb__item a {
	color: var(--wp--preset--color--muted);
}

.breadcrumb__item a:hover {
	color: var(--wp--preset--color--primary);
}

.breadcrumb__item[aria-current] {
	color: var(--wp--preset--color--contrast);
	font-weight: 500;
}

/* ---------------------------------------------------------------------------
 * Anchor nav (anchor-nav pattern): in-page links under the hero, not sticky.
 * ------------------------------------------------------------------------- */

.wp-block-group.anchor-nav {
	border-bottom: var(--wp--custom--stroke--thin) solid var(--wp--preset--color--border);
}

ul.wp-block-list.anchor-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0 var(--wp--preset--spacing--lg);
}

.anchor-nav__list li {
	margin: 0;
}

.anchor-nav__list a {
	display: inline-block;
	padding: 14px 0;
	border-bottom: var(--wp--custom--stroke--medium) solid transparent;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	color: var(--wp--preset--color--muted);
	text-decoration: none;
	transition: color var(--wp--custom--transition), border-color var(--wp--custom--transition);
}

.anchor-nav__list a:hover,
.anchor-nav__list a:focus-visible {
	color: var(--wp--preset--color--primary);
	border-bottom-color: var(--wp--preset--color--primary);
	text-decoration: none;
}

@media (max-width: 599px) {
	ul.wp-block-list.anchor-nav__list {
		gap: 0 var(--wp--preset--spacing--md);
	}

	.anchor-nav__list a {
		padding: 10px 0;
	}
}

/* ---------------------------------------------------------------------------
 * Topic card (tech-topics pattern): icon, H3, text, mono key figure. Not a link.
 * Cards of a row share the same height; the key figure sits at the bottom.
 * ------------------------------------------------------------------------- */

.topics-row > .wp-block-column {
	display: flex;
	flex-direction: column;
}

.wp-block-group.is-style-card.topic {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--sm);
}

/* The flex gap replaces the flow layout margins. */
.wp-block-group.is-style-card.topic > * {
	margin-block-start: 0;
}

.wp-block-group.is-style-card.topic > .topic__spec {
	margin-block-start: auto;
}

.wp-block-group.is-style-card.topic:hover {
	border-color: var(--wp--preset--color--border);
}

.topic .topic__icon {
	color: var(--wp--preset--color--primary);
}

.topic .topic__spec {
	padding-top: var(--wp--preset--spacing--xs);
	border-top: var(--wp--custom--stroke--thin) solid var(--wp--preset--color--border);
	color: var(--wp--preset--color--contrast);
}

/* ---------------------------------------------------------------------------
 * Sector rows (media-applications pattern): H3, examples in brand colour, text.
 * ------------------------------------------------------------------------- */

.wp-block-group.sector {
	border-top: var(--wp--custom--stroke--thin) solid var(--wp--preset--color--border);
}

.sector .sector__examples {
	font-weight: 500;
}

/* ---------------------------------------------------------------------------
 * Aside card (criteria-table pattern): light blue, no border, full-width button.
 * ------------------------------------------------------------------------- */

.wp-block-group.is-style-card.aside-card,
.wp-block-group.is-style-card.aside-card:hover {
	border-color: transparent;
}

.aside-card .aside-card__icon {
	color: var(--wp--preset--color--primary);
}

.aside-card .wp-block-button,
.aside-card .wp-block-button__link {
	width: 100%;
}

/* ---------------------------------------------------------------------------
 * Notice (notice pattern): orange tint, info icon, one short paragraph.
 * ------------------------------------------------------------------------- */

.notice .notice__icon {
	color: var(--wp--preset--color--accent);
	flex-shrink: 0;
	margin-top: 2px;
}

.notice p {
	color: var(--wp--preset--color--contrast);
}

/* ---------------------------------------------------------------------------
 * Range cards in a list (ranges-list pattern): visual on the left, text on the
 * right. "featured" = large visual, "row" = thumbnail. Stack below 782 px.
 * ------------------------------------------------------------------------- */

.wp-block-group.is-style-card.card--row > .card__media,
.wp-block-group.is-style-card.card--featured > .card__media {
	margin: 0 !important;
	flex-shrink: 0;
	max-width: none;
}

.wp-block-group.is-style-card.card--row > .card__media img,
.wp-block-group.is-style-card.card--featured > .card__media img {
	aspect-ratio: 3 / 2;
	border-radius: var(--wp--custom--radius--sm);
}

.wp-block-group.is-style-card.card--row > .card__media {
	width: 206px;
}

.wp-block-group.is-style-card.card--featured > .card__media {
	width: 44%;
}

.card--row > .card__body,
.card--featured > .card__body {
	flex: 1 1 0;
	min-width: 0;
}

.wp-block-group.is-style-card.card--row .card__link a,
.wp-block-group.is-style-card.card--featured .card__link a {
	display: inline-flex;
	justify-content: flex-start;
}

@media (max-width: 781px) {
	.wp-block-group.is-style-card.card--row,
	.wp-block-group.is-style-card.card--featured {
		flex-wrap: wrap !important;
	}

	.wp-block-group.is-style-card.card--row > .card__media,
	.wp-block-group.is-style-card.card--featured > .card__media {
		width: 100%;
	}
}
