/* Custom FAQ Widget — scoped styles (prefix: cfw-)
   Palette: navy #192348, teal #2E8F7C, light #F7FBFD. Every colour can be changed from the widget's Style tab. */

.cfw-faq-widget {
	--cfw-ease: cubic-bezier(.22, .9, .32, 1);
	--cfw-navy: #192348;
	--cfw-teal: #2E8F7C;
	--cfw-teal-dark: #257565;
	--cfw-light: #F7FBFD;
	--cfw-line: #DCE3EA;
	--cfw-head-font: 'Otto', 'Newsreader', Georgia, serif;
	font-family: inherit;
}

.cfw-faq-widget * {
	box-sizing: border-box;
}

/* ---------- Header ---------- */
.cfw-header {
	text-align: center;
	padding: 72px 24px;
	background-color: var(--cfw-navy);
}

.cfw-heading {
	margin: 0 0 32px;
	font-family: var(--cfw-head-font);
	font-size: 48px;
	font-weight: 400;
	line-height: 1.15;
	color: #FFFFFF;
}

.cfw-search {
	--cfw-focus: var(--cfw-teal);
	max-width: 720px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 12px;
	height: 60px;
	padding: 0 20px;
	background-color: #FFFFFF;
	border: 1.5px solid #FFFFFF;
	border-radius: 10px;
	transition: box-shadow .2s var(--cfw-ease), border-color .2s var(--cfw-ease);
}

.cfw-search:focus-within {
	border-color: var(--cfw-focus);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--cfw-focus) 30%, transparent);
}

.cfw-search-icon {
	display: inline-flex;
	color: var(--cfw-teal);
	flex-shrink: 0;
}

.cfw-faq-widget .cfw-search-input {
	flex: 1;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	outline: none;
	font-family: inherit;
	font-size: 17px;
	font-weight: 400;
	color: var(--cfw-navy);
	-webkit-appearance: none;
	appearance: none;
}

.cfw-faq-widget .cfw-search-input::placeholder {
	color: #7A8296;
	opacity: 1;
}

.cfw-faq-widget .cfw-search-input::-webkit-search-cancel-button {
	cursor: pointer;
}

/* ---------- Body ---------- */
.cfw-body-wrap {
	background-color: #FFFFFF;
}

.cfw-body {
	padding: 48px 24px 96px;
	max-width: 960px;
	margin: 0 auto;
}

/* ---------- Tabs ---------- */
.cfw-tabs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-bottom: 28px;
}

.cfw-faq-widget .cfw-tab {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	margin: 0;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--cfw-navy);
	background-color: #FFFFFF;
	border: 1.5px solid var(--cfw-line);
	border-radius: 8px;
	padding: 11px 18px;
	text-transform: none;
	letter-spacing: normal;
	transition: background-color .2s var(--cfw-ease), color .2s var(--cfw-ease), border-color .2s var(--cfw-ease);
}

.cfw-faq-widget .cfw-tab:hover {
	border-color: var(--cfw-teal);
	background-color: #FFFFFF;
	color: var(--cfw-navy);
}

.cfw-faq-widget .cfw-tab.is-active,
.cfw-faq-widget .cfw-tab.is-active:hover {
	background-color: var(--cfw-teal);
	color: #FFFFFF;
	border-color: var(--cfw-teal);
}

.cfw-faq-widget .cfw-tab:focus-visible {
	outline: 2px solid var(--cfw-teal);
	outline-offset: 2px;
}

.cfw-tab-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background-color: var(--cfw-light);
	color: var(--cfw-navy);
	font-size: 12px;
	font-weight: 600;
}

.cfw-tab.is-active .cfw-tab-count {
	background-color: rgba(255, 255, 255, .22);
	color: #FFFFFF;
}

.cfw-tab[hidden] {
	display: none;
}

/* ---------- Pagination ---------- */
.cfw-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-bottom: 28px;
}

.cfw-page-label {
	font-size: 15px;
	font-weight: 500;
	color: var(--cfw-navy);
	min-width: 120px;
	text-align: center;
}

.cfw-faq-widget .cfw-page-btn {
	appearance: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border-radius: 50%;
	border: 1.5px solid var(--cfw-teal);
	background-color: #FFFFFF;
	color: var(--cfw-teal);
	transition: opacity .2s var(--cfw-ease), transform .15s var(--cfw-ease), background-color .2s var(--cfw-ease);
}

.cfw-faq-widget .cfw-page-btn:hover:not(:disabled) {
	transform: translateY(-1px);
	background-color: var(--cfw-light);
}

.cfw-faq-widget .cfw-page-btn:disabled {
	opacity: .35;
	cursor: not-allowed;
}

/* ---------- FAQ list ---------- */
.cfw-list {
	display: flex;
	flex-direction: column;
}

.cfw-faq-item {
	margin-bottom: 12px;
	overflow: hidden;
	background-color: #FFFFFF;
	border: 1px solid var(--cfw-line);
	border-radius: 10px;
	transition: background-color .25s var(--cfw-ease), border-color .25s var(--cfw-ease), box-shadow .25s var(--cfw-ease);
}

.cfw-faq-item:hover,
.cfw-faq-item.is-open {
	border-color: var(--cfw-teal);
}

.cfw-faq-item.is-open {
	background-color: var(--cfw-light);
	box-shadow: 0 10px 28px rgba(25, 35, 72, .06);
}

.cfw-faq-item[hidden] {
	display: none;
}

.cfw-faq-widget .cfw-faq-question {
	appearance: none;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 0;
	text-align: left;
	cursor: pointer;
	font-family: var(--cfw-head-font);
	font-size: 20px;
	font-weight: 400;
	line-height: 1.4;
	text-transform: none;
	letter-spacing: normal;
	white-space: normal;
	color: var(--cfw-navy);
	background-color: transparent;
	border: none;
	border-radius: 0;
	padding: 20px 24px;
	transition: background-color .2s var(--cfw-ease), color .2s var(--cfw-ease);
}

.cfw-faq-widget .cfw-faq-question:hover,
.cfw-faq-widget .cfw-faq-question:focus {
	background-color: transparent;
	color: var(--cfw-navy);
}

.cfw-faq-widget .cfw-faq-question:focus-visible {
	outline: 2px solid var(--cfw-teal);
	outline-offset: -2px;
}

.cfw-faq-icon {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	border: 1px solid var(--cfw-line);
	background-color: #FFFFFF;
	color: var(--cfw-teal);
	transition: transform .3s var(--cfw-ease), background-color .2s var(--cfw-ease), color .2s var(--cfw-ease), border-color .2s var(--cfw-ease);
}

.cfw-faq-item.is-open .cfw-faq-icon {
	transform: rotate(180deg);
	background-color: var(--cfw-teal);
	border-color: var(--cfw-teal);
	color: #FFFFFF;
}

/* smooth open/close: grid row animates from 0fr to 1fr */
.cfw-faq-answer {
	display: grid;
	grid-template-rows: 0fr;
	visibility: hidden;
	transition: grid-template-rows .3s var(--cfw-ease), visibility 0s linear .3s;
}

.cfw-faq-item.is-open .cfw-faq-answer {
	grid-template-rows: 1fr;
	visibility: visible;
	transition: grid-template-rows .3s var(--cfw-ease), visibility 0s;
}

.cfw-faq-answer-inner {
	min-height: 0;
	overflow: hidden;
	color: #3F4242;
	font-size: 16px;
	line-height: 1.7;
}

.cfw-faq-answer-content {
	padding: 0 72px 22px 24px;
}

.cfw-faq-answer-content > *:first-child {
	margin-top: 0;
}

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

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

.cfw-faq-answer-content ul,
.cfw-faq-answer-content ol {
	margin: 0 0 12px;
	padding-left: 1.3em;
}

.cfw-faq-answer-content li + li {
	margin-top: 4px;
}

.cfw-faq-answer-content a {
	color: var(--cfw-teal);
	text-decoration: underline;
}

.cfw-faq-answer-content a:hover {
	color: var(--cfw-teal-dark);
}

/* ---------- Empty state ---------- */
.cfw-empty-state {
	margin: 0;
	text-align: center;
	color: #5A6275;
	font-size: 16px;
	padding: 32px 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.cfw-heading {
		font-size: 40px;
	}
}

@media (max-width: 640px) {
	.cfw-header {
		padding: 48px 16px;
	}

	.cfw-heading {
		font-size: 32px;
		margin-bottom: 24px;
	}

	.cfw-search {
		height: 54px;
		padding: 0 16px;
	}

	.cfw-faq-widget .cfw-search-input {
		font-size: 16px; /* 16px stops iOS zooming in on focus */
	}

	.cfw-body {
		padding: 32px 16px 64px;
	}

	.cfw-tabs {
		justify-content: flex-start;
		overflow-x: auto;
		flex-wrap: nowrap;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding-bottom: 4px;
		margin-left: -16px;
		margin-right: -16px;
		padding-left: 16px;
		padding-right: 16px;
	}

	.cfw-tabs::-webkit-scrollbar {
		display: none;
	}

	.cfw-faq-widget .cfw-tab {
		flex-shrink: 0;
	}

	.cfw-faq-widget .cfw-faq-question {
		font-size: 17px;
		padding: 16px 18px;
	}

	.cfw-faq-answer-content {
		padding: 0 18px 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cfw-faq-answer,
	.cfw-faq-icon,
	.cfw-faq-item {
		transition: none;
	}
}
