/*
 * Mime FAQ Manager — front-end styles.
 * All selectors are scoped under .mime-faq so the theme is untouched.
 */

.mime-faq {
	/* Values taken from the Salient theme's dynamic CSS on mime.webdem.co,
	   matching the Mime Team Directory plugin so the two look related. */
	--mime-faq-font: "SegoeUI", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	--mime-faq-accent: #06367a;
	--mime-faq-navy: #0d2240;
	--mime-faq-ink: #12203a;
	--mime-faq-muted: #4a5568;
	--mime-faq-border: #e2e5ea;
	--mime-faq-band: #eef2fb;
	--mime-faq-card-bg: #fff;
	--mime-faq-pill-bg: #eef5ff;
	--mime-faq-pill-border: #9ec4fa;
	--mime-faq-radius: 8px;
	--mime-faq-gap: 2.5rem;
	--mime-faq-sticky-top: 120px;

	font-family: var(--mime-faq-font);
	color: var(--mime-faq-ink);
	margin: 2rem 0;
}

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

.mime-faq .mime-faq-title {
	margin: 0 0 1.5rem;
	color: var(--mime-faq-navy);
}

.mime-faq-inner {
	display: block;
}

.mime-faq-layout-sidebar.mime-faq-has-sidebar .mime-faq-inner {
	display: grid;
	grid-template-columns: minmax(200px, 260px) 1fr;
	gap: var(--mime-faq-gap);
	align-items: start;
}

/* ---------- Sidebar ---------- */

.mime-faq-sidebar {
	min-width: 0;
}

.mime-faq-is-sticky .mime-faq-sidebar-inner {
	position: sticky;
	top: var(--mime-faq-sticky-top);
	/* Keeps a long category list scrollable rather than clipped when it
	   is taller than the viewport. */
	max-height: calc(100vh - var(--mime-faq-sticky-top) - 2rem);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.mime-faq-layout-stacked .mime-faq-sidebar-inner {
	position: static;
	max-height: none;
	overflow: visible;
}

.mime-faq-search {
	margin-bottom: 1.5rem;
}

.mime-faq .mime-faq-search-label {
	display: block;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--mime-faq-muted);
	margin-bottom: 0.5rem;
}

.mime-faq .mime-faq-search-input {
	width: 100%;
	padding: 0.7rem 0.9rem;
	font-family: inherit;
	font-size: 0.95rem;
	color: var(--mime-faq-ink);
	background: #fff;
	border: 1px solid var(--mime-faq-border);
	border-radius: var(--mime-faq-radius);
	-webkit-appearance: none;
	appearance: none;
}

.mime-faq .mime-faq-search-input:focus {
	outline: none;
	border-color: var(--mime-faq-accent);
	box-shadow: 0 0 0 3px rgba(6, 54, 122, 0.12);
}

.mime-faq .mime-faq-nav-heading {
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--mime-faq-muted);
	margin: 0 0 0.75rem;
}

.mime-faq .mime-faq-nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mime-faq .mime-faq-nav-item {
	list-style: none;
	margin: 0 0 0.25rem;
	padding: 0;
}

.mime-faq .mime-faq-nav-item::before {
	content: none;
}

/*
 * Buttons are reset explicitly: themes style bare <button> heavily, and
 * Salient in particular applies its own padding, colour and shadow.
 */
.mime-faq .mime-faq-filter {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	width: 100%;
	margin: 0;
	padding: 0.65rem 0.85rem;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.35;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	color: var(--mime-faq-ink);
	background: transparent;
	border: 1px solid transparent;
	border-radius: var(--mime-faq-radius);
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.mime-faq .mime-faq-filter:hover,
.mime-faq .mime-faq-filter:focus-visible {
	background: var(--mime-faq-band);
	color: var(--mime-faq-accent);
	outline: none;
}

.mime-faq .mime-faq-filter:focus-visible {
	border-color: var(--mime-faq-accent);
}

.mime-faq .mime-faq-filter.is-active {
	background: var(--mime-faq-accent);
	color: #fff;
	border-color: var(--mime-faq-accent);
}

.mime-faq .mime-faq-filter-count {
	flex: 0 0 auto;
	min-width: 1.75rem;
	padding: 0.1rem 0.45rem;
	font-size: 0.78rem;
	font-weight: 600;
	text-align: center;
	color: var(--mime-faq-accent);
	background: var(--mime-faq-pill-bg);
	border: 1px solid var(--mime-faq-pill-border);
	border-radius: 999px;
}

.mime-faq .mime-faq-filter.is-active .mime-faq-filter-count {
	color: #fff;
	background: rgba(255, 255, 255, 0.18);
	border-color: rgba(255, 255, 255, 0.45);
}

/* ---------- List ---------- */

.mime-faq-main {
	min-width: 0;
}

.mime-faq .mime-faq-status {
	margin: 0 0 1rem;
	font-size: 0.875rem;
	color: var(--mime-faq-muted);
}

.mime-faq .mime-faq-status:empty {
	display: none;
}

.mime-faq-item {
	background: var(--mime-faq-card-bg);
	border: 1px solid var(--mime-faq-border);
	border-radius: var(--mime-faq-radius);
	margin-bottom: 0.75rem;
	overflow: hidden;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.mime-faq-item.is-open {
	border-color: var(--mime-faq-pill-border);
	box-shadow: 0 2px 14px rgba(13, 34, 64, 0.07);
}

.mime-faq .mime-faq-question {
	margin: 0;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
	border: 0;
}

.mime-faq .mime-faq-question-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	width: 100%;
	margin: 0;
	padding: 1.05rem 1.25rem;
	font-family: inherit;
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.4;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	color: var(--mime-faq-navy);
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
	transition: color 0.18s ease, background-color 0.18s ease;
}

.mime-faq .mime-faq-question-toggle:hover,
.mime-faq .mime-faq-question-toggle:focus-visible {
	color: var(--mime-faq-accent);
	background: var(--mime-faq-band);
	outline: none;
}

.mime-faq .mime-faq-question-toggle:focus-visible {
	box-shadow: inset 0 0 0 2px var(--mime-faq-accent);
}

.mime-faq-item.is-open .mime-faq-question-toggle {
	color: var(--mime-faq-accent);
}

/* Plus/minus mark, drawn in CSS to avoid depending on the theme's icon font. */
.mime-faq .mime-faq-icon {
	position: relative;
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin-top: 0.15rem;
}

.mime-faq .mime-faq-icon::before,
.mime-faq .mime-faq-icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	background: currentColor;
	border-radius: 1px;
	transform: translate(-50%, -50%);
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.mime-faq .mime-faq-icon::before {
	width: 16px;
	height: 2px;
}

.mime-faq .mime-faq-icon::after {
	width: 2px;
	height: 16px;
}

.mime-faq-item.is-open .mime-faq-icon::after {
	transform: translate(-50%, -50%) rotate(90deg);
	opacity: 0;
}

/* Minimal style: rules instead of cards, closer to Salient's "minimal" toggles. */
.mime-faq-style-minimal .mime-faq-item {
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--mime-faq-border);
	border-radius: 0;
	margin-bottom: 0;
	box-shadow: none;
}

.mime-faq-style-minimal .mime-faq-question-toggle {
	padding-left: 0;
	padding-right: 0;
}

.mime-faq-style-minimal .mime-faq-question-toggle:hover,
.mime-faq-style-minimal .mime-faq-question-toggle:focus-visible {
	background: transparent;
}

.mime-faq-style-minimal .mime-faq-answer-body {
	padding-left: 0;
	padding-right: 0;
}

/* ---------- Grouped sections ---------- */

.mime-faq .mime-faq-section + .mime-faq-section {
	margin-top: 2.5rem;
}

.mime-faq .mime-faq-section-title {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	margin: 0 0 1rem;
	padding: 0;
	font-family: inherit;
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.01em;
	text-transform: none;
	color: var(--mime-faq-navy);
	text-wrap: balance;
}

.mime-faq .mime-faq-section-number {
	flex: 0 0 auto;
	color: var(--mime-faq-accent);
	font-variant-numeric: tabular-nums;
}

/*
 * While a filter or search is active the headings would only repeat the
 * chosen category or split matches into fragments, so the list reads flat.
 */
/* .mime-faq doubled up so these outrank the later 600px spacing rule. */
.mime-faq.mime-faq-is-narrowed .mime-faq-section-title {
	display: none;
}

.mime-faq.mime-faq-is-narrowed .mime-faq-section + .mime-faq-section {
	margin-top: 0;
}

/*
 * Deep links (#faq-..., #faq-cat-...) should land below a fixed site header
 * rather than underneath it; the sticky offset is the same measurement.
 */
.mime-faq,
.mime-faq .mime-faq-section,
.mime-faq .mime-faq-item {
	scroll-margin-top: var(--mime-faq-sticky-top);
}

/* ---------- Answer ---------- */

/*
 * Without JS every answer is simply open (see .mime-faq-js below), so the
 * content is always readable if the script fails to load.
 */
.mime-faq-answer {
	display: grid;
	grid-template-rows: 1fr;
}

/*
 * The collapsing box carries NO padding of its own. A box's padding is part
 * of the box, not its contents, so it survives the grid row going to 0fr and
 * overflow clips contents, not self -- padding left here keeps every closed
 * card ~20px taller than the button inside it. Spacing goes on the body.
 */
.mime-faq-answer-inner {
	min-height: 0;
	overflow: hidden;
}

.mime-faq-answer-body {
	padding: 0 1.25rem 1.25rem;
	color: var(--mime-faq-muted);
	font-size: 1rem;
	line-height: 1.65;
}

.mime-faq-js .mime-faq-answer {
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.28s ease;
}

.mime-faq-js .mime-faq-item.is-open .mime-faq-answer {
	grid-template-rows: 1fr;
}

/*
 * A collapsed answer is only clipped, not removed, so links inside it stay
 * in the tab order and readable by screen readers. visibility takes it out
 * of both; the delay holds it visible until the collapse finishes.
 */
.mime-faq-js .mime-faq-answer-inner {
	visibility: hidden;
	transition: visibility 0s linear 0.28s;
}

.mime-faq-js .mime-faq-item.is-open .mime-faq-answer-inner {
	visibility: visible;
	transition-delay: 0s;
}

.mime-faq .mime-faq-answer-body > *:first-child {
	margin-top: 0;
}

.mime-faq .mime-faq-answer-body > *:last-child {
	margin-bottom: 0;
}

.mime-faq .mime-faq-answer-body a {
	color: var(--mime-faq-accent);
	text-decoration: underline;
}

.mime-faq .mime-faq-item-cats {
	margin: 1rem 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.mime-faq .mime-faq-item-cat {
	display: inline-block;
	padding: 0.2rem 0.6rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--mime-faq-accent);
	background: var(--mime-faq-pill-bg);
	border: 1px solid var(--mime-faq-pill-border);
	border-radius: 999px;
}

.mime-faq .mime-faq-no-results,
.mime-faq .mime-faq-empty {
	margin: 1.5rem 0;
	padding: 1.25rem;
	text-align: center;
	color: var(--mime-faq-muted);
	background: var(--mime-faq-band);
	border-radius: var(--mime-faq-radius);
}

.mime-faq [hidden] {
	display: none !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 999px) {
	.mime-faq-layout-sidebar.mime-faq-has-sidebar .mime-faq-inner {
		grid-template-columns: 1fr;
		gap: 1.75rem;
	}

	.mime-faq-is-sticky .mime-faq-sidebar-inner {
		position: static;
		max-height: none;
		overflow: visible;
	}

	/* Categories read better as a wrapping row once they are full width. */
	.mime-faq .mime-faq-nav-list {
		display: flex;
		flex-wrap: wrap;
		gap: 0.5rem;
	}

	.mime-faq .mime-faq-nav-item {
		margin: 0;
	}

	.mime-faq .mime-faq-filter {
		width: auto;
		border-color: var(--mime-faq-border);
	}
}

@media (max-width: 600px) {
	.mime-faq .mime-faq-section-title {
		font-size: 1.2rem;
	}

	.mime-faq .mime-faq-section + .mime-faq-section {
		margin-top: 2rem;
	}

	.mime-faq .mime-faq-question-toggle {
		padding: 0.9rem 1rem;
		font-size: 1rem;
	}

	.mime-faq-answer-body {
		padding: 0 1rem 1rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mime-faq *,
	.mime-faq *::before,
	.mime-faq *::after {
		transition-duration: 0.01ms !important;
		/* Nothing animates, so the visibility hand-off must not wait either. */
		transition-delay: 0s !important;
	}
}
