/**
 * FAQ page styles — accordion with smooth animations.
 *
 * @package FliseRens
 */

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

.fliserens-faq-hero {
	background: linear-gradient(135deg, var(--fr-primary, #48c774) 0%, var(--fr-primary-dark, #257942) 100%);
	position: relative;
	overflow: hidden;
}

.fliserens-faq-hero .hero-body {
	position: relative;
	z-index: 1;
}

/* ---------- Search ---------- */

.faq-search-section {
	padding-bottom: 0;
}

/* ---------- Category ---------- */

.faq-category {
	margin-bottom: 3rem;
}

.faq-category-title {
	display: flex;
	align-items: center;
	border-bottom: 2px solid var(--fr-border, #dbdbdb);
	padding-bottom: 0.75rem;
}

/* ---------- Accordion Items ---------- */

.faq-item {
	border: 1px solid var(--fr-border, #dbdbdb);
	border-radius: var(--fr-radius, 6px);
	margin-bottom: 0.5rem;
	overflow: hidden;
	transition: box-shadow 0.2s ease;
}

.faq-item:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.faq-item.is-hidden-faq {
	display: none;
}

/* ---------- Toggle Button ---------- */

.faq-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 1.25rem 1.5rem;
	background: none;
	border: none;
	cursor: pointer;
	text-align: left;
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--fr-text, #2d2d2d);
	line-height: 1.5;
	gap: 1rem;
	transition: background-color 0.15s ease;
}

.faq-toggle:hover {
	background-color: var(--fr-bg-alt, #f5f5f5);
}

.faq-toggle:focus-visible {
	outline: 2px solid var(--fr-green, #48c774);
	outline-offset: -2px;
}

.faq-question {
	flex: 1;
}

.faq-icon {
	flex-shrink: 0;
	color: var(--fr-green, #48c774);
	transition: transform 0.3s ease;
}

.faq-item.is-active .faq-icon {
	transform: rotate(180deg);
}

/* ---------- Answer ---------- */

.faq-answer {
	overflow: hidden;
	max-height: 0;
	transition: max-height 0.35s ease;
}

.faq-answer[hidden] {
	display: block !important; /* Override hidden for animation */
	max-height: 0;
	visibility: hidden;
}

.faq-item.is-active .faq-answer {
	visibility: visible;
}

.faq-answer-content {
	padding: 0 1.5rem 1.25rem 1.5rem;
	color: var(--fr-text-light, #555555);
	line-height: 1.8;
}

.faq-answer-content p {
	margin: 0;
}

/* ---------- No Results ---------- */

#faq-no-results .notification {
	border-radius: var(--fr-radius, 6px);
}

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

.faq-cta-section {
	padding: 4rem 1.5rem;
}

/* ---------- Dark Mode ---------- */

html.dark-mode .faq-item {
	border-color: #2a2a4a;
	background: #20203a;
}

html.dark-mode .faq-item:hover {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
	border-color: #3a3a5a;
}

html.dark-mode .faq-toggle {
	color: #e0e0e0;
}

html.dark-mode .faq-toggle:hover {
	background-color: #2a2a4a;
}

html.dark-mode .faq-answer-content {
	color: #b0b0b0;
}

html.dark-mode .faq-category-title {
	border-bottom-color: #2a2a4a;
}

/* ---------- Mobile ---------- */

@media screen and (max-width: 768px) {
	.faq-toggle {
		padding: 1rem 1.25rem;
		font-size: 0.95rem;
	}

	.faq-answer-content {
		padding: 0 1.25rem 1rem 1.25rem;
		font-size: 0.95rem;
	}

	.faq-cta-section .buttons {
		flex-direction: column;
	}

	.faq-cta-section .buttons .button {
		width: 100%;
	}
}

/* Auto dark mode (prefers-color-scheme) */
@media (prefers-color-scheme: dark) {
	.faq-item {
		border-color: #2a2a4a;
		background: #20203a;
	}
	.faq-item:hover {
		box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
		border-color: #3a3a5a;
	}
	.faq-toggle {
		color: #e0e0e0;
	}
	.faq-toggle:hover {
		background-color: #2a2a4a;
	}
	.faq-answer-content {
		color: #b0b0b0;
	}
	.faq-category-title {
		border-bottom-color: #2a2a4a;
	}
}
