/**
 * FPL FAQ — Frontend Stylesheet
 * Aligned with new.fpl.kz corporate design tokens
 */

:root {
	--fpl-faq-primary: #165567;
	--fpl-faq-primary-hover: #0f3d4a;
	--fpl-faq-accent: #227187;
	--fpl-faq-cielo: #f0f7f9;
	--fpl-faq-text-dark: #1e293b;
	--fpl-faq-text-body: #334155;
	--fpl-faq-text-muted: #64748b;
	--fpl-faq-border: #e2e8f0;
	--fpl-faq-border-subtle: #f1f5f9;
	--fpl-faq-white: #ffffff;
	--fpl-faq-radius: 10px;
}

/* 1. WRAPPER & PAGE INTEGRATION */
html:has(.fpl-faq-wrapper),
body.page-id-267,
body.page-id-268,
body.page-id-269 {
	overflow-x: clip;
}

.page-id-267 .fpl-article-header,
.page-id-268 .fpl-article-header,
.page-id-269 .fpl-article-header,
.fpl-article-wrapper:has(.fpl-faq-wrapper) .fpl-article-header {
	display: none !important;
}

.page-id-267 .fpl-article-container,
.page-id-268 .fpl-article-container,
.page-id-269 .fpl-article-container {
	padding-top: 20px;
	padding-left: 0;
	padding-right: 0;
	max-width: 100%;
}

.page-id-267 .fpl-breadcrumbs,
.page-id-268 .fpl-breadcrumbs,
.page-id-269 .fpl-breadcrumbs {
	max-width: 1240px;
	margin: 0 auto 16px;
	padding: 0 24px;
	box-sizing: border-box;
}

.fpl-faq-wrapper {
	width: 100%;
	font-family: inherit;
	color: var(--fpl-faq-text-body);
	box-sizing: border-box;
}

.fpl-faq-wrapper *,
.fpl-faq-wrapper *::before,
.fpl-faq-wrapper *::after {
	box-sizing: border-box;
}

/* FAQ-01A1: Full-bleed FAQ sections must escape the article's narrow
   Gutenberg content column without changing other pages. */
.fpl-article-wrapper:has(.fpl-faq-wrapper) .fpl-article-container,
.fpl-article-wrapper:has(.fpl-faq-wrapper) .entry-content,
.fpl-article-wrapper:has(.fpl-faq-wrapper) .wp-block-post-content {
	max-width: none;
	width: 100%;
}

/* 2. FULL-WIDTH HERO SECTION */
.fpl-faq-hero {
	width: 100vw;
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	margin-top: 0;
	margin-bottom: 0;
	min-height: 380px;
	overflow: hidden;
	border-bottom: 1px solid var(--fpl-faq-border);
	background: linear-gradient(100deg, #fff 0%, #f6fafc 52%, #eaf2f6 100%);
	display: flex;
	align-items: center;
}

/* FAQ-01A2: display the replacement seamless Hero image without vertical masking. */
.fpl-faq-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image: linear-gradient(to right, rgba(255,255,255,.98) 0%, rgba(255,255,255,.92) 38%, rgba(255,255,255,0) 73%), url('../images/faq-hero-bg.webp');
	background-position: center, right center;
	background-size: cover;
	background-repeat: no-repeat;
}

.fpl-faq-hero-inner {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 1240px;
	margin: 0 auto;
	padding: 48px 24px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.fpl-faq-hero-text {
	max-width: 620px;
}

.fpl-faq-hero-title {
	font-family: var(--wp--preset--font-family--montserrat, 'Montserrat', sans-serif);
	font-size: 38px;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--fpl-faq-primary);
	margin: 0 0 14px 0;
	text-transform: uppercase;
	line-height: 1.15;
}

.fpl-faq-hero-subtitle {
	font-size: 15px;
	line-height: 1.6;
	color: var(--fpl-faq-text-muted);
	margin: 0 0 28px 0;
	max-width: 580px;
}

/* HERO SEARCH BAR */
.fpl-faq-search-wrap {
	max-width: 620px;
	width: 100%;
}

.fpl-faq-search-form {
	display: flex;
	align-items: center;
	background: var(--fpl-faq-white);
	border: 1.5px solid #cbd5e1;
	border-radius: 8px;
	box-shadow: 0 4px 18px rgba(22, 85, 103, 0.07);
	padding: 4px;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.fpl-faq-search-form:focus-within {
	border-color: var(--fpl-faq-primary);
	box-shadow: 0 0 0 3.5px rgba(22, 85, 103, 0.15);
}

.fpl-faq-search-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 10px 0 14px;
	color: var(--fpl-faq-text-muted);
}

.fpl-faq-search-input {
	flex: 1;
	border: none;
	outline: none;
	background: transparent;
	font-size: 15px;
	color: var(--fpl-faq-text-dark);
	padding: 10px 8px;
	font-family: inherit;
	min-width: 0;
}

.fpl-faq-search-input::placeholder {
	color: #94a3b8;
}

.fpl-faq-search-clear {
	background: none;
	border: none;
	padding: 8px 10px;
	color: #94a3b8;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.fpl-faq-search-clear:hover {
	color: var(--fpl-faq-text-dark);
}

.fpl-faq-search-btn {
	background: var(--fpl-faq-primary);
	color: var(--fpl-faq-white);
	border: none;
	border-radius: 6px;
	padding: 11px 26px;
	font-size: 14.5px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.1s ease;
	white-space: nowrap;
}

.fpl-faq-search-btn:hover {
	background: var(--fpl-faq-primary-hover);
}

.fpl-faq-search-btn:active {
	transform: scale(0.98);
}

/* 3. CATEGORY FILTER TABS BAR */
.fpl-faq-tabs {
	width: 100vw;
	position: relative;
	left: 50%;
	margin-left: -50vw;
	background: var(--fpl-faq-white);
	border-bottom: 1px solid var(--fpl-faq-border);
}

.fpl-faq-tabs-inner {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 24px;
	display: flex;
	gap: 32px;
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.fpl-faq-tabs-inner::-webkit-scrollbar {
	display: none;
}

.fpl-faq-tab-btn {
	position: relative;
	background: none;
	border: none;
	padding: 18px 4px 16px 4px;
	font-size: 15px;
	font-weight: 500;
	color: var(--fpl-faq-text-muted);
	cursor: pointer;
	white-space: nowrap;
	transition: color 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.fpl-faq-tab-btn:hover {
	color: var(--fpl-faq-primary);
}

.fpl-faq-tab-btn.is-active {
	color: var(--fpl-faq-primary);
	font-weight: 700;
}

.fpl-faq-tab-count {
	font-weight: 600;
	font-size: 14px;
	opacity: 0.85;
}

.fpl-faq-tab-line {
	position: absolute;
	bottom: -1px;
	left: 0;
	width: 100%;
	height: 3px;
	background: transparent;
	border-radius: 3px 3px 0 0;
	transition: background-color 0.2s ease;
}

.fpl-faq-tab-btn.is-active .fpl-faq-tab-line {
	background: var(--fpl-faq-primary);
}

/* 4. MAIN CONTENT LAYOUT */
.fpl-faq-layout {
	width: 100vw;
	position: relative;
	left: 50%;
	margin-left: -50vw;
	background: #fcfdfe;
	padding: 44px 0 64px 0;
}

.fpl-faq-layout-inner {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 24px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 32px;
	align-items: start;
}

/* 5. MAIN COLUMN / ACCORDIONS */
.fpl-faq-main-col {
	min-width: 0;
}

.fpl-faq-category-group {
	margin-bottom: 36px;
}

.fpl-faq-category-group.is-filtered-out {
	display: none !important;
}

.fpl-faq-category-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.fpl-faq-category-icon {
	color: var(--fpl-faq-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
}

.fpl-faq-category-title {
	font-family: var(--wp--preset--font-family--montserrat, 'Montserrat', sans-serif);
	font-size: 20px;
	font-weight: 700;
	color: var(--fpl-faq-primary);
	margin: 0;
	flex: 1;
}

.fpl-faq-category-count {
	font-size: 13.5px;
	font-weight: 500;
	color: var(--fpl-faq-text-muted);
}

.fpl-faq-accordion-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* ACCORDION ITEM */
.fpl-faq-item {
	background: var(--fpl-faq-white);
	border: 1px solid var(--fpl-faq-border);
	border-radius: var(--fpl-faq-radius);
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fpl-faq-item:hover {
	border-color: #cbd5e1;
	box-shadow: 0 3px 12px rgba(22, 85, 103, 0.04);
}

.fpl-faq-item.is-open {
	border-color: #cbd5e1;
	box-shadow: 0 4px 16px rgba(22, 85, 103, 0.06);
}

.fpl-faq-item.is-hidden {
	display: none !important;
}

.fpl-faq-question-btn {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 22px;
	background: none;
	border: none;
	text-align: left;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	color: var(--fpl-faq-text-dark);
	line-height: 1.45;
	font-family: inherit;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.fpl-faq-question-btn:hover {
	color: var(--fpl-faq-primary);
}

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

.fpl-faq-chevron {
	color: var(--fpl-faq-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.fpl-faq-item.is-open .fpl-faq-chevron {
	transform: rotate(180deg);
}

.fpl-faq-answer {
	border-top: 1px solid var(--fpl-faq-border-subtle);
	padding: 20px 22px 24px 22px;
	font-size: 14.5px;
	line-height: 1.7;
	color: var(--fpl-faq-text-body);
}

.fpl-faq-answer[hidden] {
	display: none;
}

.fpl-faq-answer-inner > *:first-child {
	margin-top: 0;
}

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

.fpl-faq-answer-inner p {
	margin: 0 0 14px 0;
}

.fpl-faq-answer-inner ol,
.fpl-faq-answer-inner ul {
	margin: 0 0 14px 0;
	padding-left: 22px;
}

.fpl-faq-answer-inner li {
	margin-bottom: 6px;
}

.fpl-faq-answer-inner a {
	color: var(--fpl-faq-primary);
	text-decoration: underline;
	font-weight: 500;
}

.fpl-faq-answer-inner a:hover {
	color: var(--fpl-faq-primary-hover);
}

/* SEARCH HIGHLIGHTING */
mark.fpl-faq-highlight {
	background-color: #fef08a;
	color: inherit;
	padding: 0 2px;
	border-radius: 2px;
}

/* EMPTY STATE */
.fpl-faq-empty-state {
	text-align: center;
	padding: 48px 24px;
	background: var(--fpl-faq-white);
	border: 1px dashed var(--fpl-faq-border);
	border-radius: var(--fpl-faq-radius);
	margin-bottom: 32px;
}

.fpl-faq-empty-icon {
	color: #94a3b8;
	margin-bottom: 16px;
}

.fpl-faq-empty-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--fpl-faq-primary);
	margin: 0 0 8px 0;
}

.fpl-faq-empty-desc {
	font-size: 14px;
	color: var(--fpl-faq-text-muted);
	margin: 0 0 20px 0;
	max-width: 440px;
	margin-left: auto;
	margin-right: auto;
}

.fpl-faq-btn-outline {
	background: transparent;
	border: 1.5px solid var(--fpl-faq-primary);
	border-radius: 6px;
	padding: 8px 18px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--fpl-faq-primary);
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}

.fpl-faq-btn-outline:hover {
	background: var(--fpl-faq-primary);
	color: var(--fpl-faq-white);
}

/* 6. SIDEBAR CARDS */
.fpl-faq-side-col {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.fpl-faq-card {
	background: var(--fpl-faq-white);
	border: 1px solid var(--fpl-faq-border);
	border-radius: 12px;
	padding: 24px;
	box-shadow: 0 4px 18px rgba(22, 85, 103, 0.03);
}

/* CARD 1: POPULAR QUESTIONS */
.fpl-faq-card-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 16px;
	color: var(--fpl-faq-primary);
}

.fpl-faq-card-icon {
	display: flex;
	align-items: center;
	justify-content: center;
}

.fpl-faq-card-title {
	font-family: var(--wp--preset--font-family--montserrat, 'Montserrat', sans-serif);
	font-size: 16.5px;
	font-weight: 700;
	color: var(--fpl-faq-primary);
	margin: 0;
}

.fpl-faq-popular-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.fpl-faq-popular-item {
	border-bottom: 1px solid var(--fpl-faq-border-subtle);
	padding: 12px 0;
}

.fpl-faq-popular-item:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.fpl-faq-popular-link {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	width: 100%;
	background: none;
	border: none;
	text-align: left;
	cursor: pointer;
	padding: 0;
	font-family: inherit;
	color: var(--fpl-faq-text-dark);
	font-size: 13.5px;
	line-height: 1.45;
	transition: color 0.15s ease;
}

.fpl-faq-popular-link:hover {
	color: var(--fpl-faq-primary);
}

.fpl-faq-popular-num {
	font-size: 13px;
	font-weight: 600;
	color: #94a3b8;
	min-width: 20px;
	line-height: 1.4;
}

.fpl-faq-popular-text {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.45;
	max-height: calc(1.45em * 3);
	word-break: break-word;
	flex: 1;
}

.fpl-faq-popular-link:hover .fpl-faq-popular-num {
	color: var(--fpl-faq-primary);
}

/* CARD 2: CONTACT CTA */
.fpl-faq-contact-card {
	background: #f8fafc;
	border-color: #e2e8f0;
}

.fpl-faq-contact-icon {
	color: var(--fpl-faq-primary);
	margin-bottom: 14px;
}

.fpl-faq-contact-title {
	font-family: var(--wp--preset--font-family--montserrat, 'Montserrat', sans-serif);
	font-size: 16.5px;
	font-weight: 700;
	color: var(--fpl-faq-primary);
	margin: 0 0 8px 0;
	line-height: 1.35;
}

.fpl-faq-contact-desc {
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--fpl-faq-text-muted);
	margin: 0 0 20px 0;
}

.fpl-faq-btn-contact {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 11px 18px;
	border: 1.5px solid var(--fpl-faq-primary);
	border-radius: 8px;
	color: var(--fpl-faq-primary);
	background: var(--fpl-faq-white);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.2s ease;
}

.fpl-faq-btn-contact:hover {
	background: var(--fpl-faq-primary);
	color: var(--fpl-faq-white);
}

/* 7. RESPONSIVE MEDIA QUERIES */
@media (max-width: 991px) {
	.fpl-faq-layout-inner {
		grid-template-columns: 1fr;
		gap: 36px;
	}

	.fpl-faq-hero {
		min-height: 350px;
		background-position: 85% center;
	}

	.fpl-faq-hero-title {
		font-size: 32px;
	}

	.fpl-faq-side-col {
		max-width: 580px;
	}
}

@media (max-width: 768px) {
	.fpl-faq-hero {
		min-height: 330px;
		background-position: 88% center;
	}

	.fpl-faq-hero-inner {
		padding: 36px 20px;
	}

	.fpl-faq-hero-title {
		font-size: 28px;
	}

	.fpl-faq-hero-subtitle {
		font-size: 14px;
		margin-bottom: 22px;
	}

	.fpl-faq-tabs-inner {
		padding: 0 16px;
		gap: 20px;
	}

	.fpl-faq-tab-btn {
		font-size: 14px;
		padding: 14px 2px 12px 2px;
	}

	.fpl-faq-layout {
		padding: 32px 0 48px 0;
	}

	.fpl-faq-layout-inner {
		padding: 0 16px;
	}

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

	.fpl-faq-question-btn {
		padding: 16px 18px;
		font-size: 14.5px;
	}

	.fpl-faq-answer {
		padding: 16px 18px 20px 18px;
		font-size: 14px;
	}
}

@media (max-width: 480px) {
	.fpl-faq-hero {
		min-height: 320px;
		background-position: right top;
	}

	.fpl-faq-hero-inner {
		padding: 28px 16px;
	}

	.fpl-faq-hero-title {
		font-size: 24px;
	}

	.fpl-faq-search-form {
		flex-direction: column;
		align-items: stretch;
		padding: 8px;
		gap: 8px;
	}

	.fpl-faq-search-btn {
		width: 100%;
		padding: 10px;
	}
}

/* FAQ-01A1 responsive hero artwork positioning */
@media (max-width: 768px) {
	.fpl-faq-hero::before { background-position: center, 78% center; }
}
@media (max-width: 480px) {
	.fpl-faq-hero::before {
		background-position: center, 82% top;
		opacity: .48;
	}
}

/* 7. HELPFULNESS VOTING BOX (FAQ-01C) */
.fpl-faq-vote-box {
	margin-top: 24px;
	padding-top: 18px;
	border-top: 1px solid var(--fpl-faq-border-subtle);
}

.fpl-faq-vote-prompt-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
}

.fpl-faq-vote-prompt {
	font-size: 13.5px;
	font-weight: 500;
	color: var(--fpl-faq-text-muted);
}

.fpl-faq-vote-actions {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.fpl-faq-vote-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	padding: 6px 14px;
	font-size: 13px;
	font-weight: 600;
	color: #334155;
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: inherit;
}

.fpl-faq-vote-btn:hover:not(:disabled) {
	background: #f1f5f9;
	border-color: #94a3b8;
	color: #0f172a;
}

.fpl-faq-vote-btn:focus-visible {
	outline: 2px solid var(--fpl-faq-primary);
	outline-offset: 2px;
}

.fpl-faq-vote-btn.is-voted,
.fpl-faq-vote-btn:disabled {
	background: #f0fdf4;
	border-color: #86efac;
	color: #15803d;
	cursor: default;
}

.fpl-faq-vote-btn.is-voted .fpl-faq-vote-icon {
	fill: #15803d;
}

.fpl-faq-vote-btn.is-loading {
	opacity: 0.7;
	pointer-events: none;
}

.fpl-faq-vote-icon {
	flex-shrink: 0;
	transition: fill 0.2s ease;
}

.fpl-faq-vote-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 28px;
	padding: 0 8px;
	background: #f1f5f9;
	border-radius: 14px;
	font-size: 12px;
	font-weight: 700;
	color: #475569;
}

.fpl-faq-vote-btn.is-voted + .fpl-faq-vote-count {
	background: #dcfce7;
	color: #15803d;
}

.fpl-faq-vote-feedback {
	margin-top: 8px;
	font-size: 12.5px;
	font-weight: 500;
	color: #15803d;
	animation: fplFadeIn 0.25s ease-out;
}

.fpl-faq-vote-feedback.is-error {
	color: #b91c1c;
}

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