/**
 * Nexza FAQ widget.
 */

.nx-faq {
	display: grid;
	grid-template-columns: 27% 1fr;
	gap: 4vw;
	align-items: start;
}

.nx-faq > * {
	min-width: 0;
}

/* No badge: the questions take the full width. */
.nx-faq:not(:has(.nx-faq-aside)) {
	grid-template-columns: 1fr;
}

/* Rotating badge */
.nx-faq-badge {
	position: relative;
	display: block;
	width: min(230px, 60vw);
	aspect-ratio: 1;
	color: var(--nx-sand);
}

.nx-faq-ring {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
	animation: nx-faq-spin 22s linear infinite;
}

/* Font size and spacing are set per text on the element, so it fits the circle. */
.nx-faq-ring text {
	fill: currentColor;
	font-weight: 600;
}

.nx-faq-core {
	position: absolute;
	inset: 28%;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--nx-copper);
	color: var(--nx-ink);
	transition: background-color .3s, transform .4s var(--nx-ease);
}

.nx-faq-badge:hover .nx-faq-core,
.nx-faq-badge:focus-visible .nx-faq-core {
	background: var(--nx-ember);
	transform: rotate(45deg);
}

@keyframes nx-faq-spin {
	to { transform: rotate(360deg); }
}

/* Heading */
.nx-faq-intro {
	max-width: 56ch;
	margin-top: 24px;
}

/* Accordion */
.nx-faq-list {
	margin-top: clamp(32px, 4vw, 56px);
	border-top: 1px solid var(--nx-line-2);
}

.nx-faq-item {
	border-bottom: 1px solid var(--nx-line-2);
}

.nx-faq-item summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 26px 0;
	list-style: none;
	cursor: pointer;
	font-size: clamp(18px, 1.5vw, 22px);
	font-weight: 600;
	letter-spacing: -.01em;
	line-height: 1.35;
	color: var(--nx-sand);
	transition: color .3s;
}

.nx-faq-item summary::-webkit-details-marker {
	display: none;
}

.nx-faq-item summary:hover {
	color: var(--nx-ember);
}

.nx-faq-pm {
	display: grid;
	place-items: center;
	flex: none;
	width: 40px;
	height: 40px;
	border: 1px solid var(--nx-line-2);
	border-radius: 50%;
	color: var(--nx-sand);
	transition: transform .3s var(--nx-ease), background-color .3s, border-color .3s, color .3s;
}

.nx-faq-item[open] .nx-faq-pm {
	background: var(--nx-copper);
	border-color: var(--nx-copper);
	color: var(--nx-ink);
	transform: rotate(45deg);
}

.nx-faq-a p {
	margin: 0;
	padding: 0 64px 26px 0;
}

/* Answer fades and slides in when opened (opacity + transform only). */
.nx-faq-item[open] .nx-faq-a {
	animation: nx-faq-in .45s var(--nx-ease);
}

@keyframes nx-faq-in {
	from { opacity: 0; transform: translateY(-8px); }
	to { opacity: 1; transform: none; }
}

@media (max-width: 860px) {
	.nx-faq {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.nx-faq-badge {
		width: 160px;
	}

	.nx-faq-item summary {
		gap: 16px;
		padding: 22px 0;
		font-size: 17px;
	}

	.nx-faq-a p {
		padding: 0 0 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nx-faq-ring,
	.nx-faq-item[open] .nx-faq-a {
		animation: none;
	}
}
