/**
 * FAQ Widget Front-end Styles.
 *
 * Modern, creative, fintech-grade accordion component matching Ray Theme aesthetics.
 *
 * @package RayTheme
 */

.ray-faq-widget {
	direction: rtl;
	text-align: right;
	margin-top: 48px;
	margin-bottom: 48px;
	box-sizing: border-box;
	font-family: 'IRANYekanXFaNum', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	position: relative;
	clear: both;
}

.ray-faq-widget *,
.ray-faq-widget *::before,
.ray-faq-widget *::after {
	box-sizing: border-box;
}

/* ==========================================================================
   Widget Header
   ========================================================================== */

.ray-faq-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 22px;
	padding-bottom: 18px;
	border-bottom: 1.5px solid #edf0f5;
}

.ray-faq-header-right {
	display: flex;
	align-items: center;
	gap: 14px;
}

.ray-faq-header-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 14px;
	background: linear-gradient(135deg, #ffd305 0%, #ffc107 100%);
	color: #080f1d;
	flex-shrink: 0;
	box-shadow: 0 4px 14px rgba(255, 211, 5, 0.35);
}

.ray-faq-header-icon svg {
	width: 22px;
	height: 22px;
	display: block;
}

.ray-faq-header-titles {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.ray-faq-title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	color: #0d1329;
	line-height: 1.3;
}

.ray-faq-count-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #f1f4f9;
	color: #505763;
	font-size: 13px;
	font-weight: 600;
	padding: 4px 12px;
	border-radius: 20px;
	border: 1px solid #eef2f7;
	line-height: 1;
}

.ray-faq-header-actions {
	display: flex;
	align-items: center;
}

/* High-specificity button reset override */
.directory-single-main .ray-faq-widget .ray-faq-toggle-all-btn,
.ray-faq-widget .ray-faq-toggle-all-btn {
	display: inline-flex !important;
	align-items: center !important;
	gap: 7px !important;
	padding: 7px 16px !important;
	background: #f8fafd !important;
	border: 1px solid #e2e8f0 !important;
	border-radius: 20px !important;
	color: #475569 !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	cursor: pointer !important;
	transition: all 0.2s ease !important;
	font-family: inherit !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

.directory-single-main .ray-faq-widget .ray-faq-toggle-all-btn:hover,
.ray-faq-widget .ray-faq-toggle-all-btn:hover {
	background: #edf2f9 !important;
	color: #0d1329 !important;
	border-color: #cbd5e1 !important;
}

.ray-faq-toggle-all-icon {
	width: 14px;
	height: 14px;
	transition: transform 0.25s ease;
}

.ray-faq-toggle-all-btn[data-state="expanded"] .ray-faq-toggle-all-icon {
	transform: rotate(180deg);
}

/* ==========================================================================
   Accordion List & Items
   ========================================================================== */

.ray-faq-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.ray-faq-item {
	background: #ffffff;
	border: 1.5px solid #edf0f5;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(13, 19, 41, 0.02);
	transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.ray-faq-item:hover {
	border-color: #d1d9e4;
	box-shadow: 0 6px 20px rgba(13, 19, 41, 0.05);
	transform: translateY(-1px);
}

.ray-faq-item.is-open {
	border-color: #ffd305;
	box-shadow: 0 8px 24px rgba(255, 211, 5, 0.12), 0 2px 8px rgba(13, 19, 41, 0.03);
	background-color: #ffffff;
}

/* ==========================================================================
   Question Button (Strict Specificity)
   ========================================================================== */

.directory-single-main .ray-faq-widget .ray-faq-button,
.ray-faq-widget .ray-faq-button {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 16px !important;
	width: 100% !important;
	padding: 18px 24px !important;
	margin: 0 !important;
	background: transparent !important;
	border: none !important;
	text-align: right !important;
	cursor: pointer !important;
	font-family: inherit !important;
	transition: background-color 0.2s ease !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}

.ray-faq-button:focus-visible {
	outline: 2px solid #ffd305 !important;
	outline-offset: -2px !important;
	border-radius: 20px !important;
}

.ray-faq-q-wrap {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-grow: 1;
	min-width: 0;
}

.ray-faq-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 11px;
	background: #f1f4f9;
	color: #1d2542;
	font-size: 13.5px;
	font-weight: 700;
	border: 1px solid #eef2f7;
	flex-shrink: 0;
	transition: all 0.25s ease;
}

.ray-faq-item:hover .ray-faq-number {
	background: #e8edf5;
	color: #0d1329;
}

.ray-faq-item.is-open .ray-faq-number {
	background: #ffd305;
	color: #080f1d;
	font-weight: 800;
	border-color: #e5bd05;
	box-shadow: 0 2px 6px rgba(255, 211, 5, 0.4);
}

.ray-faq-question-text {
	font-size: 16px;
	font-weight: 600;
	color: #0d1329;
	line-height: 1.6;
	flex-grow: 1;
	transition: color 0.2s ease;
}

.ray-faq-item:hover .ray-faq-question-text {
	color: #0650d7;
}

.ray-faq-item.is-open .ray-faq-question-text {
	color: #080f1d;
	font-weight: 700;
}

.ray-faq-chevron {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 12px;
	background: #f8fafd;
	border: 1px solid #eef2f7;
	color: #6b6f77;
	flex-shrink: 0;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.ray-faq-chevron svg {
	width: 18px;
	height: 18px;
	display: block;
}

.ray-faq-item:hover .ray-faq-chevron {
	background: #f1f4f9;
	color: #0d1329;
	border-color: #d8e0eb;
}

.ray-faq-item.is-open .ray-faq-chevron {
	transform: rotate(-180deg);
	background: #1d2542;
	border-color: #1d2542;
	color: #ffd305;
	box-shadow: 0 3px 10px rgba(29, 37, 66, 0.25);
}

/* ==========================================================================
   Answer Panel (CSS Grid Transition & Nested Card)
   ========================================================================== */

.ray-faq-answer {
	display: grid;
	grid-template-rows: 0fr;
	overflow: hidden;
	visibility: hidden;
	transition: grid-template-rows 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s ease;
}

.ray-faq-item.is-open .ray-faq-answer {
	grid-template-rows: 1fr;
	visibility: visible;
}

.ray-faq-answer-inner {
	min-height: 0;
	overflow: hidden;
	padding: 0 24px 0 24px;
	transition: padding-bottom 0.32s ease;
}

.ray-faq-item.is-open .ray-faq-answer-inner {
	padding-bottom: 20px;
}

.ray-faq-answer-card {
	background: #f8fafd;
	border: 1px solid #edf1f7;
	border-right: 4px solid #ffd305;
	border-radius: 14px;
	padding: 20px 22px;
	margin-top: 4px;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.015);
}

.ray-faq-answer-content {
	font-size: 15px;
	line-height: 2.05;
	color: #374151;
	font-weight: 400;
}

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

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

.ray-faq-answer-content a {
	color: #0650d7;
	text-decoration: none;
	border-bottom: 1.5px solid rgba(6, 80, 215, 0.25);
	font-weight: 600;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.ray-faq-answer-content a:hover {
	color: #f59e0b;
	border-color: #f59e0b;
}

.ray-faq-answer-content ul,
.ray-faq-answer-content ol {
	padding-right: 20px;
	margin: 10px 0;
}

.ray-faq-answer-content li {
	margin-bottom: 6px;
}


/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media screen and (max-width: 768px) {
	.ray-faq-widget {
		margin-top: 36px;
		margin-bottom: 36px;
	}

	.ray-faq-header {
		margin-bottom: 18px;
		padding-bottom: 14px;
		gap: 12px;
	}

	.ray-faq-header-icon {
		width: 38px;
		height: 38px;
		border-radius: 12px;
	}

	.ray-faq-title {
		font-size: 18px;
	}

	.ray-faq-count-badge {
		font-size: 12px;
		padding: 3px 10px;
	}

	.directory-single-main .ray-faq-widget .ray-faq-toggle-all-btn,
	.ray-faq-widget .ray-faq-toggle-all-btn {
		font-size: 12px !important;
		padding: 6px 12px !important;
	}

	.ray-faq-item {
		border-radius: 16px;
	}

	.directory-single-main .ray-faq-widget .ray-faq-button,
	.ray-faq-widget .ray-faq-button {
		padding: 14px 16px !important;
		gap: 12px !important;
	}

	.ray-faq-q-wrap {
		gap: 10px;
	}

	.ray-faq-number {
		width: 30px;
		height: 30px;
		border-radius: 9px;
		font-size: 12px;
	}

	.ray-faq-question-text {
		font-size: 14.5px;
	}

	.ray-faq-chevron {
		width: 32px;
		height: 32px;
		border-radius: 10px;
	}

	.ray-faq-chevron svg {
		width: 16px;
		height: 16px;
	}

	.ray-faq-answer-inner {
		padding: 0 16px 16px 16px;
	}

	.ray-faq-answer-card {
		padding: 16px 18px;
		border-radius: 12px;
	}

	.ray-faq-answer-content {
		font-size: 13.5px;
		line-height: 1.95;
	}



@media screen and (max-width: 480px) {
	.ray-faq-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.ray-faq-header-actions {
		width: 100%;
		justify-content: flex-end;
	}

	.directory-single-main .ray-faq-widget .ray-faq-toggle-all-btn,
	.ray-faq-widget .ray-faq-toggle-all-btn {
		width: 100% !important;
		justify-content: center !important;
	}
}
