/*
 * Sipoon Wolf theme styles for the FAQ page (page-templates/faq.php).
 *
 * inc/assets.php loads this file only on these pages, after main.css. The tokens are in main.css.
 */

/* FAQ page ------------------------------------------------------------ */

/* The lead text and the grey box below the title. */
.page-header__intro {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
	align-items: start;
	gap: clamp(24px, 4vw, 64px);
	width: 100%;
	margin-top: clamp(8px, 1.5vw, 20px);
}

.page-header__intro .lead {
	max-width: 50ch;
	line-height: 1.5;
}

.page-header__aside {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 560px;
	padding: clamp(24px, 2.6vw, 36px);
	background: var(--wolf-paper-2);
}

.page-header__aside-title {
	font-family: var(--wolf-font-display);
	font-weight: 900;
	font-size: clamp(20px, 1.8vw, 24px);
	line-height: 1.1;
	text-transform: uppercase;
}

.page-header__aside-text {
	color: var(--wolf-ink-2);
	font-size: 16px;
	line-height: 1.5;
}

.page-header__aside-link,
.faq-contact__link {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	min-height: 44px;
	color: var(--wolf-ink);
	font-weight: 700;
	font-size: 17px;
	text-decoration: underline;
	text-underline-offset: 4px;
	overflow-wrap: anywhere;
}

.page-header__aside-link:hover,
.faq-contact__link:hover {
	text-decoration-thickness: 2px;
}

/* The numbered steps on the yellow band. */
.faq-steps {
	padding-block: var(--wolf-section);
	background: var(--wolf-gold);
	color: var(--wolf-ink);
}

.faq-steps__inner,
.faq__inner,
.faq-contacts__inner {
	display: flex;
	flex-direction: column;
	gap: clamp(28px, 3vw, 44px);
}

.faq-steps__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px 32px;
}

.faq-steps__title,
.faq__title,
.faq-contacts__title {
	font-weight: 900;
	font-size: clamp(32px, 4vw, 56px);
	line-height: 0.95;
	text-transform: uppercase;
}

.faq-steps__text {
	max-width: 44ch;
	font-size: 17px;
	line-height: 1.5;
}

.faq-steps__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
	gap: clamp(12px, 1.6vw, 20px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.faq-steps__list > li {
	display: flex;
}

.faq-step {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 14px;
	min-height: 220px;
	padding: clamp(22px, 2.2vw, 30px);
	background: var(--wolf-gold-tint);
	color: var(--wolf-ink);
	text-decoration: none;
	transition: background-color 0.15s;
}

a.faq-step:hover {
	background: var(--wolf-paper);
}

.faq-step__number {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--wolf-ink);
	color: var(--wolf-gold);
	font-family: var(--wolf-font-display);
	font-weight: 900;
	font-size: 20px;
}

.faq-step__title,
.faq-contact__name {
	font-family: var(--wolf-font-display);
	font-weight: 900;
	font-size: clamp(20px, 1.7vw, 24px);
	line-height: 1.05;
	text-transform: uppercase;
}

.faq-step__text,
.faq-contact__text {
	color: var(--wolf-ink-2);
	font-size: 16px;
	line-height: 1.5;
}

.faq-step__more,
.faq-item__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--wolf-font-display);
	font-weight: 800;
	font-size: 13px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.faq-step__more {
	margin-top: auto;
}

/* The questions by topic. */
.faq {
	padding: clamp(64px, 8vw, 120px) 0 clamp(72px, 9vw, 136px);
}

.faq__title {
	padding-bottom: 20px;
	border-bottom: 4px solid var(--wolf-ink);
}

.faq__grid {
	display: grid;
	grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
	align-items: start;
	gap: clamp(32px, 4vw, 72px);
}

/* Without JavaScript, the topic buttons do not show. Then the questions use all the width. */
.faq__grid:has(> .faq__topics[hidden]) {
	grid-template-columns: minmax(0, 1fr);
}

.faq__topics {
	position: sticky;
	top: 24px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.faq__topics[hidden] {
	display: none;
}

.faq__topics-label {
	margin-bottom: 4px;
	color: var(--wolf-muted);
	font-family: var(--wolf-font-display);
	font-weight: 800;
	font-size: 13px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.faq__chip {
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	min-height: 48px;
	padding: 0 18px;
	font-size: 14px;
	letter-spacing: 0.08em;
	text-align: left;
}

.faq__groups {
	display: flex;
	flex-direction: column;
	gap: clamp(40px, 4vw, 64px);
	min-width: 0;
}

.faq-topic {
	display: flex;
	flex-direction: column;
	gap: 8px;
	scroll-margin-top: 24px;
}

.faq-topic[hidden] {
	display: none;
}

.faq-topic__head {
	display: flex;
	align-items: baseline;
	gap: 14px;
}

.faq-topic__number {
	color: var(--wolf-gold-dark);
	font-family: var(--wolf-font-display);
	font-weight: 900;
	font-size: 15px;
}

.faq-topic__title {
	font-weight: 900;
	font-size: clamp(24px, 2.2vw, 32px);
	line-height: 1;
	text-transform: uppercase;
}

.faq-topic__list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 2px solid var(--wolf-ink);
}

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

.faq-item__heading {
	margin: 0;
}

.faq-item__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	min-height: 64px;
	padding: 14px 8px;
	border: 0;
	background: none;
	color: var(--wolf-ink);
	font-family: var(--wolf-font-body);
	font-weight: 700;
	font-size: clamp(17px, 1.4vw, 20px);
	line-height: 1.35;
	text-align: left;
	cursor: pointer;
	transition: background-color 0.15s;
}

.faq-item__toggle:hover {
	background: var(--wolf-paper-2);
}

.faq-item__icon {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--wolf-paper-2);
	transition: background-color 0.15s;
}

.faq-item__icon .icon {
	transition: transform 0.2s var(--wolf-ease);
}

.faq-item__toggle[aria-expanded="true"] .faq-item__icon {
	background: var(--wolf-gold);
}

.faq-item__toggle[aria-expanded="true"] .faq-item__icon .icon {
	transform: rotate(180deg);
}

.faq-item__panel {
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-width: 72ch;
	padding: 0 8px 26px;
}

.faq-item__panel[hidden] {
	display: none;
}

.faq-item__answer {
	display: flex;
	flex-direction: column;
	gap: 12px;
	color: var(--wolf-ink-2);
	font-size: 17px;
	line-height: 1.6;
}

.faq-item__link {
	align-self: flex-start;
	min-height: 44px;
	color: var(--wolf-ink);
	text-decoration: none;
}

.faq-item__link:hover {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 5px;
}

/* Without JavaScript, all the answers are open and the buttons do nothing. */
.no-js .faq-item__panel[hidden] {
	display: flex;
}

.no-js .faq-item__toggle {
	cursor: default;
}

.no-js .faq-item__toggle:hover {
	background: none;
}

.no-js .faq-item__icon {
	display: none;
}

/* The contact cards. */
.faq-contacts {
	padding-block: var(--wolf-section);
	background: var(--wolf-paper-2);
}

.faq-contacts__inner {
	gap: clamp(24px, 3vw, 40px);
}

.faq-contacts__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
	gap: var(--wolf-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.faq-contact {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: clamp(22px, 2.2vw, 32px);
	background: var(--wolf-paper);
}

.faq-contact__role {
	color: var(--wolf-gold-dark);
	font-family: var(--wolf-font-display);
	font-weight: 800;
	font-size: 12px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.faq-contact__name {
	line-height: 1.1;
}

.faq-contact__link {
	font-size: 16px;
}

/* On a narrow screen, the topic buttons are a row that the user can scroll. */
@media (max-width: 960px) {
	.faq__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.faq__topics {
		position: static;
		flex-direction: row;
		margin-inline: calc(-1 * var(--wolf-gutter));
		padding: 2px var(--wolf-gutter) 8px;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.faq__topics::-webkit-scrollbar {
		display: none;
	}

	.faq__topics-label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.faq__chip {
		flex: 0 0 auto;
		width: auto;
		white-space: nowrap;
	}
}
