/*
 * FAQ page — content (accordion sections).
 *
 * Layout:
 *   - centred 892px column on desktop, fluidly shrinks to viewport width
 *   - 80px gap below the hero block
 *   - 32px gradient group title, 40px gap before first item
 *   - 20px gradient question + chevron, 16px #73ACCB answer
 *   - subtle gradient line under every item (open or closed), 892px wide
 *   - 54px gap between items
 *
 * Animation:
 *   - the answer panel uses the modern `display: grid` row-track trick so
 *     it animates from collapsed (0fr) to expanded (1fr) smoothly without
 *     measuring scrollHeight. JS only toggles `is-open` + aria-expanded.
 */

.faq-content {
	/*
	 * 80px gap from the hero block. The bottom gap to whatever follows
	 * (CTA card on the FAQ page, or the footer if the CTA is removed) is
	 * controlled by the next sibling's `margin-top` so we don't double-stack
	 * vertical spacing here.
	 */
	margin-top: 80px;
	margin-bottom: 0;
}

.faq-content__inner {
	width: min(892px, 100%);
	margin: 0 auto;
}

/*
 * Gap between group titles ("General Questions" → "Services" → ...).
 * The 80px gap from the hero block to the first group lives on `.faq-content`
 * itself; between sibling groups the spec is a tighter 40px so the page reads
 * as one continuous text column rather than disconnected sections.
 */
.faq-content__group + .faq-content__group {
	margin-top: 40px;
}

.faq-content__group-title {
	margin: 0 0 40px;
	font-size: clamp(24px, 3vw, 32px);
	font-weight: 600;
	line-height: 1.12;
	background-image: linear-gradient(90deg, #e6e7eb 0%, #bdd3fa 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	-webkit-text-fill-color: transparent;
}

.faq-accordion {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
}

.faq-accordion__item + .faq-accordion__item {
	margin-top: 54px;
}

/* Question row — full-width button so the entire bar is clickable. */
.faq-accordion__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	width: 100%;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.faq-accordion__summary:focus-visible {
	outline: 2px solid rgba(189, 211, 250, 0.6);
	outline-offset: 6px;
	border-radius: 4px;
}

.faq-accordion__question {
	flex: 1 1 auto;
	min-width: 0;
	font-size: clamp(17px, 1.6vw, 20px);
	font-weight: 500;
	line-height: 1.3;
	background-image: linear-gradient(90deg, #e6e7eb 0%, #bdd3fa 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	-webkit-text-fill-color: transparent;
}

/* Chevron rotates when the panel is open. */
.faq-accordion__icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	color: #bdd3fa;
	transition: transform 0.28s ease;
}

.faq-accordion__icon svg {
	width: 16px;
	height: 16px;
	display: block;
}

.faq-accordion__item.is-open .faq-accordion__icon {
	transform: rotate(180deg);
}

/*
 * Animated panel via grid row-track trick:
 *   collapsed: grid-template-rows: 0fr   → child has effective height 0
 *   open:      grid-template-rows: 1fr   → child takes its natural height
 * Modern browsers (2024+) interpolate between these track values smoothly.
 */
.faq-accordion__panel {
	display: grid;
	grid-template-rows: 0fr;
	overflow: hidden;
	transition: grid-template-rows 0.32s ease, margin-top 0.32s ease;
	margin-top: 0;
}

.faq-accordion__panel-inner {
	min-height: 0;
	overflow: hidden;
}

.faq-accordion__item.is-open .faq-accordion__panel {
	grid-template-rows: 1fr;
	margin-top: 18px;
}

.faq-accordion__answer {
	margin: 0;
	color: #73accb;
	font-size: 16px;
	line-height: 1.4;
}

/*
 * Optional bullet list inside an answer (e.g. "What types of packages does
 * Draxil offer?"). Bullets are rendered through `::marker` so we keep a
 * native `<ul>` for accessibility while still controlling color/spacing.
 */
.faq-accordion__list {
	margin: 14px 0 0;
	padding-left: 20px;
	color: #73accb;
	font-size: 16px;
	line-height: 1.4;
}

.faq-accordion__list li {
	margin: 0;
	padding-left: 6px;
}

.faq-accordion__list li::marker {
	color: #73accb;
}

.faq-accordion__list li + li {
	margin-top: 10px;
}

/*
 * Bottom line — appears under every item, open or closed. Width 892px from
 * Figma; constrained to 100% so it never overflows the centred column on
 * smaller viewports.
 */
.faq-accordion__line {
	width: min(892px, 100%);
	height: 2px;
	margin: 24px auto 0;
	margin-left: 0;
	background: linear-gradient(
		90deg,
		rgba(112, 125, 148, 0) 0%,
		rgba(189, 211, 250, 0.24) 50.96%,
		rgba(112, 125, 148, 0) 100%
	);
}

.faq-accordion__item.is-open .faq-accordion__line {
	margin-top: 32px;
}

@media (max-width: 768px) {
	.faq-content {
		margin-top: clamp(48px, 10vw, 64px);
	}

	.faq-content__group-title {
		margin-bottom: 28px;
	}

	.faq-accordion__item + .faq-accordion__item {
		margin-top: 36px;
	}

	.faq-accordion__line {
		margin-top: 18px;
	}

	.faq-accordion__item.is-open .faq-accordion__line {
		margin-top: 24px;
	}
}
