/* ==========================================================================
   Simple FAQ Manager — Frontend Styles
   ========================================================================== */

/*
 * Color tokens — overridden via inline <style> injected by PHP when custom
 * colors are saved in FAQs > Settings > Colors.
 */
:root {
	--sfm-accent:        #2271b1;
	--sfm-accent-dark:   #1a5c99;
	--sfm-accent-bg:     #eef5fc;
	--sfm-question-text: #1d2327;
	--sfm-answer-text:   #444444;
	--sfm-item-bg:       #f9f9f9;
	--sfm-answer-bg:     #fafafa;
}

/* --------------------------------------------------------------------------
   Wrapper
   -------------------------------------------------------------------------- */

.sfm-faq-list-wrap {
	max-width: 860px;
	margin: 0 auto;
}

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

.sfm-search-wrap {
	position: relative;
	margin-bottom: 28px;
}

.sfm-search-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	color: #aab4be;
	pointer-events: none;
	flex-shrink: 0;
}

.sfm-search-input {
	width: 100%;
	max-width: 520px;
	padding: 11px 18px 11px 44px !important;
	font-size: 15px;
	line-height: 1.5;
	border: 1.5px solid #e2e8f0;
	border-radius: 50px;
	background: #fff;
	color: var(--sfm-question-text);
	outline: none;
	box-sizing: border-box;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	transition: border-color 0.2s, box-shadow 0.2s;
	font-family: inherit;
}

.sfm-search-input::placeholder {
	color: #aab4be;
}

.sfm-search-input:focus {
	border-color: var(--sfm-accent);
	box-shadow: 0 0 0 3px var(--sfm-accent-bg);
}

/* --------------------------------------------------------------------------
   Category filter buttons
   -------------------------------------------------------------------------- */

.sfm-category-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 36px;
}

.sfm-cat-btn {
	padding: 8px 20px;
	font-size: 13px;
	font-weight: 500;
	font-family: inherit;
	border: 1.5px solid #e2e8f0;
	border-radius: 50px;
	background: #fff;
	cursor: pointer;
	color: #64748b;
	line-height: 1.4;
	letter-spacing: 0.01em;
	transition: background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s;
}

.sfm-cat-btn:hover {
	border-color: var(--sfm-accent);
	color: var(--sfm-accent);
	background: var(--sfm-accent-bg);
}

.sfm-cat-btn.active {
	background: var(--sfm-accent);
	border-color: var(--sfm-accent);
	color: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* --------------------------------------------------------------------------
   Expand / Collapse All button
   -------------------------------------------------------------------------- */

.sfm-expand-controls {
	margin-bottom: 20px;
	text-align: right;
}

.sfm-expand-all-btn {
	padding: 7px 18px;
	font-size: 13px;
	font-weight: 500;
	font-family: inherit;
	border: 1.5px solid var(--sfm-accent);
	border-radius: 50px;
	background: transparent;
	color: var(--sfm-accent);
	cursor: pointer;
	letter-spacing: 0.01em;
	transition: background 0.18s, color 0.18s;
	line-height: 1.5;
}

.sfm-expand-all-btn:hover {
	background: var(--sfm-accent);
	color: #fff;
}

/* --------------------------------------------------------------------------
   Category group + title
   -------------------------------------------------------------------------- */

.sfm-faq-group {
	margin-bottom: 48px;
}

.sfm-category-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 20px;
	padding-bottom: 14px;
	border-bottom: 1px solid #edf0f3;
	color: var(--sfm-question-text);
}

.sfm-category-title::before {
	content: '';
	display: inline-block;
	width: 4px;
	height: 20px;
	background: var(--sfm-accent);
	border-radius: 2px;
	flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Expanded mode — FAQ cards
   -------------------------------------------------------------------------- */

.sfm-faq-item {
	margin-bottom: 10px;
	padding: 22px 26px;
	background: #fff;
	border-radius: 12px;
	border-left: 4px solid var(--sfm-accent);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07), 0 2px 8px rgba(0, 0, 0, 0.04);
	transition: box-shadow 0.2s, transform 0.2s;
}

.sfm-faq-item:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
	transform: translateY(-1px);
}

.sfm-faq-question {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 10px;
	color: var(--sfm-question-text);
	line-height: 1.45;
}

.sfm-faq-answer {
	font-size: 15px;
	line-height: 1.8;
	color: var(--sfm-answer-text);
}

.sfm-faq-answer > *:last-child {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Accordion mode — list
   -------------------------------------------------------------------------- */

.sfm-mode-accordion .sfm-faq-group {
	border: 1px solid #e8ecf0;
	border-radius: 14px;
	overflow: hidden;
	margin-bottom: 28px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.sfm-mode-accordion .sfm-category-title {
	padding: 16px 24px;
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	background: var(--sfm-item-bg);
	border-bottom: 1px solid #e8ecf0;
	border-radius: 0;
}

/* Override default border-bottom on category title inside accordion groups */
.sfm-mode-accordion .sfm-faq-group > .sfm-category-title {
	border-bottom: 1px solid #e8ecf0;
	padding-bottom: 16px;
}

.sfm-mode-accordion .sfm-faq-item {
	padding: 0;
	background: transparent;
	border-left: none;
	border-radius: 0;
	box-shadow: none;
	margin-bottom: 0;
}

.sfm-mode-accordion .sfm-faq-item:hover {
	transform: none;
	box-shadow: none;
}

.sfm-mode-accordion .sfm-faq-question {
	margin: 0;
	font-size: inherit;
	font-weight: inherit;
}

/* Toggle button */
.sfm-list-toggle {
	width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 18px 24px;
	background: #fff;
	border: none;
	border-bottom: 1px solid #f0f4f8;
	font-size: 15px;
	font-weight: 600;
	font-family: inherit;
	text-align: left;
	cursor: pointer;
	color: var(--sfm-question-text);
	transition: background 0.18s, color 0.18s;
	line-height: 1.5;
}

.sfm-list-toggle:hover {
	background: var(--sfm-accent-bg);
	color: var(--sfm-accent);
}

.sfm-list-toggle:focus-visible {
	outline: 2px solid var(--sfm-accent);
	outline-offset: -2px;
}

.sfm-list-toggle[aria-expanded="true"] {
	background: var(--sfm-accent-bg);
	color: var(--sfm-accent);
	border-bottom-color: transparent;
}

/* Chevron icon */
.sfm-list-icon {
	flex-shrink: 0;
	width: 24px;
	height: 24px;
	font-size: 0;
	position: relative;
}

.sfm-list-icon::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translate(-60%, -70%) rotate(45deg);
	transition: transform 0.25s ease;
}

.sfm-list-toggle[aria-expanded="true"] .sfm-list-icon::before {
	transform: translate(-50%, -30%) rotate(-135deg);
}

/* Answer panel */
.sfm-mode-accordion .sfm-faq-item .sfm-faq-answer {
	padding: 0 24px;
	font-size: 15px;
	line-height: 1.8;
	color: var(--sfm-answer-text);
	background: #fff;
	border-bottom: 1px solid #f0f4f8;
	overflow: hidden;
	max-height: 0;
	transition: max-height 0.3s ease, padding-top 0.3s ease, padding-bottom 0.3s ease;
}

.sfm-mode-accordion .sfm-faq-item .sfm-faq-answer:not([hidden]) {
	max-height: 2000px;
	padding: 18px 24px 22px;
}

/* "No results" message */
.sfm-no-results {
	text-align: center;
	color: #94a3b8;
	padding: 56px 0;
	font-size: 16px;
}

/* Hidden items (search / category filter) */
.sfm-faq-item.sfm-hidden,
.sfm-faq-group.sfm-hidden {
	display: none;
}

.sfm-no-faqs {
	color: #94a3b8;
	font-style: italic;
}

/* --------------------------------------------------------------------------
   [faq_widget] & Elementor widget — Accordion
   -------------------------------------------------------------------------- */

.sfm-faq-widget-wrap {
	max-width: 800px;
	margin: 0 auto;
}

.sfm-widget-title {
	font-size: 22px;
	font-weight: 700;
	margin-bottom: 20px;
	color: var(--sfm-question-text);
}

.sfm-accordion {
	border: 1px solid #e8ecf0;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.sfm-accordion-item {
	border-bottom: 1px solid #f0f4f8;
}

.sfm-accordion-item:last-child {
	border-bottom: none;
}

.sfm-accordion-header {
	width: 100%;
	background: #fff;
	border: none;
	padding: 18px 24px;
	font-size: 15px;
	font-weight: 600;
	font-family: inherit;
	text-align: left;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	color: var(--sfm-question-text);
	transition: background 0.18s, color 0.18s;
	line-height: 1.5;
}

.sfm-accordion-header:hover {
	background: var(--sfm-accent-bg);
	color: var(--sfm-accent);
}

.sfm-accordion-header:focus-visible {
	outline: 2px solid var(--sfm-accent);
	outline-offset: -2px;
}

.sfm-accordion-header[aria-expanded="true"] {
	background: var(--sfm-accent-bg);
	color: var(--sfm-accent);
}

/* Chevron icon */
.sfm-accordion-icon {
	flex-shrink: 0;
	width: 24px;
	height: 24px;
	font-size: 0;
	position: relative;
}

.sfm-accordion-icon::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translate(-60%, -70%) rotate(45deg);
	transition: transform 0.25s ease;
}

.sfm-accordion-header[aria-expanded="true"] .sfm-accordion-icon::before {
	transform: translate(-50%, -30%) rotate(-135deg);
}

.sfm-accordion-body {
	font-size: 15px;
	line-height: 1.8;
	color: var(--sfm-answer-text);
	background: #fff;
	overflow: hidden;
	max-height: 0;
	padding: 0 24px;
	border-top: 1px solid transparent;
	transition: max-height 0.3s ease, padding-top 0.3s ease, padding-bottom 0.3s ease;
}

.sfm-accordion-body:not([hidden]) {
	max-height: 2000px;
	padding: 18px 24px 22px;
	border-top-color: #f0f4f8;
}

.sfm-accordion-body > *:last-child {
	margin-bottom: 0;
}

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

@media (max-width: 600px) {
	.sfm-faq-item {
		padding: 18px 18px;
	}

	.sfm-list-toggle,
	.sfm-accordion-header {
		padding: 15px 18px;
		font-size: 14px;
	}

	.sfm-mode-accordion .sfm-faq-item .sfm-faq-answer:not([hidden]),
	.sfm-accordion-body:not([hidden]) {
		padding: 14px 18px 18px;
	}

	.sfm-category-title {
		font-size: 16px;
	}

	.sfm-mode-accordion .sfm-category-title {
		padding: 14px 18px;
	}
}
