/* The site's design for familyheritage.info: one responsive design for every screen.

   TNG prints the page's content itself, mostly as tables with fixed widths and inline styles;
   this stylesheet, loaded after TNG's genstyle.css, restyles that markup rather than changing
   it. The template's own header and footer are in topmenu.php and footer.php, the home page in
   index.php, and the few things CSS cannot do in js/template.js.

   Colours come from four variables. A page about one family branch sets them to that branch's
   colours (branches.php), so everything below follows the branch. */

/* The site's two fonts, Newsreader for headings and Public Sans for text, served from the site
   (fonts/, under the SIL Open Font License: OFL-*.txt) with the Latin and Latin Extended subsets
   that Google Fonts makes. Declared here, in a stylesheet in the page's head, the browser knows
   them before it draws anything; with font-display: block the browser holds back the text for
   up to three seconds while they load, rather than drawing it in Georgia and Arial (if they take
   longer, it draws the text in those and changes to the site's fonts when they arrive). */
@font-face {
	font-family: "Newsreader";
	font-style: normal;
	font-weight: 500 700;
	font-display: block;
	src: url(../fonts/newsreader-latin-ext.woff2) format("woff2");
	unicode-range:
		U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
		U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
		U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Newsreader";
	font-style: normal;
	font-weight: 500 700;
	font-display: block;
	src: url(../fonts/newsreader-latin.woff2) format("woff2");
	unicode-range:
		U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
		U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Public Sans";
	font-style: italic;
	font-weight: 100 900;
	font-display: block;
	src: url(../fonts/publicsans-italic-latin-ext.woff2) format("woff2");
	unicode-range:
		U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
		U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
		U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Public Sans";
	font-style: italic;
	font-weight: 100 900;
	font-display: block;
	src: url(../fonts/publicsans-italic-latin.woff2) format("woff2");
	unicode-range:
		U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
		U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Public Sans";
	font-style: normal;
	font-weight: 100 900;
	font-display: block;
	src: url(../fonts/publicsans-latin-ext.woff2) format("woff2");
	unicode-range:
		U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
		U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
		U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Public Sans";
	font-style: normal;
	font-weight: 100 900;
	font-display: block;
	src: url(../fonts/publicsans-latin.woff2) format("woff2");
	unicode-range:
		U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
		U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
	--fh-accent: #3b3f7e;
	--fh-accent-dark: #262a55;
	--fh-visited: #66698f;
	--fh-hover: #2a2d63;

	--fh-ink: #1b1d22;
	--fh-ink-2: #3b414a;
	--fh-muted: #5a616b;
	--fh-line: #d5dae1;
	--fh-paper: #f4f5f8;

	--fh-serif: "Newsreader", Georgia, serif;
	--fh-sans: "Public Sans", Arial, Helvetica, sans-serif;
	--fh-max: 1280px;
	--fh-gutter: 32px;
	--fh-label: 132px;
	--fh-date: 170px;

	/* How far down the window a sticky bar stops: below any header fixed to the top of the
	   screen. There is none (TNG's mobile site, whose header is fixed, is not used: begin.php) */
	--fh-stick-top: 0px;
}

@media screen and (max-width: 720px) {
	:root {
		--fh-gutter: 12px;
	}
}

/* Colours worked out from the four: a custom property is worked out where it is declared, so these
   are declared again wherever the four are set (a family's page sets them on the body, and the home
   page's family boxes inline), to follow that family rather than the site */
:root,
body,
[style*="--fh-accent"] {
	--fh-tint: color-mix(in srgb, var(--fh-accent) 13%, #ffffff);
	--fh-shade: color-mix(in srgb, var(--fh-accent) 8%, #ffffff);
}

/* ---------------------------------------------------------------- page */

html {
	overflow-x: clip;
	-webkit-text-size-adjust: 100%;
}

body.fh {
	margin: 0;
	background: #ffffff;
	color: var(--fh-ink);
	font-family: var(--fh-sans);
	font-size: 16px;
	line-height: 1.4;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

body.fh .normal,
body.fh .indleftcol,
body.fh td,
body.fh th,
body.fh input,
body.fh select,
body.fh textarea,
body.fh button {
	font-family: var(--fh-sans);
}

body.fh .normal {
	font-size: 15px;
}

body.fh .smaller {
	font-size: 13.5px;
}

body.fh img {
	max-width: 100%;
}

/* Except small icons in a table cell: a cell sized to its contents would shrink to nothing
   under max-width, squeezing the icon to a sliver (the event map's pins and Earth links), and
   Google's maps, whose controls hold images in boxes of no width (the Street View pegman was
   drawn as a blank white square) */
body.fh #mapevents img,
body.fh img[src$="earth.gif"],
body.fh img[src*="google_marker.php"],
body.fh .gm-style img {
	max-width: none;
}

/* The maps (the event map, the place page's map, and TNG's other maps), whether Leaflet's or
   Google's, keep their layers to themselves: Leaflet stacks its panes at 400 to 1000, which put
   them over the cards links show (z-index 200) */
body.fh #map,
body.fh .fh-place-map {
	isolation: isolate;
}

a:link,
a:active,
div.icons a {
	color: var(--fh-accent);
}

a:visited {
	color: var(--fh-visited);
}

a:hover {
	color: var(--fh-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.fh-wrap {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--fh-max);
	margin: 0 auto;
	padding: 0 var(--fh-gutter);
}

.fh-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.fh-skip {
	position: absolute;
	left: 8px;
	top: -60px;
	z-index: 100;
	background: #ffffff;
	padding: 8px 12px;
	border-radius: 4px;
}

.fh-skip:focus {
	top: 8px;
}

/* ---------------------------------------------------------------- header */

.fh-header {
	background: var(--fh-accent-dark);
	color: #ffffff;
}

.fh-bar {
	min-height: 60px;
	display: flex;
	align-items: center;
	gap: 6px 24px;
	flex-wrap: wrap;
}

/* A stripe of the four families' colours under the bar on every page, in the branches' order
   (topmenu.php); on a family's page the bar takes that family's colour, and the stripe stays */
.fh-stripe {
	display: flex;
	height: 5px;
}

.fh-stripe > span {
	flex: 1 1 0;
}

.fh-brand,
.fh-brand:link,
.fh-brand:visited {
	font-family: var(--fh-serif);
	font-size: 27px;
	font-weight: 600;
	color: #ffffff;
	text-decoration: none;
	white-space: nowrap;
}
/* The symbol is exactly as tall as Newsreader's capitals (0.67em) and stands on the baseline like a letter,
   so its top and bottom rails line up with the tops and feet of the capitals at any size */
.fh-brand svg {
	height: 0.67em;
	width: auto;
	vertical-align: baseline;
	margin-right: 0.35em;
	fill: none;
	stroke: currentColor;
	stroke-width: 9;
	stroke-linejoin: miter;
}

/* The site menu and the search box are popovers (topmenu.php), so on a phone their buttons open
   them without a script; on a wider screen they are part of the bar, without the popover's look */
:where(.fh-header) [popover] {
	position: static;
	inset: auto;
	width: auto;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	overflow: visible;
	color: inherit;
	background: none;
}

.fh-sitenav {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 6px 20px;
}

.fh-sitenav > a,
.fh-sitenav > a:link,
.fh-sitenav > a:visited,
.fh-menu > summary {
	font-size: 14.5px;
	font-weight: 500;
	color: #ffffff;
	text-decoration: none;
	white-space: nowrap;
}

/* Log in sits at the far end of the menu, beside the search box, with an editor's Edit button before it */
.fh-sitenav > .fh-login,
.fh-sitenav > .fh-edit-page {
	margin-left: auto;
}

.fh-sitenav > .fh-edit-page + .fh-login {
	margin-left: 0;
}

.fh-sitenav > .fh-edit-page::before {
	content: "\270E";
	margin-right: 5px;
}

.fh-header a:hover,
.fh-header a:focus-visible,
.fh-menu > summary:hover,
.fh-menu[open] > summary {
	color: #ffffff;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 5px;
}

/* The name search: a first name and a last name, each a white field, and the button */
.fh-search {
	flex: 0 1 330px;
	min-width: 240px;
	display: flex;
	align-items: center;
	gap: 6px;
}

body.fh .fh-search input[type="text"] {
	flex: 1 1 0;
	min-width: 0;
	height: 44px;
	box-sizing: border-box;
	border: none;
	border-radius: 4px;
	background: #ffffff;
	color: var(--fh-ink);
	padding: 0 10px;
	font-size: 15px;
}

.fh-search input::placeholder {
	color: var(--fh-muted);
}

.fh-search input:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}

.fh-search button {
	flex: none;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 4px;
	background: #ffffff;
	color: var(--fh-ink);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	cursor: pointer;
}

.fh-bar-buttons {
	display: none;
}

/* The template's own buttons, free of TNG's grey button style */
.fh-toggle,
.fh-search button {
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none;
	border: none;
	-webkit-tap-highlight-color: transparent;
}

/* Nor its pale grey while pressed (button:active in genstyle.css), which flashed on the bar */
.fh-toggle:active {
	background: rgba(255, 255, 255, 0.16);
	color: #ffffff;
	border: none;
}

.fh-search button:active {
	background: #ffffff;
	color: var(--fh-ink);
	border: none;
}

.fh-toggle {
	width: 44px;
	height: 44px;
	border: none;
	background: transparent;
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	cursor: pointer;
}

/* ---------------------------------------------------------------- the menu bar's drop-downs */

/* Families, Find, Media and Info (topmenu.php): each a <details>, so a tap or a click opens it
   without a script. The rows inside Find, Media and Info are TNG's own (tngddrow() in genlib.php). */
.fh-menu {
	position: relative;
}

.fh-menu > summary {
	display: inline-flex;
	align-items: center;
	min-height: 60px;
	list-style: none;
	cursor: pointer;
}

.fh-menu > summary::-webkit-details-marker {
	display: none;
}

.fh-menu > summary::after {
	content: "";
	width: 12px;
	height: 12px;
	margin-left: 3px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E")
		center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E")
		center / contain no-repeat;
}

.fh-menu[open] > summary::after {
	transform: rotate(180deg);
}

.fh-menu > ul {
	position: absolute;
	top: 100%;
	left: -14px;
	z-index: 50;
	min-width: 220px;
	max-height: calc(100vh - 70px);
	overflow-y: auto;
	margin: 0;
	padding: 4px 0;
	list-style: none;
	background: #ffffff;
	border: 1px solid var(--fh-line);
	border-top: 3px solid var(--fh-accent);
	border-radius: 0 0 4px 4px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

/* On the full-width bar an open menu's name becomes a white tab, joined to its list beneath:
   the tab (drawn behind the name, so the name does not move) is as far below the name as above
   it, and the list starts just under it, overlapping the bar, so it is not far from the name.
   The tab covers the list's top edge where they meet. The folded menu (below 1,000px) stacks
   the list under its name instead. */
@media (min-width: 1000px) {
	.fh-menu[open] > summary {
		position: relative;
		z-index: 51;
	}

	.fh-menu[open] > summary::before {
		content: "";
		position: absolute;
		inset: 12px -14px 12px;
		z-index: -1;
		background: #ffffff;
		border: 1px solid var(--fh-line);
		border-bottom: 0;
		border-radius: 4px 4px 0 0;
	}

	.fh-header .fh-menu[open] > summary {
		color: var(--fh-accent-dark);
		text-decoration: none;
	}

	.fh-menu[open] > ul {
		top: calc(100% - 13px);
		border-top-width: 1px;
		border-top-color: var(--fh-line);
		border-radius: 0 4px 4px 4px;
	}
}

.fh-menu li {
	margin: 0;
}

.fh-header .fh-menu li a,
.fh-header .fh-menu li a:link,
.fh-header .fh-menu li a:visited {
	display: block;
	padding: 7px 14px;
	font-size: 14.5px;
	font-weight: 400;
	color: var(--fh-ink);
	text-decoration: none;
	white-space: nowrap;
}

.fh-header .fh-menu li a:hover,
.fh-header .fh-menu li a:focus-visible {
	background: var(--fh-tint);
	color: var(--fh-accent-dark);
	text-decoration: none;
}

/* TNG's rows carry an icon and a padded label; the icons are not used */
.fh-menu .menu-label {
	display: inline;
	padding: 0 !important;
}

.fh-menu .menu-icon {
	display: none;
}

/* The four families, each with a bar in its colour, linking to its box on the home page */
.fh-header .fh-menu li a[style*="--fh-key"] {
	box-shadow: inset 4px 0 0 var(--fh-key);
	padding-left: 18px;
	font-weight: 600;
}

/* ---------------------------------------------------------------- page */

.fh-main {
	flex: 1 0 auto;
	box-sizing: border-box;
	width: 100%;
	max-width: var(--fh-max);
	margin: 0 auto;
	padding: 0 var(--fh-gutter) 8px;
}

/* ---------------------------------------------------------------- headings and the title band */

body.fh .header,
body.fh .plainheader {
	color: var(--fh-accent-dark);
	font-family: var(--fh-serif);
	font-weight: 600;
}

body.fh h2.header,
body.fh h3.header,
body.fh h2,
body.fh h3 {
	font-family: var(--fh-serif);
	font-weight: 600;
	color: var(--fh-accent-dark);
	line-height: 1.15;
}

body.fh h2.header,
body.fh h2 {
	font-size: 28px;
	margin: 28px 0 10px;
}

/* ------------------------------------------------------------- a media item's page */

/* A media item's page (showmedia.php, built by media_page.php): the item under its heading, the
   line stepping through a place's media, then what it is in sentences, what it says and its notes */
body.fh-page-showmedia .fh-viewer,
body.fh-page-showmedia .fh-pdf,
body.fh-page-showsource .fh-viewer,
body.fh-page-showsource .fh-pdf {
	margin-bottom: 14px;
}

/* "‹ Previous · 3 of 12 from Roxwell, Essex · Next ›", for an item opened from a place: the
   count in the middle, the two links at the ends, wrapping to two rows on a phone */
.fh-media-steps {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px 18px;
	margin: 0 0 22px;
	padding: 10px 0;
	border-top: 1px solid var(--fh-line);
	border-bottom: 1px solid var(--fh-line);
	font-size: 15px;
}

.fh-media-count {
	color: var(--fh-ink-2);
	text-align: center;
}

.fh-media-prev,
.fh-media-next {
	min-width: 6em;
	font-weight: 600;
	white-space: nowrap;
}

.fh-media-next {
	text-align: right;
}

@media screen and (max-width: 720px) {
	.fh-media-count {
		order: -1;
		flex: 1 1 100%;
	}
}

/* For an item the visitor may not see: why it is not shown */
.fh-media-withheld {
	margin: 0 0 20px;
	font-size: 17px;
	max-width: 60ch;
}

/* An item the page can't show in place (a Word document, one kept on another site): its link */
.fh-media-open {
	margin: 0 0 20px;
	font-size: 17px;
	font-weight: 600;
}

body.fh-page-showmedia .fh-media-av,
body.fh-page-showsource .fh-media-av {
	display: block;
	max-width: 100%;
	margin: 0 0 20px;
}

body.fh-page-showmedia .fh-media-text,
body.fh-page-showsource .fh-media-text {
	margin: 0 0 20px;
	padding: 14px 16px;
	background: var(--fh-paper);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	font-size: 15px;
}

/* The quiet download link under the sentences */
.fh-section > p.fh-media-download {
	font-size: 14px;
}

/* What it says: the transcription as it was written, with its table where it has one */
.fh-media-body {
	max-width: 78ch;
	font-size: 16px;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

.fh-media-body table.transcript {
	display: block;
	max-width: 100%;
	overflow-x: auto;
}

/* ------------------------------------------------------------- a source's page */

/* A source's page (showsource.php, built by source_page.php): the record's heading, the strip of
   its pages, the current image and its own section, then what the record is. The strip is a row
   of small copies, in a <nav>; the current page is outlined in the page's colour. On a phone the
   row scrolls within itself, never the page. */
.fh-source-strip {
	display: flex;
	align-items: center;
	gap: 6px 14px;
	margin: 0 0 14px;
}

.fh-source-pages {
	display: flex;
	gap: 8px;
	flex: 0 1 auto;
	min-width: 0;
	margin: 0;
	padding: 4px;
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scrollbar-width: thin;
}

.fh-source-pages li {
	flex: none;
	margin: 0;
	padding: 0;
}

.fh-source-pages li[hidden] {
	display: none;
}

.fh-source-pages a {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 72px;
	min-width: 48px;
	border: 1px solid var(--fh-line);
	background: var(--fh-paper);
	text-decoration: none;
}

.fh-source-pages img {
	display: block;
	height: 100%;
	width: auto;
	max-width: 110px;
	object-fit: cover;
}

.fh-source-pages a[aria-current] {
	outline: 3px solid var(--fh-accent);
	outline-offset: 1px;
}

.fh-source-pages a:focus-visible {
	outline: 3px solid var(--fh-accent-dark);
	outline-offset: 1px;
}

.fh-source-noimg {
	padding: 0 12px;
	color: var(--fh-ink-2);
	font-size: 15px;
}

/* "+5 more" at either end, which shows the rest of the pages */
.fh-source-pages .fh-source-more a {
	padding: 0 12px;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	background: none;
}

/* ‹ and ›, which the script adds at the strip's ends */
.fh-source-step {
	flex: none;
	width: 36px;
	height: 72px;
	border: 1px solid var(--fh-line);
	background: none;
	color: var(--fh-accent);
	font: inherit;
	font-size: 24px;
	cursor: pointer;
}

.fh-source-step:disabled {
	color: var(--fh-line);
	cursor: default;
}

.fh-source-count {
	flex: none;
	margin: 0;
	color: var(--fh-ink-2);
	font-size: 15px;
	white-space: nowrap;
}

.fh-source-page h3 {
	margin: 18px 0 6px;
	font-family: var(--fh-serif);
	font-size: 20px;
}

@media screen and (max-width: 720px) {
	.fh-source-strip {
		flex-wrap: wrap;
	}

	.fh-source-count {
		flex-basis: 100%;
		order: -1;
	}

	.fh-source-pages a,
	.fh-source-step {
		height: 60px;
	}
}

/* Printed: the current image and the record's sentences, without the strip or the download link */
@media print {
	.fh-source-strip {
		display: none !important;
	}

	.fh-source-about p,
	.fh-source-page p {
		break-inside: avoid;
	}
}

/* A media page's picture (fh_imgviewer.php, js/fh-imgviewer.js): fitted to the page's width and
   the window's height, in a pale frame that the zoomed picture fills, with controls like the
   maps'. Without scripts it is just the fitted picture. */
body.fh .fh-viewer {
	margin: 0 0 20px;
}

body.fh .fh-viewer-frame {
	position: relative;
	overflow: hidden;
	display: flex;
	justify-content: center;
	align-items: center;
	background: var(--fh-paper);
	/* One finger scrolls the page while the picture fits; two pinch it */
	touch-action: pan-x pan-y;
	-webkit-user-select: none;
	user-select: none;
}

body.fh .fh-viewer-zoomed .fh-viewer-frame {
	touch-action: none;
	cursor: grab;
}

body.fh .fh-viewer-dragging .fh-viewer-frame {
	cursor: grabbing;
}

body.fh .fh-viewer-frame:focus {
	outline: none;
}

body.fh .fh-viewer-frame:focus-visible {
	outline: 2px solid var(--fh-accent);
	outline-offset: 2px;
}

body.fh .fh-viewer-pic {
	position: relative;
	flex: none;
	max-width: 100%;
	line-height: 0;
	transform-origin: 0 0;
}

body.fh .fh-viewer-pic.fh-viewer-animate {
	transition: transform 0.25s ease;
}

body.fh .fh-viewer-img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 80vh;
	-webkit-user-drag: none;
}

/* The image tags: a box over each person, named below it at one size whatever the zoom; hidden
   until the pointer is over them, or all shown by Toggle Tags */
body.fh .fh-viewer-tag {
	position: absolute;
	box-sizing: border-box;
	border: 1px solid #ccc;
	border-radius: 5px;
	box-shadow: 2px 2px 3px 0 #333;
	opacity: 0;
	transition: opacity 0.15s;
}

body.fh .fh-viewer-tag:hover,
body.fh .fh-viewer-tag:focus-visible,
body.fh .fh-viewer-tag.fh-viewer-tagshown {
	opacity: 1;
}

body.fh .fh-viewer-tagson .fh-viewer-tag {
	opacity: 0.85;
}

body.fh .fh-viewer-label {
	position: absolute;
	top: 100%;
	left: 50%;
	margin-top: 2px;
	padding: 3px 7px;
	border-radius: 5px;
	background: rgba(0, 0, 0, 0.65);
	color: #fff;
	font: 13px/1.3 var(--fh-sans);
	white-space: nowrap;
	transform: translateX(-50%) scale(calc(1 / var(--fh-viewer-scale, 1)));
	transform-origin: 50% 0;
}

/* The controls, as the maps': + and - in one white box in the bottom right corner, the button
   that fits the picture again above them (shown once zoomed in), full screen top right */
body.fh .fh-viewer-zoom,
body.fh .fh-viewer-reset,
body.fh .fh-viewer-full {
	position: absolute;
	right: 10px;
	z-index: 2;
	background: #fff;
	border-radius: 2px;
	box-shadow: rgba(0, 0, 0, 0.3) 0 1px 4px -1px;
}

body.fh .fh-viewer-zoom {
	bottom: 10px;
	display: flex;
	flex-direction: column;
}

body.fh .fh-viewer-zoom button {
	position: relative;
}

body.fh .fh-viewer-zoom button,
body.fh .fh-viewer-reset,
body.fh .fh-viewer-full {
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 2px;
	background: #fff;
	color: #666;
	font:
		300 26px/40px Roboto,
		Arial,
		sans-serif;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

body.fh .fh-viewer-zoom button:hover,
body.fh .fh-viewer-reset:hover,
body.fh .fh-viewer-full:hover {
	color: #333;
}

body.fh .fh-viewer-zoom button:disabled {
	color: #ccc;
	cursor: default;
}

body.fh .fh-viewer-in::after {
	content: "";
	position: absolute;
	left: 8px;
	right: 8px;
	bottom: 0;
	height: 1px;
	background: #e6e6e6;
}

body.fh .fh-viewer-reset {
	bottom: 100px;
}

body.fh .fh-viewer-reset:disabled {
	display: none;
}

body.fh .fh-viewer-full {
	top: 10px;
}

/* "Show names", for a picture with image tags, top left */
body.fh .fh-viewer-names {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	margin: 0;
	padding: 0 12px;
	height: 32px;
	border: 0;
	border-radius: 2px;
	background: #fff;
	color: #444;
	font: 600 13px/32px var(--fh-sans);
	box-shadow: rgba(0, 0, 0, 0.3) 0 1px 4px -1px;
	cursor: pointer;
}

body.fh .fh-viewer-names[aria-pressed="true"] {
	background: var(--fh-accent);
	color: #fff;
}

/* The message shown when the page scrolls over the picture, as over the maps */
body.fh .fh-viewer-hint {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 20px;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	font:
		22px Roboto,
		Arial,
		sans-serif;
	text-align: center;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.3s;
}

body.fh .fh-viewer-hint.fh-viewer-on {
	opacity: 1;
	transition: opacity 0.1s;
}

/* Full screen: the picture fits the screen, on black */
body.fh .fh-viewer.fh-viewer-fullscreen {
	margin: 0;
	background: #111;
}

body.fh .fh-viewer-fullscreen .fh-viewer-frame {
	width: 100%;
	height: 100%;
	background: #111;
}

body.fh .fh-viewer-fullscreen .fh-viewer-img {
	max-height: 100vh;
}

body.fh h3.header,
body.fh h3 {
	font-size: 24px;
	margin: 30px 0 10px;
}

body.fh .subhead {
	font-family: var(--fh-serif);
	font-size: 20px;
	color: var(--fh-accent-dark);
}

/* A page's main heading sits in a band of the accent colour across the whole window. The band
   is drawn by each element's own shadow, so the heading and anything TNG prints with it (a
   person's dates, the Individual/Ancestors tabs) join up whatever markup comes between them. */
.fh-main h1.header,
.fh-main .fh-band {
	box-shadow: 0 0 0 100vmax var(--fh-accent);
	clip-path: inset(0 -100vmax);
	background: var(--fh-accent);
	color: #ffffff;
}

.fh-main h1.header {
	margin: 0 0 18px;
	padding: 16px 0;
	font-size: 48px;
	line-height: 1;
	letter-spacing: -0.01em;
}

.fh-main h1.header .headericon {
	display: none;
}

.fh-main h1.header + br[clear] {
	display: none;
}

/* A media item's category, a small label in the band above its title (showmedia.php) */
.fh-main .fh-story-eyebrow.fh-band {
	margin: 0;
	padding-top: 16px;
	color: rgba(255, 255, 255, 0.85);
}

.fh-main .fh-story-eyebrow.fh-band + h1.header,
.fh-main .fh-story-eyebrow.fh-band + .fh-namebar {
	padding-top: 6px;
}

/* ---------------------------------------------------------------- a person's heading and tabs */

.fh-main .vcard {
	display: flow-root;
}

/* The name, with the sex and years on the right (js/template.js puts them in one line,
   .fh-namebar; without it they are two lines of the band) */
.fh-main .fh-namebar {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 2px 18px;
	/* Room under the name, so the band does not end at its descenders; less where a gallery
	   follows in the same band */
	padding-top: 16px;
	padding-bottom: 14px;
}

.fh-main #nameheader {
	margin: 0 !important;
	padding: 16px 0 0;
	box-shadow: none;
	clip-path: none;
}

.fh-main .fh-namebar #nameheader {
	padding: 0;
	background: none;
}

.fh-main #nameheader + .normal {
	box-shadow: 0 0 0 100vmax var(--fh-accent);
	clip-path: inset(-1px -100vmax 0);
	background: var(--fh-accent);
	color: #ffffff;
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: var(--fh-serif);
	font-size: 30px;
	font-weight: 500;
	font-variant-numeric: lining-nums;
	line-height: 1.1;
}

.fh-main .fh-namebar #nameheader + .normal {
	box-shadow: none;
	clip-path: none;
	background: none;
}

.fh-main #nameheader + .normal br,
.fh-main .vcard > br,
.fh-main .fh-namebar + br {
	display: none;
}

.fh-main .fh-namebar .normal a:link,
.fh-main .fh-namebar .normal a:visited {
	color: rgba(255, 255, 255, 0.9);
	font-family: var(--fh-sans);
	font-size: 13px;
}

.fh-main .fh-namebar .normal .menu-icon {
	display: none;
}

.fh-main .fh-sex {
	font-family: var(--fh-sans);
	font-size: 11px;
	line-height: 1.3;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	border: 1px solid rgba(255, 255, 255, 0.55);
	border-radius: 3px;
	padding: 1px 5px;
}

/* A person's photo, beside the name in the band */
.fh-main .vcard .defphoto,
.fh-main > .defphoto {
	float: right;
	margin: 12px 0 0 18px;
	position: relative;
	z-index: 1;
}

.fh-main .defphoto img {
	display: block;
	max-height: 96px;
	width: auto;
	border: 2px solid #ffffff;
	border-radius: 3px;
}

/* For someone signed in, the relationship line and the links to choose the home person, in the
   band (getperson.php and fh_reldisplay.php) */
.fh-main .fh-relmenu,
.fh-main #reldisplay {
	display: block;
	box-shadow: 0 0 0 100vmax var(--fh-accent);
	clip-path: inset(-1px -100vmax 0);
	background: var(--fh-accent);
	padding-top: 8px;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.85);
}

.fh-main .fh-relmenu:empty {
	display: none;
}

.fh-main .fh-relmenu a.relicon:link,
.fh-main .fh-relmenu a.relicon:visited,
.fh-main #reldisplay a {
	color: rgba(255, 255, 255, 0.85);
}

.fh-main .fh-relmenu a.relicon img,
.fh-main .fh-relmenu a[title^="Tips For Setting"] {
	display: none;
}

/* The relationship display's close button: a round x in place of TNG's red icon, centred on
   the line of text */
.fh-main #reldisplay a:has(> img.relmenuicon[src*="tng_delete"]) {
	display: inline-block;
	width: 18px;
	height: 18px;
	margin-right: 4px;
	vertical-align: middle;
	border: 1px solid rgba(255, 255, 255, 0.55);
	border-radius: 50%;
	box-sizing: border-box;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1 1l6 6M7 1L1 7' stroke='white' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E")
		center / 8px 8px no-repeat;
}

.fh-main #reldisplay a:has(> img.relmenuicon[src*="tng_delete"]):hover {
	border-color: #ffffff;
	background-color: rgba(255, 255, 255, 0.15);
}

.fh-main #reldisplay img.relmenuicon {
	display: none;
}

.fh-main #reldisplay a.relicon {
	white-space: nowrap;
	font-size: inherit;
	text-decoration: underline;
}

.fh-main form:has(> #tngmenu) {
	margin: 0;
}

/* The tabs' band reaches the window's edges through a layer behind it, so that the More menu's
   list can open below it (a clip on the tabs themselves would cut the list off). The layer is
   the tabs' own width and reaches the edges with a clipped shadow, as the other bands do: a
   shadow never makes the page wider, where a layer stretched past the edges made a phone's
   page scroll sideways */
#tngmenu {
	position: relative;
	z-index: 5;
	isolation: isolate;
	background: var(--fh-accent);
	padding-top: 12px;
	overflow: visible;
	clear: both;
	margin-bottom: 0;
}

#tngmenu::before {
	content: "";
	position: absolute;
	z-index: -1;
	top: -1px;
	bottom: 0;
	left: 0;
	right: 0;
	background: var(--fh-accent);
	box-shadow: 0 0 0 100vmax var(--fh-accent);
	clip-path: inset(0 -100vmax);
}

/* "More" (genlib.php writes the tabs again in it): on a narrower screen it takes the
   tabs that do not fit, keeping the current page's tab in the strip */
#tngnav > li.fh-more {
	display: none;
	position: relative;
}

.fh-more > details > summary {
	display: flex;
	align-items: center;
	gap: 3px;
	min-height: 100%;
	box-sizing: border-box;
	padding: 8px 13px;
	border-radius: 6px 6px 0 0;
	color: #ffffff;
	font-size: 14.5px;
	font-weight: 600;
	list-style: none;
	cursor: pointer;
	white-space: nowrap;
}

.fh-more > details > summary::-webkit-details-marker {
	display: none;
}

.fh-more > details > summary::after {
	content: "";
	width: 11px;
	height: 11px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E")
		center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E")
		center / contain no-repeat;
}

.fh-more > details > summary:hover,
.fh-more > details[open] > summary {
	background: rgba(255, 255, 255, 0.2);
}

.fh-more > details > ul {
	position: absolute;
	left: 0;
	max-width: calc(100vw - 24px);
	top: 100%;
	z-index: 30;
	min-width: 190px;
	margin: 0;
	padding: 4px 0;
	list-style: none;
	background: #ffffff;
	border: 1px solid var(--fh-line);
	border-top: 3px solid var(--fh-accent);
	border-radius: 0 0 4px 4px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

#tngnav .fh-more ul a,
#tngnav .fh-more ul a:link,
#tngnav .fh-more ul a:visited {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 0 14px !important;
	border-radius: 0;
	background: none;
	color: var(--fh-ink);
	font-size: 15px;
	font-weight: 500;
	white-space: nowrap;
}

#tngnav .fh-more ul a:hover {
	background: var(--fh-tint);
	color: var(--fh-accent-dark);
}

/* How many tabs stay in the strip: four below 860px, two on a phone, one on a very narrow one (360px),
   with the current page's tab always; More shows when there are tabs left over (genlib.php writes no More
   for two tabs or fewer, and then none is hidden) */
@media (max-width: 860px) {
	ul#tngnav:not(.fh-fit) {
		flex-wrap: nowrap;
	}

	#tngnav:not(.fh-fit):has(> li.fh-more) > li:nth-child(n + 5):not(.fh-more):not(:has(> a.here)) {
		display: none;
	}

	#tngnav:not(.fh-fit):has(> li:nth-child(6)) > li.fh-more {
		display: block;
	}

	#tngnav:not(.fh-fit) .fh-more ul > li:nth-child(-n + 4) {
		display: none;
	}

	/* More can be near the screen's right-hand edge, so its list opens leftwards, lined up with
	   More's right-hand end */
	#tngnav:not(.fh-fit) .fh-more > details > ul {
		left: auto;
		right: 0;
	}
}

@media screen and (max-width: 720px) {
	#tngnav:not(.fh-fit):has(> li.fh-more) > li:nth-child(n + 3):not(.fh-more):not(:has(> a.here)) {
		display: none;
	}

	#tngnav:not(.fh-fit):has(> li:nth-child(4)) > li.fh-more {
		display: block;
	}

	#tngnav:not(.fh-fit) .fh-more ul > li:nth-child(n + 3) {
		display: block;
	}

	#tngnav:not(.fh-fit) .fh-more ul > li:nth-child(-n + 2) {
		display: none;
	}
}

@media (max-width: 360px) {
	#tngnav:not(.fh-fit):has(> li.fh-more) > li:nth-child(n + 2):not(.fh-more):not(:has(> a.here)) {
		display: none;
	}

	#tngnav:not(.fh-fit):has(> li:nth-child(3)) > li.fh-more {
		display: block;
	}

	#tngnav:not(.fh-fit) .fh-more ul > li:nth-child(n + 2) {
		display: block;
	}

	#tngnav:not(.fh-fit) .fh-more ul > li:nth-child(-n + 1) {
		display: none;
	}

	/* With one tab More is too near the left for that, so its list lines up with the strip's
	   right-hand end instead */
	#tngnav:not(.fh-fit) > li.fh-more {
		position: static;
	}
}

/* The current page's tab is in the strip, so not in More */
#tngnav .fh-more ul > li:has(> a.here) {
	display: none !important;
}

/* The breakpoints above are for a page without scripts. js/template.js measures the strip
   instead (fh-fit): it keeps every tab that fits, and hides the rest from the end, keeping the
   current page's tab, showing them in More instead */
ul#tngnav.fh-fit {
	flex-wrap: nowrap;
}

#tngnav.fh-fit > li.fh-more {
	display: block;
}

#tngnav.fh-fit li[hidden] {
	display: none !important;
}

/* More in the right-hand half of the strip opens leftwards, lined up with its right-hand end */
#tngnav.fh-fit > li.fh-more-end > details > ul {
	left: auto;
	right: 0;
}

ul#tngnav {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	margin: 0;
	padding: 0;
}

#tngnav li {
	float: none;
	margin: 0;
}

#tngnav a,
#tngnav a:link,
#tngnav a:visited {
	padding: 8px 13px !important;
	min-height: 0;
	border: none;
	border-radius: 6px 6px 0 0;
	background: none;
	color: #ffffff;
	font-size: 14.5px;
	font-weight: 600;
	text-decoration: none;
}

#tngnav a span[id$="-smicon"] {
	display: none;
}

#tngnav a:hover,
#tngnav a:focus-visible {
	background: rgba(255, 255, 255, 0.2);
	color: #ffffff;
}

#tngnav a.here,
#tngnav a.here:hover {
	background: #ffffff;
	color: var(--fh-accent-dark);
	font-weight: 700;
	padding: 8px 13px !important;
	border: none;
}

/* The links under the tabs (Personal Information, Media, Sources...), plain on white */
#pub-innermenu {
	display: flex;
	flex-wrap: wrap;
	gap: 0 16px;
	margin: 0 0 4px;
	padding: 8px 0 10px;
	background: none;
	border: none;
	filter: none;
	border-radius: 0;
	font-size: 0;
	color: transparent;
}

#pub-innermenu > div[style*="float"] {
	order: 2;
	margin-left: auto;
}

#pub-innermenu a,
#pub-innermenu a:link,
#pub-innermenu a:visited {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--fh-accent);
	text-decoration: none;
}

#pub-innermenu a.lightlink3 {
	color: var(--fh-accent-dark);
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

#pub-innermenu a:hover {
	color: var(--fh-hover);
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

#pub-innermenu + br {
	display: none;
}

/* The generations select: TNG's "Generations:" is plain text, hidden with the "|" separators,
   so the stylesheet writes the label (closing up the gaps either side of the hidden text) */
#pub-innermenu:has(> select[name="generations"])::before {
	content: "Generations";
	align-self: center;
	margin-right: -26px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--fh-muted);
}

#pub-innermenu > select[name="generations"] {
	align-self: center;
}

body.fh #pub-innermenu select {
	margin: 0;
	padding: 2px 24px 2px 6px;
	height: auto;
	font-family: var(--fh-sans);
	font-size: 13.5px;
	box-shadow: none;
	background-color: #ffffff;
	background-position: right 6px center;
}

/* An administrator's buttons for adding media, parents or a spouse: at the end of the links under
   the tabs, or on a person's page (which has no such links) in a row of their own */
.fh-adds {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 6px;
	margin: 10px 0 4px;
}

.fh-adds a.fh-add {
	text-decoration: none;
}

#pub-innermenu a.fh-add,
#pub-innermenu a.fh-add:link,
#pub-innermenu a.fh-add:visited,
.fh-adds a.fh-add,
.fh-adds a.fh-add:link,
.fh-adds a.fh-add:visited {
	align-self: center;
	padding: 2px 9px;
	border: 1px solid var(--fh-line);
	border-radius: 4px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--fh-muted);
	background: #ffffff;
}

#pub-innermenu :not(.fh-add) + a.fh-add {
	margin-left: auto;
}

#pub-innermenu a.fh-add::before,
.fh-adds a.fh-add::before {
	content: "+";
	margin-right: 4px;
}

#pub-innermenu a.fh-add:hover,
.fh-adds a.fh-add:hover {
	color: var(--fh-accent-dark);
	border-color: var(--fh-accent);
	text-decoration: none;
}

/* The links under the tabs keep to one line too: js/template.js moves the ones that do not fit
   (from the end, keeping the one in use) into a More of their own, after the others */
#pub-innermenu.fh-fit {
	flex-wrap: nowrap;
	position: relative;
	z-index: 4;
}

#pub-innermenu.fh-fit > * {
	flex: none;
	white-space: nowrap;
}

#pub-innermenu > details.fh-inmore {
	order: 1;
	align-self: center;
	position: relative;
}

#pub-innermenu > details.fh-inmore[hidden] {
	display: none;
}

.fh-inmore > summary {
	display: flex;
	align-items: center;
	gap: 3px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--fh-accent);
	list-style: none;
	cursor: pointer;
	white-space: nowrap;
}

.fh-inmore > summary::-webkit-details-marker {
	display: none;
}

.fh-inmore > summary::after {
	content: "";
	width: 11px;
	height: 11px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E")
		center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E")
		center / contain no-repeat;
}

.fh-inmore > summary:hover,
.fh-inmore[open] > summary {
	color: var(--fh-hover);
}

.fh-inmore > div {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 30;
	display: flex;
	flex-direction: column;
	min-width: 190px;
	max-width: calc(100vw - 24px);
	margin-top: 6px;
	padding: 4px 0;
	background: #ffffff;
	border: 1px solid var(--fh-line);
	border-top: 3px solid var(--fh-accent);
	border-radius: 0 0 4px 4px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.fh-inmore.fh-inmore-end > div {
	left: auto;
	right: 0;
}

#pub-innermenu .fh-inmore > div > a,
#pub-innermenu .fh-inmore > div > a:link,
#pub-innermenu .fh-inmore > div > a:visited,
#pub-innermenu .fh-inmore > div > a.fh-add,
#pub-innermenu .fh-inmore > div > a.fh-add:link,
#pub-innermenu .fh-inmore > div > a.fh-add:visited {
	display: flex;
	align-items: center;
	align-self: stretch;
	min-height: 44px;
	margin: 0;
	padding: 0 14px;
	border: none;
	border-radius: 0;
	background: none;
	color: var(--fh-ink);
	font-size: 15px;
	font-weight: 500;
	white-space: nowrap;
	text-decoration: none;
}

#pub-innermenu .fh-inmore > div > a.lightlink3 {
	color: var(--fh-accent-dark);
	font-weight: 700;
}

#pub-innermenu .fh-inmore > div > a:hover {
	background: var(--fh-tint);
	color: var(--fh-accent-dark);
	text-decoration: none;
}

/* ---------------------------------------------------------------- tables */

.whiteback {
	border: 1px solid var(--fh-line);
	background-color: #ffffff;
	border-collapse: collapse;
}

.tfixed,
.thfixed,
.dna-tfixed {
	border-radius: 0;
	box-shadow: none;
}

.tfixed tr td,
.thfixed tr th,
.thfixed tr td {
	border-radius: 0 !important;
}

.fieldnameback,
.tablesaw-cell-label {
	background-color: var(--fh-tint);
	border: none;
	border-top: 1px solid var(--fh-line);
	padding: 8px 10px;
	text-align: right;
	vertical-align: top;
}

.fieldnameback .fieldname,
.fieldname {
	color: var(--fh-accent-dark);
	font-size: 13.5px;
	font-weight: 700;
}

body.fh .fieldnameback a.lightlink:link,
body.fh .fieldnameback a.lightlink:visited,
body.fh th.fieldnameback a:link,
body.fh th.fieldnameback a:visited {
	color: var(--fh-accent-dark);
}

.databack,
.databackalt {
	background-color: #ffffff;
	border: none;
	border-top: 1px solid var(--fh-line);
	padding: 7px 12px 8px;
	vertical-align: top;
	font-size: 16px;
}

.databackalt {
	background-color: var(--fh-paper);
}

.labelcol {
	width: var(--fh-label);
}

.tfixed col[style*="150px"] {
	width: var(--fh-date) !important;
}

.whiteback + br,
.tfixed + br {
	display: block;
	content: "";
	margin-top: 12px;
}

th.fieldnameback {
	text-align: left;
	border-top: none;
	border-bottom: 2px solid var(--fh-accent);
	white-space: nowrap;
}

.thfixed {
	border-top: 2px solid var(--fh-accent);
}

/* Citation numbers [1, 2] as small chips; the brackets and commas are hidden */
.fh-cite {
	font-size: 0;
	white-space: normal;
}

.fh-cite a,
.fh-cite a:link,
.fh-cite a:visited {
	display: inline-block;
	font-size: 12px;
	line-height: 1.5;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	text-decoration: none;
	background: var(--fh-tint);
	color: var(--fh-accent-dark);
	border-radius: 3px;
	padding: 0 5px;
	margin: 1px 0;
}

.fh-cite a + a {
	margin-left: 3px;
}

.fh-cite a:hover {
	background: var(--fh-accent);
	color: #ffffff;
}

/* The Geocode Assist globe after a place with no coordinates (shown to administrators):
   a line-drawn map pin in the link's colour, in place of TNG's shiny globe */
img[src$="img/globe.gif"] {
	display: none;
}

a:has(> img[src$="img/globe.gif"])::before {
	content: "";
	display: inline-block;
	width: 13px;
	height: 13px;
	vertical-align: -2px;
	background: var(--fh-accent);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4'%3E%3Cpath d='M8 15s-5-5.1-5-8.6a5 5 0 0 1 10 0C13 9.9 8 15 8 15z'/%3E%3Ccircle cx='8' cy='6.4' r='1.8'/%3E%3C/svg%3E")
		center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4'%3E%3Cpath d='M8 15s-5-5.1-5-8.6a5 5 0 0 1 10 0C13 9.9 8 15 8 15z'/%3E%3Ccircle cx='8' cy='6.4' r='1.8'/%3E%3C/svg%3E")
		center / contain no-repeat;
}

a:has(> img[src$="img/globe.gif"]):hover::before {
	background: var(--fh-hover);
}

/* TNG's small magnifier after a place: find everyone with events there */
img[src$="tng_search_small.gif"] {
	width: 11px !important;
	height: 11px !important;
	opacity: 0.55;
	vertical-align: 0;
}

/* Years made bold by js/template.js */
.fh-year {
	font-weight: 700;
}

/* ---------------------------------------------------------------- the person page */

/* A person's histories (fh_story.php), under the tabs and above the facts: a cover beside the
   title, what it is, who wrote it, and a button to read it. Several sit side by side. */
.fh-stories {
	display: grid;
	gap: 16px;
	margin: 22px 0 8px;
}

@media (min-width: 1000px) {
	.fh-stories-many {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.fh-story {
	display: grid;
	grid-template-columns: 128px minmax(0, 1fr);
	gap: 28px;
	align-items: center;
	padding: 24px 28px;
	background: var(--fh-shade);
	border-radius: 6px;
}

/* The cover: the item's thumbnail, or a title page in the site's type, with a second sheet behind */
.fh-story-cover {
	display: block;
	text-decoration: none;
}

.fh-story-cover img,
.fh-story-page {
	display: block;
	width: 100%;
	box-shadow:
		5px 5px 0 -1px #ffffff,
		5px 5px 0 0 var(--fh-line),
		0 1px 4px rgba(0, 0, 0, 0.14);
	transition: transform 0.15s ease;
}

.fh-story-page {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	aspect-ratio: 3 / 4;
	padding: 16px 12px 10px;
	background: #ffffff;
	border-top: 4px solid var(--fh-accent);
}

.fh-story-pagetitle {
	font-family: var(--fh-serif);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--fh-accent-dark);
	overflow: hidden;
}

.fh-story-pagedate {
	margin-top: auto;
	padding-top: 6px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--fh-muted);
}

.fh-story-cover:hover img,
.fh-story-cover:hover .fh-story-page {
	transform: translateY(-2px);
}

.fh-story-text > p {
	margin: 0;
}

.fh-story-eyebrow {
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fh-accent);
}

body.fh h2.fh-story-title {
	margin: 4px 0 10px;
	font-size: 30px;
}

h2.fh-story-title a,
h2.fh-story-title a:visited {
	color: inherit;
	text-decoration: none;
}

h2.fh-story-title a:hover,
h2.fh-story-title a:focus-visible {
	text-decoration: underline;
}

.fh-story-text > p.fh-story-notes {
	margin-bottom: 8px;
	font-size: 17px;
	line-height: 1.5;
	color: var(--fh-ink-2);
}

.fh-story-text > p.fh-story-byline {
	margin-bottom: 16px;
	font-size: 14px;
	color: var(--fh-muted);
}

.fh-story-read {
	display: flex;
	align-items: center;
	gap: 10px;
}

a.fh-story-button,
a.fh-story-button:link,
a.fh-story-button:visited {
	padding: 8px 18px;
	border-radius: 4px;
	background: var(--fh-accent);
	color: #ffffff;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}

a.fh-story-button::after {
	content: "\2192";
	margin-left: 8px;
}

a.fh-story-button:hover,
a.fh-story-button:focus-visible {
	background: var(--fh-hover);
	text-decoration: none;
}

.fh-story-format {
	padding: 1px 6px;
	border: 1px solid var(--fh-line);
	border-radius: 3px;
	background: #ffffff;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--fh-muted);
}

@media screen and (max-width: 720px) {
	.fh-story {
		grid-template-columns: 76px minmax(0, 1fr);
		gap: 16px;
		align-items: start;
		padding: 16px;
	}

	.fh-story-page {
		padding: 8px 6px 6px;
		border-top-width: 3px;
	}

	.fh-story-pagetitle {
		font-size: 8.5px;
	}

	.fh-story-pagedate {
		font-size: 7px;
	}

	body.fh h2.fh-story-title {
		font-size: 22px;
	}

	.fh-story-text > p.fh-story-notes {
		font-size: 15.5px;
	}
}

/* A PDF on its media page (fh_pdfviewer.php, js/fh-pdfviewer.js): a story's card with its Open
   and Download links, which phones keep; on a desktop the browser's own viewer above it, filling
   most of the window, and the card as a bar of the links */
.fh-pdf {
	margin: 0 0 20px;
}

.fh-pdf-card p.fh-story-title {
	margin: 4px 0 6px;
	font-family: var(--fh-serif);
	font-size: 26px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--fh-ink);
}

.fh-pdf-links {
	flex-wrap: wrap;
}

a.fh-pdf-download,
a.fh-pdf-download:link,
a.fh-pdf-download:visited {
	background: #ffffff;
	color: var(--fh-accent);
	box-shadow: inset 0 0 0 1px var(--fh-accent);
}

a.fh-pdf-download::after {
	content: "\2193";
}

a.fh-pdf-download:hover,
a.fh-pdf-download:focus-visible {
	background: var(--fh-tint);
	color: var(--fh-hover);
}

.fh-pdf-embed {
	display: block;
	width: 100%;
	height: 85vh;
	min-height: 480px;
	border: 1px solid var(--fh-line);
	background: var(--fh-paper);
	box-sizing: border-box;
}

.fh-pdf-embedded .fh-pdf-card {
	display: block;
	padding: 10px 16px;
	border-radius: 0 0 6px 6px;
}

.fh-pdf-embedded .fh-story-cover,
.fh-pdf-embedded .fh-story-eyebrow,
.fh-pdf-embedded p.fh-story-title {
	display: none;
}

.fh-pdf-embedded .fh-story-text {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
}

.fh-pdf-embedded .fh-story-text > p.fh-story-byline {
	margin: 0;
}

@media screen and (max-width: 720px) {
	.fh-pdf-card p.fh-story-title {
		font-size: 20px;
	}
}

/* The preview shown over a thumbnail: a card as wide as its image, beside the thumbnail, in
   place of TNG's fixed 410 x 400 speech bubble. On a phone it is centred on the screen. */
body.fh .media-prev {
	top: -120px;
	/* js/template.js sets --fh-thumb-left and --fh-thumb-right to the thumbnail's edges within .media-img */
	left: calc(var(--fh-thumb-right, 100%) + 14px);
	right: auto;
	width: max-content;
	height: auto;
	padding: 8px;
	line-height: 1.3;
	text-align: left;
	background: #ffffff;
	border: 1px solid var(--fh-line);
	border-radius: 6px;
	box-shadow: 0 8px 28px rgba(16, 20, 26, 0.22);
}

/* TNG moves it to the thumbnail's left near the page's right edge */
body.fh .media-prev[style*="right"] {
	left: auto;
	right: calc(100% - var(--fh-thumb-left, 0px) + 14px) !important;
	background-image: none !important;
}

body.fh .media-prev img {
	display: block;
	width: auto;
	height: auto;
	max-width: min(560px, 46vw);
	max-height: min(460px, 70vh);
	margin: 0;
	border: none;
}

body.fh .media-prev .prev-caption {
	position: static;
	width: 0;
	min-width: 100%;
	margin: 8px 0 0;
	padding: 0;
	background: none;
	color: var(--fh-ink-2);
	font-size: 13.5px;
	font-weight: 400;
}

/* TNG sends the title in bold */
body.fh .media-prev .prev-caption strong {
	font-weight: 500;
}

body.fh .media-prev .prev-caption:empty {
	display: none;
}

/* Below 1,000px a wide table scrolls in its own box, which would cut off a preview inside it,
   so the preview is centred on the screen instead */
@media (max-width: 999px) {
	body.fh .media-prev,
	body.fh .media-prev[style*="right"] {
		position: fixed;
		top: 50%;
		left: 50%;
		right: auto !important;
		transform: translate(-50%, -50%);
	}
}

@media screen and (max-width: 720px) {
	body.fh .media-prev img {
		max-width: calc(100vw - 48px);
	}
}

/* A person's media, shown when pointing at the camera beside their name (js/template.js) */
.fh-mediacard {
	position: absolute;
	z-index: 200;
	width: 340px;
	max-width: calc(100vw - 16px);
	box-sizing: border-box;
	padding: 10px 12px 12px;
	background: #ffffff;
	border: 1px solid var(--fh-line);
	border-top: 3px solid var(--fh-accent);
	border-radius: 6px;
	box-shadow: 0 8px 28px rgba(16, 20, 26, 0.22);
	font-family: var(--fh-sans);
}

.fh-mediacard-head {
	margin-bottom: 8px;
	font-family: var(--fh-serif);
	font-size: 17px;
	font-weight: 600;
	color: var(--fh-accent-dark);
}

.fh-mediacard ul {
	max-height: 360px;
	overflow-y: auto;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fh-mediacard li + li {
	border-top: 1px solid var(--fh-line);
}

.fh-mediacard a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 0;
	font-size: 13.5px;
	line-height: 1.3;
	color: var(--fh-accent);
	text-decoration: none;
}

.fh-mediacard a:hover span {
	text-decoration: underline;
}

.fh-mediacard img {
	flex: none;
	width: 56px;
	height: 56px;
	object-fit: contain;
	background: var(--fh-paper);
	border: 1px solid var(--fh-line);
	border-radius: 3px;
}

.fh-mediacard p {
	margin: 0;
	font-size: 13.5px;
	color: var(--fh-muted);
}

/* The card a source number shows on a person or family page (js/template.js), styled as the
   media card above. The whole card opens the source, so it takes a pointer cursor. */
.fh-sourcecard {
	position: absolute;
	z-index: 200;
	width: 320px;
	max-width: calc(100vw - 16px);
	box-sizing: border-box;
	padding: 10px 12px 10px;
	background: #ffffff;
	border: 1px solid var(--fh-line);
	border-top: 3px solid var(--fh-accent);
	border-radius: 6px;
	box-shadow: 0 8px 28px rgba(16, 20, 26, 0.22);
	font-family: var(--fh-sans);
	font-size: 13.5px;
	line-height: 1.4;
	color: var(--fh-ink);
	cursor: pointer;
}

.fh-sourcecard-num {
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--fh-muted);
}

.fh-sourcecard-head {
	margin-top: 2px;
	font-family: var(--fh-serif);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--fh-accent-dark);
}

.fh-sourcecard-text {
	margin-top: 6px;
	overflow-wrap: anywhere;
	max-height: 160px;
	overflow-y: auto;
}

.fh-sourcecard-text a {
	color: var(--fh-accent);
}

/* Each picture keeps its own shape, up to 88px tall, shrinking to share the card's width */
.fh-sourcecard-pics {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-top: 10px;
}

.fh-sourcecard-pics a {
	display: block;
	flex: 0 1 auto;
	min-width: 0;
}

.fh-sourcecard-pics img {
	display: block;
	max-width: 100%;
	max-height: 88px;
	width: auto;
	height: auto;
	border-radius: 2px;
	box-shadow: 0 1px 4px rgba(16, 20, 26, 0.22);
}

.fh-sourcecard-foot {
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px solid var(--fh-line);
	font-size: 13px;
	font-weight: 600;
	color: var(--fh-accent);
}

.fh-sourcecard:hover .fh-sourcecard-foot {
	text-decoration: underline;
}

/* The card a link to a person shows (js/template.js, fh_personcard.php), styled as the source card
   above. It takes the person's branch colours (set on the card, so --fh-tint follows them); its
   relationship line is tinted as the site's shaded rows are. */
.fh-personcard {
	position: absolute;
	z-index: 200;
	width: 320px;
	max-width: calc(100vw - 16px);
	box-sizing: border-box;
	padding: 10px 12px 10px;
	background: #ffffff;
	border: 1px solid var(--fh-line);
	border-top: 3px solid var(--fh-accent);
	border-radius: 6px;
	box-shadow: 0 8px 28px rgba(16, 20, 26, 0.22);
	font-family: var(--fh-sans);
	font-size: 13.5px;
	line-height: 1.4;
	color: var(--fh-ink);
	cursor: pointer;
}

.fh-personcard-num {
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--fh-muted);
}

.fh-personcard-top {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-top: 2px;
}

/* A portrait keeps its own shape, up to 64px wide and 80px tall (under body.fh, to outrank
   body.fh img's max-width) */
body.fh .fh-personcard-photo {
	display: block;
	flex: 0 0 auto;
	max-width: 64px;
	max-height: 80px;
	width: auto;
	height: auto;
	border-radius: 2px;
	box-shadow: 0 1px 4px rgba(16, 20, 26, 0.22);
}

.fh-personcard-head {
	font-family: var(--fh-serif);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--fh-accent-dark);
}

.fh-personcard-life {
	margin-top: 1px;
	color: var(--fh-muted);
}

.fh-personcard-rel {
	margin: 8px -12px 0;
	padding: 5px 12px;
	background: var(--fh-tint);
	font-weight: 600;
	color: var(--fh-accent-dark);
}

.fh-personcard-facts {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 3px 10px;
	margin: 8px 0 0;
}

.fh-personcard-facts dt {
	font-weight: 600;
	color: var(--fh-ink-2);
}

.fh-personcard-facts dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.fh-personcard-text {
	margin-top: 6px;
	color: var(--fh-ink-2);
}

.fh-personcard-foot {
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px solid var(--fh-line);
	font-size: 13px;
	font-weight: 600;
	color: var(--fh-accent);
}

.fh-personcard:hover .fh-personcard-foot {
	text-decoration: underline;
}

/* The card a link to a family shows (js/template.js, fh_familycard.php), laid out as the person card
   above, in the site's own colours; each partner's name takes their family line's colours (set on
   the name) */
.fh-familycard {
	position: absolute;
	z-index: 200;
	width: 320px;
	max-width: calc(100vw - 16px);
	box-sizing: border-box;
	padding: 10px 12px 10px;
	background: #ffffff;
	border: 1px solid var(--fh-line);
	border-top: 3px solid var(--fh-accent);
	border-radius: 6px;
	box-shadow: 0 8px 28px rgba(16, 20, 26, 0.22);
	font-family: var(--fh-sans);
	font-size: 13.5px;
	line-height: 1.4;
	color: var(--fh-ink);
	cursor: pointer;
}

.fh-familycard-num {
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--fh-muted);
}

.fh-familycard-top {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-top: 2px;
}

/* A photo keeps its own shape, up to 80px wide and 64px tall */
body.fh .fh-familycard-photo {
	display: block;
	flex: 0 0 auto;
	max-width: 80px;
	max-height: 64px;
	width: auto;
	height: auto;
	border-radius: 2px;
	box-shadow: 0 1px 4px rgba(16, 20, 26, 0.22);
}

.fh-familycard-head {
	font-family: var(--fh-serif);
	font-size: 17px;
	line-height: 1.25;
}

.fh-familycard-and {
	color: var(--fh-muted);
}

.fh-familycard-name {
	font-weight: 600;
	color: var(--fh-accent-dark);
}

.fh-familycard-life {
	margin-left: 6px;
	font-family: var(--fh-sans);
	font-size: 13.5px;
	color: var(--fh-muted);
	white-space: nowrap;
}

.fh-familycard-facts {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 3px 10px;
	margin: 8px 0 0;
}

.fh-familycard-facts dt {
	font-weight: 600;
	color: var(--fh-ink-2);
}

.fh-familycard-facts dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.fh-familycard-text {
	margin-top: 6px;
	color: var(--fh-ink-2);
}

.fh-familycard-foot {
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px solid var(--fh-line);
	font-size: 13px;
	font-weight: 600;
	color: var(--fh-accent);
}

.fh-familycard:hover .fh-familycard-foot {
	text-decoration: underline;
}

/* The card a link to a place shows (js/template.js, fh_placecard.php), laid out as the person card
   above, in the site's own colours, with a strip of map across its full width */
.fh-placecard {
	position: absolute;
	z-index: 200;
	width: 320px;
	max-width: calc(100vw - 16px);
	box-sizing: border-box;
	padding: 10px 12px 10px;
	background: #ffffff;
	border: 1px solid var(--fh-line);
	border-top: 3px solid var(--fh-accent);
	border-radius: 6px;
	box-shadow: 0 8px 28px rgba(16, 20, 26, 0.22);
	font-family: var(--fh-sans);
	font-size: 13.5px;
	line-height: 1.4;
	color: var(--fh-ink);
	cursor: pointer;
}

.fh-placecard-num {
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--fh-muted);
}

.fh-placecard-top {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-top: 2px;
}

/* A photo keeps its own shape, up to 80px wide and 64px tall */
body.fh .fh-placecard-photo {
	display: block;
	flex: 0 0 auto;
	max-width: 80px;
	max-height: 64px;
	width: auto;
	height: auto;
	border-radius: 2px;
	box-shadow: 0 1px 4px rgba(16, 20, 26, 0.22);
}

.fh-placecard-head {
	font-family: var(--fh-serif);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--fh-accent-dark);
	overflow-wrap: anywhere;
}

.fh-placecard-where {
	margin-top: 1px;
	color: var(--fh-muted);
}

.fh-placecard-notes {
	margin-top: 6px;
	font-style: italic;
	color: var(--fh-ink-2);
}

.fh-placecard-map {
	position: relative;
	height: 128px;
	margin: 8px -12px 0;
	overflow: hidden;
	background: #e8e4da;
	border-top: 1px solid var(--fh-line);
	border-bottom: 1px solid var(--fh-line);
}

body.fh .fh-placecard-map img {
	position: absolute;
	width: 256px;
	height: 256px;
	max-width: none;
}

/* The pin's point is on the place */
.fh-placecard-pin {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 14px;
	height: 14px;
	margin: -18px 0 0 -8px;
	background: var(--fh-accent);
	border: 2px solid #ffffff;
	border-radius: 50% 50% 50% 0;
	transform: rotate(-45deg);
	box-shadow: 0 1px 4px rgba(16, 20, 26, 0.4);
}

.fh-placecard-credit {
	position: absolute;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 1px 4px;
	background: rgba(255, 255, 255, 0.85);
	font-size: 10px;
	line-height: 1.2;
	color: var(--fh-ink-2);
}

.fh-placecard-credit a {
	color: inherit;
	text-decoration: none;
}

/* MapTiler's logo, which its free plan asks for, at the strip's small size */
body.fh .fh-placecard-map .fh-placecard-credit img {
	position: static;
	display: block;
	width: auto;
	height: 11px;
}

.fh-placecard-facts {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 3px 10px;
	margin: 8px 0 0;
}

.fh-placecard-facts dt {
	font-weight: 600;
	color: var(--fh-ink-2);
}

.fh-placecard-facts dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.fh-placecard-text {
	margin-top: 6px;
	color: var(--fh-ink-2);
}

.fh-placecard-foot {
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px solid var(--fh-line);
	font-size: 13px;
	font-weight: 600;
	color: var(--fh-accent);
}

.fh-placecard:hover .fh-placecard-foot {
	text-decoration: underline;
}

/* The event map's list of events keeps a readable width (280px or more); the map takes the rest,
   in place of TNG's fixed 65% */
.fh-main li#eventmap .mapcol {
	width: auto;
}

.fh-main li#eventmap table.tfixed col:last-of-type {
	width: 340px;
}

@media (max-width: 1000px) {
	.fh-main li#eventmap table.tfixed col:last-of-type {
		width: 280px;
	}
}

/* The Google Earth links' globe: a line drawing in the link's colour, in place of TNG's shiny one */
.fh-main img[src$="img/earth.gif"] {
	display: none;
}

.fh-main a:has(> img[src$="img/earth.gif"])::before,
.fh-main span:has(> img[src$="img/earth.gif"])::before {
	content: "";
	display: inline-block;
	width: 16px;
	height: 16px;
	vertical-align: -3px;
	background: var(--fh-accent);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.3'%3E%3Ccircle cx='8' cy='8' r='6.6'/%3E%3Cellipse cx='8' cy='8' rx='2.8' ry='6.6'/%3E%3Cpath d='M1.6 6h12.8M1.6 10h12.8'/%3E%3C/svg%3E")
		center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.3'%3E%3Ccircle cx='8' cy='8' r='6.6'/%3E%3Cellipse cx='8' cy='8' rx='2.8' ry='6.6'/%3E%3Cpath d='M1.6 6h12.8M1.6 10h12.8'/%3E%3C/svg%3E")
		center / contain no-repeat;
}

.fh-main a:has(> img[src$="img/earth.gif"]):hover::before {
	background: var(--fh-hover);
}

ul.nopad {
	padding: 0;
	margin: 0;
}

ul.nopad > li {
	list-style: none;
}

/* Each event's first row; its label cell spans the rest */
.fh-main table.tfixed td.fieldnameback[rowspan] {
	border-top: 1px solid var(--fh-line);
}

/* Dates, places and details */
.fh-main #info td.databack {
	font-size: 16px;
}

.fh-main #info td.fh-date {
	font-size: 15px;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	/* A long date ("Bef 25 Feb 1747/8") wraps rather than running into the place */
	overflow-wrap: break-word;
}

.fh-main #info tr[class^="t"] > td.databack,
.fh-main #info tr[class*=" t"] > td.databack {
	border-top: none;
	padding-top: 2px;
	font-size: 15px;
	color: var(--fh-ink-2);
}

.fh-main #info tr[class^="t"] > td.databack[colspan="2"] {
	padding-left: calc(var(--fh-date) + 12px);
}

.fh-main #info .notearea {
	max-height: none;
	font-size: 14.5px;
	line-height: 1.45;
	color: var(--fh-ink-2);
	max-width: 74ch;
}

.fh-main #info .notearea ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* A thumbnail sits uncropped in a 124 x 92 box beside its title */
.fh-main td.databack[align="center"] {
	text-align: left;
}

.fh-main td.databack img.thumb {
	display: block;
	max-width: 124px;
	max-height: 92px;
	width: auto;
	height: auto !important;
	border: 1px solid var(--fh-line);
}

.fh-main #info td.databack a[href^="showmedia.php"],
.fh-main #info td.databack a[href^="/media/"] {
	font-size: 14px;
	text-underline-offset: 2px;
}

/* Birth, death and marriage: a solid label and a lightly shaded box with a 2px border
   (js/template.js tags the rows) */
/* The label has the same 2px edges as the shaded cells beside it, so they line up */
.fh-main #info td.fieldnameback.fh-milestone {
	background: var(--fh-accent);
	border-top: 2px solid var(--fh-accent);
	border-bottom: 2px solid var(--fh-accent);
}

.fh-main #info td.fieldnameback.fh-milestone .fieldname {
	color: #ffffff;
}

.fh-main #info tr.fh-milestone > td.databack {
	background: var(--fh-shade);
}

.fh-main #info tr.fh-milestone-first > td.databack {
	border-top: 2px solid var(--fh-accent);
}

.fh-main #info tr.fh-milestone > td.databack:last-child {
	box-shadow: inset -2px 0 0 var(--fh-accent);
}

.fh-main #info tr.fh-milestone-last > td.databack {
	border-bottom: 2px solid var(--fh-accent);
}

.fh-main #info tr.fh-milestone-first > td.fh-date {
	font-size: 16px;
	font-weight: 700;
	color: var(--fh-accent-dark);
}

.fh-main #info tr.fh-milestone-first > td.fh-date + td {
	font-weight: 600;
}

/* Sources, notes and the event map, full width under the facts */
/* Two columns of sources; each number sits in its item's own margin so the
   second column's numbers have room, and no source is split between columns */
.fh-main ol.citeblock {
	margin: 0;
	padding-left: 0;
	font-size: 13px;
	column-count: 2;
	column-gap: 28px;
}

/* TNG ends each source with two line breaks, a blank line between sources; a margin
   a little smaller than that line takes its place */
.fh-main ol.citeblock li {
	margin: 0 0 12px 2.2em;
	break-inside: avoid;
}

.fh-main ol.citeblock li > br + br:last-child {
	display: none;
}

@media screen and (max-width: 720px) {
	.fh-main ol.citeblock {
		column-count: 1;
	}
}

/* ---------------------------------------------------------------- a family's page */

/* The family's page (family_page.php). It borrows the place page's gallery
   in the heading's band, its figures band and its timeline (.fh-households), and the person page's
   life-story panel and two columns of sources (.fh-main ol.citeblock); what is its own is here. */
.fh-main .fh-family-figures {
	margin-bottom: 8px;
}

.fh-main .fh-family-top {
	margin-top: 30px;
}

/* The marriage in one sentence, in the heading type */
body.fh .fh-family-marriage > p.fh-family-lede {
	font-family: var(--fh-serif);
	font-size: 21px;
	line-height: 1.45;
	color: var(--fh-ink);
}

/* Notes on the marriage or the banns: the words of the record, set off by a rule (and a note on
   a record in a person's timeline) */
.fh-family-note,
.fh-person-note {
	border-left: 3px solid var(--fh-tint);
	padding-left: 12px;
	color: var(--fh-ink-2);
	font-size: 15px;
	line-height: 1.5;
}

.fh-family-note p,
.fh-person-note p {
	margin: 0 0 6px;
}

.fh-family-also {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 15px;
	line-height: 1.5;
}

.fh-family-also li + li {
	margin-top: 6px;
}

.fh-family-what {
	font-weight: 600;
	color: var(--fh-accent-dark);
}

.fh-main .fh-family-general {
	font-size: 14px;
	color: var(--fh-muted);
}

/* Each partner: husband or wife, small, over their name; their facts as label and text */
.fh-family-partner + .fh-family-partner {
	border-top: 1px solid var(--fh-line);
	padding-top: 12px;
}

.fh-family-role {
	margin: 0;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--fh-muted);
}

body.fh .fh-family-partner h3 {
	margin: 2px 0 8px;
	font-size: 22px;
	line-height: 1.25;
}

.fh-family-years {
	font-family: var(--fh-sans);
	font-size: 15px;
	font-weight: 400;
	color: var(--fh-muted);
}

.fh-family-partner dl {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	gap: 4px 14px;
	margin: 0;
	font-size: 15px;
	line-height: 1.45;
}

.fh-family-partner dt {
	font-weight: 600;
	color: var(--fh-accent-dark);
}

.fh-family-partner dd {
	margin: 0;
	overflow-wrap: anywhere;
}

/* The quiet link to a family's page that ends a line about it ("their family ›"), here and on a
   place's timeline */
.fh-family-go {
	font-size: 13.5px;
	white-space: nowrap;
}

/* The children and the homes, each a timeline as a place's households are */
.fh-main .fh-family-children,
.fh-main .fh-family-homes {
	margin-top: 36px;
}

.fh-family-kids .fh-household-body {
	padding-bottom: 18px;
}

.fh-family-life {
	margin: 0 0 4px;
	font-size: 15.5px;
	line-height: 1.5;
	color: var(--fh-ink-2);
}

/* A home's census rows are sentences, which may wrap */
.fh-family-homes .fh-household-names li {
	white-space: normal;
}

/* The map of the homes with its key (fh_map_with_key()), under the timeline; each home carries
   the number of its pin */
.fh-family-homes .fh-map-panel {
	margin-top: 18px;
}

.fh-map-pin {
	display: inline-block;
	min-width: 1.5em;
	margin-left: 4px;
	padding: 0 4px;
	box-sizing: border-box;
	border-radius: 999px;
	background: var(--fh-accent);
	color: #ffffff;
	font: 600 12.5px/1.6 var(--fh-sans);
	text-align: center;
	vertical-align: 3px;
}

/* Three generations: each partner's parents over them, the couple, and their children in a
   group under them, joined by lines; the boxes as the home page's ancestor chart has them, each in
   the colours of its person's family line */
.fh-main .fh-family-chart {
	margin-top: 30px;
}

.fh-fchart-row {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: 24px;
}

.fh-fchart-1 .fh-fchart-row {
	grid-template-columns: minmax(0, 1fr);
}

.fh-fchart-row + .fh-fchart-row {
	margin-top: 24px;
}

.fh-fchart-cell {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	min-width: 0;
}

/* Under a pair of parents, the line runs on to the foot of the row, to meet the line down to their
   child however much taller the other side's pair is */
.fh-fchart-cell:has(> .fh-fchart-pair)::after {
	content: "";
	flex: 1 1 auto;
	min-height: 0;
	border-left: 1px solid #6b7280;
}

.fh-fchart-pair {
	position: relative;
	display: flex;
	justify-content: center;
	gap: 16px;
	width: 100%;
}

.fh-fchart-pair::before,
.fh-fchart-couple::before {
	content: "";
	position: absolute;
	left: 25%;
	right: 25%;
	top: 50%;
	border-top: 1px solid #6b7280;
}

.fh-fchart-1 .fh-fchart-couple::before {
	content: none;
}

/* The line from a partner's parents down to them, and from the couple down to their children */
.fh-fchart-up::before,
.fh-fchart-down::after {
	content: "";
	position: absolute;
	left: 50%;
	border-left: 1px solid #6b7280;
}

.fh-fchart-up::before {
	top: -24px;
	height: 24px;
}

.fh-fchart-down::after {
	top: 50%;
	bottom: -24px;
}

.fh-fchart-marr {
	position: absolute;
	z-index: 2;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	padding: 0 6px;
	background: #ffffff;
	font-size: 13px;
	color: var(--fh-muted);
	white-space: nowrap;
}

.fh-fchart-box {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	width: 160px;
	max-width: 100%;
	padding: 7px 8px;
	border: 1px solid var(--fh-accent);
	border-radius: 6px;
	background: var(--fh-tint);
	text-align: center;
	font-size: 14px;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.fh-fchart-box a:link,
.fh-fchart-box a:visited {
	font-weight: 700;
	color: var(--fh-accent-dark);
	text-decoration: none;
}

.fh-fchart-box a:hover {
	text-decoration: underline;
}

.fh-fchart-years {
	display: block;
	margin-top: 2px;
	font-size: 12.5px;
	color: var(--fh-ink-2);
}

.fh-fchart-partner {
	width: 210px;
	padding: 10px;
	border-width: 2px;
	background: color-mix(in srgb, var(--fh-accent) 24%, #ffffff);
	font-size: 16px;
}

.fh-fchart-unknown {
	border: 1px dashed #9ca3af;
	background: #ffffff;
	color: var(--fh-muted);
	font-style: italic;
}

.fh-fchart-kids {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin: 24px 0 0;
	padding: 14px;
	list-style: none;
	border: 1px solid var(--fh-line);
	border-radius: 8px;
	background: var(--fh-shade);
}

.fh-fchart-kids li {
	display: flex;
}

@media (max-width: 600px) {
	.fh-fchart-row {
		column-gap: 12px;
	}

	.fh-fchart-pair {
		flex-direction: column;
		align-items: center;
		gap: 6px;
	}

	.fh-fchart-pair::before {
		content: none;
	}

	.fh-fchart-box {
		width: 100%;
		max-width: 180px;
	}

	/* The year of the marriage on the line down to the children, as the couple fill the width */
	.fh-fchart-marr {
		top: calc(100% + 12px);
	}

	.fh-fchart-partner {
		font-size: 15px;
	}

	.fh-fchart-kids li {
		flex: 0 0 calc(50% - 5px);
	}

	.fh-fchart-kids .fh-fchart-box {
		max-width: none;
	}
}

/* Printed, the page is the family's record on paper: the heading and figures without their
   coloured bands, no photos, map or links to follow, the chart in its colours, and no entry, box
   or heading left alone at the foot of a page. The site's header, footer and menus are hidden by
   the print rules at the end of this file. */
@media print {
	@page {
		margin: 15mm 14mm;
	}

	body.fh-page-familygroup .fh-gallery,
	body.fh-page-familygroup .fh-map-panel,
	body.fh-page-familygroup .fh-map-pin,
	body.fh-page-familygroup .fh-family-go,
	body.fh-page-familygroup .fh-placecard,
	body.fh-page-familygroup .fh-skip {
		display: none !important;
	}

	body.fh-page-familygroup .fh-main h1.header,
	body.fh-page-familygroup .fh-main .fh-band {
		box-shadow: none;
		clip-path: none;
		background: none;
		color: var(--fh-ink);
	}

	body.fh-page-familygroup .fh-main h1.header {
		padding: 0;
		font-size: 30px;
	}

	body.fh-page-familygroup .fh-main .fh-namebar #nameheader + .normal,
	body.fh-page-familygroup .fh-family-figures .fh-figure-num {
		color: var(--fh-ink);
	}

	body.fh-page-familygroup .fh-main a:link,
	body.fh-page-familygroup .fh-main a:visited {
		color: inherit;
		text-decoration: none;
	}

	body.fh-page-familygroup .fh-family-figures {
		padding: 0;
		border-bottom: 1px solid var(--fh-line);
	}

	.fh-fchart,
	.fh-fchart-box {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	.fh-family-chart,
	.fh-family-partner,
	.fh-family-kids > li,
	.fh-family-homes .fh-households > li,
	.fh-main ol.citeblock > li {
		break-inside: avoid;
	}

	body.fh-page-familygroup .fh-main h2,
	body.fh-page-familygroup .fh-main h3 {
		break-after: avoid;
	}

	body.fh-page-familygroup .fh-main section {
		margin-top: 18px;
	}
}

@media (max-width: 720px) {
	.fh-family-partner dl {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}

	.fh-family-partner dd {
		margin-bottom: 6px;
	}
}

/* ---------------------------------------------------------------- a person's page */

/* The person's page (person_page.php). Like a family's, it borrows the place page's gallery in the
   heading's band, its figures band and its timeline (.fh-households, with the register's rows),
   the life-story panel, the family page's notes and the two columns of sources; what is its own
   is here. */
.fh-main .fh-person-figures {
	margin-bottom: 8px;
}

/* Their life beside their family on a wide screen */
.fh-main .fh-person-top {
	margin-top: 30px;
}

/* The opening sentences, in the heading type, as a family's marriage */
body.fh .fh-person-life > p.fh-person-lede {
	font-family: var(--fh-serif);
	font-size: 21px;
	line-height: 1.45;
	color: var(--fh-ink);
}

.fh-person-years {
	font-family: var(--fh-sans);
	font-size: 15px;
	font-weight: 400;
	color: var(--fh-muted);
}

.fh-main .fh-person-general {
	font-size: 14px;
	color: var(--fh-muted);
}

body.fh .fh-person-family > p.fh-person-parents {
	margin: 0 0 6px;
}

/* Beside their life the column is narrow, so a row's label goes over its names */
.fh-person-family .fh-household-row {
	grid-template-columns: minmax(0, 1fr);
	gap: 0;
	margin-bottom: 14px;
}

.fh-person-families {
	margin-top: 18px;
}

.fh-person-families .fh-household-body {
	padding-bottom: 18px;
}

body.fh .fh-person-families h3 {
	font-size: 20px;
}

.fh-person-family .fh-household-names li {
	white-space: normal;
}

.fh-main .fh-person-charts {
	font-size: 14.5px;
	color: var(--fh-muted);
}

/* Every record of them: each line's notes and pictures under its sentence */
/* (section., to outrank .fh-section:first-of-type, as it is the first section outside the
   two columns) */
.fh-main section.fh-person-timeline {
	margin-top: 40px;
}

.fh-person-timeline .fh-person-note {
	margin: 6px 0 4px;
}

.fh-person-timeline .fh-map-panel {
	margin-top: 18px;
}

/* Their birth, baptism, marriages, death and burial: shaded lines with a rule in the page's colour */
/* The shading reaches out to either side, so the line's date and words stay in line with the
   others */
.fh-person-timeline .fh-register-rows li.fh-person-milestone {
	margin: 4px -12px 4px -15px;
	padding: 10px 12px;
	border-left: 3px solid var(--fh-accent);
	background: var(--fh-tint);
}

/* On the shading, source numbers are white chips, filled in the page's colour when pointed at */
.fh-person-milestone .fh-cite a,
.fh-person-milestone .fh-cite a:link,
.fh-person-milestone .fh-cite a:visited {
	background: #ffffff;
	box-shadow: 0 0 0 1px var(--fh-line);
}

.fh-person-milestone .fh-cite a:hover,
.fh-person-milestone .fh-cite a:focus-visible {
	background: var(--fh-accent);
	color: #ffffff;
	box-shadow: none;
}

/* A milestone's event ("Born", "Married"), heading its line in the heading type */
.fh-person-event {
	display: block;
	margin: -2px 0 2px;
	font-family: var(--fh-serif);
	font-size: 21px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.005em;
	color: var(--fh-accent-dark);
}

/* Each line that is not a milestone is marked in the margin by its kind of record (data-kind,
   fh_person_kind() in person_page.php): a small line drawing in the quietest ink, beside the
   words, so the words stay in line with the milestones' and the marks never compete with them */
.fh-person-timeline li[data-kind] .fh-register-what {
	position: relative;
}

.fh-person-timeline li[data-kind] .fh-register-what::before {
	content: "";
	position: absolute;
	left: -27px;
	top: 1px;
	width: 18px;
	height: 18px;
	background: var(--fh-muted);
	-webkit-mask: var(--fh-kind) no-repeat center / contain;
	mask: var(--fh-kind) no-repeat center / contain;
	opacity: 0.75;
}

.fh-person-timeline li[data-kind="census"] {
	--fh-kind: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3.5' width='16' height='17' rx='1.5'/%3E%3Cpath d='M4 8.5h16M4 13h16M4 17h16M10 3.5v17'/%3E%3C/svg%3E");
}

.fh-person-timeline li[data-kind="home"] {
	--fh-kind: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 11.5 12 4.5l8.5 7'/%3E%3Cpath d='M6 10v10h12V10'/%3E%3Cpath d='M10 20v-5h4v5'/%3E%3C/svg%3E");
}

.fh-person-timeline li[data-kind="work"] {
	--fh-kind: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='7.5' width='17' height='12' rx='1.5'/%3E%3Cpath d='M9 7.5v-2h6v2M3.5 12.5h17'/%3E%3C/svg%3E");
}

.fh-person-timeline li[data-kind="news"] {
	--fh-kind: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h13v14H6a2 2 0 0 1-2-2z'/%3E%3Cpath d='M17 9h3v8a2 2 0 0 1-2 2'/%3E%3Cpath d='M7 8.5h7M7 12h7M7 15.5h4'/%3E%3C/svg%3E");
}

.fh-person-timeline li[data-kind="register"] {
	--fh-kind: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='10.5' width='16' height='9.5' rx='1'/%3E%3Cpath d='M8.5 10.5V4h7v6.5M8 15h8'/%3E%3C/svg%3E");
}

.fh-person-timeline li[data-kind="will"] {
	--fh-kind: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3.5h9l4 4v13H6z'/%3E%3Cpath d='M15 3.5v4h4'/%3E%3Ccircle cx='12.5' cy='14.5' r='2.5'/%3E%3C/svg%3E");
}

.fh-person-timeline li[data-kind="record"] {
	--fh-kind: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3.5h9l4 4v13H6z'/%3E%3Cpath d='M15 3.5v4h4M9 12h7M9 15.5h7'/%3E%3C/svg%3E");
}

.fh-person-timeline li[data-kind="family"] {
	--fh-kind: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3'/%3E%3Cpath d='M3.5 19.5a5.5 5.5 0 0 1 11 0'/%3E%3Ccircle cx='16.5' cy='9.5' r='2.5'/%3E%3Cpath d='M15.5 14.4a4.5 4.5 0 0 1 5 4.6'/%3E%3C/svg%3E");
}

.fh-person-timeline li[data-kind="child"] {
	--fh-kind: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3'/%3E%3Cpath d='M7 20a5 5 0 0 1 10 0'/%3E%3C/svg%3E");
}

/* A line about the family (a parent's or partner's death, a child's life): the same rule as a
   milestone's but dotted and quiet, its words in the quieter
   ink, so it is told apart without being made more of */
.fh-person-timeline .fh-register-rows li.fh-person-kin {
	margin-left: -15px;
	padding-left: 12px;
	border-left: 3px dotted var(--fh-line);
	color: var(--fh-ink-2);
}

/* On a milestone's shading, its notes sit under its words without a rule or an indent */
.fh-person-milestone .fh-person-note {
	padding-left: 0;
	border-left: none;
}

/* Phones: the date over the words, with no margin for the marks */
@media (max-width: 699px) {
	.fh-person-timeline li[data-kind] .fh-register-what::before {
		display: none;
	}
}

/* The family's lines, until asked for (?family=1, or the switch js/template.js makes of it) */
.fh-person-nokin .fh-person-kin {
	display: none;
}

.fh-person-timeline .fh-filters {
	margin: 4px 0 18px;
}

.fh-person-timeline .fh-register-rows li.fh-person-milestone + li {
	border-top: none;
}

/* A line with pictures of its record has them in a column on its right */
.fh-person-timeline .fh-register-rows li:has(> .fh-person-records) {
	grid-template-columns: 11em minmax(0, 1fr) auto;
}

/* A record's picture: the image over its title, opening its media page */
.fh-person-records {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 10px 14px;
	margin: 4px 0;
}

.fh-main a.fh-person-record {
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: 160px;
	font-size: 13px;
	line-height: 1.3;
	text-underline-offset: 2px;
}

/* Every picture the same tile, filled from the top of the record, so a long thin certificate
   shows its heading rather than a sliver */
.fh-main a.fh-person-record img {
	display: block;
	width: 160px;
	height: 120px;
	object-fit: cover;
	object-position: center top;
	border: 1px solid var(--fh-line);
	background: #ffffff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Beside their life, the records of its events in a row under the sentences */
.fh-person-life > .fh-person-records {
	margin: 14px 0 10px;
}

/* Their family on a shaded panel beside their life */
.fh-main .fh-person-family {
	padding: 18px 20px 6px;
	background: var(--fh-paper);
	border-top: 3px solid var(--fh-accent);
}

.fh-person-family .fh-household-body::before {
	background: var(--fh-paper);
}

@media (max-width: 699px) {
	.fh-person-timeline .fh-register-rows li:has(> .fh-person-records) {
		grid-template-columns: minmax(0, 1fr);
	}

	.fh-main .fh-person-family {
		padding: 14px 14px 4px;
	}
}

/* Printed, the page is the person's record on paper, as a family's is: the heading and figures
   without their coloured bands, no photos, map, record pictures or links to follow, and no line or
   heading left alone at the foot of a page */
@media print {
	body.fh-page-getperson .fh-gallery,
	body.fh-page-getperson .fh-map-panel,
	body.fh-page-getperson .fh-map-pin,
	body.fh-page-getperson .fh-family-go,
	body.fh-page-getperson .fh-person-record img,
	body.fh-page-getperson .fh-person-charts,
	body.fh-page-getperson .fh-placecard,
	body.fh-page-getperson .fh-skip {
		display: none !important;
	}

	body.fh-page-getperson .fh-main h1.header,
	body.fh-page-getperson .fh-main .fh-band {
		box-shadow: none;
		clip-path: none;
		background: none;
		color: var(--fh-ink);
	}

	body.fh-page-getperson .fh-main h1.header {
		padding: 0;
		font-size: 30px;
	}

	body.fh-page-getperson .fh-main .fh-namebar #nameheader + .normal,
	body.fh-page-getperson .fh-person-figures .fh-figure-num {
		color: var(--fh-ink);
	}

	body.fh-page-getperson .fh-main a:link,
	body.fh-page-getperson .fh-main a:visited {
		color: inherit;
		text-decoration: none;
	}

	body.fh-page-getperson .fh-person-figures {
		padding: 0;
		border-bottom: 1px solid var(--fh-line);
	}

	/* Paper is too narrow for their family beside their life: one under the other */
	body.fh-page-getperson .fh-person-top {
		display: block;
	}

	.fh-person-families > li,
	.fh-person-timeline .fh-register-rows > li {
		break-inside: avoid;
	}

	.fh-person-timeline .fh-register-rows li.fh-person-milestone,
	body.fh-page-getperson .fh-main .fh-person-family {
		background: none;
	}

	body.fh-page-getperson .fh-main h2,
	body.fh-page-getperson .fh-main h3 {
		break-after: avoid;
	}

	body.fh-page-getperson .fh-main section {
		margin-top: 18px;
	}
}

/* ---------------------------------------------------------------- lists: search results and others */

.fh-main .thfixed td.databack,
.fh-main table.whiteback:not(.tfixed) td.databack {
	font-size: 15px;
}

.fh-main td.databack img.chartimg {
	display: none;
}

.fh-main td.databack .searchthumb {
	float: left;
	margin-right: 6px;
}

.fh-main a.pers {
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.fh-main td.nbrcol,
.fh-main th.nbrcol,
.fh-main .thfixed tr > td:first-child {
	color: var(--fh-muted);
	font-variant-numeric: tabular-nums;
	width: 2.5em;
}

.fh-main .thfixed td.databack:nth-child(3) {
	color: var(--fh-muted);
	font-size: 13.5px;
	font-variant-numeric: tabular-nums;
}

.fh-page-search .fh-main table:has(th.nbrcol) td.databack:nth-child(4) {
	white-space: nowrap;
}

/* A media item's Info cell (the one TNG gives a width of 250px) can hold a long web address
   with no spaces; let it break there, and only there, so other columns keep whole words */
.fh-page-browsemedia .fh-main table.tablesaw td[style*="width:250px"] {
	min-width: 250px;
	overflow-wrap: anywhere;
}

/* TNG's hover previews of a person or family are 520px wide and sit to the right of a name.
   Hidden, they would still widen the page, so they take no room until search.js shows them. */
.fh-main .person-prev:not([style*="visible"]) {
	display: none;
}

/* TNG's sort arrows are white, for its dark heading cells */
th.fieldnameback img.sortimg {
	filter: invert(0.7);
	vertical-align: 1px;
}

.fh-main .thfixed tr:hover > td.databack {
	background: var(--fh-paper);
}

/* TNG's bar charts (places, statistics) */
.bar {
	background-color: var(--fh-accent);
}

/* Buttons and button-like links */
a.snlink,
a.snlink:link,
a.snlink:visited,
.btn,
input[type="submit"],
input[type="button"] {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 14px;
	border: none;
	border-radius: 4px;
	background: var(--fh-accent);
	color: #ffffff;
	font-family: var(--fh-sans);
	font-size: 14.5px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	box-sizing: border-box;
}

a.snlink:hover,
.btn:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
	background: var(--fh-accent-dark);
	color: #ffffff;
}

body.fh input[type="text"],
body.fh input[type="search"],
body.fh input[type="email"],
body.fh input[type="password"],
body.fh select,
body.fh textarea {
	border: 1px solid #a9b0ba;
	border-radius: 4px;
	padding: 6px 8px;
	font-size: 15px;
	box-sizing: border-box;
	max-width: 100%;
}

/* The browser's own arrow sits almost against the right edge; draw it ourselves so it has the
   same 8px gap from the edge as the text has on the left */
body.fh select:not([multiple]):not([size]),
body.fh select[size="1"] {
	appearance: none;
	-webkit-appearance: none;
	background: #ffffff
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%233B414A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
		no-repeat right 8px center;
	padding-right: 28px;
}

.fh-header input[type="text"] {
	border: none;
}

/* TNG's pop-up boxes */
.LB_window {
	background: #ffffff;
	border: 1px solid var(--fh-line);
	border-top: 3px solid var(--fh-accent);
	color: var(--fh-ink);
	border-radius: 4px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.LB_closeAjaxWindow {
	background-color: var(--fh-accent);
}

.sidelink {
	font-weight: 700;
	text-decoration: none;
	color: var(--fh-accent);
}

.sidelink:hover {
	text-decoration: underline;
	color: var(--fh-hover);
}

/* ---------------------------------------------------------------- the home page (index.php) */

/* The hero: the headline and the four couples on the left, the mosaic of pictures on the right,
   in the page's own column, so the headline lines up with the figures and the boxes below */
.fh-main .fh-welcome {
	display: flex;
	align-items: stretch;
	gap: 0 56px;
	padding: 0;
	margin: 0;
}

.fh-welcome-text {
	flex: 1 1 440px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 48px 0;
}

.fh-welcome h1 {
	margin: 0;
	font-family: var(--fh-serif);
	font-size: 54px;
	line-height: 1.06;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: #ffffff;
}

/* The headline breaks after "Meet our grandparents." */
.fh-welcome h1 > span {
	display: block;
}

.fh-couples {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 26px;
}

.fh-couples p {
	display: grid;
	grid-template-columns: 14px minmax(0, 1fr);
	column-gap: 12px;
	margin: 0;
	font-size: 16.5px;
	line-height: 1.5;
	color: #ffffff;
}

/* Each couple's square, in its family's colour, level with the sentence's first line */
.fh-couple-key {
	width: 12px;
	height: 12px;
	margin-top: calc(0.75em - 6px);
	border: 1px solid rgba(255, 255, 255, 0.8);
}

/* White on the band, whatever branch footer.php marks the person link with */
.fh-welcome .fh-couples a:link,
.fh-welcome .fh-couples a:visited,
.fh-welcome .fh-couples a:hover {
	color: #ffffff;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.fh-couples a:hover {
	text-decoration-thickness: 2px;
}

/* The mosaic fills the band's height; its tiles are placed by js/mosaic.js, which sets the grid's
   columns and rows. Its height is set here at every width, so nothing moves as the tiles arrive. */
.fh-mosaic {
	flex: 1 1 440px;
	min-width: 0;
	min-height: 440px;
	/* Sized by the band and the rules below, never by its pictures */
	contain: size;
	box-sizing: border-box;
	display: grid;
	gap: 3px;
	background: var(--fh-accent-dark);
}

.fh-mosaic .fh-welcome-photo {
	width: 100%;
	height: 100%;
}

/* Each tile is drawn on its own (isolation), so its tint blends with nothing outside it, and
   pointing at one redraws only that tile */
.fh-tile {
	position: relative;
	display: block;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
	isolation: isolate;
	background: var(--fh-accent);
}

/* Each picture in greys tinted with the band's colour, so records, sepia photographs and colour
   snapshots read as one: a layer of the colour over it gives the greys its hue. In full colour,
   the layer faded out, when pointed at or reached with the keyboard. */
.fh-tile img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
	filter: grayscale(1);
	opacity: 0.85;
	transition:
		filter 150ms ease,
		opacity 150ms ease;
}

.fh-tile::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--fh-accent);
	mix-blend-mode: color;
	pointer-events: none;
	z-index: 1;
	transition: opacity 150ms ease;
}

.fh-tile-doc img {
	object-position: top;
}

.fh-tile:hover img,
.fh-tile:focus-visible img {
	filter: none;
	opacity: 1;
}

.fh-tile:hover::before,
.fh-tile:focus-visible::before {
	opacity: 0;
}

.fh-tile:focus-visible {
	outline: none;
}

.fh-tile:focus-visible::after {
	content: "";
	position: absolute;
	z-index: 2;
	inset: 3px;
	outline: 3px solid #ffffff;
}

@media (prefers-reduced-motion: reduce) {
	.fh-tile img,
	.fh-tile::before {
		transition: none;
	}
}

/* The old collage: shown when there is no script, or too few pictures for the mosaic */
.fh-welcome-photo {
	box-sizing: border-box;
	background: url("../img/header.jpg") center / cover no-repeat #d9d4ca;
}

/* Four figures under the hero, each numeral above its label, on a pale band across the window */
.fh-main .fh-band.fh-figures {
	position: relative;
	box-shadow: 0 0 0 100vmax var(--fh-paper);
	background: var(--fh-paper);
	color: var(--fh-ink);
	padding: 28px 0 30px;
	/* The space between the band and "The four families" */
	margin: 0 0 32px;
}

/* The rule under the band runs from edge to edge of the window and no further: unlike a box
   shadow, a real box that reached 100vmax past the edges made the page wider than a phone,
   so it could be scrolled sideways. The band is centred, so 50% - 50vw is the window's edge. */
.fh-main .fh-figures::after {
	content: "";
	position: absolute;
	left: calc(50% - 50vw);
	right: calc(50% - 50vw);
	bottom: 0;
	border-bottom: 1px solid var(--fh-line);
}

.fh-figures-list {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px 40px;
	align-items: start;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fh-figures-list li {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	margin: 0;
}

.fh-figure-num {
	font-family: var(--fh-serif);
	font-size: 42px;
	line-height: 1;
	font-weight: 500;
	color: var(--fh-accent);
}

.fh-figure-label {
	font-size: 15px;
	line-height: 1.4;
	color: var(--fh-ink-2);
}

/* Tablets: the text, then the mosaic, across the column */
@media (max-width: 999px) {
	.fh-main .fh-welcome {
		flex-direction: column;
	}

	.fh-welcome-text {
		flex: none;
		padding: 40px 0 32px;
	}

	.fh-welcome h1 {
		font-size: 44px;
	}

	.fh-couples p {
		font-size: 16px;
	}

	.fh-mosaic {
		flex: none;
		min-height: 0;
		height: 300px;
	}
}

/* Two figures to a row where four do not fit */
@media (max-width: 879px) {
	.fh-figures-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Phones: the headline over the mosaic, which runs across the screen */
@media (max-width: 699px) {
	.fh-welcome-text {
		padding: 32px calc(20px - var(--fh-gutter)) 28px;
	}

	.fh-welcome h1 {
		font-size: min(30px, 8.6vw);
		line-height: 1.12;
	}

	.fh-welcome h1 > span {
		white-space: nowrap;
	}

	.fh-couples {
		display: none;
	}

	.fh-mosaic {
		height: 200px;
		margin: 0 calc(-1 * var(--fh-gutter));
	}

	.fh-figure-num {
		font-size: 36px;
	}

	.fh-figure-label {
		font-size: 14px;
	}

	.fh-figures-list {
		gap: 20px 24px;
	}
}

.fh-section {
	margin-top: 26px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
}

.fh-section:first-of-type {
	margin-top: 0;
}

body.fh .fh-section h2 {
	margin: 0;
	font-size: 28px;
	line-height: 1.1;
	color: var(--fh-ink);
}

.fh-section > p {
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
	max-width: 78ch;
}

/* The four families, two to a row; each in its own colours */
.fh-lines {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	align-items: start;
}

table.fh-linebox {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--fh-line);
	background: #ffffff;
	scroll-margin-top: 12px;
}

table.fh-linebox th {
	width: 128px;
	box-sizing: border-box;
	padding: 8px 10px;
	text-align: right;
	vertical-align: top;
	font-size: 13.5px;
	font-weight: 700;
	background: var(--fh-tint);
	color: var(--fh-accent-dark);
	border-top: 1px solid var(--fh-line);
}

table.fh-linebox td {
	padding: 8px 12px;
	vertical-align: top;
	font-size: 15px;
	line-height: 1.4;
	border-top: 1px solid var(--fh-line);
}

table.fh-linebox a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

table.fh-linebox tr.fh-linehead th,
table.fh-linebox tr.fh-linehead td {
	border-top: 2px solid var(--fh-accent);
}

table.fh-linebox tr.fh-linehead th {
	background: var(--fh-accent);
	color: #ffffff;
}

/* The family's name, as a heading */
table.fh-linebox tr.fh-linehead th {
	padding-top: 10px;
	font-family: var(--fh-serif);
	font-size: 26px;
	font-weight: 600;
	line-height: 1.05;
}

table.fh-linebox tr.fh-linehead td {
	background: var(--fh-shade);
	box-shadow:
		inset -2px 0 0 var(--fh-accent),
		inset 0 -2px 0 var(--fh-accent);
	font-size: 16px;
}

/* The family tabs (fh_branch_tabs() in branches.php), on the home, statistics and places pages:
   each tinted in its family's colour (--fh-tab, set on the tab) with a bar of it along the top,
   the chosen one filled, a count after the name in small. The strip scrolls sideways rather than
   wrap, without a scrollbar; the line under it is the page's colour. It stays at the top of the
   window as the page scrolls, below any fixed header (--fh-stick-top), on white to the window's
   edges, over a map (whose layers keep to themselves) */
.fh-branchtabs {
	position: sticky;
	top: var(--fh-stick-top);
	z-index: 50;
	padding-top: 6px;
	background: #ffffff;
	box-shadow: 0 0 0 100vmax #ffffff;
	clip-path: inset(0 -100vmax);
	display: flex;
	gap: 3px;
	overflow-x: auto;
	scrollbar-width: none;
	border-bottom: 3px solid var(--fh-accent);
}

.fh-branchtabs::-webkit-scrollbar {
	display: none;
}

.fh-branchtabs > a,
.fh-branchtabs > button {
	flex: none;
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	margin: 0;
	padding: 0 14px;
	border: 0;
	border-radius: 6px 6px 0 0;
	font: 700 14.5px/1 var(--fh-sans);
	text-decoration: none;
	cursor: pointer;
	color: color-mix(in srgb, var(--fh-tab, var(--fh-accent)) 70%, #000000);
	background: color-mix(in srgb, var(--fh-tab, var(--fh-accent)) 13%, #ffffff);
	box-shadow: inset 0 3px 0 var(--fh-tab, var(--fh-accent));
}

body.fh .fh-branchtabs > a:link,
body.fh .fh-branchtabs > a:visited {
	color: color-mix(in srgb, var(--fh-tab, var(--fh-accent)) 70%, #000000);
	text-decoration: none;
}

body.fh .fh-branchtabs > a:hover,
.fh-branchtabs > button:hover {
	background: color-mix(in srgb, var(--fh-tab, var(--fh-accent)) 22%, #ffffff);
}

body.fh .fh-branchtabs > [aria-pressed="true"],
body.fh .fh-branchtabs > a[aria-current] {
	background: var(--fh-tab, var(--fh-accent));
	color: #ffffff;
	box-shadow: none;
}

.fh-branchtabs small {
	margin-left: 5px;
	font-size: 12px;
	font-weight: 500;
	opacity: 0.8;
}

/* The home page's tabs scroll with the page, and its chart sits straight under them, the chart's
   top edge (in the chosen family's colour) their line; the negative margin takes back the gap its
   section puts between them */
#chart .fh-branchtabs {
	position: static;
	padding-top: 0;
	box-shadow: none;
	clip-path: none;
	border-bottom: 0;
	margin-bottom: -10px;
}

.fh-chartbox {
	border: 1px solid var(--fh-line);
	border-top: 3px solid var(--fh-accent);
	background: #ffffff;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.fh-chartbox iframe {
	display: block;
	border: none;
}

/* Brick walls and chief interests, side by side. The interests column is never narrower than
   its table, whose long place names ("Brackley, Northamptonshire") would otherwise push it
   past the window just above 1000px; the brick walls give up the room instead. (min-content,
   not auto: sections have min-width: 0, which turns auto into nothing.) */
.fh-twocol {
	margin-top: 26px;
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(min-content, 1fr);
	gap: 26px 28px;
	align-items: start;
}

.fh-twocol .fh-section {
	margin-top: 0;
}

table.fh-list {
	border-collapse: collapse;
	width: 100%;
	border: 1px solid var(--fh-line);
	background: #ffffff;
}

table.fh-list th {
	text-align: left;
	padding: 8px 10px;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--fh-accent-dark);
	background: var(--fh-tint);
	border-bottom: 2px solid var(--fh-accent);
	white-space: nowrap;
}

table.fh-list td {
	padding: 7px 10px;
	font-size: 15px;
	line-height: 1.35;
	border-top: 1px solid var(--fh-line);
	vertical-align: top;
}

table.fh-list a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.fh-nowrap {
	white-space: nowrap;
}

.fh-chip {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 3px;
	font-size: 12.5px;
	font-weight: 700;
	color: #ffffff;
	background: var(--fh-accent);
	white-space: nowrap;
}

form.fh-admin {
	margin-top: 2em;
	color: var(--fh-muted);
}

form.fh-admin + form.fh-admin {
	margin-top: 0;
}

form.fh-admin input[type="submit"] {
	margin-right: 8px;
}

form.fh-admin input[type="submit"]:disabled {
	opacity: 0.45;
	cursor: default;
}

/* ---------------------------------------------------------------- charts */

/* Wide charts scroll sideways inside the page rather than widening it */
.fh-main #outer,
.fh-main #vcontainer,
.fh-main .fh-scroll {
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* TNG's chart boxes take their colours from its pedigree settings, set in the admin area;
   here they are white with a light edge, and a person's branch colour down the left */
.fh-main .pedbox {
	background-color: #ffffff !important;
	border: 1px solid var(--fh-line) !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
	border-radius: 4px !important;
}

/* ---------------------------------------------------------------- footer */

.fh-footer {
	margin-top: 26px;
	background: var(--fh-paper);
	border-top: 1px solid var(--fh-line);
}

.fh-footer .fh-wrap {
	padding-top: 14px;
	padding-bottom: 18px;
	display: flex;
	justify-content: space-between;
	gap: 4px 20px;
	flex-wrap: wrap;
	font-size: 13.5px;
	color: var(--fh-muted);
}

.fh-footer .fh-brand,
.fh-footer .fh-brand:link,
.fh-footer .fh-brand:visited {
	font-size: 17px;
	color: var(--fh-ink);
}

/* ---------------------------------------------------------------- narrower screens */

/* Below 1,000px the menu folds into a button, opening as a list in which each drop-down opens in
   place beneath its name; the search box stays in the bar */
@media (max-width: 999px) {
	.fh-bar {
		flex-wrap: nowrap;
		justify-content: space-between;
		padding-right: 2px;
	}

	.fh-bar-buttons {
		display: flex;
	}

	.fh-sitenav,
	.fh-toggle[popovertarget="fh-search"] {
		display: none;
	}

	.fh-search {
		margin-left: auto;
	}

	.fh-header {
		position: relative;
	}

	/* The site menu, and on a phone the search box, open below the bar and the stripe */
	#fh-sitenav:popover-open,
	#fh-search:popover-open {
		display: flex;
		position: absolute;
		left: 0;
		right: 0;
		top: 65px; /* the bar and the stripe; a popover is placed from the page's top */
		width: auto;
		margin: 0;
		z-index: 40;
		background: var(--fh-accent-dark);
		padding: 8px var(--fh-gutter) 14px;
		box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
	}

	#fh-sitenav:popover-open {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		max-height: calc(100dvh - 65px);
		overflow-y: auto;
		box-sizing: border-box;
	}

	#fh-sitenav:popover-open > a,
	#fh-sitenav:popover-open .fh-menu > summary {
		display: flex;
		align-items: center;
		min-height: 44px;
		font-size: 16px;
	}

	#fh-sitenav:popover-open > .fh-login,
	#fh-sitenav:popover-open > .fh-edit-page {
		margin-left: 0;
	}

	#fh-sitenav:popover-open .fh-menu > ul {
		position: static;
		min-width: 0;
		max-height: none;
		overflow: visible;
		margin: 0 0 8px;
		border-radius: 4px;
		box-shadow: none;
	}

	#fh-sitenav:popover-open .fh-menu li a {
		padding: 10px 14px;
		font-size: 16px;
		white-space: normal;
	}

	.fh-header:has(#fh-sitenav:popover-open) .fh-toggle[popovertarget="fh-sitenav"],
	.fh-header:has(#fh-search:popover-open) .fh-toggle[popovertarget="fh-search"] {
		background: rgba(255, 255, 255, 0.16);
	}
}

/* On a phone the search box folds into a button too, and opens below the bar */
@media (max-width: 699px) {
	.fh-brand,
	.fh-brand:link,
	.fh-brand:visited {
		font-size: 24px;
	}

	.fh-search {
		display: none;
	}

	.fh-toggle[popovertarget="fh-search"] {
		display: inline-flex;
	}

	body.fh #fh-search:popover-open input[type="text"] {
		font-size: 16px;
	}
}

@media (max-width: 1000px) {
	.fh-lines,
	.fh-twocol {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media screen and (max-width: 720px) {
	/* The home page on a phone */
	table.fh-linebox th {
		width: 96px;
	}

	table.fh-linebox tr.fh-linehead th {
		font-size: 21px;
	}

	/* Brick walls as cards: name and family, then birth, then relationship */
	table.fh-walls,
	table.fh-walls tbody {
		display: block;
	}

	table.fh-walls thead {
		display: none;
	}

	table.fh-walls tr {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		column-gap: 10px;
		row-gap: 1px;
		padding: 8px 10px;
		border-top: 1px solid var(--fh-line);
	}

	table.fh-walls tr:first-child {
		border-top: none;
	}

	table.fh-walls td {
		display: block;
		padding: 0;
		border: none;
	}

	table.fh-walls td.fh-wall-name {
		grid-row: 1;
		font-size: 16px;
		font-weight: 700;
	}

	table.fh-walls td.fh-wall-family {
		grid-row: 1;
		grid-column: 2;
		align-self: baseline;
	}

	table.fh-walls td.fh-wall-born,
	table.fh-walls td.fh-wall-rel {
		grid-column: 1 / -1;
	}

	table.fh-walls td.fh-wall-rel {
		color: var(--fh-ink-2);
	}

	/* Chief interests as cards in the same way: surname and family, then place, then period,
	   since four columns of long place names are wider than a phone */
	table.fh-interests,
	table.fh-interests tbody {
		display: block;
	}

	table.fh-interests thead {
		display: none;
	}

	table.fh-interests tr {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		column-gap: 10px;
		row-gap: 1px;
		padding: 8px 10px;
		border-top: 1px solid var(--fh-line);
	}

	table.fh-interests tr:first-child {
		border-top: none;
	}

	table.fh-interests td {
		display: block;
		padding: 0;
		border: none;
	}

	table.fh-interests td.fh-int-surname {
		grid-row: 1;
		font-size: 16px;
		font-weight: 700;
	}

	table.fh-interests td.fh-int-family {
		grid-row: 1;
		grid-column: 2;
		align-self: baseline;
	}

	table.fh-interests td.fh-int-place,
	table.fh-interests td.fh-int-period {
		grid-column: 1 / -1;
	}

	.fh-main h1.header {
		font-size: 38px;
		padding: 12px 0;
	}

	.fh-main .fh-namebar {
		padding-top: 12px;
		padding-bottom: 10px;
	}

	.fh-main #nameheader {
		font-size: 38px;
	}

	.fh-main #nameheader + .normal {
		font-size: 19px;
	}

	.fh-sex {
		font-size: 10.5px;
	}

	#tngmenu {
		padding-top: 6px;
	}

	/* The tabs keep to one line (More takes the rest); without js/template.js the links under
	   them wrap */
	ul#tngnav {
		flex-wrap: nowrap;
		position: relative;
	}

	#tngnav li {
		flex: none;
	}

	.fh-more > details > summary {
		min-height: 44px;
		padding: 0 10px;
	}

	#tngnav a,
	#tngnav a:link,
	#tngnav a:visited,
	#tngnav a.here,
	#tngnav a.here:hover {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
		box-sizing: border-box;
		padding: 0 10px !important;
		white-space: nowrap;
	}

	#pub-innermenu {
		flex-wrap: wrap;
		column-gap: 14px;
		padding: 0;
		position: relative;
	}

	#pub-innermenu a,
	#pub-innermenu a:link,
	#pub-innermenu a:visited {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
	}

	#pub-innermenu a.fh-add,
	#pub-innermenu a.fh-add:link,
	#pub-innermenu a.fh-add:visited {
		min-height: 32px;
		margin: 6px 0;
	}

	.fh-inmore > summary {
		min-height: 44px;
	}

	/* Tables of facts: each row wraps. An event's label and date share a tinted first line,
	   and its place takes the full width beneath; the rows that follow are plain blocks. */
	.fh-main table.tfixed,
	.fh-main table.tfixed > tbody {
		display: block;
		width: 100%;
	}

	.fh-main table.tfixed col {
		display: none;
	}

	.fh-main table.tfixed > tbody > tr {
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
	}

	.fh-main table.tfixed > tbody > tr > td {
		display: block;
		box-sizing: border-box;
		border-top: none;
	}

	.fh-main table.tfixed > tbody > tr > td.fieldnameback {
		flex: 1 1 auto;
		text-align: left;
		padding: 4px 10px;
		border-top: 1px solid var(--fh-line);
		align-self: stretch;
	}

	/* Only a row with a cell after the date is an event; a section with one cell beside its
	   label (Sources, Research) and the event map's map take the full width beneath it.
	   :where() keeps the tests out of the specificity, so the milestone rules below still win. */
	.fh-main
		table.tfixed
		> tbody
		> tr
		> td.fieldnameback
		+ td.databack:not([colspan]):where(:has(+ td.databack):not(li#eventmap td)) {
		flex: 0 1 auto;
		align-self: stretch;
		background: var(--fh-tint);
		border-top: 1px solid var(--fh-line);
		color: var(--fh-accent-dark);
		padding: 4px 10px;
		text-align: right;
	}

	.fh-main table.tfixed > tbody > tr > td.fieldnameback + td.databack[colspan] {
		flex: 1 1 100%;
	}

	.fh-main table.tfixed > tbody > tr > td.databack {
		flex: 1 1 100%;
		padding: 6px 10px 8px;
	}

	.fh-main table.tfixed > tbody > tr > td.fieldnameback + td.databack + td.databack {
		flex: 1 1 100%;
	}

	.fh-main #info tr[class^="t"] > td.databack[colspan="2"] {
		padding-left: 10px;
	}

	.fh-main #info tr[class^="t"] > td.databack[align="center"] {
		flex: 0 0 auto;
		padding-right: 0;
	}

	/* The thumbnail's shadow reaches past its cell; keep it above the title's shaded cell */
	.fh-main #info tr[class^="t"] > td.databack[align="center"] img.thumb {
		position: relative;
	}

	/* The event list under the map grows with its events instead of TNG's fixed 380px */
	.fh-main li#eventmap #mapevents {
		height: auto !important;
	}

	.fh-main #info tr[class^="t"] > td.databack[align="center"] + td.databack {
		flex: 1 1 0;
		min-width: 0;
		align-self: center;
	}

	.fh-main #info td.fieldnameback.fh-milestone + td.databack:not([colspan]) {
		background: var(--fh-accent);
		color: #ffffff;
	}

	.fh-main #info tr.fh-milestone-first > td.fh-date {
		color: #ffffff;
	}

	.fh-main #info tr.fh-milestone > td.databack:last-child {
		box-shadow:
			inset -2px 0 0 var(--fh-accent),
			inset 2px 0 0 var(--fh-accent);
	}

	/* A thumbnail and its title share a line: the box's left edge is on the thumbnail */
	.fh-main #info tr.fh-milestone > td.databack[align="center"]:first-child {
		background: var(--fh-shade);
		box-shadow: inset 2px 0 0 var(--fh-accent);
	}

	.fh-main #info tr.fh-milestone > td.databack[align="center"] + td.databack:last-child {
		box-shadow: inset -2px 0 0 var(--fh-accent);
	}

	/* The title is centred beside the thumbnail; the row behind it keeps the shading and edge */
	.fh-main #info tr.fh-milestone:has(> td.databack[align="center"]:first-child) {
		background: var(--fh-shade);
		box-shadow: inset -2px 0 0 var(--fh-accent);
	}

	.fh-main #info tr.fh-milestone-last:has(> td.databack[align="center"]:first-child) {
		box-shadow:
			inset -2px 0 0 var(--fh-accent),
			inset 0 -2px 0 var(--fh-accent);
	}

	.fh-main
		#info
		tr.fh-milestone-last:has(> td.databack[align="center"]:first-child)
		> td.databack {
		border-bottom: none;
	}

	.fh-main #info tr.fh-milestone-last > td.databack[align="center"]:first-child {
		box-shadow:
			inset 2px 0 0 var(--fh-accent),
			inset 0 -2px 0 var(--fh-accent);
	}

	.fh-main #info tr.fh-milestone-first > td.databack {
		border-top: none;
	}

	/* The calendar and the timeline chart scroll sideways within the page */
	.fh-main #mcontainer,
	.fh-main #tngchart {
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	/* A timeline bar's hidden popup would make the chart's box scroll up and down too, so it
	   takes no room until timeline2.php shows it */
	.fh-main #tngchart .popup:not([style*="visible"]) {
		display: none;
	}

	/* Search fields narrow to fit beside their labels */
	.fh-main input.medfield {
		width: 100%;
		max-width: 268px;
		box-sizing: border-box;
	}

	/* The top surnames and first names: no gap kept on their right */
	.fh-main .titlebox > div:has(> table.table-top30) {
		margin-right: 0 !important;
	}

	/* Search results as cards: name and ID, then birth and place */
	.fh-page-search .fh-main table:has(th.nbrcol),
	.fh-page-search .fh-main table:has(th.nbrcol) > tbody {
		display: block;
		width: 100%;
	}

	.fh-page-search .fh-main table:has(th.nbrcol) thead,
	.fh-page-search .fh-main table:has(th.nbrcol) tr > :first-child,
	.fh-page-search .fh-main table:has(th.nbrcol) tr > :nth-child(6) {
		display: none;
	}

	.fh-page-search .fh-main table:has(th.nbrcol) tr {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr) auto;
		column-gap: 10px;
		padding: 8px 10px;
		border-top: 1px solid var(--fh-line);
	}

	.fh-page-search .fh-main table:has(th.nbrcol) tr:first-child {
		border-top: none;
	}

	.fh-page-search .fh-main table:has(th.nbrcol) td {
		display: block;
		border: none;
		padding: 0;
		background: none !important;
	}

	.fh-page-search .fh-main table:has(th.nbrcol) td:nth-child(2) {
		grid-column: 1 / 3;
		font-size: 16px;
		white-space: normal;
	}

	.fh-page-search .fh-main table:has(th.nbrcol) td:nth-child(3) {
		text-align: right;
		align-self: baseline;
	}

	.fh-page-search .fh-main table:has(th.nbrcol) td:nth-child(4),
	.fh-page-search .fh-main table:has(th.nbrcol) td:nth-child(5) {
		grid-row: 2;
		font-size: 15px;
	}

	.fh-page-search .fh-main table:has(th.nbrcol) td:nth-child(4) {
		grid-column: 1;
		padding-right: 8px;
	}

	.fh-page-search .fh-main table:has(th.nbrcol) td:nth-child(5) {
		grid-column: 2 / -1;
	}
}

@media (max-width: 999px) {
	/* Wide tables (search results, lists) scroll sideways within the page. The box around the
	   table scrolls, not the table, so a table narrower than the page still fills it. That
	   includes the .fh-tablebox that js/template.js puts round a table with no box of its own. */
	.fh-main *:has(> table.whiteback:not(.tfixed)),
	.fh-main .fh-tablebox {
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	/* That box would cut off a person's or family's hover preview, so when shown it sits on the
	   screen instead, centred once there is room */
	.fh-main .person-prev {
		position: fixed;
		top: 64px;
		left: max(8px, calc(50vw - 260px));
		width: calc(100vw - 36px);
		max-width: 500px;
	}

	/* A table with no box of its own (the media list, search results) is given one by
	   js/template.js. Until then, or without scripts, it scrolls itself; as a block its rows
	   would only fill it if wide enough, so it is as wide as they are. */
	.fh-main > table.whiteback:not(.tfixed) {
		display: block;
		width: max-content;
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
}

@media (max-width: 359px) {
	/* The top surnames and first names: one list under the other, as two side by side
	   need 300px */
	.fh-main table.table-top30,
	.fh-main table.table-top30 > tbody,
	.fh-main table.table-top30 > tbody > tr,
	.fh-main table.table-top30 > tbody > tr > td {
		display: block;
	}

	.fh-main table.table-top30 td.table-gutter {
		display: none;
	}
}

/* ---------------------------------------------------------------- a place's page */

/* The place's pictures (place_page.php), in the heading's band, before the
   tabs: the lead (its default photo) large and two rows high, up to six more beside it in three
   columns. Up to three small pictures make one row as tall as the lead (fh-gallery-onerow); the
   last small picture widens to fill its row (fh-gallery-span2, -span3); with more than seven, the
   sixth small cell is "+N more" (fh-gallery-more). A lone picture fills the band. */
.fh-main .fh-gallery {
	display: grid;
	grid-template-columns: minmax(0, 2.1fr) repeat(3, minmax(0, 1fr));
	grid-auto-rows: 200px;
	gap: 6px;
	padding: 8px 0 22px;
}

.fh-main .fh-namebar:has(+ br + .fh-gallery) {
	padding-bottom: 6px;
}

.fh-gallery-pic {
	position: relative;
	display: block;
	overflow: hidden;
	background: var(--fh-accent-dark);
	border-radius: 3px;
	text-decoration: none;
	color: #ffffff;
}

.fh-gallery-pic img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 300ms ease;
}

.fh-gallery-pic:hover img,
.fh-gallery-pic:focus-visible img {
	transform: scale(1.04);
}

.fh-gallery-pic:focus-visible,
.fh-gallery-more:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: 2px;
}

.fh-gallery-lead {
	grid-row: span 2;
}

.fh-gallery-onerow .fh-gallery-pic:not(.fh-gallery-lead) {
	grid-row: span 2;
}

.fh-gallery-single .fh-gallery-lead {
	grid-column: 1 / -1;
}

.fh-gallery-span2 {
	grid-column: span 2;
}

.fh-gallery-span3 {
	grid-column: span 3;
}

/* Captions sit on a dark fade at the foot of each picture: the type, small, over the title */
.fh-gallery-cap {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 26px 10px 8px;
	background: linear-gradient(to top, rgba(14, 16, 32, 0.82), rgba(14, 16, 32, 0));
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.25;
}

/* An item with no picture of its own (a recording, a transcript) is its caption on the band */
.fh-gallery-noimg .fh-gallery-cap {
	top: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	background: none;
}

.fh-gallery-kind {
	display: block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.8;
}

.fh-gallery-lead .fh-gallery-cap {
	padding: 60px 18px 14px;
	font-family: var(--fh-serif);
	font-size: 26px;
	font-weight: 500;
}

.fh-gallery-lead .fh-gallery-kind {
	font-family: var(--fh-sans);
	margin-bottom: 4px;
}

.fh-gallery-more {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	padding: 14px 16px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 3px;
	text-decoration: none;
	font-size: 14px;
}

.fh-gallery-more-num {
	font-family: var(--fh-serif);
	font-size: 42px;
	line-height: 1;
}

.fh-gallery-more-go {
	margin-top: 6px;
	font-weight: 600;
}

.fh-gallery-more:hover {
	background: rgba(255, 255, 255, 0.08);
}

.fh-gallery-more:hover .fh-gallery-more-go {
	text-decoration: underline;
}

body.fh .fh-gallery a,
body.fh .fh-gallery a:visited,
body.fh .fh-gallery a span {
	color: #ffffff;
}

.fh-main .fh-place-figures {
	margin-bottom: 8px;
}

/* Where it is: under its heading, the map, three-fifths of the width, beside the place's
   details; the details under the map on a tablet or phone, as .fh-twocol has them */
.fh-place-where-cols {
	display: grid;
	grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	gap: 26px 28px;
	align-items: start;
}

@media (max-width: 1000px) {
	.fh-place-where-cols {
		grid-template-columns: minmax(0, 1fr);
	}
}

.fh-place-map {
	width: 100%;
	height: 340px;
	border-radius: 6px;
	border: 1px solid var(--fh-line);
}

/* The heading over a map and its key */
body.fh h3.fh-map-heading {
	margin: 26px 0 10px;
	font-size: 22px;
}

/* A map's numbered pins (js/fh-nlsmaps.js): a drop in the page's colour with a white edge, its
   number upright on it, its point on the place, as the key's numbers are drawn */
.fh-map-marker {
	background: none;
	border: none;
}

.fh-map-marker-drop {
	position: absolute;
	left: 2px;
	top: 1px;
	width: 26px;
	height: 26px;
	box-sizing: border-box;
	border: 2px solid #ffffff;
	border-radius: 50% 50% 50% 0;
	background: var(--fh-accent);
	box-shadow: -1px 1px 4px rgba(0, 0, 0, 0.35);
	transform: rotate(-45deg);
}

.fh-map-marker-n {
	position: absolute;
	left: 0;
	top: 6px;
	width: 30px;
	color: #ffffff;
	font: 700 12.5px/16px var(--fh-sans);
	text-align: center;
}

/* A map with its key (fh_map_with_key() in fh_parts.php): the key of numbered pins beside the
   map, as tall as it and scrolling within; under it below 1,000px */
.fh-map-panel {
	display: grid;
	grid-template-columns: minmax(0, 1.7fr) minmax(16em, 1fr);
	gap: 16px;
	align-items: start;
}

.fh-map-key {
	max-height: 340px;
	overflow-y: auto;
	margin: 0;
	padding: 0 4px 0 0;
	list-style: none;
	font-size: 14px;
	line-height: 1.4;
}

.fh-map-key li {
	display: grid;
	grid-template-columns: 2em minmax(0, 1fr);
	gap: 0 6px;
	padding: 5px 0;
}

.fh-map-key li + li {
	border-top: 1px solid var(--fh-paper);
}

.fh-map-key .fh-map-pin {
	justify-self: start;
	align-self: start;
	margin: 1px 0 0;
}

.fh-map-key-lines {
	display: block;
	color: var(--fh-ink-2);
}

@media (max-width: 999px) {
	.fh-map-panel {
		grid-template-columns: minmax(0, 1fr);
	}

	.fh-map-key {
		max-height: none;
	}
}

.fh-place-facts dl {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	gap: 10px 18px;
	margin: 0;
	font-size: 16px;
	line-height: 1.45;
}

.fh-place-facts dt {
	font-weight: 600;
	color: var(--fh-accent-dark);
}

.fh-place-facts dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.fh-place-facts p {
	margin: 6px 0 0;
	font-weight: 600;
}

/* Who was here: one entry per household, in date order down a line, its year on the left */
/* Its space above is kept on a page with no gallery, where it is the first section, which
   .fh-section:first-of-type would otherwise set to nothing; so is that of "Where it is" */
.fh-main .fh-place-who {
	margin-top: 36px;
}

.fh-main section.fh-place-where {
	margin-top: 26px;
}

/* The description runs the full width, as the timeline does */
.fh-place-who > p {
	max-width: none;
	color: var(--fh-ink-2);
}

.fh-households {
	list-style: none;
	margin: 10px 0 0;
	padding: 0;
}

.fh-household {
	display: grid;
	grid-template-columns: 76px minmax(0, 1fr);
	gap: 0 22px;
}

/* The year, the circle and the couple's names share a line: the names' first line is 27.5px
   high, so each is centred 14px down */
.fh-household-year {
	padding-top: 1px;
	text-align: right;
	font-family: var(--fh-serif);
	font-size: 26px;
	line-height: 1;
	color: var(--fh-accent);
}

.fh-household-body {
	position: relative;
	padding: 0 0 30px 24px;
	border-left: 2px solid var(--fh-line);
}

/* The line runs on to the bottom of the list, through the last decade or household */
.fh-household:last-child .fh-household-body {
	padding-bottom: 0;
}

.fh-household-body::before {
	content: "";
	position: absolute;
	left: -7px;
	top: 8px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #ffffff;
	border: 2px solid var(--fh-accent);
	box-sizing: border-box;
}

body.fh .fh-household-body h3 {
	margin: 0 0 4px;
	font-size: 22px;
	line-height: 1.25;
}

.fh-household-meta {
	margin: 0 0 10px;
	font-size: 14.5px;
	color: var(--fh-muted);
}

.fh-household-row {
	display: grid;
	grid-template-columns: 120px minmax(0, 1fr);
	gap: 4px 16px;
	margin-top: 6px;
	font-size: 16px;
	line-height: 1.6;
}

.fh-household-label {
	padding-top: 3px;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--fh-muted);
}

/* First names with their years, in a line, between middots; each dot ends its item, so a line
   that wraps never begins with one */
.fh-household-names {
	margin: 0;
	padding: 0;
	list-style: none;
}

.fh-household-names li {
	display: inline;
	white-space: nowrap;
}

.fh-household-names li:not(:last-child)::after {
	content: "·";
	margin: 0 5px 0 9px;
	color: var(--fh-muted);
}

.fh-household-y {
	color: var(--fh-ink-2);
}

.fh-household-d {
	color: var(--fh-muted);
	font-size: 14px;
}

/* Everyone with an event here who is in no household, in two columns where there is room */
body.fh .fh-place-who > h3 {
	margin: 26px 0 0;
	font-size: 22px;
}

.fh-place-also {
	margin: 0;
	padding: 0;
	list-style: none;
	columns: 2 340px;
	column-gap: 40px;
	font-size: 16px;
	line-height: 1.5;
}

.fh-place-also li {
	break-inside: avoid;
	padding: 3px 0;
}

/* Places within it: the busiest as the places index's cards, then the others A to Z, each with
   its people and years, quieter than the name */
.fh-place-children h3 {
	margin: 26px 0 8px;
}

.fh-place-who > p.fh-place-cut {
	font-size: 15px;
	color: var(--fh-muted);
}

.fh-place-cut a {
	font-weight: 600;
}

/* Filters (fh_filter_row() in place_page.php): a place's events, the browse pages' photos. Each
   row is named in a column of its own, then its pills, the chosen one filled; a long row folds
   its rest under "+N more", which opens in the row. On a phone the name sits above its pills. */
.fh-filters {
	display: grid;
	gap: 8px;
	margin: 6px 0 12px;
}

.fh-filter {
	display: flex;
	gap: 12px;
	align-items: baseline;
}

.fh-filter-label {
	flex: 0 0 76px;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--fh-muted);
}

.fh-filter-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	font-size: 14px;
	font-weight: 500;
}

.fh-filter-pills a,
.fh-filter-pills span[aria-current],
.fh-filter-more > summary {
	padding: 3px 12px;
	border: 1px solid var(--fh-line);
	border-radius: 999px;
}

.fh-filter-pills span[aria-current] {
	border-color: var(--fh-accent);
	background: var(--fh-accent);
	color: #ffffff;
}

body.fh .fh-filter-pills a:link,
body.fh .fh-filter-pills a:visited {
	text-decoration: none;
}

/* A count beside a pill's words: lighter, its figures in line */
.fh-filter-n {
	margin-left: 2px;
	font-size: 12.5px;
	font-variant-numeric: tabular-nums;
	opacity: 0.7;
}

.fh-filter-more {
	display: contents;
}

.fh-filter-more > summary {
	list-style: none;
	white-space: nowrap;
	cursor: pointer;
	color: var(--fh-accent);
	font-weight: 600;
}

.fh-filter-more > summary::-webkit-details-marker {
	display: none;
}

.fh-filter-more[open] > summary {
	display: none;
}

@media (max-width: 560px) {
	.fh-filter {
		display: block;
	}

	.fh-filter-label {
		display: block;
		margin-bottom: 4px;
	}

	.fh-filter-label:empty {
		display: none;
	}
}

/* By date: a decade to each circle, each event a row of its date and a sentence */
.fh-register-rows {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* The first row on the line of its decade and circle */
.fh-register-rows li:first-child {
	padding-top: 2px;
}

.fh-register-rows li {
	display: grid;
	grid-template-columns: 11em minmax(0, 1fr);
	gap: 0 14px;
	padding: 4px 0;
	font-size: 16px;
	line-height: 1.45;
}

.fh-register-rows li + li {
	border-top: 1px solid var(--fh-paper);
}

/* Wide enough for the longest single date, "Bef 5 Mar 1699/1700"; only a span ("Between
   10 Oct 1765 and 27 Feb 1767") wraps */
.fh-register-date {
	color: var(--fh-ink-2);
	font-variant-numeric: tabular-nums;
}

/* Phones: the date over its sentence */
@media (max-width: 699px) {
	.fh-register-rows li {
		grid-template-columns: minmax(0, 1fr);
	}

	.fh-register-date {
		font-size: 14px;
		color: var(--fh-muted);
	}
}

@media (prefers-reduced-motion: reduce) {
	.fh-gallery-pic img {
		transition: none;
	}
}

/* Tablets: the lead across the band, the others in rows of three beneath it */
@media (max-width: 999px) {
	.fh-main .fh-gallery {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		grid-template-rows: 300px;
		grid-auto-rows: 150px;
	}

	.fh-gallery-lead {
		grid-row: auto;
		grid-column: 1 / -1;
	}
}

/* Phones: the pictures run to the screen's edges; the years narrow */
@media (max-width: 699px) {
	.fh-main .fh-gallery {
		margin: 0 calc(-1 * var(--fh-gutter));
		padding: 0 0 14px;
		gap: 3px;
		grid-template-rows: 240px;
		grid-auto-rows: 110px;
	}

	.fh-gallery-pic {
		border-radius: 0;
	}

	.fh-gallery-lead .fh-gallery-cap {
		font-size: 21px;
		padding: 40px 14px 10px;
	}

	.fh-gallery-pic:not(.fh-gallery-lead) .fh-gallery-cap {
		font-size: 12px;
		padding: 18px 6px 5px;
	}

	.fh-gallery-pic:not(.fh-gallery-lead):not(.fh-gallery-placed) .fh-gallery-kind {
		display: none;
	}

	.fh-gallery-placed:not(.fh-gallery-lead) .fh-gallery-kind {
		font-size: 9.5px;
		letter-spacing: 0.04em;
	}

	.fh-gallery-more {
		padding: 8px 10px;
		font-size: 12px;
		border: 0;
	}

	.fh-gallery-more-num {
		font-size: 30px;
	}

	.fh-place-map {
		height: 260px;
	}

	.fh-household {
		grid-template-columns: 44px minmax(0, 1fr);
		gap: 0 14px;
	}

	.fh-household-year {
		padding-top: 5px;
		font-size: 18px;
	}

	.fh-household-body {
		padding-left: 18px;
	}

	.fh-household-row {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}
}

/* ---------------------------------------------------------------- the places index */

/* The places index (places.php and the search's list, places-oneletter.php, built by
   places_index.php): the figures band, then the map of every place, the
   busiest parishes as cards and every place by country and county, under a search box. */
.fh-places-where .fh-places-map {
	width: 100%;
	height: 560px;
	border-radius: 6px;
	border: 1px solid var(--fh-line);
}

/* The historic map's paper (OS c.1900, the map it opens on, zoomed out to every place) where
   the maps have no tile, as past their east edge, instead of Leaflet's grey */
.fh-places-where .fh-places-map.leaflet-container {
	background: #ded8c2;
}

/* The key to the circles' colours, under the map, and the words on them: not while Google's map,
   with numbered pins, is shown (js/fh-nlsmaps.js marks it fh-nls-google) */
.fh-places-where:has(.fh-nls-google) .fh-places-key,
.fh-places-where:has(.fh-nls-google) .fh-places-coloured {
	display: none;
}

.fh-places-key {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
	color: var(--fh-muted);
}

.fh-places-key li {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}

.fh-places-swatch {
	width: 12px;
	height: 12px;
	border: 1.5px solid #ffffff;
	border-radius: 50%;
	box-shadow: 0 0 0 1px var(--fh-line);
	opacity: 0.85;
}

.fh-places-abroad {
	color: var(--fh-muted);
	font-size: 15px;
}

/* A circle's balloon: the place, linked, over its people and years */
.fh-places-balloon {
	font: 14px/1.45 var(--fh-sans);
}

.fh-places-balloon a {
	font-family: var(--fh-serif);
	font-size: 17px;
	font-weight: 500;
}

/* The busiest parishes: four cards to a row, each a picture over the name, the county and the
   people, like the gallery's tiles */
.fh-places-cards {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
}

.fh-places-cards li {
	margin: 0;
}

.fh-places-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	border: 1px solid var(--fh-line);
	border-radius: 6px;
	overflow: hidden;
	background: #ffffff;
	text-decoration: none;
	color: var(--fh-ink);
}

.fh-places-card:link,
.fh-places-card:visited {
	color: var(--fh-ink);
}

.fh-places-card-pic {
	display: block;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: var(--fh-tint);
}

.fh-places-card-name {
	padding: 12px 14px 0;
	font-family: var(--fh-serif);
	font-size: 22px;
	line-height: 1.15;
	font-weight: 500;
	color: var(--fh-accent);
}

.fh-places-card:hover .fh-places-card-name {
	text-decoration: underline;
}

.fh-places-card-where {
	padding: 2px 14px 0;
	font-size: 14px;
	color: var(--fh-muted);
}

.fh-places-card-people {
	padding: 8px 14px 14px;
	font-size: 15px;
	color: var(--fh-ink-2);
}

/* A card with no photo shows the historic map at the place (fh_places_tiles()), nine tiles
   placed so that the place is in the middle, with a pin; with no map either, the place's initial */
.fh-places-card-pic {
	position: relative;
}

.fh-places-tiles {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

body.fh .fh-places-tiles img {
	position: absolute;
	width: 256px;
	height: 256px;
	max-width: none;
}

.fh-places-initial {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	font-family: var(--fh-serif);
	font-size: 72px;
	color: color-mix(in srgb, var(--fh-accent) 35%, #ffffff);
}

/* Find a place: a white field and the button, in the site's colour */
.fh-places-search {
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-width: 560px;
}

.fh-places-search label {
	font-weight: 600;
	font-size: 15px;
}

.fh-places-search-row {
	display: flex;
	gap: 8px;
}

.fh-places-search input[type="search"] {
	flex: 1;
	min-width: 0;
	height: 42px;
	padding: 0 12px;
	border: 1px solid var(--fh-line);
	border-radius: 4px;
	font: 16px var(--fh-sans);
	color: var(--fh-ink);
	background: #ffffff;
}

.fh-places-search button {
	-webkit-appearance: none;
	appearance: none;
	height: 42px;
	padding: 0 18px;
	border: none;
	border-radius: 4px;
	background: var(--fh-accent);
	color: #ffffff;
	font: 600 15px var(--fh-sans);
	cursor: pointer;
}

.fh-places-search button:hover,
.fh-places-search button:active {
	background: var(--fh-hover);
	color: #ffffff;
	border: none;
}

.fh-places-browse-intro {
	color: var(--fh-muted);
}

/* The family tabs, under the title band, and the figures band straight under them */
body.fh-page-places .fh-branchtabs {
	padding-top: 14px;
}

.fh-main .fh-branchtabs + .fh-figures {
	margin-top: 0;
}

/* Every place: the search's results, or every county's places, under a heading for each
   country */
.fh-places-found {
	color: var(--fh-muted);
	font-size: 14px;
}

.fh-places-every,
.fh-places-found-box {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.fh-places-every[hidden],
.fh-places-found-box[hidden] {
	display: none;
}

body.fh .fh-places-every h3.fh-places-country {
	margin: 18px 0 0;
	padding-bottom: 6px;
	border-bottom: 2px solid var(--fh-accent);
	font-size: 24px;
}

.fh-places-panel {
	border-bottom: 1px solid var(--fh-line);
	scroll-margin-top: 60px;
}

/* One county to a line: its name and counts; the arrow turns as it opens */
.fh-places-panel summary {
	display: flex;
	align-items: baseline;
	gap: 10px;
	padding: 9px 4px;
	list-style: none;
	cursor: pointer;
}

.fh-places-panel summary::-webkit-details-marker {
	display: none;
}

.fh-places-panel summary::before {
	content: "";
	flex: none;
	align-self: center;
	width: 7px;
	height: 7px;
	border-right: 2px solid var(--fh-accent);
	border-bottom: 2px solid var(--fh-accent);
	transform: rotate(-45deg);
	transition: transform 150ms ease;
}

.fh-places-panel[open] summary::before {
	transform: rotate(45deg);
}

.fh-places-panel summary:hover {
	background: var(--fh-shade);
}

.fh-places-panel-name {
	font-family: var(--fh-serif);
	font-size: 20px;
	font-weight: 500;
	color: var(--fh-accent);
}

.fh-places-panel-n {
	font-size: 14px;
	color: var(--fh-muted);
}

.fh-places-own {
	margin: 0 0 6px 21px;
	font-size: 14px;
}

.fh-places-panel .fh-places-tree {
	margin: 0 0 12px 21px;
}

/* A county's places in columns, each parish keeping its churches and streets with it */
.fh-places-tree,
.fh-places-results {
	margin: 0;
	padding: 0;
	list-style: none;
	columns: 3 280px;
	column-gap: 40px;
	font-size: 16px;
	line-height: 1.5;
}

.fh-places-tree > li,
.fh-places-results > li {
	break-inside: avoid;
	padding: 3px 0;
}

.fh-places-tree ul {
	margin: 2px 0 0 2px;
	padding: 0 0 0 14px;
	list-style: none;
	border-left: 1px solid var(--fh-line);
	font-size: 15px;
}

.fh-places-n {
	font-size: 13px;
	color: var(--fh-muted);
	white-space: nowrap;
}

/* The pages of the busiest parishes: where this page is, then the pages as pills, the one shown filled */
.fh-places-pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 10px 0 4px;
	font-size: 14px;
}

.fh-places-pager > a,
.fh-places-pager > span[aria-current] {
	min-width: 1.4em;
	padding: 3px 10px;
	border: 1px solid var(--fh-line);
	border-radius: 999px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

body.fh .fh-places-pager a:link,
body.fh .fh-places-pager a:visited {
	text-decoration: none;
}

.fh-places-pager > span[aria-current] {
	border-color: var(--fh-accent);
	background: var(--fh-accent);
	color: #ffffff;
	font-weight: 600;
}

.fh-places-pager-of {
	margin-right: 6px;
	color: var(--fh-muted);
	font-variant-numeric: tabular-nums;
}

.fh-places-pager-off,
.fh-places-pager-gap {
	padding: 3px 4px;
	color: var(--fh-muted);
	opacity: 0.6;
}

@media (max-width: 999px) {
	.fh-places-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.fh-places-where .fh-places-map {
		height: 440px;
	}
}

@media (max-width: 699px) {
	.fh-places-cards {
		gap: 12px;
	}

	.fh-places-card-name {
		font-size: 19px;
	}

	.fh-places-where .fh-places-map {
		height: 360px;
	}
}

/* Printed, a place's page and the places index are their words on paper, as a family's page is:
   the heading and figures without their bands, no photos, maps, tabs, filters or search, and no
   entry, card or heading left alone at the foot of a page */
@media print {
	body.fh-page-placesearch .fh-gallery,
	body.fh-page-placesearch .fh-place-map,
	body.fh-page-placesearch .fh-filters,
	body.fh-page-placesearch .fh-family-go,
	body.fh-page-placesearch .fh-placecard,
	body.fh-page-places .fh-branchtabs,
	body.fh-page-places .fh-places-where,
	body.fh-page-places .fh-places-search,
	body.fh-page-places .fh-places-pager,
	body.fh-page-places .fh-places-card-pic,
	body.fh-page-placesearch .fh-places-card-pic {
		display: none !important;
	}

	body.fh-page-placesearch .fh-main .fh-band,
	body.fh-page-places .fh-main .fh-band {
		box-shadow: none;
		clip-path: none;
		background: none;
		color: var(--fh-ink);
	}

	body.fh-page-placesearch .fh-main h1.header,
	body.fh-page-places .fh-main h1.header {
		padding: 0;
		font-size: 30px;
	}

	body.fh-page-placesearch .fh-main a:link,
	body.fh-page-placesearch .fh-main a:visited,
	body.fh-page-places .fh-main a:link,
	body.fh-page-places .fh-main a:visited {
		color: inherit;
		text-decoration: none;
	}

	body.fh-page-placesearch .fh-place-where-cols {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Every county's places are opened by js/places-index.js before printing */

	.fh-households > li,
	.fh-register-rows > li,
	.fh-places-cards > li,
	.fh-places-panel {
		break-inside: avoid;
	}

	body.fh-page-placesearch .fh-main h2,
	body.fh-page-placesearch .fh-main h3,
	body.fh-page-places .fh-main h2,
	body.fh-page-places .fh-main h3 {
		break-after: avoid;
	}
}

/* ---------------------------------------------------------------- Facts & Figures */

/* Facts & Figures (familystats.php, built by familystats_page.php): the family tabs, the figures
   band, the opening words, the four families, On this day, then the charts a section at a time,
   one or two to a row. A chart's columns and bars are sized by the figures, given as --fh-v (a
   height or width) and --fh-a (where a surname's span starts); the drawing is hidden from screen
   readers, and the table under "The figures" says the same in words. */
body.fh-page-familystats .fh-branchtabs {
	padding-top: 14px;
}

/* Five figures to a row where they fit */
@media (min-width: 1000px) {
	.fh-stats-figures .fh-figures-list {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
}

.fh-stats {
	display: flex;
	flex-direction: column;
}

.fh-stats > .fh-section {
	margin-top: 32px;
}

.fh-stats > .fh-section:first-of-type,
.fh-stats > .fh-figures + .fh-section {
	margin-top: 0;
}

.fh-stats-events {
	margin: 0;
	padding: 0 0 0 20px;
	font-size: 16px;
	line-height: 1.55;
	max-width: 78ch;
}

.fh-stats-more > summary {
	cursor: pointer;
	color: var(--fh-accent);
	font-size: 15px;
	margin: 4px 0;
}

/* The four families: each in its colour, its name, its words and a bar of its people */
.fh-stats-families {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fh-stats-families li {
	margin: 0;
	padding: 12px 14px;
	background: var(--fh-shade);
	border: 1px solid var(--fh-line);
	border-top: 3px solid var(--fh-accent);
	border-radius: 4px;
	font-size: 15px;
	line-height: 1.45;
	color: var(--fh-ink-2);
}

.fh-stats-family {
	display: block;
	font-family: var(--fh-serif);
	font-size: 22px;
	font-weight: 500;
	line-height: 1.2;
}

.fh-stats-families .fh-stats-hbar {
	margin-top: 8px;
}

/* A bar along a row (a family's people, a county's births): its width is the figure */
.fh-stats-hbar {
	display: block;
	width: var(--fh-v);
	min-width: 2px;
	height: 8px;
	margin-top: 4px;
	border-radius: 0 2px 2px 0;
	background: var(--fh-accent);
}

/* The charts: two to a row, one on a phone */
.fh-stats-section {
	gap: 22px;
}

.fh-stats-pair {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 22px 32px;
	align-items: start;
}

.fh-stats-chart {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

/* Two charts side by side share their rows (heading, words, drawing), and the drawings sit at
   the foot of theirs, so the columns stand on one baseline however long the words are */
.fh-stats-pair > .fh-stats-chart {
	display: grid;
	grid-template-rows: subgrid;
	grid-row: span 3;
	align-content: start;
}

.fh-stats-pair .fh-stats-body:has(.fh-stats-drawing) {
	align-self: end;
}

body.fh .fh-stats-chart h3 {
	margin: 0;
	font-family: var(--fh-serif);
	font-size: 22px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--fh-accent-dark);
}

.fh-stats-chart > p {
	margin: 0;
	font-size: 15.5px;
	line-height: 1.5;
	color: var(--fh-ink-2);
	max-width: 78ch;
}

/* The two series' colours: the page's colour, and a paler one */
.fh-stats-s1 {
	background: var(--fh-accent);
}

.fh-stats-s2 {
	background: color-mix(in srgb, var(--fh-accent) 40%, var(--fh-paper));
}

.fh-stats-key {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 16px;
	margin: 0 0 6px;
	padding: 0;
	list-style: none;
	font-size: 13px;
	color: var(--fh-ink-2);
}

.fh-stats-key li {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}

.fh-stats-swatch {
	width: 10px;
	height: 10px;
}

/* The drawing keeps its labels to itself, a little past its edges where the browser allows,
   so a label under the last column never makes the page scroll sideways */
.fh-stats-drawing {
	overflow-x: clip;
	overflow-clip-margin: 10px;
}

/* Columns: each a plot over its label; a column's height (--fh-v) is a share of the plot's, and
   a stacked column's parts shares of the column. The figure over a column is its data-top. */
.fh-stats-cols {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fh-stats-col {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
}

.fh-stats-col:hover .fh-stats-plot {
	background: var(--fh-paper);
}

/* A column's figures (its data-tip) over it on hover, or on a tap on a phone; in the chart's
   right half the box opens to the left, so it stays within the chart */
.fh-stats-col:hover::after {
	content: attr(data-tip);
	position: absolute;
	bottom: 100%;
	left: 0;
	z-index: 5;
	padding: 4px 8px;
	border-radius: 3px;
	background: var(--fh-ink);
	color: var(--fh-paper);
	font-size: 12.5px;
	line-height: 1.35;
	white-space: nowrap;
	pointer-events: none;
}

.fh-stats-col-right:hover::after {
	left: auto;
	right: 0;
}

.fh-stats-plot {
	display: flex;
	align-items: flex-end;
	gap: 1px;
	height: 150px;
	padding: 18px 1px 0;
	border-bottom: 1px solid var(--fh-muted);
}

.fh-stats-bar {
	position: relative;
	flex: 1 1 0;
	height: var(--fh-v);
	min-height: 1px;
	display: flex;
	flex-direction: column-reverse;
}

.fh-stats-seg {
	display: block;
	height: var(--fh-v);
}

.fh-stats-bar[data-top]::before {
	content: attr(data-top);
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	padding-bottom: 2px;
	font-size: 11px;
	line-height: 1.2;
	white-space: nowrap;
	color: var(--fh-muted);
}

/* The labels under the columns, every one or every few, centred under their column and free to
   run over the empty labels beside it */
.fh-stats-x {
	display: block;
	height: 18px;
	margin: 4px -40px 0;
	font-size: 11px;
	line-height: 18px;
	text-align: center;
	white-space: nowrap;
	color: var(--fh-ink-2);
}

/* A chart's figures in a table, for screen readers only: sighted readers have each column's
   figures on hover */
.fh-stats-body {
	position: relative;
	min-width: 0;
}

.fh-stats-table {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.fh-stats-table,
.fh-stats-ranked {
	border-collapse: collapse;
	width: 100%;
	font-size: 14px;
	font-variant-numeric: tabular-nums;
}

.fh-stats-table caption,
.fh-stats-ranked caption {
	padding: 0 0 4px;
	text-align: left;
	font-size: 13px;
	color: var(--fh-muted);
}

.fh-stats-table th,
.fh-stats-table td,
.fh-stats-ranked th,
.fh-stats-ranked td {
	padding: 4px 8px;
	border-bottom: 1px solid var(--fh-line);
	text-align: right;
	vertical-align: top;
}

.fh-stats-table th:first-child,
.fh-stats-ranked th,
.fh-stats-ranked td:first-child {
	text-align: left;
}

.fh-stats-table thead th,
.fh-stats-ranked thead th {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--fh-muted);
}

.fh-stats-table tbody th,
.fh-stats-ranked tbody th {
	font-weight: 500;
}

/* A ranked list: the bar under each name, the number beside it */
.fh-stats-ranked tbody th {
	width: 100%;
}

.fh-stats-ranked td {
	white-space: nowrap;
}

/* The surnames: each one's span of births on one scale of years, the years beside it */
.fh-stats-spans tbody th {
	width: auto;
	white-space: nowrap;
}

.fh-stats-spans td:nth-child(2) {
	width: 100%;
	text-align: left;
}

.fh-stats-span {
	display: block;
	height: 10px;
	margin-top: 4px;
	background: var(--fh-paper);
}

.fh-stats-span > span {
	display: block;
	height: 100%;
	width: var(--fh-v);
	margin-left: var(--fh-a);
	background: var(--fh-accent);
}

.fh-stats-span-years {
	display: block;
	font-size: 12.5px;
	color: var(--fh-muted);
}

/* The longest lived, and the commonest first names in each century */
.fh-stats-longest {
	margin: 0;
	padding: 0 0 0 24px;
	font-size: 15px;
	line-height: 1.6;
}

.fh-stats-names {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 14px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fh-stats-names > li {
	margin: 0;
}

body.fh .fh-stats-names h4 {
	margin: 0 0 4px;
	padding-bottom: 3px;
	border-bottom: 2px solid var(--fh-accent);
	font-size: 14px;
	font-weight: 600;
	color: var(--fh-ink);
}

.fh-stats-names ol {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 15px;
	line-height: 1.6;
}

.fh-stats-names ol li {
	display: flex;
	justify-content: space-between;
	margin: 0;
}

.fh-stats-names ol span {
	font-size: 13px;
	color: var(--fh-muted);
	font-variant-numeric: tabular-nums;
}

/* Phones: one column of everything, and every other label under a chart's columns */
@media screen and (max-width: 720px) {
	.fh-stats-pair,
	.fh-stats-families {
		grid-template-columns: minmax(0, 1fr);
	}

	.fh-stats-x-wide {
		visibility: hidden;
	}

	.fh-stats-plot {
		height: 130px;
	}
}

/* Printed, the page is its words and charts, without its tabs: the bands as ink on white, and
   the bars, which are backgrounds the printer may leave out, drawn in outline */
@media print {
	body.fh-page-familystats .fh-branchtabs,
	.fh-stats-more > summary,
	.fh-stats .fh-family-go {
		display: none !important;
	}

	body.fh-page-familystats .fh-main .fh-band {
		box-shadow: none;
		clip-path: none;
		background: none;
		color: var(--fh-ink);
	}

	.fh-stats-pair {
		gap: 14px 20px;
	}

	.fh-stats-s1,
	.fh-stats-hbar,
	.fh-stats-span > span {
		background: none;
		border: 1px solid var(--fh-accent);
		box-sizing: border-box;
	}

	.fh-stats-s2 {
		background: none;
		border: 1px dashed var(--fh-accent);
		box-sizing: border-box;
	}

	.fh-stats-span {
		background: none;
	}

	.fh-stats-chart,
	.fh-stats-families li,
	.fh-stats-events li,
	.fh-stats-names > li,
	.fh-stats-ranked tr {
		break-inside: avoid;
	}

	body.fh-page-familystats .fh-main h2,
	body.fh-page-familystats .fh-main h3 {
		break-after: avoid;
	}
}

/* ---------------------------------------------------------------- the browse pages for photos, headstones and documents */

/* browsemedia.php for photos, headstones and documents (browse_gallery.php):
   the figures band, the filters (.fh-filters), then a grid of tiles in the place gallery's style
   (.fh-gallery-pic), each with the place and people it is linked to beneath it. */
.fh-browse-count {
	margin: 14px 0 10px;
	font-size: 15px;
}

.fh-browse-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 18px 14px;
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
}

.fh-browse-grid > li {
	margin: 0;
	padding: 0;
}

.fh-browse-grid .fh-gallery-pic {
	height: 220px;
}

.fh-browse-headstones .fh-gallery-pic {
	height: 300px;
}

.fh-browse-documents .fh-gallery-pic {
	height: 280px;
	background: #ffffff;
	border: 1px solid var(--fh-line);
}

body.fh .fh-browse-grid a.fh-gallery-pic,
body.fh .fh-browse-grid a.fh-gallery-pic span {
	color: #ffffff;
}

.fh-browse-grid .fh-gallery-cap {
	font-size: 14.5px;
}

/* A printed page is mostly white: its caption sits on a darker fade */
.fh-browse-documents .fh-gallery-pic:not(.fh-gallery-noimg) .fh-gallery-cap {
	padding-top: 40px;
	background: linear-gradient(to top, rgba(14, 16, 32, 0.92) 55%, rgba(14, 16, 32, 0));
}

/* An item with no picture: the start of its words (an inscription, a transcript), fading out above
   its caption */
.fh-browse-grid .fh-gallery-noimg {
	display: flex;
	flex-direction: column;
	background: var(--fh-accent-dark);
	border: 0;
}

.fh-browse-grid .fh-gallery-noimg .fh-gallery-cap {
	position: static;
	flex: none;
	background: none;
	padding-top: 6px;
}

.fh-browse-words {
	flex: 1 1 0;
	min-height: 0;
	overflow: hidden;
	padding: 18px 16px 0;
	font-family: var(--fh-serif);
	font-size: 17px;
	font-style: italic;
	line-height: 1.35;
	opacity: 0.85;
	-webkit-mask-image: linear-gradient(to bottom, #000000 70%, transparent);
	mask-image: linear-gradient(to bottom, #000000 70%, transparent);
}

.fh-browse-words::before {
	content: "\201C";
}

.fh-browse-words::after {
	content: "\201D";
}

.fh-browse-links {
	margin: 6px 2px 0;
	font-size: 13px;
	line-height: 1.4;
	color: var(--fh-muted);
}

/* The link to the next batch, which the script fetches as it comes near */
.fh-browse-next {
	margin: 4px 0 24px;
	text-align: center;
	font-weight: 600;
}

.fh-browse-loading a {
	opacity: 0.5;
	pointer-events: none;
}

@media (max-width: 560px) {
	.fh-browse-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px 8px;
	}

	.fh-browse-grid .fh-gallery-pic {
		height: 170px;
	}

	.fh-browse-headstones .fh-gallery-pic,
	.fh-browse-documents .fh-gallery-pic {
		height: 220px;
	}
}

/* ---------------------------------------------------------------- print */

/* Printed, a page is its content alone: no header, menu, tabs or footer. Browsers leave out
   backgrounds unless "Background graphics" is ticked, so everything the site fills with its
   colour and writes on in white (the bands, labels, buttons, chips, a selected switch or page)
   is printed as ink on white instead, whichever way that box is set: labels are coloured text,
   and the birth, death and marriage boxes and the buttons keep coloured edges. Pale tints that
   only shade a box may still print when the box is ticked; nothing is unreadable without them. The phone
   layouts are for screens only (screen and (max-width: 720px)), so a sheet of A4 (186mm, about
   703px, between its 12mm side margins) gets the tables as a desktop has them. */
.fh-print-source {
	display: none;
}

@media print {
	@page {
		size: A4;
		margin: 14mm 12mm 16mm;
	}

	:root {
		--fh-gutter: 0px;
		--fh-label: 104px;
	}

	html,
	body.fh {
		background: #ffffff;
	}

	.fh-header,
	.fh-footer,
	.menucontainer,
	#tngmenu,
	#pub-innermenu,
	.fh-adds,
	.fh-relmenu,
	.fh-main .toggleicon,
	.fh-main img[src*="tng_edit"],
	.fh-main .media-prev,
	#fh-card,
	.fh-mediacard,
	[popover] {
		display: none !important;
	}

	.fh-main {
		max-width: none;
		margin: 0;
		padding: 0;
	}

	/* Links keep their colours (a person's name in their family's), without underlines */
	.fh-main a,
	.fh-main a:link,
	.fh-main a:visited {
		text-decoration: none !important;
	}

	/* The heading: the name in the page's colour over a rule, with the sex and years beside it */
	.fh-main h1.header,
	.fh-main .fh-band,
	#nameheader + .normal {
		box-shadow: none !important;
		clip-path: none !important;
		background: none !important;
		color: var(--fh-accent-dark);
	}

	.fh-main .fh-namebar {
		padding: 0 0 6px;
		margin-bottom: 14px;
		border-bottom: 2px solid var(--fh-accent);
	}

	.fh-main .fh-namebar #nameheader {
		font-size: 30pt;
	}

	.fh-main .fh-namebar #nameheader + .normal {
		font-size: 16pt;
		color: var(--fh-ink-2);
	}

	.fh-main .fh-sex {
		color: var(--fh-ink-2);
		border-color: var(--fh-ink-2);
	}

	/* Whatever else a band holds (a person's Most Wanted link, the home page's headline and
	   couples) is white on screen, so it is given ink too, as the band's colour is not printed */
	.fh-main .fh-band,
	.fh-main .fh-band *,
	.fh-main #nameheader + .normal * {
		color: var(--fh-accent-dark) !important;
	}

	/* Buttons, chips, a home page box's heading and a selected switch or page are white on the
	   page's colour on screen: printed, ink on white, edged in the colour where they were filled */
	a.fh-story-button,
	a.fh-story-button:link,
	a.fh-story-button:visited,
	a.snlink,
	a.snlink:link,
	a.snlink:visited,
	.btn,
	input[type="submit"],
	input[type="button"],
	.fh-chip,
	table.fh-linebox tr.fh-linehead th,
	.fh-filter-pills span[aria-current] {
		background: none !important;
		box-shadow: none !important;
		color: var(--fh-accent-dark) !important;
		border: 1px solid var(--fh-accent) !important;
	}

	table.fh-linebox tr.fh-linehead th {
		border-width: 0 0 2px !important;
	}

	/* The chosen family tab likewise, in its family's colour */
	body.fh .fh-branchtabs > [aria-pressed="true"],
	body.fh .fh-branchtabs > a[aria-current] {
		background: none !important;
		box-shadow: none !important;
		color: color-mix(in srgb, var(--fh-tab, var(--fh-accent)) 70%, #000000) !important;
		border: 1px solid var(--fh-tab, var(--fh-accent)) !important;
	}

	/* A media page's picture prints without its controls, names and hint, which are for the
	   screen, and without the line stepping through a place's media or the download link */
	body.fh .fh-viewer-label,
	body.fh .fh-viewer-hint,
	body.fh .fh-viewer-zoom,
	body.fh .fh-viewer-reset,
	body.fh .fh-viewer-full,
	body.fh .fh-viewer-names,
	body.fh .fh-viewer-tag,
	.fh-media-steps,
	.fh-media-download,
	body.fh .fh-pdf-embed {
		display: none !important;
	}

	body.fh .fh-viewer-frame {
		background: none;
	}

	body.fh .fh-viewer-img {
		max-height: 200mm;
	}

	.fh-media-about p,
	.fh-media-body tr {
		break-inside: avoid;
	}

	.fh-media-body table.transcript {
		display: table;
	}

	/* The relationship line under a person's heading, for someone signed in: in ink, without
	   its band or its close and swap buttons */
	.fh-main #reldisplay {
		box-shadow: none !important;
		clip-path: none !important;
		background: none !important;
		color: var(--fh-ink-2) !important;
		padding: 0 0 8px;
	}

	.fh-main #reldisplay a {
		color: var(--fh-ink-2) !important;
	}

	.fh-main #reldisplay a:has(> img.relmenuicon),
	.fh-main #reldisplay a.relicon {
		display: none !important;
	}

	/* A place's gallery prints its pictures; the captions and "+N more" are white on a dark fade,
	   which is a background, so they are left out */
	.fh-main .fh-gallery-cap,
	.fh-main .fh-gallery-more {
		display: none !important;
	}

	.fh-main h2 {
		font-size: 16pt;
		margin: 16px 0 6px;
		break-after: avoid;
	}

	.fh-main .fieldnameback,
	.fh-main .databackalt,
	.fh-main #info tr.fh-milestone > td.databack {
		background: none !important;
	}

	.fh-main .fieldnameback .fieldname,
	.fh-main .fieldname {
		font-size: 8.5pt;
	}

	.fh-main #info td.fieldnameback.fh-milestone {
		background: none !important;
		border-left: 2px solid var(--fh-accent);
	}

	.fh-main #info td.fieldnameback.fh-milestone .fieldname {
		color: var(--fh-accent-dark);
	}

	.fh-main #info tr.fh-milestone-first > td.fh-date {
		font-size: 10pt;
	}

	.fh-main table.whiteback {
		border-color: var(--fh-line);
	}

	/* A row is kept on one page where it fits, and a heading with what follows it */
	.fh-main tr,
	.fh-main ol.citeblock > li {
		break-inside: avoid;
	}

	/* Thumbnails of records are a reminder of the image, not the image: up to 30mm tall */
	.fh-main td.databack img.thumb {
		max-width: 100%;
		max-height: 30mm;
		box-shadow: none;
	}

	/* Citation numbers as plain small numbers */
	.fh-main .fh-cite a,
	.fh-main .fh-cite a:link,
	.fh-main .fh-cite a:visited {
		font-size: 7pt;
		background: none;
		color: var(--fh-accent-dark);
		padding: 0 1px;
		margin: 0 2px 0 0;
		vertical-align: super;
		line-height: 1;
	}

	.fh-main ol.citeblock {
		font-size: 8.5pt;
		column-gap: 20px;
	}

	.fh-main ol.citeblock > li {
		margin-bottom: 3px;
	}

	/* Where the page came from, under it */
	.fh-print-source {
		display: block;
		margin: 18px 0 0;
		padding-top: 6px;
		border-top: 1px solid var(--fh-line);
		font-size: 8.5pt;
		color: var(--fh-muted);
	}
}
