/**
* FAQ Module Styling
* Layout + accordion mechaniek. Kleuren blijven zoveel mogelijk inherit
* zodat Total theme's dark/light styling gewoon doorwerkt.
*/

/* ---------- Wrapper ---------- */
.faq-module {
	width: 100%;
	box-sizing: border-box;
}

.faq-module *,
.faq-module *::before,
.faq-module *::after {
	box-sizing: border-box;
}

/* ---------- Header: titel + search naast elkaar ---------- */
.faq-module__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 2rem;
	margin-bottom: 2rem;
	flex-wrap: wrap;
}

.faq-module__title {
	flex: 1 1 auto;
	margin: 0;
	min-width: 0;
	font-size: var(--wpex-text-xl);
	color: var(--wpex-palette-9-color);
	font-weight: 600;
	width: 20%;
}

@media (max-width: 768px) {
	.faq-module__header {
		flex-direction: column;
		gap: 1.5rem;
	}

	.faq-module__title {
		width: 100%!important;
	}
}

/* ---------- Search ---------- */
.faq-module__search {
	position: relative;
	flex: 0 1 330px;
	min-width: 240px;
	align-self: flex-start;
	margin-top: 0.5rem;
}

.faq-module__search-input {
	width: 100%;
	background: transparent;
	border: none;
	border-bottom: 1px solid rgba(255, 255, 255, 0.3);
	color: inherit;
	padding: 10px 36px 10px 0;
	font-size: 15px;
	outline: none;
	transition: border-color 0.2s ease;
	box-shadow: none;
	border-radius: 0;
	line-height: 1.4;
}

.faq-module__search-input:focus {
	border-bottom-color: rgba(255, 255, 255, 0.8);
	outline: none;
	box-shadow: none;
}

.faq-module__search-input::placeholder {
	color: rgba(255, 255, 255, 0.5);
	opacity: 1;
}

.faq-module__search-icon {
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
	opacity: 0.7;
}

.faq-module__mark {
	background: rgba(168, 230, 195, 0.25);
	color: inherit;
	padding: 0 2px;
	border-radius: 2px;
}

@media (max-width:768px){
	.faq-module__search {
		flex: 0 1 0px!important;
		width: 100%;
	}
}

/* ---------- Tabs ---------- */
.faq-module__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
	margin-bottom: 0;
	padding: 0;
}

@media (max-width: 600px) {
	.faq-module__tabs {
		flex-wrap: nowrap;
		overflow-x: auto;
		overflow-y: hidden;
		gap: 1.5rem;
		/* Voorkom dat scrollbar layout breekt op iOS */
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none; /* Firefox */
		/* Kleine fade-hint dat er meer tabs zijn */
		scroll-snap-type: x proximity;
	}

	.faq-module__tabs::-webkit-scrollbar {
		display: none; /* Chrome/Safari */
	}

	.faq-module__tab {
		scroll-snap-align: start;
		flex-shrink: 0;
	}
}

.faq-module__tab {
	background: transparent;
	border: none;
	cursor: pointer;
	color: inherit;
	font: inherit;
	font-size: 16px;
	padding: 12px 0;
	margin: 0;
	position: relative;
	opacity: 0.6;
	transition: opacity 0.2s ease;
	white-space: nowrap;
}

.faq-module__tab:hover {
	opacity: 0.85;
}

.faq-module__tab.is-active {
	opacity: 1;
	font-weight: 500;
}

.faq-module__tab.is-active::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 2px;
	background: var(--wpex-palette-7-color);
}

.faq-module__tab:focus {
	outline: none;
}

.faq-module__tab:focus-visible {
	outline: 2px solid rgba(168, 230, 195, 0.5);
	outline-offset: 2px;
	border-radius: 2px;
}

/* ---------- Panels ---------- */
.faq-module__panel {
	display: none;
}

.faq-module__panel.is-active {
	display: block;
}

.faq-module__content {
	margin-top: 0;
}

/* ---------- Accordion items ---------- */
.faq-module__item {
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.faq-module__question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	width: 100%;
	background: transparent;
	border: none;
	padding: 1.5rem 0;
	margin: 0;
	cursor: pointer;
	text-align: left;
	color: inherit;
	font: inherit;
	font-size: var(--wpex-text-base);
	font-weight: 600;
	line-height: 1.2em;
}

.faq-module__question:hover {
	opacity: 0.85;
}

.faq-module__question:focus {
	outline: none;
}

.faq-module__question:focus-visible {
	outline: 2px solid rgba(168, 230, 195, 0.5);
	outline-offset: 4px;
	border-radius: 2px;
}

.faq-module__question-text {
	flex: 1 1 auto;
	min-width: 0;
}

.faq-module__icon {
	flex-shrink: 0;
	transition: transform 0.25s ease;
	opacity: 0.8;
}

.faq-module__item.is-open .faq-module__icon {
	transform: rotate(180deg);
}

/* ---------- Answer (smooth expand) ---------- */
.faq-module__answer {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.3s ease;
}

.faq-module__item.is-open .faq-module__answer {
	grid-template-rows: 1fr;
}

.faq-module__answer-inner {
	overflow: hidden;
	min-height: 0;
}

.faq-module__item.is-open .faq-module__answer-inner {
	padding-bottom: 1.5rem;
}

.faq-module__answer-inner p {
	margin: 0 0 1em;
	opacity: 0.8;
	line-height: 1.6;
}

.faq-module__answer-inner p:last-child {
	margin-bottom: 0;
}

/* Fallback voor oudere browsers */
@supports not (grid-template-rows: 1fr) {
	.faq-module__answer {
		display: none;
	}
	.faq-module__item.is-open .faq-module__answer {
		display: block;
	}
}

/* ---------- No results ---------- */
.faq-module__no-results {
	padding: 2rem 0;
	opacity: 0.6;
	font-style: italic;
}
