/* Rule of Law FAQ. Everything is scoped to .rolfaq so it cannot leak into the theme.
   Colors are taken from the site: navy text, teal accent, light blue tints. */

.rolfaq {
	--rolfaq-ink: #06023b;
	--rolfaq-body: #2a2756;
	--rolfaq-muted: #5a5880;
	--rolfaq-accent: #2ecad1;
	--rolfaq-blue: #009fe3;
	--rolfaq-sky: #ccecfa;
	--rolfaq-tint: #f2f8f8;
	--rolfaq-panel: #eef4f6;
	--rolfaq-line: #dbe6ea;
	--rolfaq-heading: "Ivar Semi Bold", "Ivar", Georgia, "Times New Roman", serif;

	color: var(--rolfaq-ink);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.6;
	max-width: 1040px;
	margin: 0 auto;
	padding: 28px;
	background: var(--rolfaq-panel);
	border-radius: 16px;
}
.rolfaq *, .rolfaq *::before, .rolfaq *::after { box-sizing: border-box; }
.rolfaq [hidden] { display: none !important; }
html.rolfaq-lock { overflow: hidden; }

.rolfaq__sr {
	position: absolute !important;
	width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Neutralise theme button styles inside the FAQ. */
.rolfaq button {
	appearance: none;
	-webkit-appearance: none;
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	box-shadow: none;
	min-height: 0;
	line-height: 1.3;
	cursor: pointer;
}
.rolfaq button:focus-visible,
.rolfaq summary:focus-visible,
.rolfaq input:focus-visible {
	outline: 3px solid var(--rolfaq-blue);
	outline-offset: 2px;
}

/* Toolbar ---------------------------------------------------------------- */

.rolfaq__toolbar {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.rolfaq__searchbox {
	position: relative;
	display: block;
	margin: 0;
}
.rolfaq__searchicon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--rolfaq-muted);
	pointer-events: none;
}
.rolfaq .rolfaq__search {
	width: 100%;
	height: 52px;
	margin: 0;
	padding: 0 16px 0 48px;
	font: inherit;
	font-size: 17px;
	color: var(--rolfaq-ink);
	background: #fff;
	border: 1px solid var(--rolfaq-line);
	border-radius: 10px;
	box-shadow: 0 1px 2px rgba(6, 2, 59, .04);
}
.rolfaq .rolfaq__search::placeholder { color: #7a7896; opacity: 1; }
.rolfaq .rolfaq__search:focus { border-color: var(--rolfaq-blue); }

.rolfaq__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.rolfaq .rolfaq__chip {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 7px 14px;
	font-size: 15px;
	white-space: nowrap;
	color: var(--rolfaq-ink);
	background: #fff;
	border: 1px solid transparent;
	border-radius: 999px;
	transition: background-color .15s, border-color .15s, color .15s;
}
.rolfaq .rolfaq__chip:hover { border-color: var(--rolfaq-accent); }
.rolfaq .rolfaq__chip[aria-pressed="true"] {
	color: #fff;
	background: var(--rolfaq-ink);
	border-color: var(--rolfaq-ink);
}
.rolfaq__n {
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	min-width: 22px;
	padding: 1px 6px;
	text-align: center;
	border-radius: 999px;
	background: var(--rolfaq-tint);
	color: var(--rolfaq-muted);
}
.rolfaq__chip[aria-pressed="true"] .rolfaq__n {
	background: rgba(255, 255, 255, .18);
	color: #fff;
}

.rolfaq .rolfaq__status {
	margin: 0;
	font-size: 14px;
	color: var(--rolfaq-muted);
}
.rolfaq .rolfaq__reset,
.rolfaq .rolfaq__copy {
	margin: 0;
	padding: 4px 0;
	font-size: 14px;
	color: var(--rolfaq-ink);
	background: none;
	border: 0;
	border-bottom: 2px solid var(--rolfaq-accent);
	border-radius: 0;
}
.rolfaq .rolfaq__reset:hover,
.rolfaq .rolfaq__copy:hover,
.rolfaq .rolfaq__copy.is-done { border-bottom-color: var(--rolfaq-ink); }

/* Topic groups ----------------------------------------------------------- */

.rolfaq__group { margin-top: 36px; }
.rolfaq__toolbar + .rolfaq__group { margin-top: 28px; }

.rolfaq .rolfaq__grouptitle {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 14px;
	padding: 0;
	font-family: var(--rolfaq-heading);
	font-size: 24px;
	font-weight: normal;
	line-height: 1.2;
	color: var(--rolfaq-ink);
}
.rolfaq .rolfaq__grouptitle::before {
	content: "";
	flex: 0 0 auto;
	width: 6px;
	height: 22px;
	border-radius: 3px;
	background: var(--rolfaq-accent);
}

/* Question list ---------------------------------------------------------- */

.rolfaq .rolfaq__list {
	display: grid;
	gap: 12px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.rolfaq .rolfaq__item {
	margin: 0;
	padding: 0;
	background: #fff;
	border: 1px solid transparent;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(6, 2, 59, .06);
	overflow: hidden;
	transition: border-color .15s, box-shadow .15s, transform .15s;
}
.rolfaq .rolfaq__item::before,
.rolfaq .rolfaq__item::marker { content: none; }
.rolfaq .rolfaq__item:hover {
	border-color: var(--rolfaq-sky);
	box-shadow: 0 6px 20px rgba(6, 2, 59, .08);
}

.rolfaq__details { margin: 0; height: 100%; }

.rolfaq .rolfaq__q {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px 20px;
	list-style: none;
	cursor: pointer;
	color: var(--rolfaq-ink);
}
.rolfaq .rolfaq__q::-webkit-details-marker { display: none; }
.rolfaq .rolfaq__q::marker { content: ""; }

.rolfaq .rolfaq__num {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	min-width: 30px;
	height: 30px;
	padding: 0 6px;
	font-size: 14px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 1;
	color: var(--rolfaq-ink);
	background: var(--rolfaq-accent);
	border-radius: 7px;
}

.rolfaq .rolfaq__qtext {
	flex: 1 1 auto;
	font-family: var(--rolfaq-heading);
	font-size: 19px;
	line-height: 1.35;
}

/* Plus/minus (no-JS accordion) */
.rolfaq__icon {
	position: relative;
	flex: 0 0 30px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--rolfaq-tint);
}
.rolfaq__icon::before,
.rolfaq__icon::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 12px;
	height: 2px;
	margin: -1px 0 0 -6px;
	background: var(--rolfaq-ink);
	border-radius: 1px;
}
.rolfaq__icon::after { transform: rotate(90deg); }
.rolfaq__details[open] .rolfaq__icon::after { transform: rotate(0deg); }

.rolfaq__body { padding: 4px 24px 24px 64px; }

.rolfaq .rolfaq__a {
	max-width: 66ch;
	font-size: 16px;
	line-height: 1.75;
	color: var(--rolfaq-body);
}
.rolfaq .rolfaq__a p { margin: 0 0 1em; }
.rolfaq .rolfaq__a p:last-child { margin-bottom: 0; }
.rolfaq .rolfaq__a a { color: var(--rolfaq-blue); }

/* First sentence of the answer, shown as a short summary. */
.rolfaq .rolfaq__lead {
	display: block;
	margin-bottom: 1em;
	padding: 14px 18px;
	font-size: 17.5px;
	font-weight: 600;
	line-height: 1.55;
	color: var(--rolfaq-ink);
	background: var(--rolfaq-tint);
	border-left: 4px solid var(--rolfaq-accent);
	border-radius: 0 8px 8px 0;
}

.rolfaq__meta { margin-top: 20px; }
.rolfaq__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.rolfaq__tag {
	padding: 2px 10px;
	font-size: 13px;
	color: var(--rolfaq-muted);
	background: var(--rolfaq-tint);
	border-radius: 999px;
}

.rolfaq mark.rolfaq__mark {
	padding: 0 1px;
	color: inherit;
	background: var(--rolfaq-sky);
	border-radius: 2px;
}

.rolfaq__empty {
	margin-top: 24px;
	padding: 40px 16px;
	text-align: center;
	color: var(--rolfaq-muted);
	background: #fff;
	border-radius: 12px;
}
.rolfaq__empty p { margin: 0 0 12px; }

/* Card mode (JavaScript on): a grid of question cards ------------------- */

.rolfaq--js .rolfaq__list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.rolfaq--js .rolfaq__item:hover { transform: translateY(-2px); }
.rolfaq--js .rolfaq__body { display: none; }

.rolfaq--js .rolfaq__q {
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	height: 100%;
	padding: 20px 22px 18px;
}
.rolfaq--js .rolfaq__qtext { font-size: 18px; }

.rolfaq__snippet {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 14px;
	line-height: 1.5;
	color: var(--rolfaq-muted);
}

/* The plus icon becomes a "Read answer →" link at the bottom of the card. */
.rolfaq--js .rolfaq__icon {
	flex: 0 0 auto;
	width: auto;
	height: auto;
	margin-top: auto;
	padding-top: 4px;
	background: none;
	border-radius: 0;
	font-size: 14px;
	color: var(--rolfaq-ink);
}
.rolfaq--js .rolfaq__icon::before {
	content: attr(data-label) "  \2192";
	position: static;
	width: auto;
	height: auto;
	margin: 0;
	background: none;
	white-space: pre;
	border-bottom: 2px solid var(--rolfaq-accent);
	padding-bottom: 2px;
}
.rolfaq--js .rolfaq__icon::after { content: none; }
.rolfaq--js .rolfaq__item:hover .rolfaq__icon::before { border-bottom-color: var(--rolfaq-ink); }

/* Reading panel ---------------------------------------------------------- */

.rolfaq__reader {
	width: min(760px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100vh - 48px);
	padding: 0;
	color: var(--rolfaq-ink);
	background: #fff;
	border: 0;
	border-radius: 16px;
	box-shadow: 0 24px 60px rgba(6, 2, 59, .3);
	overflow: hidden;
}
.rolfaq__reader[open] {
	display: flex;
	flex-direction: column;
	animation: rolfaq-in .2s ease-out;
}
.rolfaq__reader::backdrop { background: rgba(6, 2, 59, .55); }
@keyframes rolfaq-in {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}

.rolfaq__rhead {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 14px 12px 32px;
	color: #fff;
	background: var(--rolfaq-ink);
}
.rolfaq__rgroup {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.rolfaq .rolfaq__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	color: #fff;
	background: rgba(255, 255, 255, .1);
	border: 0;
	border-radius: 50%;
}
.rolfaq .rolfaq__close:hover { background: rgba(255, 255, 255, .22); }

.rolfaq__rbody {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 28px 32px 32px;
}
.rolfaq .rolfaq__rtitle {
	margin: 14px 0 0;
	padding: 0;
	font-family: var(--rolfaq-heading);
	font-size: 26px;
	font-weight: normal;
	line-height: 1.25;
	color: var(--rolfaq-ink);
}
.rolfaq .rolfaq__rtitle::after {
	content: "";
	display: block;
	width: 48px;
	height: 3px;
	margin: 18px 0 22px;
	background: var(--rolfaq-accent);
	border-radius: 2px;
}
.rolfaq .rolfaq__ranswer { max-width: none; }
.rolfaq__rtags { margin-top: 24px; }

.rolfaq__rfoot {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	background: var(--rolfaq-tint);
	border-top: 1px solid var(--rolfaq-line);
}
.rolfaq .rolfaq__nav {
	margin: 0;
	padding: 9px 16px;
	font-size: 14px;
	color: var(--rolfaq-ink);
	background: #fff;
	border: 1px solid var(--rolfaq-line);
	border-radius: 999px;
}
.rolfaq .rolfaq__nav:hover:not(:disabled) { border-color: var(--rolfaq-accent); }
.rolfaq .rolfaq__nav:disabled { opacity: .4; cursor: default; }

/* Small screens ---------------------------------------------------------- */

@media (max-width: 600px) {
	.rolfaq { padding: 16px; border-radius: 12px; }
	/* One scrollable row of topics instead of a tall stack. */
	.rolfaq__chips {
		flex-wrap: nowrap;
		overflow-x: auto;
		margin: 0 -16px;
		padding: 0 16px 2px;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}
	.rolfaq__chips::-webkit-scrollbar { display: none; }
	.rolfaq .rolfaq__chip { padding: 6px 12px; font-size: 14px; }
	.rolfaq .rolfaq__grouptitle { font-size: 21px; }
	.rolfaq--js .rolfaq__qtext { font-size: 17px; }
	.rolfaq__body { padding: 4px 18px 20px; }

	/* The reading panel fills the screen. */
	.rolfaq__reader {
		width: 100vw;
		height: 100dvh;
		max-height: 100dvh;
		margin: 0;
		border-radius: 0;
	}
	.rolfaq__rhead { padding-left: 20px; }
	.rolfaq__rbody { padding: 22px 20px 28px; }
	.rolfaq .rolfaq__rtitle { font-size: 22px; }
	.rolfaq .rolfaq__lead { font-size: 16.5px; padding: 12px 14px; }
	.rolfaq .rolfaq__nav { padding: 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
	.rolfaq *, .rolfaq *::before, .rolfaq *::after,
	.rolfaq__reader[open] { transition: none !important; animation: none !important; }
}
