/**
 * FAQ block — see block.php's/init.php's top comments for the Figma
 * measurements and the sticky-heading/header-clearance reasoning this
 * reproduces.
 *
 * Simplification worth flagging: Figma moves its big decorative "?"
 * watermark to a different spot at each breakpoint (tucked behind the
 * heading on mobile, next to the question columns on desktop). Rather
 * than duplicate it in the DOM, it's rendered once as a plain text
 * glyph (.faq__mark, no image asset needed) and just repositioned by
 * media query below — same element, two spots.
 *
 * @package intobi
 */

.faq {
	position: relative;
}

.faq__container {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 32px;
	padding-top: var(--io-section-py);
	padding-bottom: var(--io-section-py);
}

@media (min-width: 1024px) {
	.faq__container {
		gap: 64px;
	}
	.site-main__toc-content .faq__container {
		gap: 32px;
	}
}


.faq__mark {
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	min-height: 122px;
	max-height: 580px;
	pointer-events: none;
	user-select: none;
	z-index: -1;
}
.faq__mark svg {
	height: 100%;
	width: auto;
	max-width: 100%;
}

.faq__list .faq__mark {
	display: none;
}

@media (min-width: 768px) {
	.faq__list .faq__mark {
		display: block;
	}
	.faq__head .faq__mark {
		display: none;
	}
	.faq__mark {
		left: -28%;
		right: auto;
	}
	.site-main__toc-content .faq__mark {
		left: -38%;
	}
}
@media (min-width: 1024px) {
	.site-main__toc-content .faq__mark {
		left: -2%;
	}
}
@media (min-width: 1240px) {
	.faq__mark {
		left: -16%;
	}
	.site-main__toc-content .faq__mark {
		left: -38%;
	}
}

@media (min-width: 1440px) {
	.site-main__toc-content .faq__mark {
		left: -28%;
	}
}

/* ---------------------------------------------------------------
   Head — heading + CTA. Sticks under the fixed header at ≥1024px,
   stacks and un-stickies below it — same pattern as Technology, see
   init.php's top comment.
------------------------------------------------------------------ */

.faq__head {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
}

.faq__cta {
	min-width: 130px;
}

@media (min-width: 768px) {
	.faq__head {
		flex-direction: row;
		align-items: center;
		gap: 24px;
		z-index: 2;
	}
}

@media (min-width: 1024px) {
	.faq__heading {
		flex: 1 1 0%;
		min-width: 0;
	}

	.site-main__toc-content .faq__head {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media (min-width: 1240px) {
	.site-main__toc-content .faq__head {
		flex-direction: row;
		align-items: center;
	}
}

/* ---------------------------------------------------------------
   List — 1 column below 1240px (both "Column" frames still stack
   full-width at the 1024-wide frame), 2 columns at/above 1240px
   (matches Figma's own two "Column" frames sitting side by side only
   there — same DOM order either way, CSS just switches
   flex-direction). Confirmed against both frames' own coordinates,
   node 2001:6916.
------------------------------------------------------------------ */

.faq__list {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: 100%;
}

@media (min-width: 768px) {
	.faq__list {
		max-width: 78%;
		margin-left: auto;
	}

	.site-main__toc-content .faq__list {
		max-width: 72%;
	}
}

@media (min-width: 1024px) {
	.site-main__toc-content .faq__list {
		max-width: 100%;
	}
}

@media (min-width: 1240px) {
	.faq__list {
		flex-direction: row;
		align-items: flex-start;
		gap: 8px;
		max-width: 85%;
		margin-left: auto;
	}
	.site-main__toc-content .faq__list {
		max-width: 72%;
	}
}

@media (min-width: 1440px) {
	.site-main__toc-content .faq__list {
		max-width: 78%;
	}
}

.faq__column {
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: 100%;
	min-width: 0;
}

@media (min-width: 1240px) {
	.faq__column {
		flex: 1 1 0%;
	}
}

/* ---------------------------------------------------------------
   "Stacked" layout — init.php's "layout" field. Same left/right
   question grouping and .faq__list positioning (85%-width, offset
   right of the "?" watermark) as "Columns" above — only the ≥1240px
   row-split is cancelled, so both groups stay one full-width column
   stacked on top of each other at every width (Figma node 2001:9776,
   the single Service page's own FAQ section).
------------------------------------------------------------------ */

@media (min-width: 1240px) {
	.faq--stacked .faq__list {
		flex-direction: column;
		gap: 4px;
	}

	.faq--stacked .faq__column {
		flex: initial;
	}
}

/* ---------------------------------------------------------------
   Question card — <details>/<summary> when it has an answer (native
   expand/collapse, no JS), a plain non-expandable card when it
   doesn't (nothing to reveal yet).
------------------------------------------------------------------ */

.faq__item {
	background: var(--io-bg);
	border: 1px solid var(--io-border);
	border-radius: var(--io-radius-card);
	padding: 12px;
	transition: border-color 0.2s ease;
}

/* Hover — Figma node 2001:2498 "Hover" variant: card border steps up
   to Border/additional, toggle button border/icon go from
   Primary/dark to Ink (same token swap as .io-btn--outline in
   base.css, box-shadow trick instead of a border-width change so the
   40x40 button doesn't reflow). :has() lets keyboard focus on the
   summary trigger the same card-level styling as a mouse hover. */
.faq__item:hover,
.faq__item:has( .faq__q:focus-visible ) {
	border-color: var(--io-border-additional);
}

summary.faq__q {
	cursor: pointer;
	list-style: none;
}

summary.faq__q::-webkit-details-marker {
	display: none;
}

.faq__q {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
}

.faq__q-text {
	flex: 1 1 0%;
	min-width: 0;
	padding: 8px 16px;
	font-family: var(--io-font-body);
	font-weight: 500;
	font-size: 20px;
	line-height: 1.25;
	color: var(--io-ink);
}

.faq__toggle {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 1px solid var(--io-primary-dark);
	border-radius: 20px;
	box-shadow: inset 0 0 0 0px var(--io-ink);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq__item:hover .faq__toggle,
.faq__q:focus-visible .faq__toggle {
	border-color: var(--io-ink);
	box-shadow: inset 0 0 0 1px var(--io-ink);
}

.faq__toggle-up,
.faq__toggle-down {
	display: flex;
	align-items: center;
	justify-content: center;
}

.faq__toggle .icon {
	width: 24px;
	height: 24px;
	display: inline-flex;
}

.faq__toggle svg path {
	stroke: var(--io-primary-dark);
	transition: stroke 0.2s ease;
}

.faq__item:hover .faq__toggle svg path,
.faq__q:focus-visible .faq__toggle svg path {
	stroke: var(--io-ink);
}

.faq__toggle-up {
	display: none;
}

details[open] .faq__toggle-down {
	display: none;
}

details[open] .faq__toggle-up {
	display: inline-flex;
}

.faq__a {
	padding: 0 50px 8px 16px;
}

.faq__a p {
	font-family: var(--io-font-body);
	font-weight: 400;
	font-size: 16px;
	line-height: 1.5;
	color: var(--io-body);
	margin: 0;
}
