/* =====================================================================
   WyoHS: Annals of Wyoming index  (/annals-index/)
   Loaded by /inc/annals-index.php alongside [wyohs_annals_index].

   The find bar is the Regions county-finder idiom: a condensed-caps label
   beside a serif control on a single hairline, no box. Rows are the index
   itself, term left and citations right, which is how the printed index
   this descends from was read.
   ===================================================================== */

.wyohs-aindex {
	--aindex-rule: rgba(27, 58, 92, .14);
	--aindex-ink: var(--wyohs-navy, #1b3a5c);
	/* The component sits in the page intro row, which centres its text. An
	   index is read down its left edge, so it sets its own alignment and lets
	   the find bar and the A to Z stay centred on their own flexbox. */
	text-align: left;
	/* Pulled in from the row's full 1356px: a term and its citations sitting a
	   third of a screen apart stop reading as one line. */
	max-width: 1040px;
	margin-left: auto;
	margin-right: auto;
}

/* ---------- find bar ------------------------------------------------- */
.wyohs-aindex__find {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 14px;
	padding-top: 20px;
	margin-bottom: 26px;
	border-top: 2px solid var(--aindex-rule);
}

.wyohs-aindex__label {
	font-family: var(--wyohs-display, 'Arial Narrow', sans-serif);
	font-size: 15px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--aindex-ink);
	white-space: nowrap;
}

/* The theme dresses every search input as a boxed field, with enough
   specificity that a single class loses. Naming the element and its type is
   what it takes to get back to the Regions treatment: a serif control on one
   hairline, no box. */
.wyohs-aindex__find input[type="search"].wyohs-aindex__input {
	font-family: var(--wyohs-serif, Georgia, serif);
	font-size: 19px;
	color: var(--aindex-ink);
	background: transparent;
	border: 0;
	border-bottom: 1px solid rgba(27, 58, 92, .45);
	border-radius: 0;
	padding: 4px 2px 6px;
	width: 340px;
	max-width: 100%;
	-webkit-appearance: none;
	appearance: none;
}

.wyohs-aindex__find input[type="search"].wyohs-aindex__input:focus {
	outline: 0;
	border-bottom-color: var(--wyohs-sand, #d2a56c);
	border-bottom-width: 2px;
	padding-bottom: 5px;
}

.wyohs-aindex__find input[type="search"].wyohs-aindex__input::placeholder { color: rgba(27, 58, 92, .38); }

/* ---------- A to Z --------------------------------------------------- */
.wyohs-aindex__az {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2px 4px;
	margin-bottom: 26px;
	padding-bottom: 20px;
	border-bottom: 2px solid var(--aindex-rule);
}

.wyohs-aindex__letter {
	font-family: var(--wyohs-display, 'Arial Narrow', sans-serif);
	font-size: 17px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: rgba(27, 58, 92, .6);
	background: transparent;
	border: 0;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	padding: 3px 7px 4px;
	cursor: pointer;
	transition: color .15s ease, border-color .15s ease;
}

.wyohs-aindex__letter:hover { color: var(--aindex-ink); }

.wyohs-aindex__letter.is-active {
	color: var(--aindex-ink);
	border-bottom-color: var(--wyohs-sand, #d2a56c);
}

/* ---------- status --------------------------------------------------- */
.wyohs-aindex__status {
	text-align: center;
	font-family: var(--wyohs-display, 'Arial Narrow', sans-serif);
	font-size: 13px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: rgba(27, 58, 92, .6);
	margin: 0 0 14px;
}

/* ---------- the history opener --------------------------------------- */

/* A Beaver Builder button module in the intro copy rather than part of this
   component, so that the copy and its call to action stay editable in the
   builder. Centred and spaced from here rather than through the module's own
   alignment setting, which the text-link treatment overrides. */
.wyohs-annals-history,
.wyohs-annals-history .fl-button-wrap {
	text-align: center;
}

.wyohs-annals-history { margin-top: 4px; }

/* ---------- scope note and the history button ------------------------ */
.wyohs-aindex__note {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	margin: -6px 0 22px;
}

.wyohs-aindex__scope {
	margin: 0;
	max-width: 660px;
	font-size: 14px;
	line-height: 1.6;
	text-align: center;
	color: rgba(27, 58, 92, .65);
}

/* ---------- the history copy, inside the Beaver Builder popup --------- */

/* The panel itself is the Popup module: its width, padding, background and
   close button are builder settings, not ours. All that is left here is the
   voice of the copy inside it. */
.wyohs-annals-history-copy h2 {
	font-family: var(--wyohs-serif, Georgia, serif);
	font-size: 30px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	text-align: left;
	margin: 0 0 22px;
	padding-bottom: 18px;
	border-bottom: 2px solid rgba(27, 58, 92, .14);
	color: var(--wyohs-navy, #1b3a5c);
}

.wyohs-annals-history-copy p {
	text-align: left;
	font-size: 16px;
	line-height: 1.72;
	margin: 0 0 1.1em;
	color: rgba(27, 58, 92, .88);
}

.wyohs-annals-history-copy p:last-child { margin-bottom: 0; }

/* ---------- the entries ---------------------------------------------- */
.wyohs-aindex__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 38%);
	gap: 24px;
	align-items: baseline;
	padding: 13px 0;
	border-bottom: 1px solid var(--aindex-rule);
}

.wyohs-aindex__term {
	font-family: var(--wyohs-sans, 'Special Gothic', Helvetica, Arial, sans-serif);
	font-size: 17px;
	line-height: 1.4;
	color: var(--aindex-ink);
}

/* A category headword such as BRANDS: or FIRSTS: opens a run of entries
   under it in the source, so it takes the label voice rather than the
   serif and reads as the heading it is. */
.wyohs-aindex__row--head .wyohs-aindex__term {
	font-family: var(--wyohs-display, 'Arial Narrow', sans-serif);
	font-size: 15px;
	letter-spacing: 2px;
	text-transform: uppercase;
}

.wyohs-aindex__refs {
	font-size: 14px;
	line-height: 1.65;
	text-align: right;
	color: rgba(27, 58, 92, .78);
}

/* Each citation is a link to the volume it names, scanned at the Internet
   Archive. The page number stays as text: the Archive addresses scan leaves
   rather than printed pages, and the offset differs volume by volume. */
.wyohs-aindex__cite {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid transparent;
	white-space: nowrap;
}

/* The prose-link rule in home.css would draw a sand underline beneath all
   36,789 citations wherever this component sits inside prose. Met at the same
   specificity; this sheet loads later, so the citations keep their own hover.
   The second selector covers the component in a row of its own, where there is
   no .wyohs-prose above it. */
.fl-builder-content .wyohs-prose a.wyohs-aindex__cite,
.fl-builder-content .wyohs-aindex a.wyohs-aindex__cite {
	color: inherit;
	text-decoration: none;
}

.fl-builder-content .wyohs-prose a.wyohs-aindex__cite:hover,
.fl-builder-content .wyohs-prose a.wyohs-aindex__cite:focus,
.fl-builder-content .wyohs-aindex a.wyohs-aindex__cite:hover,
.fl-builder-content .wyohs-aindex a.wyohs-aindex__cite:focus {
	color: var(--aindex-ink);
	text-decoration: none;
	border-bottom-color: var(--wyohs-sand, #d2a56c);
}

.wyohs-aindex__sep { color: rgba(27, 58, 92, .4); }

.wyohs-aindex__see {
	display: inline-block;
	color: rgba(27, 58, 92, .55);
}

/* The mark sits inside a word as often as around one, so it carries no
   padding and no radius: a highlighted fragment has to keep the letters
   either side of it at their normal spacing. */
.wyohs-aindex mark.wyohs-aindex__hit {
	background: rgba(210, 165, 108, .32);
	color: inherit;
	font: inherit;
	padding: 0;
	margin: 0;
	border-radius: 0;
	box-decoration-break: clone;
	-webkit-box-decoration-break: clone;
}

/* ---------- more, empty, noscript ------------------------------------ */
.wyohs-aindex__more { margin: 26px 0 0; text-align: center; }
.wyohs-aindex__more[hidden] { display: none; }

.wyohs-aindex__morebtn {
	font-family: var(--wyohs-display, 'Arial Narrow', sans-serif);
	font-size: 15px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--wyohs-peach, #f7e2c4);
	background: var(--aindex-ink);
	border: 0;
	border-radius: 0;
	padding: 13px 26px;
	cursor: pointer;
}

.wyohs-aindex__empty {
	font-family: var(--wyohs-serif, Georgia, serif);
	font-size: 18px;
	color: rgba(27, 58, 92, .7);
	padding: 26px 0;
}

.wyohs-aindex__noscript { margin: 0; }

/* ---------- narrow --------------------------------------------------- */
@media (max-width: 780px) {
	.wyohs-aindex__find { flex-direction: column; align-items: stretch; gap: 8px; }
	.wyohs-aindex__find input[type="search"].wyohs-aindex__input { width: 100%; }
	.wyohs-aindex__row { grid-template-columns: 1fr; gap: 5px; }
	.wyohs-aindex__refs { text-align: left; }
	.wyohs-aindex__note { gap: 10px; }
}

/* --- history popup: centre + scroll ------------------------------------- */
.fl-builder-content .fl-module.fl-popup,
.fl-builder-content .fl-popup.fl-module-popup,
dialog.fl-popup {
	margin-left: auto !important;
	margin-right: auto !important;
	max-height: 82vh;
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* Source italics (titles of books, papers, vessels) ride through the import
   as <em>; Special Gothic has no drawn italic, so the browser obliques it. */
.wyohs-aindex__term em,
.wyohs-aindex__term i,
.wyohs-aindex__refs em,
.wyohs-aindex__refs i {
	font-style: italic;
}

/* A category run carries far more in the citation column than a normal row,
   so the headword takes a fixed measure and the run gets the rest of the
   width, reading left to right like the paragraph it was in the source. */
.wyohs-aindex__row--head {
	grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
	align-items: start;
}

.wyohs-aindex__row--head .wyohs-aindex__refs {
	text-align: left;
}

/* A category run reads as an indented list under its headword, so a
   sub-entry keeps the two-column shape every other row has and only steps
   in from the margin. */
.wyohs-aindex__row--sub .wyohs-aindex__term {
	padding-left: 28px;
}

.wyohs-aindex__row--sub .wyohs-aindex__term::before {
	content: '';
	position: absolute;
	margin-left: -18px;
	margin-top: .62em;
	width: 7px;
	height: 1px;
	background: rgba(27, 58, 92, .35);
}

/* Naming the run only matters when a search has pulled the sub-entry away
   from the headword it sits under. */
.wyohs-aindex__up {
	font-family: var(--wyohs-display, 'Arial Narrow', sans-serif);
	font-size: 13px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: rgba(27, 58, 92, .55);
}

/* the headword of a run that is followed by its own rows carries nothing on
   the right, so it closes up against the first of them */
.wyohs-aindex__row--head:has(+ .wyohs-aindex__row--sub) {
	border-bottom-color: transparent;
	padding-bottom: 4px;
}

/* ---------- back to top ---------------------------------------------- */
/* Built in script and hung off <body> rather than off the component: a
   Beaver Builder row can carry a transform, and a transformed ancestor makes
   position: fixed behave like position: absolute. Sits under the sticky
   header rather than over it. */
.wyohs-aindex__totop {
	z-index: 90;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 62px;
	height: 62px;
	padding: 0;
	border-radius: 50%;
	background: var(--wyohs-navy, #1b3a5c);
	color: var(--wyohs-cream, #fff8e7);
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(27, 58, 92, .28);
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity .28s ease, transform .28s ease, visibility 0s linear .28s;
}

/* The theme skin dresses every button in :hover, :focus and :active — a blue
   fill, a border, outline: none and top: 1px — from selectors like
   `button:active`, which at (0,1,1) outrank a single class. On this button
   that was not cosmetic: :active also flipped position to relative, so on
   mousedown it left the viewport, the mouseup landed on whatever was beneath,
   and the click never happened at all. Position and offsets are therefore
   asserted in every state, not just the resting one. */
.wyohs-aindex__totop,
.wyohs-aindex__totop:hover,
.wyohs-aindex__totop:focus,
.wyohs-aindex__totop:active {
	position: fixed;
	top: auto;
	left: auto;
	right: 28px;
	bottom: 28px;
	border: 0;
	color: var(--wyohs-cream, #fff8e7);
}

.wyohs-aindex__totop.is-shown {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .28s ease, transform .28s ease, visibility 0s;
}

.wyohs-aindex__totop:hover,
.wyohs-aindex__totop:focus,
.wyohs-aindex__totop:active {
	background: #14293f;
}

.wyohs-aindex__totop:focus-visible {
	outline: 2px solid var(--wyohs-sand, #d2a56c);
	outline-offset: 3px;
}

.wyohs-aindex__totop-arrow {
	width: 9px;
	height: 9px;
	margin-top: 4px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	transform: rotate(-45deg);
}

.wyohs-aindex__totop-label {
	font-family: var(--wyohs-display, 'Arial Narrow', sans-serif);
	font-size: 12px;
	letter-spacing: 1.5px;
	line-height: 1;
	text-transform: uppercase;
}

/* The same theme dressing reaches the letter bar and the Show more button.
   Harmless there, but it flashes them blue and nudges them a pixel down on
   click, so it is turned off at matching specificity. */
.wyohs-aindex__letter:hover,
.wyohs-aindex__letter:focus,
.wyohs-aindex__letter:active,
.wyohs-aindex__morebtn:hover,
.wyohs-aindex__morebtn:focus,
.wyohs-aindex__morebtn:active {
	position: static;
	top: auto;
	background: transparent;
	border-color: transparent;
}

.wyohs-aindex__letter:hover,
.wyohs-aindex__letter:focus,
.wyohs-aindex__letter:active {
	color: var(--aindex-ink);
}

.wyohs-aindex__letter.is-active,
.wyohs-aindex__letter.is-active:hover,
.wyohs-aindex__letter.is-active:focus {
	color: var(--aindex-ink);
	border-bottom-color: var(--wyohs-sand, #d2a56c);
}

@media (max-width: 780px) {
	.wyohs-aindex__totop,
	.wyohs-aindex__totop:hover,
	.wyohs-aindex__totop:focus,
	.wyohs-aindex__totop:active {
		right: 16px;
		bottom: 16px;
	}
	.wyohs-aindex__totop { width: 54px; height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
	.wyohs-aindex__totop { transform: none; transition: opacity .01s linear, visibility 0s linear .01s; }
	.wyohs-aindex__totop.is-shown { transition: opacity .01s linear, visibility 0s; }
}
