/* =========================================================================
   WEFOM — components.css
   Header, navigation, buttons, cards, patterns-level components.
   ========================================================================= */

/* -- Icons ---------------------------------------------------------------
   Inline SVGs have no intrinsic size without explicit width/height, so
   every icon must be sized explicitly here — otherwise browsers fall back
   to a large default box (this was previously breaking CTA layouts). */
.wefom-icon {
	width: 24px;
	height: 24px;
	flex: none;
}

.wefom-arrow {
	width: 18px;
	height: 18px;
	flex: none;
	vertical-align: -3px;
}

.wefom-use-case-cell .wefom-icon {
	width: 28px;
	height: 28px;
}

/* -- Header ------------------------------------------------------------- */
.wefom-header {
	position: sticky;
	top: 0;
	z-index: 999;
	background: transparent;
	border-bottom: 1px solid transparent;
	transition: background-color var(--wefom-normal) var(--wefom-easing),
		border-color var(--wefom-normal) var(--wefom-easing),
		backdrop-filter var(--wefom-normal) var(--wefom-easing);
}

.wefom-header.is-scrolled {
	background: color-mix(in srgb, var(--wp--preset--color--warm-white) 92%, transparent);
	backdrop-filter: saturate(140%) blur(8px);
	border-bottom-color: var(--wp--preset--color--border-light);
}

.wefom-header .wp-block-navigation {
	font-size: var(--wp--preset--font-size--small);
}

.wefom-header .wp-block-navigation a {
	text-decoration: none;
	color: var(--wp--preset--color--graphite-secondary);
	transition: color var(--wefom-fast) var(--wefom-easing);
}

.wefom-header .wp-block-navigation a:hover {
	color: var(--wp--preset--color--graphite);
}

.wefom-header .wp-block-navigation__responsive-container-open,
.wefom-header .wp-block-navigation__responsive-container-close {
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: var(--wp--custom--radius--small, 6px);
}

/* -- Buttons -------------------------------------------------------------- */
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 48px;
	line-height: 1;
	transition: background-color var(--wefom-fast) var(--wefom-easing),
		color var(--wefom-fast) var(--wefom-easing),
		border-color var(--wefom-fast) var(--wefom-easing),
		transform var(--wefom-fast) var(--wefom-easing);
}

.wp-block-button__link:active {
	transform: translateY(1px);
}

.is-style-wefom-primary .wp-block-button__link {
	background: var(--wp--preset--color--primary-blue);
	color: var(--wp--preset--color--pure-white);
	border: 1px solid var(--wp--preset--color--primary-blue);
}

.is-style-wefom-primary .wp-block-button__link:hover {
	background: var(--wp--preset--color--dark-blue);
	border-color: var(--wp--preset--color--dark-blue);
}

.is-style-wefom-secondary .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--graphite);
	border: 1px solid var(--wp--preset--color--border-strong);
}

.is-style-wefom-secondary .wp-block-button__link:hover {
	background: var(--wp--preset--color--soft-surface);
	border-color: var(--wp--preset--color--graphite);
}

.is-style-wefom-on-dark.is-style-wefom-primary .wp-block-button__link {
	background: var(--wp--preset--color--pure-white);
	color: var(--wp--preset--color--near-black);
	border-color: var(--wp--preset--color--pure-white);
}

.is-style-wefom-on-dark.is-style-wefom-secondary .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--pure-white);
	border-color: var(--wp--preset--color--dark-muted-text);
}

.is-style-wefom-on-dark.is-style-wefom-secondary .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--pure-white);
}

.wp-block-button__link[disabled] {
	opacity: 0.45;
	pointer-events: none;
}

/* Arrow icon inside link/button text — CSS-only movement on hover. */
.wefom-arrow {
	display: inline-block;
	transition: transform var(--wefom-fast) var(--wefom-easing);
}

.wp-block-button__link:hover .wefom-arrow,
.wefom-text-link:hover .wefom-arrow {
	transform: translateX(3px);
}

/* -- Text link ------------------------------------------------------------- */
.wefom-text-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--wp--preset--color--primary-blue);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	font-weight: 600;
	font-size: 1.125rem;
	white-space: nowrap;
}

.wefom-text-link:hover {
	color: var(--wp--preset--color--dark-blue);
}

.wefom-text-link.is-on-dark {
	color: var(--wp--preset--color--pure-white);
}

/* -- Eyebrow / section labels ------------------------------------------------ */
.wefom-section-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--wp--preset--color--muted-text);
}

.wefom-section-label::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--wp--preset--color--primary-blue);
	flex: none;
}

/* -- Cards: service panel --------------------------------------------------- */
.wefom-service-panel {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: var(--wp--custom--radius--default, 10px);
	padding: var(--wp--preset--spacing--xl);
	background: var(--wp--preset--color--pure-white);
	transition: border-color var(--wefom-normal) var(--wefom-easing);
	height: 100%;
}

.wefom-service-cta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--sm);
}

.wefom-service-panel:hover {
	border-color: var(--wp--preset--color--border-strong);
}

.wefom-service-panel .wefom-index {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--h4);
	color: var(--wp--preset--color--muted-text);
	font-weight: 700;
}

.wefom-service-panel ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.wefom-service-panel ul li {
	padding-left: 22px;
	position: relative;
	color: var(--wp--preset--color--graphite-secondary);
	font-size: var(--wp--preset--font-size--small);
}

.wefom-service-panel ul li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.55em;
	width: 8px;
	height: 8px;
	border-radius: 2px;
	border: 1.5px solid var(--wp--preset--color--primary-blue);
}

/* -- Cards: case-study panel -------------------------------------------------- */
.wefom-case-panel {
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: var(--wp--custom--radius--large, 16px);
	overflow: hidden;
	background: var(--wp--preset--color--pure-white);
	transition: border-color var(--wefom-normal) var(--wefom-easing);
}

.wefom-case-panel:hover {
	border-color: var(--wp--preset--color--border-strong);
}

.wefom-case-panel .wefom-case-media {
	aspect-ratio: 16/9;
	background: var(--wp--preset--color--soft-surface);
	border-bottom: 1px solid var(--wp--preset--color--border-light);
}

.wefom-case-panel .wefom-case-body {
	padding: var(--wp--preset--spacing--lg);
}

.wefom-case-meta {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	color: var(--wp--preset--color--muted-text);
	font-size: var(--wp--preset--font-size--small);
}

/* -- Cards: insight card ------------------------------------------------------- */
.wefom-insight-card {
	border-top: 1px solid var(--wp--preset--color--border-light);
	padding-top: var(--wp--preset--spacing--lg);
}

.wefom-insight-card .wefom-insight-meta {
	display: flex;
	gap: 12px;
	align-items: center;
	color: var(--wp--preset--color--muted-text);
	font-size: var(--wp--preset--font-size--small);
}

/* -- Engagement card (replaces empty image placeholders with a small
   flow diagram — no stock imagery, no fake case-study covers) -------------------- */
.wefom-engagement-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: var(--wp--preset--spacing--lg);
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: var(--wp--custom--radius--default, 10px);
	background: var(--wp--preset--color--pure-white);
}

.wefom-engagement-card h3 {
	margin: 0;
	font-size: var(--wp--preset--font-size--heading-4);
}

.wefom-engagement-flow {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	color: var(--wp--preset--color--primary-blue);
	padding: 10px 12px;
	background: var(--wp--preset--color--pale-blue);
	border-radius: var(--wp--custom--radius--small, 6px);
	width: fit-content;
}

.wefom-engagement-meta {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 6px;
	color: var(--wp--preset--color--muted-text);
	font-size: var(--wp--preset--font-size--small);
}

/* -- Metric block --------------------------------------------------------------- */
.wefom-metric {
	border-top: 2px solid var(--wp--preset--color--primary-blue);
	padding-top: var(--wp--preset--spacing--sm);
}

.wefom-metric .wefom-metric-value {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--h2);
	font-weight: 800;
	line-height: 1;
}

/* -- Technical diagram panel ------------------------------------------------------ */
.wefom-diagram {
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: var(--wp--custom--radius--large, 16px);
	background: var(--wp--preset--color--soft-surface);
	padding: var(--wp--preset--spacing--xl);
	display: grid;
	gap: var(--wp--preset--spacing--md);
}

.wefom-diagram svg {
	width: 100%;
	height: auto;
}

.wefom-diagram .wefom-node {
	fill: var(--wp--preset--color--pure-white);
	stroke: var(--wp--preset--color--border-strong);
	stroke-width: 1.5;
}

.wefom-diagram .wefom-node-active {
	fill: var(--wp--preset--color--pale-blue);
	stroke: var(--wp--preset--color--primary-blue);
}

.wefom-diagram .wefom-edge {
	stroke: var(--wp--preset--color--border-strong);
	stroke-width: 1.5;
	fill: none;
}

.wefom-diagram .wefom-node-label {
	font-family: var(--wp--preset--font-family--body);
	font-size: 11px;
	fill: var(--wp--preset--color--graphite-secondary);
}

/* -- Process component -------------------------------------------------------------- */
.wefom-process {
	display: grid;
	gap: var(--wp--preset--spacing--xl);
	grid-template-columns: repeat(5, 1fr);
	position: relative;
}

.wefom-process::before {
	content: "";
	position: absolute;
	top: 22px;
	left: 22px;
	right: 22px;
	height: 1px;
	background: var(--wp--preset--color--border-light);
}

.wefom-process-step {
	position: relative;
	display: grid;
	gap: 6px;
}

.wefom-process-step h3,
.wefom-process-step p,
.wefom-use-case-cell h3,
.wefom-use-case-cell p,
.wefom-insight-card h3,
.wefom-insight-card p {
	margin: 0;
}

.wefom-process-step .wefom-process-number {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--wp--preset--color--pure-white);
	border: 1.5px solid var(--wp--preset--color--border-strong);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	position: relative;
	z-index: 1;
}

@media (max-width: 900px) {
	.wefom-process {
		grid-template-columns: 1fr;
		gap: var(--wp--preset--spacing--lg);
	}

	.wefom-process::before {
		top: 0;
		bottom: 0;
		left: 22px;
		right: auto;
		width: 1px;
		height: auto;
	}
}

/* -- Use-case grid ------------------------------------------------------------------- */
.wefom-use-case-cell {
	border: 1px solid var(--wp--preset--color--border-light);
	padding: var(--wp--preset--spacing--lg);
	display: grid;
	gap: 8px;
	align-content: start;
}

.wefom-use-case-cell .wefom-icon {
	color: var(--wp--preset--color--primary-blue);
}

/* -- FAQ / accordion (native details/summary) ---------------------------------------- */
.wefom-faq-item {
	border-bottom: 1px solid var(--wp--preset--color--border-light);
}

.wefom-faq-item summary {
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: var(--wp--preset--spacing--md) 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--body-large);
}

.wefom-faq-item summary::-webkit-details-marker {
	display: none;
}

.wefom-faq-item .wefom-faq-icon {
	position: relative;
	flex: none;
	width: 20px;
	height: 20px;
}

.wefom-faq-item .wefom-faq-icon::before,
.wefom-faq-item .wefom-faq-icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	background: var(--wp--preset--color--graphite);
	transition: transform var(--wefom-normal) var(--wefom-easing), opacity var(--wefom-normal) var(--wefom-easing);
}

.wefom-faq-item .wefom-faq-icon::before {
	width: 14px;
	height: 1.5px;
	transform: translate(-50%, -50%);
}

.wefom-faq-item .wefom-faq-icon::after {
	width: 1.5px;
	height: 14px;
	transform: translate(-50%, -50%);
}

.wefom-faq-item[open] .wefom-faq-icon::after {
	transform: translate(-50%, -50%) rotate(90deg);
	opacity: 0;
}

.wefom-faq-item .wefom-faq-answer {
	padding-bottom: var(--wp--preset--spacing--md);
	color: var(--wp--preset--color--graphite-secondary);
	max-width: var(--wp--custom--content-width--text, 72ch);
}

@media (prefers-reduced-motion: no-preference) {
	.wefom-faq-item .wefom-faq-answer {
		animation: wefom-faq-reveal var(--wefom-normal) var(--wefom-easing);
	}
}

@keyframes wefom-faq-reveal {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: translateY(0); }
}

/* -- Footer --------------------------------------------------------------------------- */
.wefom-footer {
	background: var(--wp--preset--color--near-black);
	color: var(--wp--preset--color--dark-muted-text);
}

.wefom-footer a {
	color: var(--wp--preset--color--dark-muted-text);
	text-decoration: none;
}

.wefom-footer a:hover {
	color: var(--wp--preset--color--pure-white);
}

.wefom-footer h2,
.wefom-footer h3 {
	color: var(--wp--preset--color--pure-white);
}

.wefom-footer .wefom-footer-heading {
	color: var(--wp--preset--color--pure-white);
	font-size: var(--wp--preset--font-size--label);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-weight: 600;
}

/* -- Trust strip logo marks ------------------------------------------------------------ */
.wefom-logo-mark {
	filter: grayscale(1) contrast(0.9);
	opacity: 0.7;
	transition: opacity var(--wefom-normal) var(--wefom-easing);
}

.wefom-logo-mark:hover {
	opacity: 1;
}
