/**
 * HLI Footnotes
 * Everything themeable sits in the custom properties below. Override them in
 * the theme stylesheet or Elementor custom CSS rather than editing this file.
 */

:root {
	--hli-fn-accent: #8fb8e8;
	--hli-fn-note-bg: #1b1b1b;
	--hli-fn-note-fg: #f2f2f2;
	--hli-fn-note-border: rgba(255, 255, 255, 0.16);
	--hli-fn-note-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
	--hli-fn-note-width: 24rem;
	--hli-fn-note-radius: 6px;
}

/* Marker */

.hli-fn {
	white-space: nowrap;
}

.hli-fn__ref {
	background: none;
	border: 0;
	color: var(--hli-fn-accent);
	cursor: pointer;
	font: inherit;
	line-height: 1;
	margin: 0;
	padding: 0 0.15em;
}

.hli-fn__ref sup {
	font-size: 0.72em;
	font-weight: 600;
}

.hli-fn__ref:hover,
.hli-fn__ref[aria-expanded='true'] {
	text-decoration: underline;
}

.hli-fn__ref:focus-visible {
	outline: 2px solid var(--hli-fn-accent);
	outline-offset: 2px;
}

/* The note itself. The popover attribute hides it until shown and lifts it to
   the top layer, so it is never clipped by an Elementor container. */

.hli-fn__note {
	background: var(--hli-fn-note-bg);
	border: 1px solid var(--hli-fn-note-border);
	border-radius: var(--hli-fn-note-radius);
	box-shadow: var(--hli-fn-note-shadow);
	box-sizing: border-box;
	color: var(--hli-fn-note-fg);
	display: none;
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.55;
	margin: 0;
	max-height: 55vh;
	max-width: calc(100vw - 24px);
	overflow-y: auto;
	padding: 0.85rem 1rem;
	position: fixed;
	text-align: left;
	white-space: normal;
	width: var(--hli-fn-note-width);
	z-index: 100000;
}

.hli-fn__note:popover-open,
.hli-fn__note.is-open {
	display: flex;
	gap: 0.6rem;
}

/* Browsers without :popover-open support still need the fallback visible. */
.hli-fn__note.is-open {
	display: flex;
}

.hli-fn__note::backdrop {
	background: rgba(0, 0, 0, 0.35);
}

.hli-fn__note-num {
	color: var(--hli-fn-accent);
	flex: 0 0 auto;
	font-size: 0.8125rem;
	font-weight: 700;
}

.hli-fn__note-body > *:first-child {
	margin-top: 0;
}

.hli-fn__note-body > *:last-child {
	margin-bottom: 0;
}

.hli-fn__note-body a {
	color: var(--hli-fn-accent);
	text-decoration: underline;
}

/* Touch devices: a sheet at the bottom of the screen, which stays readable for
   notes that run to several sentences. */

.hli-fn__note.is-sheet {
	border-radius: var(--hli-fn-note-radius) var(--hli-fn-note-radius) 0 0;
	bottom: 0;
	left: 0;
	max-height: 55vh;
	max-width: none;
	padding-bottom: calc(0.85rem + env(safe-area-inset-bottom));
	right: 0;
	top: auto;
	width: auto;
}

/* Optional [efn_list] block. Not rendered unless the shortcode is used. */

.hli-fn-list {
	font-size: 0.9375rem;
	margin-top: 2.5rem;
}

.hli-fn-list__title {
	font-size: 1.125rem;
	margin-bottom: 0.75rem;
}

.hli-fn-list__items {
	padding-left: 1.25rem;
}

.hli-fn-list__item {
	margin-bottom: 0.6rem;
}

@media (prefers-reduced-motion: reduce) {
	.hli-fn__note {
		transition: none;
	}
}
