/*
 * Abbey The Food Scientist - FAQ page.
 *
 * The questions are core Details blocks from the page content
 * (.wp-block-details = <details>, its <summary> = the question), styled
 * here as an accordion.
 */

.faq-hero {
	position: relative;
	overflow: hidden;
	background-color: var(--wp--preset--color--brand-cream);
	margin-top: calc(-1 * var(--site-header-height));
	padding: calc(var(--site-header-height) + var(--wp--preset--spacing--60)) var(--wp--preset--spacing--40) var(--wp--preset--spacing--70);
	text-align: center;
}

.faq-hero__inner {
	position: relative;
	z-index: 1;
	max-width: 50rem;
	margin: 0 auto;
}

.faq-hero__eyebrow {
	margin: 0;
	font-family: var(--wp--preset--font-family--eyebrow);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}

.faq-hero__rule {
	display: block;
	width: 5rem;
	height: 4px;
	border-radius: 2px;
	margin: var(--wp--preset--spacing--20) auto var(--wp--preset--spacing--40);
	background-color: var(--wp--preset--color--brand-teal);
}

.faq-hero__heading {
	margin: 0 0 var(--wp--preset--spacing--40);
	font-family: var(--wp--preset--font-family--heading);
	line-height: 1.1;
	font-size: var(--wp--preset--font-size--xxx-large);
	color: var(--wp--preset--color--brand-purple);
}

.faq-hero__description {
	max-width: 60ch;
	margin: 0 auto;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.7;
}

.faq-hero__decor {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.faq-hero__decor-img {
	position: absolute;
	display: block;
	height: auto;
}

.faq-hero__decor-img--tomato {
	left: 5%;
	bottom: 10%;
	width: 120px;
	transform: rotate(-10deg);
}

.faq-hero__decor-img--apple {
	right: 9%;
	top: calc(var(--site-header-height) + var(--wp--preset--spacing--40));
	width: 100px;
	transform: rotate(12deg);
}

.faq-hero__decor-img--molecule {
	right: -40px;
	bottom: -50px;
	width: 240px;
	opacity: 0.7;
}

.faq-list {
	background-color: var(--wp--preset--color--brand-cream-light);
	padding: var(--wp--preset--spacing--70) var(--wp--preset--spacing--40) var(--wp--preset--spacing--60);
}

.faq-list__inner {
	max-width: 56rem;
	margin: 0 auto;
}

.faq-list__empty {
	margin: 0;
	text-align: center;
	color: var(--wp--preset--color--muted);
}

.faq-list__content > * + * {
	margin-top: var(--wp--preset--spacing--30);
}

.faq-list__content .wp-block-details {
	margin-bottom: 0;
	background-color: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-list__content .wp-block-details:hover,
.faq-list__content .wp-block-details[open] {
	border-color: var(--wp--preset--color--category-teal);
	box-shadow: 0 10px 24px rgba(61, 18, 75, 0.08);
}

.faq-list__content .wp-block-details > summary {
	position: relative;
	display: block;
	list-style: none;
	cursor: pointer;
	padding: var(--wp--preset--spacing--40) calc(var(--wp--preset--spacing--40) + 2.75rem) var(--wp--preset--spacing--40) var(--wp--preset--spacing--40);
	border-radius: 16px;
	font-family: var(--wp--preset--font-family--eyebrow);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.4;
	color: var(--wp--preset--color--brand-purple);
}

/* Hide the browser's default disclosure triangle (Safari still uses this). */
.faq-list__content .wp-block-details > summary::-webkit-details-marker {
	display: none;
}

.faq-list__content .wp-block-details > summary:focus-visible {
	outline: 3px solid var(--wp--preset--color--brand-purple);
	outline-offset: 2px;
}

/* Plus icon: teal circle with a "+" that turns into an "x" when open. */
.faq-list__content .wp-block-details > summary::after {
	content: "";
	position: absolute;
	top: 50%;
	right: var(--wp--preset--spacing--40);
	width: 2rem;
	height: 2rem;
	margin-top: -1rem;
	border-radius: 50%;
	background:
		linear-gradient(var(--wp--preset--color--brand-purple), var(--wp--preset--color--brand-purple)) center / 0.85rem 2px no-repeat,
		linear-gradient(var(--wp--preset--color--brand-purple), var(--wp--preset--color--brand-purple)) center / 2px 0.85rem no-repeat,
		var(--wp--preset--color--icon-teal);
	transition: transform 0.2s ease;
}

.faq-list__content .wp-block-details[open] > summary::after {
	transform: rotate(45deg);
}

/* The answer: everything in the Details block after its summary. */
.faq-list__content .wp-block-details > :not(summary) {
	margin: 0 var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--contrast);
	line-height: 1.75;
}

.faq-list__content .wp-block-details > summary + * {
	margin-top: 0;
}

.faq-list__content .wp-block-details > :not(summary) + :not(summary) {
	margin-top: var(--wp--preset--spacing--30);
}

.faq-list__content .wp-block-details > :last-child:not(summary) {
	margin-bottom: var(--wp--preset--spacing--40);
}

.faq-list__content .wp-block-details ul,
.faq-list__content .wp-block-details ol {
	padding-left: 1.4rem;
}

.faq-list__content .wp-block-details li + li {
	margin-top: var(--wp--preset--spacing--20);
}

.faq-list__content a {
	color: var(--wp--preset--color--brand-purple);
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--brand-teal);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.faq-list__content a:hover,
.faq-list__content a:focus-visible {
	text-decoration-color: var(--wp--preset--color--brand-purple);
}

.faq-prompt {
	background-color: var(--wp--preset--color--brand-cream-light);
	padding: 0 var(--wp--preset--spacing--40) var(--wp--preset--spacing--70);
}

.faq-prompt__card {
	max-width: 56rem;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--50);
	border-radius: 20px;
	background-color: var(--wp--preset--color--brand-purple);
	color: var(--wp--preset--color--base);
}

.faq-prompt__heading {
	margin: 0 0 var(--wp--preset--spacing--20);
	font-family: var(--wp--preset--font-family--heading);
	line-height: 1.2;
	font-size: var(--wp--preset--font-size--x-large);
	color: var(--wp--preset--color--base);
}

.faq-prompt__description {
	margin: 0;
	color: rgba(255, 255, 255, 0.8);
	line-height: 1.6;
}

.faq-prompt__btn {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	white-space: nowrap;
	border-radius: 999px;
	font-family: var(--wp--preset--font-family--eyebrow);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.02em;
	padding: 0.9rem 1.6rem;
	background-color: var(--wp--preset--color--brand-teal);
	color: var(--wp--preset--color--brand-purple);
	transition: background-color 0.2s ease, color 0.2s ease;
}

.faq-prompt__btn:hover,
.faq-prompt__btn:focus-visible {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--brand-purple);
}

@media (prefers-reduced-motion: reduce) {
	.faq-list__content .wp-block-details,
	.faq-list__content .wp-block-details > summary::after,
	.faq-prompt__btn {
		transition: none;
	}
}

@media (max-width: 960px) {
	.faq-hero__decor-img--tomato {
		left: 2%;
		width: 90px;
	}

	.faq-hero__decor-img--apple {
		right: 4%;
		width: 80px;
	}
}

@media (max-width: 600px) {
	.faq-hero {
		padding: calc(var(--site-header-height) + var(--wp--preset--spacing--50)) var(--wp--preset--spacing--30) var(--wp--preset--spacing--60);
	}

	.faq-hero__decor {
		display: none;
	}

	.faq-hero__heading {
		font-size: var(--wp--preset--font-size--xx-large);
	}

	.faq-list {
		padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--30);
	}

	.faq-list__content .wp-block-details > summary {
		padding: var(--wp--preset--spacing--30) calc(var(--wp--preset--spacing--30) + 2.5rem) var(--wp--preset--spacing--30) var(--wp--preset--spacing--30);
		font-size: var(--wp--preset--font-size--medium);
	}

	.faq-list__content .wp-block-details > summary::after {
		right: var(--wp--preset--spacing--30);
	}

	.faq-list__content .wp-block-details > :not(summary) {
		margin-left: var(--wp--preset--spacing--30);
		margin-right: var(--wp--preset--spacing--30);
	}

	.faq-list__content .wp-block-details > :last-child:not(summary) {
		margin-bottom: var(--wp--preset--spacing--30);
	}

	.faq-prompt {
		padding: 0 var(--wp--preset--spacing--30) var(--wp--preset--spacing--60);
	}

	.faq-prompt__card {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
		padding: var(--wp--preset--spacing--40);
	}
}
