/* FAQ public styles. Colours/radii inherit the marketplace theme tokens
   (--mp-*) where present and fall back to WP-admin greys elsewhere. */

.faq-container {
	max-width: 100%;
	margin: 0 auto;
}

/* Footer auto-display wrapper: align to the theme's content column (centered,
   with the same max width and horizontal padding) instead of running full-bleed. */
.faq-footer-auto {
	max-width: var(--content-max-width, 1200px);
	margin: 0 auto;
	padding: var(--space-8, 40px) var(--space-6, 24px);
}

.faq-section {
	margin-bottom: 40px;
}

.faq-section-title {
	font-size: 24px;
	font-weight: 600;
	margin-bottom: 15px;
	color: var(--mp-text, #1d2327);
}

.faq-section-description {
	color: var(--mp-text-muted, #646970);
	margin-bottom: 20px;
	line-height: 1.6;
}

.faq-questions {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.faq-item {
	background: var(--mp-surface, #fff);
	border: 1px solid var(--mp-border, #dcdcde);
	border-radius: var(--mp-radius, 8px);
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-item:hover {
	border-color: var(--mp-border-strong, #8c8f94);
	box-shadow: var(--mp-shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
}

.faq-question-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 15px;
}

.faq-collapsible .faq-question-header {
	padding: 0;
}

.faq-question-toggle {
	width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px;
	background: transparent;
	border: none;
	cursor: pointer;
	text-align: left;
	font-size: 16px;
	font-weight: 500;
	color: var(--mp-text, #1d2327);
	transition: background-color 0.2s ease;
}

.faq-question-toggle:hover {
	background-color: var(--mp-surface-alt, #f6f7f7);
}

.faq-question-toggle:focus {
	outline: 2px solid var(--mp-primary, #2271b1);
	outline-offset: -2px;
}

.faq-question {
	font-size: 18px;
	font-weight: 500;
	color: var(--mp-text, #1d2327);
	line-height: 1.4;
}

.faq-toggle-icon {
	font-size: 24px;
	font-weight: 300;
	color: var(--mp-primary, #2271b1);
	flex-shrink: 0;
	transition: transform 0.3s ease;
	width: 24px;
	text-align: center;
}

.faq-question-toggle[aria-expanded="true"] .faq-toggle-icon {
	transform: rotate(45deg);
}

.faq-answer {
	padding: 0 20px 20px 20px;
	color: var(--mp-text, #2c3338);
	line-height: 1.6;
	font-size: 15px;
}

/* Collapse is driven by the [hidden] attribute (set in JS), so the class
   carries no display rule — only the reveal animation when shown. */
.faq-collapsible-content {
	animation: faqFadeIn 0.3s ease;
}

@keyframes faqFadeIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.faq-answer p {
	margin-bottom: 15px;
}

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

.faq-answer ul,
.faq-answer ol {
	margin: 15px 0;
	padding-left: 25px;
}

.faq-answer li {
	margin-bottom: 8px;
}

.faq-answer a {
	color: var(--mp-primary, #2271b1);
	text-decoration: underline;
}

.faq-answer a:hover {
	color: var(--mp-link-hover, #135e96);
}

.faq-answer strong {
	font-weight: 600;
}

.faq-answer em {
	font-style: italic;
}

.faq-item:target {
	border-color: var(--mp-primary, #2271b1);
	box-shadow: 0 0 0 3px var(--mp-primary-soft, rgba(34, 113, 177, 0.1));
}

@media screen and (max-width: 782px) {
	.faq-section-title {
		font-size: 20px;
	}

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

	.faq-question-toggle {
		padding: 15px;
	}

	.faq-answer {
		padding: 0 15px 15px 15px;
		font-size: 14px;
	}

	.faq-toggle-icon {
		font-size: 20px;
	}
}

@media screen and (max-width: 480px) {
	.faq-container {
		padding: 0 10px;
	}

	.faq-section {
		margin-bottom: 30px;
	}

	.faq-questions {
		gap: 10px;
	}
}

/* --- Per-question permalink (full-page / linkable layout only) --- */

.faq-item {
	position: relative;
}

.faq-permalink {
	position: absolute;
	top: 22px;
	left: -1.1em;
	color: var(--mp-primary, #2271b1);
	font-weight: 600;
	text-decoration: none;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.faq-item:hover .faq-permalink,
.faq-permalink:focus {
	opacity: 1;
}

/* --- Plain layout: static multi-column grid (footer FAQs) --- */
/* Three columns on wide viewports, dropping to two then one, each Q+A in its
   own cell. No card chrome and no accordion: question and answer are always
   visible, matching the footer FAQ look. */

.faq-questions--grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem 2.5rem;
	align-items: start;
}

@media (max-width: 1040px) {
	.faq-questions--grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 700px) {
	.faq-questions--grid {
		grid-template-columns: 1fr;
	}
}

.faq-questions--grid .faq-item,
.faq-questions--grid .faq-item:hover {
	background: none;
	border: 0;
	border-radius: 0;
	overflow: visible;
	box-shadow: none;
	transition: none;
}

.faq-section--plain .faq-question-header {
	display: block;
	padding: 0;
}

.faq-section--plain .faq-question {
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.4;
	margin: 0 0 0.5rem;
}

.faq-section--plain .faq-answer {
	padding: 0;
	color: var(--mp-text-muted, #525252);
	font-size: 1rem;
	line-height: 1.65;
}
