/* PSM - آکاردئون سوالات متداول (FAQ)
 *
 * نکته مهم درباره‌ی !important:
 * هیچ پراپرتی‌ای که در پنل استایل ویجت (رنگ، پس‌زمینه، بوردر، رادیوس، سایه،
 * پدینگ، فاصله‌ها، تایپوگرافی) کنترل مخصوص به خودش را دارد، اینجا !important
 * نگرفته. چون خودِ کنترل‌های ویجت (در class-psm-faq-widget.php) با
 * سلکتور {{WRAPPER}} + کلاس‌های اختصاصی، به‌طور طبیعی specificity بالاتری از
 * این فایل پایه دارند و همیشه باید برنده باشند. اگر اینجا !important بگذاریم،
 * دقیقاً همین کنترل‌های خودمان دیگر هیچ‌وقت اعمال نمی‌شوند (این باگ نسخه قبل بود).
 * !important فقط روی چیزهایی نگه داشته شده که هیچ کنترلی در پنل ندارند
 * (خودِ ریست دکمه، جهت‌دهی، grid/flex ساختاری) تا در برابر استایل پیش‌فرض
 * تم/المنتور روی تگ‌های عمومی مثل <button> مقاوم بمانند.
 */

.psm-faq-widget {
	direction: rtl;
	text-align: right;
}

/* ------------------------ عنوان بخش ------------------------ */

.psm-faq-widget .psm-faq-heading {
	font-family: inherit;
	margin: 0 0 20px;
}

/* ------------------------ گرید آکاردئون (تک/دو ستون، ریسپانسیو) ------------------------ */

.psm-faq-widget .psm-faq-accordion {
	display: grid;
	grid-template-columns: repeat(1, minmax(0, 1fr));
	gap: 14px;
	align-items: start;
}

/* ------------------------ هر آیتم ------------------------ */

.psm-faq-widget .psm-faq-item {
	transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
	list-style: none;
}

.psm-faq-widget .psm-faq-item:hover {
	box-shadow: 0 4px 16px rgba(20, 20, 30, 0.06);
}

/* ------------------------ دکمه سوال - ریست کامل استایل پیش‌فرض <button> ------------------------ */
/* این بخش ساختاری است و هیچ کنترل استایلی در پنل رقیبش نیست، پس !important امن است. */

.psm-faq-widget .psm-faq-question {
	all: unset;
	box-sizing: border-box !important;
	width: 100% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	background: transparent !important;
	background-image: none !important;
	border: none !important;
	box-shadow: none !important;
	text-shadow: none !important;
	cursor: pointer !important;
	font-family: inherit;
	text-align: inherit;
	color: inherit;
	-webkit-tap-highlight-color: transparent;
}

.psm-faq-widget .psm-faq-question:focus-visible {
	outline: 2px solid #c9772f;
	outline-offset: -2px;
	border-radius: 8px;
}

.psm-faq-widget .psm-faq-question-text {
	flex: 1;
	font-family: inherit;
	transition: color 0.25s ease;
}

/* ------------------------ آیکون باز/بسته شدن ------------------------ */

.psm-faq-widget .psm-faq-icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.25s ease, color 0.25s ease;
	line-height: 1;
}

.psm-faq-widget .psm-faq-icon-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1em;
	height: 1em;
	transition: transform 0.3s ease;
}

.psm-faq-widget .psm-faq-icon-inner svg {
	width: 1em;
	height: 1em;
	display: block;
}

/* آیکون‌های فونت‌آیکون سفارشی: فقط یکی همزمان نمایش داده می‌شود (ساختاری، بدون کنترل رقیب) */
.psm-faq-widget .psm-icon-active-state {
	display: none;
}

.psm-faq-widget .psm-faq-item.psm-active .psm-icon-normal-state {
	display: none;
}

.psm-faq-widget .psm-faq-item.psm-active .psm-icon-active-state {
	display: inline-block;
}

/* حالت پیش‌فرض «+ / −»: علامت با چرخش ۴۵ درجه به × تبدیل می‌شود (مگر کنترل «میزان چرخش» آن را override کند) */
.psm-faq-widget .psm-faq-item.psm-active .psm-icon-plus {
	transform: rotate(45deg);
}

/* ------------------------ ناحیه پاسخ ------------------------ */

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

.psm-faq-widget .psm-faq-answer-inner {
	font-family: inherit;
}

.psm-faq-widget .psm-faq-answer-inner p {
	margin: 0 0 12px;
}

.psm-faq-widget .psm-faq-answer-inner p:first-child {
	margin-top: 0;
}

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

@media (prefers-reduced-motion: reduce) {
	.psm-faq-widget .psm-faq-answer,
	.psm-faq-widget .psm-faq-icon-inner,
	.psm-faq-widget .psm-faq-item {
		transition: none !important;
	}
}
