/*
 * Pippin FAQs widget. Colours default to the Kit globals: Text, Accent, Border, Surface, Text- Muted, Brand Blue 100.
 * The answer panel takes the standard inset padding (--pt-inset), like a Box.
 */
.pt-faqs {
	--pt-faq-question: var(--e-global-color-text, #22294e);
	--pt-faq-hover: var(--e-global-color-accent, #d83040);
	--pt-faq-divider: var(--e-global-color-b0de001, #d9d9d9);
	--pt-faq-panel: var(--e-global-color-5f0ace0, #fff);
	--pt-faq-muted: var(--e-global-color-e4427e8, #757575);
	--pt-faq-active: var(--e-global-color-2c7a47e, #e4f6fe);
	--pt-faq-focus: var(--e-global-color-primary, #37aada);
	color: var(--pt-faq-question);
}

.pt-faqs__items {
	display: grid;
	grid-template-columns: repeat(var(--pt-faq-columns, 1), minmax(0, 1fr));
	column-gap: var(--pt-columns, 40px);
	align-items: start;
}

/* One question */
.pt-faq {
	border-bottom: 1px solid var(--pt-faq-divider);
}
.pt-faq[hidden] {
	display: none;
}
.pt-faqs .pt-faq__summary {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 20px 0;
	cursor: pointer;
	list-style: none;
}
.pt-faqs .pt-faq__summary::-webkit-details-marker {
	display: none;
}
.pt-faqs .pt-faq__summary:focus-visible {
	outline: 2px solid var(--pt-faq-focus);
	outline-offset: 4px;
	border-radius: 4px;
}
.pt-faqs .pt-faq__question {
	flex: 1;
	margin: 0;
	padding: 0;
	color: var(--pt-faq-question);
	font-family: inherit;
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.011em;
	text-transform: none;
	transition: color 0.2s ease;
}
.pt-faqs .pt-faq__summary:hover .pt-faq__question {
	color: var(--pt-faq-hover);
}

/* Plus that turns into a minus */
.pt-faq__icon {
	position: relative;
	flex: none;
	width: 16px;
	height: 16px;
	color: var(--pt-faq-muted);
	transition: color 0.2s ease;
}
.pt-faq__icon::before,
.pt-faq__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 2px;
	margin-top: -1px;
	border-radius: 1px;
	background: currentColor;
	transition: transform 0.2s ease;
}
.pt-faq__icon::after {
	transform: rotate(90deg);
}
.pt-faq[open] .pt-faq__icon::after {
	transform: rotate(90deg) scaleX(0);
}
.pt-faqs .pt-faq__summary:hover .pt-faq__icon {
	color: var(--pt-faq-hover);
}

.pt-faq__answer {
	padding-bottom: 20px;
}
.pt-faq__panel {
	padding: var(--pt-inset, 40px);
	border-radius: 15px;
	background: var(--pt-faq-panel);
	color: var(--e-global-color-text, #22294e);
}
.pt-faq__panel > :first-child {
	margin-top: 0;
}
.pt-faq__panel > :last-child {
	margin-bottom: 0;
}
.pt-faq__panel :is(ul, ol) {
	margin: 0.5em 0 1em;
	padding-left: 1.25em;
}
.pt-faq__panel li + li {
	margin-block-start: var(--pt-section-xxs, 0.5rem);
}

@media (prefers-reduced-motion: reduce) {
	.pt-faqs *,
	.pt-faqs *::before,
	.pt-faqs *::after {
		transition: none !important;
	}
}

/* Directory: search and topics beside the questions, grouped by topic */
.pt-faqs--directory {
	display: grid;
	grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
	gap: var(--pt-columns, 40px);
	align-items: start;
}
.pt-faqs__tools {
	position: sticky;
	top: var(--pt-faq-sticky, 120px);
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.pt-faqs__search {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 52px;
	padding: 0 18px;
	border: 1px solid var(--pt-faq-divider);
	border-radius: 999px;
	background: var(--pt-faq-panel);
	color: var(--pt-faq-muted);
	cursor: text;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.pt-faqs__search:focus-within {
	border-color: var(--pt-faq-focus);
	box-shadow: 0 0 0 3px var(--e-global-color-71b1a00, rgba(118, 208, 244, 0.1));
}
.pt-faqs__search-icon {
	flex: none;
	width: 20px;
	height: 20px;
}
.pt-faqs .pt-faqs__input,
.pt-faqs .pt-faqs__input:focus {
	flex: 1;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	background: transparent;
	box-shadow: none;
	color: var(--pt-faq-question);
	font: inherit;
	font-size: 1rem;
}
.pt-faqs__input::placeholder {
	color: var(--pt-faq-muted);
	opacity: 1;
}

.pt-faqs__topics {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
/* Higher specificity than the Kit's button styles (which also set :hover and :focus). */
.pt-faqs .pt-faqs__topic,
.pt-faqs .pt-faqs__topic:is(:hover, :focus, :active) {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	margin: 0;
	padding: 10px 14px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	box-shadow: none;
	color: var(--pt-faq-question);
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: normal;
	text-align: left;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.2s ease;
}
.pt-faqs .pt-faqs__topic:is(:hover, :focus-visible) {
	background: var(--e-global-color-6690862, #f2f2f2);
}
.pt-faqs .pt-faqs__topic:focus-visible {
	outline: 2px solid var(--pt-faq-focus);
	outline-offset: 1px;
}
.pt-faqs .pt-faqs__topic[aria-pressed="true"] {
	background: var(--pt-faq-active);
	font-weight: 600;
}
.pt-faqs__count {
	margin-left: auto;
	color: var(--pt-faq-muted);
	font-size: 0.8125rem;
	font-weight: 500;
}
.pt-faqs__status {
	min-height: 1.4em;
	margin: 0;
	padding: 0 14px;
	color: var(--pt-faq-muted);
	font-size: 0.875rem;
	line-height: 1.4;
}
.pt-faqs__status:empty {
	display: none;
}

.pt-faqs__group[hidden] {
	display: none;
}
.pt-faqs__group + .pt-faqs__group {
	margin-top: var(--pt-section-sm, 40px);
}
.pt-faqs .pt-faqs__group-title {
	margin: 0 0 4px;
	color: var(--pt-faq-question);
	font-family: inherit;
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.02em;
	scroll-margin-top: var(--pt-faq-sticky, 120px);
}
.pt-faq {
	scroll-margin-top: var(--pt-faq-sticky, 120px);
}

.pt-faqs__empty {
	padding: var(--pt-inset, 40px);
	border-radius: 15px;
	background: var(--pt-faq-panel);
	text-align: center;
}
.pt-faqs__empty[hidden] {
	display: none;
}
.pt-faqs__empty p {
	margin: 0 0 12px;
}
.pt-faqs .pt-faqs__ask {
	color: var(--e-global-color-11a0001, #d83040);
	font-weight: 600;
	text-decoration: none;
}
.pt-faqs .pt-faqs__ask:hover {
	color: var(--e-global-color-11a0002, #54bde9);
}

.pt-faqs .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	border: 0;
	white-space: nowrap;
}

/* Tablet: the tools sit above the questions and the topics become chips. */
@media (max-width: 1024px) {
	.pt-faqs--directory {
		grid-template-columns: minmax(0, 1fr);
	}
	.pt-faqs__tools {
		position: static;
	}
	.pt-faqs__topics {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 8px;
	}
	.pt-faqs .pt-faqs__topic,
	.pt-faqs .pt-faqs__topic:is(:hover, :focus, :active) {
		width: auto;
		padding: 8px 14px;
		border: 1px solid var(--pt-faq-divider);
		border-radius: 999px;
	}
	.pt-faqs .pt-faqs__topic[aria-pressed="true"] {
		border-color: transparent;
	}
	.pt-faqs__count {
		margin-left: 2px;
	}
	.pt-faqs__status {
		padding: 0;
	}
}

/* Phone: the chips scroll sideways in one row. */
@media (max-width: 767px) {
	.pt-faqs__topics {
		flex-wrap: nowrap;
		margin: 0 calc(-1 * var(--pt-gutter, 20px));
		padding: 0 var(--pt-gutter, 20px) 4px;
		overflow-x: auto;
		scroll-snap-type: x proximity;
		scroll-padding-inline: var(--pt-gutter, 20px);
		scrollbar-width: none;
	}
	.pt-faqs__topics::-webkit-scrollbar {
		display: none;
	}
	.pt-faqs .pt-faqs__topic,
	.pt-faqs .pt-faqs__topic:is(:hover, :focus, :active) {
		flex: none;
		white-space: nowrap;
		scroll-snap-align: start;
	}
	.pt-faqs .pt-faq__question {
		font-size: 1.0625rem;
	}
	.pt-faqs .pt-faq__summary {
		padding: 18px 0;
	}
}
