/* FAQs section (sections/faq.php).
   Each question is a .pe-card <details>, open by default as in Figma: 32px padding,
   question 34.5 / 41.4, 16px gap, answer 22.9 / 33.2: 158 / 191 / 224px tall
   for one, two or three answer lines.
   Default (cream, old Parties 64:428): 40px above the heading, 28px gaps, the theme's
           100px below the last card.
   --band  (any Background colour, FAQs page 83:1501…): 64px above and below, 32px gaps.
   --wave  (yellow after a cream section, Parties 83:515; also has --band): 100px above
           and below, 32px gaps, and the wavy yellow shape rising out of the section above. */
.pe-faq {
	padding-top: clamp(2rem, 2.8vw, 2.5rem);
}

.pe-faq__heading {
	margin-bottom: 1.75rem; /* 28px */
	text-align: center;
}

.pe-faq__list {
	display: flex;
	flex-direction: column;
	gap: 1.75rem; /* 28px */
}

.pe-faq__question {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	font-family: var(--pe-font-display);
	font-size: var(--pe-text-h3);
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	list-style: none;
}

/* Hide the browser's triangle and show a quiet + / − instead (Figma has no icon; it
   only hints that the card can be closed). */
.pe-faq__question::-webkit-details-marker {
	display: none;
}

.pe-faq__question-text {
	min-width: 0;
	overflow-wrap: anywhere;
}

.pe-faq__question::after {
	content: "+";
	flex-shrink: 0;
	color: var(--pe-ink);
	font-family: var(--pe-font-body);
	font-size: 1.5rem;
	font-weight: 400;
	/* As tall as one line of the question, so the sign sits centred on the first line. */
	line-height: calc(var(--pe-text-h3) * 1.2);
}

.pe-faq__item[open] .pe-faq__question::after {
	content: "−";
}

/* 16px in Figma, plus the 1.4px Figma gains by rounding the text boxes up to whole
   pixels, so the cards are as tall as Figma's and the sections line up. */
.pe-faq__answer {
	margin-top: 1.09rem; /* 17.4px */
	font-size: var(--pe-text-body);
	line-height: 1.45;
}

.pe-faq__answer > :last-child {
	margin-bottom: 0;
}

/* Buttons: centred, 32px under the last card. Figma's "Terms & Conditions" is
   246 × 64: the standard button padding, 64px tall. */
.pe-faq__buttons {
	justify-content: center;
	gap: 1.5rem;
	margin-top: clamp(1.5rem, 2.22vw, 2rem); /* 32px */
}

.pe-faq__buttons .pe-button {
	min-height: 4rem;
}

/* ---------- Coloured band (FAQs page) ---------- */

.pe-faq--band {
	padding-block: clamp(2.5rem, 4.45vw, 4rem); /* 64px */
}

.pe-faq--band .pe-faq__heading {
	margin-bottom: clamp(1.5rem, 2.22vw, 2rem); /* 32px */
}

.pe-faq--band .pe-faq__list {
	gap: clamp(1.5rem, 2.22vw, 2rem); /* 32px */
}

/* ---------- Yellow wave (Parties) ---------- */

.pe-faq.pe-faq--wave {
	padding-block: var(--pe-section-space); /* 100px */
}

/* 1440×462 at 1440, its top 148px above the section (32.03% of its height). Painted
   after the section above, so its wavy top edge covers that section's bottom. */
.pe-faq__wave {
	position: absolute;
	top: 0;
	left: 0;
	transform: translateY(-32.03%);
}

.pe-faq .pe-container {
	position: relative; /* above the wave */
}

/* The wave covers the bottom 148px of the section above (10.28vw), so that section
   gets that much extra space below its content, plus Figma's 68px between its last
   card and the top of the wave (Parties "Three steps" 83:509). A section's own
   "Space below" setting still wins (theme.css). */
.pe-section:has(+ .pe-faq.pe-faq--wave) {
	padding-bottom: calc(10.28vw + clamp(2rem, 4.72vw, 4.25rem));
}

/* ---------- Small screens ---------- */

@media (max-width: 767px) {
	.pe-faq__item {
		padding: 1.5rem;
	}
}

@media (max-width: 479px) {
	.pe-faq__item {
		padding: 1.25rem;
	}

	/* One full-width button per row, as in the other sections. */
	.pe-faq__buttons {
		flex-direction: column;
		align-items: stretch;
	}

	.pe-faq__buttons .pe-button {
		min-height: 3.5rem;
	}
}
