/* ==========================================
   FAQ ACCORDION SECTION
   Frequently Asked Questions
   ========================================== */

/* FAQ section background */
.faq {
	position: relative;
	background: linear-gradient(
		to bottom,
		transparent 0%,
		#fafaf9 120px,
		#fafaf9 calc(100% - 120px),
		transparent 100%
	);
	overflow: visible; /* Allow blob background to extend beyond */
}

/* Animated blob background container - extends both directions */
.faq-background {
	top: -120px; /* Extend into previous section for seamless blend */
	bottom: -120px; /* Extend into next section for seamless blend */
	filter: url('#plasma');
}

/* Blob color customization for FAQ section */
.faq-background .blob {
	background: radial-gradient(
		circle,
		var(--accent-weak) 0%,
		rgba(101, 163, 13, 0.1) 100%
	);
}

/* Blob animations with unique timings */
#blob-1 {
	animation: blob-float-1 20s ease-in-out infinite;
}

#blob-2 {
	animation: blob-float-2 25s ease-in-out infinite 5s;
}

#blob-3 {
	animation: blob-float-3 30s ease-in-out infinite 10s;
}

#blob-4 {
	animation: blob-float-4 22s ease-in-out infinite 3s;
}

#blob-5 {
	animation: blob-float-5 28s ease-in-out infinite 7s;
}

/* Ensure FAQ content appears above background */
.faq .container {
	position: relative;
	z-index: 1;
}

/* FAQ section heading */
.faq h2 {
	text-align: center;
}

/* Gradient accent for heading */
.faq h2 .accent {
	background: linear-gradient(135deg, #84CC16, #14532D);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: #14532D;
}

/* Accordion wrapper */
.faq-accordion {
	max-width: 800px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 20px 0;
}

/* Individual accordion item */
.faq-item {
	position: relative;
	border: 1px solid var(--line);
	border-radius: 16px;
	background: linear-gradient(135deg, rgba(234, 255, 199, 0.7), rgba(219, 234, 254, 0.7)); /* Green to blue gradient with 70% opacity */
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px); /* Safari support */
	overflow: hidden;
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

.faq-item:hover {
	border-color: rgba(101, 163, 13, 0.3);
}

.faq-item.active {
	border-color: var(--accent);
	box-shadow: 0 4px 12px rgba(101, 163, 13, 0.1);
}


/* Question button */
.faq-question {
	/* Reset button styles */
	width: 100%;
	background: none;
	border: none;
	margin: 0;
	cursor: pointer;
	font-family: inherit;
	-webkit-appearance: none;
	appearance: none;

	/* Layout */
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 20px 24px;
	text-align: left;

	/* Typography */
	font-size: 17px;
	font-weight: 600;
	color: var(--ink);
	line-height: 1.4;

	/* Interaction */
	transition: background-color 0.15s ease;
}

.faq-question:hover {
	background: rgba(101, 163, 13, 0.03);
}

.faq-question:focus {
	outline: none;
	background: rgba(101, 163, 13, 0.05);
}

.faq-question:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: -2px;
}

/* Question text */
.faq-question span {
	flex: 1;
}

/* Chevron icon */
.faq-icon {
	flex-shrink: 0;
	color: var(--muted);
	transition: transform 0.3s ease;
}

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

/* Answer container */
.faq-answer {
	overflow: hidden;
	max-height: 0;
	transition: max-height 0.3s ease-out;
}

.faq-item.active .faq-answer {
	max-height: 500px; /* Generous max for animation */
	transition: max-height 0.4s ease-in;
}

/* Answer content padding */
.faq-content {
	padding: 24px;
}

/* Answer text */
.faq-content p {
	margin: 0;
	font-size: 16px;
	line-height: 1.7;
	color: var(--muted);
}

/* ==========================================
   SCROLL ANIMATIONS (OPTIONAL)
   ========================================== */

/* Initial hidden state for fade-in animation */
.faq-item {
	opacity: 0;
	transform: translateY(10px);
	transition:
		opacity 0.4s ease-out,
		transform 0.4s ease-out,
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

/* Staggered reveal delays */
.faq-item:nth-child(1) { transition-delay: 0s; }
.faq-item:nth-child(2) { transition-delay: 0.05s; }
.faq-item:nth-child(3) { transition-delay: 0.1s; }
.faq-item:nth-child(4) { transition-delay: 0.15s; }
.faq-item:nth-child(5) { transition-delay: 0.2s; }
.faq-item:nth-child(6) { transition-delay: 0.25s; }
.faq-item:nth-child(7) { transition-delay: 0.3s; }
.faq-item:nth-child(8) { transition-delay: 0.35s; }
.faq-item:nth-child(9) { transition-delay: 0.4s; }

/* Active state when in viewport */
.faq-item.in-view {
	opacity: 1;
	transform: translateY(0);
}

/* ==========================================
   RESPONSIVE: MOBILE (<680px)
   ========================================== */
@media (max-width: 680px) {
	.faq h2 {
		margin-bottom: 28px;
	}

	.faq-accordion {
		gap: 10px;
	}

	.faq-question {
		padding: 16px 18px;
		font-size: 16px;
		gap: 12px;
	}

	.faq-content p {
		font-size: 14px;
		line-height: 1.6;
	}

	.faq-icon {
		width: 18px;
		height: 18px;
	}
}

/* ==========================================
   PROGRESSIVE ENHANCEMENT: NO JAVASCRIPT
   ========================================== */
.no-js .faq-item {
	/* Make all items visible by default when JS is disabled */
	opacity: 1;
	transform: none;
}

.no-js .faq-answer {
	/* Show all answers when JS is disabled */
	max-height: none;
}

/* ==========================================
   ACCESSIBILITY: REDUCED MOTION
   ========================================== */
@media (prefers-reduced-motion: reduce) {
	.faq-item,
	.faq-icon,
	.faq-answer {
		transition: none;
	}

	.faq-item {
		opacity: 1;
		transform: none;
	}
}
