/**
 * FAQ page (page-faqs.php).
 *
 * Every rule is scoped to .qehs-faqpage / .qehs-faqpage-* so nothing here
 * can affect another page (the homepage FAQ section keeps its own
 * faq.css + faq-accordion.js untouched). Uses the existing QEHS tokens;
 * the few page-local values below are the soft blues/greens sampled from
 * the approved FAQ design — the hero blues match the supplied
 * illustration's own backdrop (#E2F0FE) so the image blends seamlessly.
 */

.qehs-faqpage {
	--qehs-faq-hero-bg: #F2F8FE;
	--qehs-faq-soft-blue: #F1F7FD;
	--qehs-faq-soft-blue-border: #DCE8F5;
	--qehs-faq-chip-text: #1F3D6B;
	--qehs-faq-soft-green: #F2F8EC;
	--qehs-faq-soft-green-border: #DDEBCF;
	--qehs-faq-card-border: #EAEEF2;
	--qehs-faq-body: #3C4654;

	background-color: var(--qehs-background);
	overflow-x: clip;
}

/* ---------------- Hero ---------------- */

.qehs-faqpage-hero {
	position: relative;
	min-height: 320px;
	background-color: var(--qehs-faq-hero-bg);
	overflow: hidden;
}

.qehs-faqpage-hero__inner {
	position: relative;
	z-index: 1;
	padding-block: var(--qehs-space-lg) var(--qehs-space-2xl);
}

.qehs-faqpage-hero__text {
	max-width: 560px;
}

.qehs-faqpage-hero__breadcrumb {
	display: flex;
	align-items: center;
	gap: var(--qehs-space-sm);
	margin-bottom: var(--qehs-space-lg);
	font-size: 0.9rem;
	color: var(--qehs-text);
}

.qehs-faqpage-hero__breadcrumb a {
	/* Larger tap area without shifting the layout. */
	display: inline-block;
	margin-block: -8px;
	padding-block: 8px;
	color: var(--qehs-secondary);
	font-weight: 600;
	text-decoration: none;
}

.qehs-faqpage-hero__breadcrumb a:hover,
.qehs-faqpage-hero__breadcrumb a:focus-visible {
	text-decoration: underline;
}

.qehs-faqpage-hero__breadcrumb span[aria-current] {
	font-weight: 600;
}

.qehs-faqpage-hero__title {
	margin: 0 0 var(--qehs-space-md);
	font-size: clamp(2rem, 3.3vw, 3rem);
	font-weight: 800;
	line-height: 1.1;
	color: var(--qehs-primary);
}

.qehs-faqpage-hero__title span {
	display: block;
	color: var(--qehs-secondary);
}

.qehs-faqpage-hero__body {
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.65;
	color: var(--qehs-faq-body);
}

/* Anchored flush to the hero's bottom-right edge, as in the design; the
   image's own transparent edge + curved backdrop form the background. */
.qehs-faqpage-hero__illustration {
	position: absolute;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	width: 50%;
	height: 100%;
	pointer-events: none;
}

/* Natural aspect ratio always preserved: the image scales down to fit
   whichever limit (hero height or available width) is reached first. */
.qehs-faqpage-hero__illustration img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
}

/* ---------------- Search + Popular Topics ---------------- */

.qehs-faqpage-search {
	padding-top: var(--qehs-space-lg);
}

.qehs-faqpage-search__form {
	display: flex;
	align-items: center;
	gap: var(--qehs-space-md);
	padding: 4px 4px 4px var(--qehs-space-lg);
	border: 1px solid var(--qehs-faq-card-border);
	border-radius: 10px;
	background-color: var(--qehs-background);
	box-shadow: var(--qehs-shadow-sm);
}

.qehs-faqpage-search__form:focus-within {
	border-color: var(--qehs-secondary);
}

.qehs-faqpage-search__icon {
	display: inline-flex;
	flex-shrink: 0;
	color: var(--qehs-text);
}

.qehs-faqpage-search__icon svg {
	stroke-width: 2.2;
}

.qehs-faqpage-search__input {
	flex: 1;
	min-width: 0;
	height: 50px;
	padding: 0;
	border: none;
	background: none;
	font-family: inherit;
	font-size: 1.05rem;
	color: var(--qehs-text);
}

.qehs-faqpage-search__input::placeholder {
	color: var(--qehs-text-muted);
}

.qehs-faqpage-search__input:focus {
	outline: none;
}

.qehs-faqpage-search__button {
	flex-shrink: 0;
	height: 50px;
	padding: 0 36px;
	border: none;
	border-radius: var(--qehs-radius-md);
	background-color: var(--qehs-secondary);
	color: #FFFFFF;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.qehs-faqpage-search__button:hover,
.qehs-faqpage-search__button:focus-visible {
	background-color: var(--qehs-success);
}

.qehs-faqpage-topics {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--qehs-space-sm) var(--qehs-space-md);
	margin-top: var(--qehs-space-md);
}

.qehs-faqpage-topics__label {
	font-weight: 700;
	font-size: 0.95rem;
	color: var(--qehs-text);
}

.qehs-faqpage-topics__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--qehs-space-sm) 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.qehs-faqpage-topics__chip {
	min-height: 40px;
	padding: 0 22px;
	border: 1px solid var(--qehs-faq-soft-blue-border);
	border-radius: 999px;
	background-color: var(--qehs-faq-soft-blue);
	color: var(--qehs-faq-chip-text);
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 500;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.qehs-faqpage-topics__chip:hover,
.qehs-faqpage-topics__chip:focus-visible {
	border-color: var(--qehs-faq-chip-text);
	background-color: var(--qehs-background);
}

/* ---------------- Main 3-column area ---------------- */

.qehs-faqpage-main {
	padding-top: var(--qehs-space-xl);
}

.qehs-faqpage-main__grid {
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr) 310px;
	gap: 28px;
	align-items: start;
}

/* Categories */

.qehs-faqpage-cats {
	padding: var(--qehs-space-lg) var(--qehs-space-sm) var(--qehs-space-sm);
	border: 1px solid var(--qehs-faq-card-border);
	border-radius: 12px;
	background-color: var(--qehs-background);
}

.qehs-faqpage-cats__title {
	margin: 0 0 var(--qehs-space-md);
	padding-inline: 14px;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--qehs-primary);
}

.qehs-faqpage-cats__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.qehs-faqpage-cats__item {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	min-height: 52px;
	margin-bottom: 4px;
	padding: 0 14px;
	border: none;
	border-radius: var(--qehs-radius-md);
	background: none;
	color: var(--qehs-text);
	font-family: inherit;
	font-size: 0.95rem;
	text-align: left;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.qehs-faqpage-cats__item:hover {
	background-color: var(--qehs-background-alt);
}

.qehs-faqpage-cats__item:focus-visible {
	outline: 2px solid var(--qehs-secondary);
	outline-offset: -2px;
}

.qehs-faqpage-cats__item.is-active {
	background-color: var(--qehs-faq-soft-green);
	color: var(--qehs-secondary);
	font-weight: 600;
}

.qehs-faqpage-cats__icon {
	display: inline-flex;
	flex-shrink: 0;
}

/* Questions */

.qehs-faqpage-questions {
	min-width: 0;
	scroll-margin-top: var(--qehs-space-md);
}

.qehs-faqpage-questions__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--qehs-space-md);
	margin-bottom: var(--qehs-space-md);
}

.qehs-faqpage-questions__title {
	margin: 0;
	font-size: 1.6rem;
	font-weight: 800;
	color: var(--qehs-primary);
	scroll-margin-top: var(--qehs-space-lg);
}

.qehs-faqpage-questions__title:focus {
	outline: none;
}

.qehs-faqpage-questions__count {
	flex-shrink: 0;
	margin: 0;
	font-size: 0.85rem;
	color: var(--qehs-text-muted);
}

.qehs-faqpage-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.qehs-faqpage-item {
	margin-bottom: 10px;
	border: 1px solid var(--qehs-faq-card-border);
	border-radius: 10px;
	background-color: var(--qehs-background);
	transition: background-color 0.2s ease, border-color 0.2s ease;
	scroll-margin-top: var(--qehs-space-xl);
}

.qehs-faqpage-item.is-open {
	border-color: var(--qehs-faq-soft-green-border);
	background-color: var(--qehs-faq-soft-green);
}

.qehs-faqpage-item__heading {
	margin: 0;
	font-size: inherit;
}

.qehs-faqpage-item__question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--qehs-space-md);
	width: 100%;
	min-height: 58px;
	padding: var(--qehs-space-md) var(--qehs-space-lg);
	border: none;
	border-radius: 10px;
	background: none;
	color: var(--qehs-text);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.4;
	text-align: left;
	cursor: pointer;
}

.qehs-faqpage-item__question:focus-visible {
	outline: 2px solid var(--qehs-secondary);
	outline-offset: -2px;
}

/* Plus / minus drawn with two bars (no icon font). */
.qehs-faqpage-item__toggle {
	position: relative;
	flex-shrink: 0;
	width: 18px;
	height: 18px;
}

.qehs-faqpage-item__toggle::before,
.qehs-faqpage-item__toggle::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 2px;
	border-radius: 2px;
	background-color: currentColor;
	transform: translate(-50%, -50%);
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.qehs-faqpage-item__toggle::after {
	transform: translate(-50%, -50%) rotate(90deg);
}

.qehs-faqpage-item__question[aria-expanded="true"] .qehs-faqpage-item__toggle::after {
	opacity: 0;
	transform: translate(-50%, -50%) rotate(0deg);
}

.qehs-faqpage-item__panel {
	overflow: hidden;
	transition: height 0.25s ease;
}

.qehs-faqpage-item__answer {
	padding: 0 var(--qehs-space-lg) 20px;
}

.qehs-faqpage-item__answer p {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.7;
	color: var(--qehs-faq-body);
}

.qehs-faqpage-empty {
	padding: var(--qehs-space-lg);
	border: 1px dashed var(--qehs-faq-card-border);
	border-radius: 10px;
	text-align: center;
}

.qehs-faqpage-empty__title {
	margin: 0;
	font-weight: 700;
	color: var(--qehs-primary);
}

.qehs-faqpage-empty__other {
	margin: var(--qehs-space-sm) 0 0;
	font-size: 0.9rem;
	color: var(--qehs-text-muted);
}

.qehs-faqpage-empty__links {
	display: inline-flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--qehs-space-sm);
	margin-left: var(--qehs-space-xs);
}

.qehs-faqpage-empty__link {
	padding: 0;
	border: none;
	background: none;
	color: var(--qehs-secondary);
	font-family: inherit;
	font-size: inherit;
	font-weight: 700;
	text-decoration: underline;
	cursor: pointer;
}

/* Aside */

.qehs-faqpage-aside {
	display: grid;
	gap: var(--qehs-space-lg);
}

.qehs-faqpage-help,
.qehs-faqpage-articles {
	padding: var(--qehs-space-lg);
	border: 1px solid var(--qehs-faq-card-border);
	border-radius: 12px;
	background-color: var(--qehs-background);
}

.qehs-faqpage-help__title,
.qehs-faqpage-articles__title {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 var(--qehs-space-md);
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--qehs-primary);
}

.qehs-faqpage-help__title-icon {
	display: inline-flex;
	color: var(--qehs-secondary);
}

.qehs-faqpage-help__text {
	margin: 0 0 var(--qehs-space-md);
	font-size: 0.9rem;
	line-height: 1.6;
	color: var(--qehs-faq-body);
}

.qehs-faqpage-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 46px;
	padding: 0 var(--qehs-space-lg);
	border-radius: 6px;
	background-color: var(--qehs-secondary);
	color: #FFFFFF;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.qehs-faqpage-button:hover,
.qehs-faqpage-button:focus-visible {
	background-color: var(--qehs-success);
	color: #FFFFFF;
}

.qehs-faqpage-help .qehs-faqpage-button {
	width: 100%;
}

.qehs-faqpage-help__points {
	display: grid;
	gap: var(--qehs-space-md);
	margin: var(--qehs-space-lg) 0 0;
	padding: 0;
	list-style: none;
}

.qehs-faqpage-help__points li {
	display: flex;
	align-items: center;
	gap: 14px;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--qehs-faq-body);
}

.qehs-faqpage-help__point-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background-color: var(--qehs-faq-soft-green);
	color: var(--qehs-secondary);
}

.qehs-faqpage-articles {
	border-color: var(--qehs-faq-soft-blue-border);
	background-color: var(--qehs-faq-soft-blue);
}

.qehs-faqpage-articles__title-icon {
	display: inline-flex;
	color: var(--qehs-accent-blue-alt);
}

.qehs-faqpage-articles__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.qehs-faqpage-articles__list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--qehs-space-sm);
	padding: 9px 0;
	font-size: 0.9rem;
	color: var(--qehs-faq-body);
	text-decoration: none;
}

.qehs-faqpage-articles__list a svg {
	flex-shrink: 0;
	color: var(--qehs-accent-blue-alt);
}

.qehs-faqpage-articles__list a:hover span,
.qehs-faqpage-articles__list a:focus-visible span {
	color: var(--qehs-primary);
	text-decoration: underline;
}

/* ---------------- Explore More Help Topics ---------------- */

.qehs-faqpage-topics-more {
	padding-top: var(--qehs-space-xl);
}

.qehs-faqpage-topics-more__title {
	margin: 0 0 var(--qehs-space-md);
	font-size: 1.6rem;
	font-weight: 800;
	color: var(--qehs-primary);
}

.qehs-faqpage-topics-more__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.qehs-faqpage-topic-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: var(--qehs-space-lg);
	border: 1px solid var(--qehs-faq-card-border);
	border-radius: 12px;
	background-color: var(--qehs-background);
}

.qehs-faqpage-topic-card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	margin-bottom: var(--qehs-space-md);
	border-radius: 50%;
}

.qehs-faqpage-topic-card__icon--green {
	background-color: var(--qehs-faq-soft-green);
	color: var(--qehs-secondary);
}

.qehs-faqpage-topic-card__icon--blue {
	background-color: var(--qehs-accent-blue-alt-tint);
	color: var(--qehs-accent-blue-alt);
}

.qehs-faqpage-topic-card__icon--purple {
	background-color: var(--qehs-accent-purple-tint);
	color: var(--qehs-accent-purple);
}

.qehs-faqpage-topic-card__icon--orange {
	background-color: var(--qehs-accent-orange-tint);
	color: var(--qehs-accent-orange);
}

.qehs-faqpage-topic-card__title {
	margin: 0 0 var(--qehs-space-sm);
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--qehs-primary);
}

.qehs-faqpage-topic-card__text {
	flex: 1;
	margin: 0 0 var(--qehs-space-md);
	font-size: 0.93rem;
	line-height: 1.6;
	color: var(--qehs-faq-body);
}

.qehs-faqpage-topic-card__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 32px;
	padding: 0;
	border: none;
	background: none;
	color: var(--qehs-secondary);
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	cursor: pointer;
}

.qehs-faqpage-topic-card__link svg {
	transition: transform 0.15s ease;
}

.qehs-faqpage-topic-card__link:hover svg,
.qehs-faqpage-topic-card__link:focus-visible svg {
	transform: translateX(3px);
}

/* ---------------- Bottom CTA ---------------- */

.qehs-faqpage-cta {
	padding-block: var(--qehs-space-lg) var(--qehs-space-2xl);
}

.qehs-faqpage-cta__box {
	display: flex;
	align-items: center;
	gap: var(--qehs-space-lg);
	padding: var(--qehs-space-lg) var(--qehs-space-xl);
	border-radius: 12px;
	background-color: var(--qehs-primary);
	color: #FFFFFF;
}

.qehs-faqpage-cta__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 76px;
	height: 76px;
	border-radius: 50%;
	background-color: var(--qehs-accent-blue-alt);
}

.qehs-faqpage-cta__text {
	flex: 1;
	min-width: 0;
}

.qehs-faqpage-cta__text h2 {
	margin: 0 0 4px;
	font-size: 1.3rem;
	font-weight: 700;
	color: #FFFFFF;
}

.qehs-faqpage-cta__text p {
	margin: 0;
	font-size: 0.95rem;
	color: rgba(255, 255, 255, 0.88);
}

.qehs-faqpage-cta__button {
	flex-shrink: 0;
	min-height: 50px;
	padding: 0 var(--qehs-space-xl);
}

/* ---------------- Responsive ---------------- */

@media (max-width: 1200px) {
	.qehs-faqpage-hero__text {
		max-width: 440px;
	}

	.qehs-faqpage-hero__illustration {
		width: 48%;
	}
}

@media (max-width: 1280px) {
	.qehs-faqpage-main__grid {
		grid-template-columns: 230px minmax(0, 1fr) 280px;
		gap: var(--qehs-space-lg);
	}
}

/* Tablet: categories + questions side by side; help cards move below. */
@media (max-width: 1024px) {
	.qehs-faqpage-main__grid {
		grid-template-columns: 220px minmax(0, 1fr);
	}

	.qehs-faqpage-aside {
		grid-column: 1 / -1;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.qehs-faqpage-topics-more__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Hero stacks: the illustration moves below the text (below the width
   where text and illustration fit side by side without overlapping). */
@media (max-width: 1024px) {
	.qehs-faqpage-hero__text {
		max-width: 620px;
	}

	.qehs-faqpage-hero {
		min-height: 0;
	}

	.qehs-faqpage-hero__inner {
		padding-bottom: var(--qehs-space-md);
	}

	.qehs-faqpage-hero__illustration {
		position: static;
		width: min(100%, 560px);
		height: auto;
		margin-left: auto;
	}

	.qehs-faqpage-hero__illustration img {
		width: 100%;
	}
}

/* Mobile order: hero, search, topics, categories, questions, help,
   articles, explore, CTA. */
@media (max-width: 768px) {
	.qehs-faqpage-main__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.qehs-faqpage-aside {
		grid-template-columns: minmax(0, 1fr);
	}

	.qehs-faqpage-cats__list {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 4px;
	}

	.qehs-faqpage-cats__item {
		margin-bottom: 0;
	}

	.qehs-faqpage-cta__box {
		flex-direction: column;
		align-items: flex-start;
		padding: var(--qehs-space-lg);
	}

	.qehs-faqpage-cta__button {
		width: 100%;
	}
}

@media (max-width: 560px) {
	.qehs-faqpage-hero__body {
		font-size: 1rem;
	}

	.qehs-faqpage-search__form {
		padding-left: var(--qehs-space-md);
		gap: var(--qehs-space-sm);
	}

	.qehs-faqpage-search__input {
		height: 46px;
		font-size: 16px; /* prevents iOS zoom-on-focus */
	}

	.qehs-faqpage-search__button {
		height: 46px;
		padding: 0 var(--qehs-space-md);
	}

	.qehs-faqpage-topics {
		align-items: flex-start;
		flex-direction: column;
	}

	.qehs-faqpage-cats__list {
		grid-template-columns: minmax(0, 1fr);
	}

	.qehs-faqpage-questions__title,
	.qehs-faqpage-topics-more__title {
		font-size: 1.35rem;
	}

	.qehs-faqpage-item__question {
		padding: 14px var(--qehs-space-md);
		font-size: 0.95rem;
	}

	.qehs-faqpage-item__answer {
		padding: 0 var(--qehs-space-md) var(--qehs-space-md);
	}

	.qehs-faqpage-topics-more__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.qehs-faqpage *,
	.qehs-faqpage *::before,
	.qehs-faqpage *::after {
		transition: none !important;
	}
}
