/*
 * Section 12 — the FAQ.
 *
 * The lines between the rows are not borders on the rows. The design draws them on pseudo-elements —
 * one border-top on the list and one border-bottom per row — laid over the box rather than added to
 * it, so a row is 72 tall with its line and not 73. Inset shadows do the same here: they paint inside
 * the box and take no space. 1px #d9d7d1, the same hairline used elsewhere on the page.
 *
 * The two columns are 35% and the rest, not two halves and not a fixed pair: 448 of 1280, 398 of 1136
 * and 261 of 746 are all 35% to within a pixel, with the 24 gap coming out of the right-hand column.
 */

.as-faq {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 96px 32px;
	background: var(--as-cream-warm);
}

.as-faq__inner {
	display: flex;
	flex-direction: row;
	gap: 24px;
	align-items: flex-start;
	width: 100%;
	max-width: var(--as-container);
}

.as-faq__intro {
	display: flex;
	flex: 0 0 35%;
	flex-direction: column;
	gap: 20px;
	align-items: flex-start;
}

.as-faq__eyebrow {
	color: var(--as-red-deep);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 0.32em;
	text-transform: uppercase;
}

.as-faq__title {
	color: var(--as-navy-text);
	font-size: 36px;
	font-weight: 600;
	/* The lines sit 41 apart in the design (133 and 174), though its text node reports 40. */
	line-height: 1.1389; /* 41 ÷ 36 */
	letter-spacing: -0.025em;
}

.as-faq__list {
	flex: 1 1 0;
	box-shadow: inset 0 1px 0 var(--as-rule);
}

.as-faq__row {
	box-shadow: inset 0 -1px 0 var(--as-rule);
}

/*
 * Each question area is 72.3 tall: 24 above, 24.3 of text, 24 below. The question takes whatever the
 * 24px toggle and the 24 gap leave, which on the phone is 310 and wraps the two longest questions.
 */
.as-faq__question {
	display: flex;
	flex-direction: row;
	gap: 24px;
	align-items: center;
	justify-content: space-between;
	padding: 24px 0;
	color: var(--as-charcoal);
	font-size: 18px;
	font-weight: 500;
	line-height: var(--as-lh-body); /* 24.3 ÷ 18 */
	letter-spacing: -0.01em;
	cursor: pointer;
	/* The browser's own disclosure triangle, replaced by the design's cross and bar. */
	list-style: none;
}

.as-faq__question::-webkit-details-marker {
	display: none;
}

/* Nothing to click on a row with no answer, so it does not pretend otherwise. */
.as-faq__row--inert .as-faq__question {
	cursor: default;
}

.as-faq__question-text {
	flex: 1 1 auto;
}

.as-faq__mark-slot {
	display: flex;
	flex: 0 0 24px;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
}

.as-faq__mark {
	display: block;
}

/* Closed shows the cross, open shows the bar — and the open row's question turns red. */
.as-faq__mark--open {
	display: none;
}

.as-faq__row[open] > .as-faq__question {
	color: var(--as-red-deep);
}

.as-faq__row[open] > .as-faq__question .as-faq__mark--closed {
	display: none;
}

.as-faq__row[open] > .as-faq__question .as-faq__mark--open {
	display: block;
}

/* The answer is narrower than the row it sits in: 672 of 808 at desktop. 72.3 + 48 + 24 = 144.3 open. */
.as-faq__answer {
	padding-bottom: 24px;
}

.as-faq__answer-text {
	max-width: 672px;
	color: var(--as-slate);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.6; /* 24 ÷ 15 */
}

/*
 * The heading's hand-made break is taken away in the tablet band, and only there.
 *
 * The design breaks this heading by hand at 1200 and above and on the phone, but lets it wrap by
 * itself between 810 and 1199 — where the left column is only 261 wide, so "Questions we get" alone
 * needs 300 and a hand break would push the heading to three lines. Two lines is what every width
 * shows; a third line would make the left column taller than the list and set the band's height.
 *
 * The space the markup prints before the break is what joins the two halves back into one sentence
 * once the break is gone. At the widths that keep the break it sits at the end of a line, where it
 * collapses to nothing.
 */
@media (max-width: 1199px) and (min-width: 810px) {
	.as-faq__title-break {
		display: none;
	}
}

/* The phone stacks the heading above the questions and drops the padding that propped the column up. */
@media (max-width: 809px) {
	.as-faq {
		padding: 96px 16px;
	}

	.as-faq__inner {
		flex-direction: column;
		gap: 24px;
	}

	.as-faq__intro {
		flex: 0 0 auto;
		width: 100%;
	}

	.as-faq__list {
		flex: 0 0 auto;
		width: 100%;
	}
}
