/* Online Library document page - one stylesheet serving screen and print.
 *
 * One file rather than two, deliberately: the print output IS the download, so a separate print
 * sheet would be a second description of the same document that drifts from the first. Everything
 * below the @media print rule is what the reader's browser turns into a PDF. */

/* 57.5rem = 55rem of text plus the 1.25rem padding either side, because `box-sizing: border-box`
   is set site-wide and max-width therefore includes the padding.
 
   55rem is measured, not chosen. Every line the published PDF wraps was rendered in this page's own
   font and compared against the width at which the next word would still have fit. **No single width
   reproduces every break**: Gotham and Times disagree about which lines are long, so the widest line
   needs 903px while the tightest line-plus-word breaks at 862px - the interval is empty by 41px.
   880px is the best fit of the 24 wrap points in the pilot document: 19 break exactly where the PDF
   does, 2 earlier, 3 later. Going wider is strictly worse - at 60rem only 14 match. */
.doc {
	max-width: 57.5rem;
	margin: 0 auto;
	padding: 1.25rem 1.25rem 4rem;
	font-family: "HCo Gotham", Arial, sans-serif;
	color: #222;
	line-height: 1.6;
}

/* The button rides on the breadcrumb rather than under the metadata: it is an action on the page,
   not a property of the document, and the row was empty on its right half anyway. */
.doc-crumbs-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	margin-bottom: 0.75rem;
}

.doc-crumbs {
	font-size: 0.8125rem;
	color: #6b7280;
}

.doc-crumbs a {
	color: #00b0c6;
	text-decoration: none;
}

.doc-crumbs span {
	margin: 0 0.25rem;
}

.doc-head {
	border-bottom: 1px solid #e5e7eb;
	padding-bottom: 1.5rem;
	margin-bottom: 2rem;
}

.doc-head h1 {
	font-family: "Gotham Medium", Arial, sans-serif;
	font-size: 1.75rem;
	line-height: 1.3;
	margin: 0 0 1rem;
	color: #0b2a4a;
}

/* Two fields on one row, pushed to the outside edges - stacked they were two short lines of label
   and value across the full column, which is a lot of white space for "02/2010".

   The label is the quiet half and the value is the one somebody is reading, so the emphasis runs
   that way round: small grey label, full-size dark value. The site stylesheet does the opposite to
   `dt` and `dd` by default, which is why both are stated here rather than inherited. */
.doc-meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.25rem 1.5rem;
	margin: 0 0 1.25rem;
}

/* Baseline, not centre. The label and the value are different sizes, so centring their boxes leaves
   the two pieces of text sitting on different baselines - which is what reads as misaligned. */
.doc-meta > div {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
}

.doc-meta dt {
	font-size: 0.8125rem;
	font-weight: 400;
	color: #6b7280;
}

.doc-meta dd {
	margin: 0;
	font-size: 1rem;
	color: #222;
}

.doc-archived {
	background: #fff7ed;
	border-left: 3px solid #f59e0b;
	padding: 0.625rem 0.875rem;
	margin: 0 0 1.25rem;
	font-size: 0.875rem;
}

.doc-download {
	background: #00b0c6;
	color: #fff;
	border: 0;
	border-radius: 2px;
	padding: 0.375rem 0.875rem;
	font: inherit;
	font-size: 0.8125rem;
	line-height: 1.3;
	white-space: nowrap;
	cursor: pointer;
}

.doc-download:hover {
	background: #009aad;
}

/* ---------------------------------------------------- layout carried over from the source document
 *
 * Alignment, indentation and vertical rhythm come from the .docx, applied as classes by the
 * importer's layout pass. Three consequences worth knowing before changing anything here:
 *
 * - `p` has **no** default margin. Word documents in this corpus space themselves with empty
 *   paragraphs, so every gap is explicit as `doc-gap-N`. Giving `p` a margin would add spacing the
 *   source does not have, and would silently separate items 2, 3 and 4 of a numbered list that Word
 *   runs together.
 * - `pre-wrap` is deliberate. Word keeps runs of spaces and tabs, and the reference block on a
 *   Marine Advisory is aligned with them; HTML would collapse every one. The importer collapses
 *   newlines inside these blocks so the same rule cannot introduce a line break.
 * - `ch` for the indent, not `in`. The source measures in inches, but an inch of indent on a phone
 *   is a third of the screen. One level is ~0.5in at this type size and degrades sanely. */

.doc-body p,
.doc-body li {
	margin: 0;
	white-space: pre-wrap;
	/* Justified is the document's setting, not a per-paragraph one: the source and the published PDF
	   set the whole body flush both ways, and the handful of paragraphs Word left ragged are places
	   somebody did not set it rather than places somebody decided against it. Centred and right
	   paragraphs still win - `.doc-body .doc-center` is (0,2,0) against this rule's (0,1,1). */
	text-align: justify;
}

/* Scoped under .doc-body deliberately: the reset above is (0,1,1) and a bare `.doc-indent-1` is
   (0,1,0), so it loses to `margin: 0` and silently does nothing. */
.doc-body .doc-center { text-align: center; }
.doc-body .doc-right { text-align: right; }
.doc-body .doc-justify { text-align: justify; }

.doc-body .doc-indent-1 { margin-left: 6ch; }
.doc-body .doc-indent-2 { margin-left: 12ch; }
.doc-body .doc-indent-3 { margin-left: 18ch; }
.doc-body .doc-indent-4 { margin-left: 24ch; }
.doc-body .doc-indent-5 { margin-left: 30ch; }
.doc-body .doc-indent-6 { margin-left: 36ch; }

/* Two values only. The importer caps the gap at one line, because the number of times somebody
   pressed Return is not a spacing decision - see MaxGapLines. Zero is still its own case: a run of
   list items Word kept tight is different from one it did not. */
.doc-body .doc-gap-0 { margin-top: 0; }
.doc-body .doc-gap-1 { margin-top: 1lh; }

/* Headings are sized here, not by the site stylesheet, and every document gets the same scale.

   Left alone they inherit `style.css`, where an `h1` is display type for a landing page - which is
   how a two-word "Purpose" ended up larger than the document's own title. Worse, the level is the
   author's: measured across 282 documents, 82 set their section headings as Heading 1, 35 as
   Heading 2 and 12 as Heading 3, so the same word came out three sizes. The importer now rebases
   each document so its shallowest heading is `h2`; this is the other half of that, and the two are
   only consistent together.

   One line of air above by default, so a degraded document with no gap classes still reads - and
   `.doc-body .doc-gap-0` is (0,2,0) against this rule's (0,1,1), so a source that deliberately ran
   a heading tight against the line above still wins. */
.doc-body h1,
.doc-body h2,
.doc-body h3,
.doc-body h4,
.doc-body h5,
.doc-body h6 {
	font-family: "Gotham Medium", Arial, sans-serif;
	font-weight: 700;
	color: #0b2a4a;
	line-height: 1.3;
	margin: 1lh 0 0;
}

/* Three steps, not six. The corpus nests one level deep where it nests at all, so h4 and below are
   a level that exists in the markup and is not worth a size of its own.

   Measured against the body rather than against the root: the site stylesheet sets `.doc` at 18px,
   so `1.25rem` is 20px and reads as a bolder paragraph rather than as a heading. These are 22 / 19 /
   18, which is a step the eye registers without the display type an `h1` inherits from `style.css`.
   Below h3 the weight and the colour carry it - a fourth size would be a distinction nothing in
   this corpus makes. */
.doc-body h1,
.doc-body h2 { font-size: 1.375rem; }

.doc-body h3 { font-size: 1.1875rem; }

.doc-body h4,
.doc-body h5,
.doc-body h6 { font-size: 1.125rem; }

/* The site stylesheet puts `strong` at 500, which in Gotham is Medium and reads as emphasis rather
   than bold. In the source these are the Subj, Re and To blocks set in Times New Roman Bold, so they
   get the real 700 face - which is vendored, so nothing is synthesised. */
.doc-body strong,
.doc-body b {
	font-weight: 700;
}

/* Lists rebuilt by the importer out of markers somebody typed by hand.
 *
 * The marker is a counter in a fixed-width box and the item is a hanging indent, so every marker in
 * a list lines up and a wrapped line runs under the text rather than back under its own number -
 * neither of which is true of the paragraphs they were. `list-style: none` plus `::before` rather
 * than `::marker` with `content`, because `::marker` content is not reliable outside Chromium and
 * this stylesheet is also the one that prints. */
/* One indent for every list, set here rather than carried over from the source.
 
   Word indented these by whatever the author happened to type - a tab on the reference block, an
   inch on the numbered one - so reproducing it put two lists on the same page at two different
   indents for no reason a reader could see. A single value means every list on every document lines
   up with every other, which is the only version of this that stays true across 976 of them. */
.doc-body .doc-list {
	/* One line above every list, none below. The importer never puts a gap class on the `ol` itself
	   - the gap used to live on the first `li`, which is exactly the per-item spacing being taken
	   away below - so without this the list jams against the sentence introducing it. Nothing below,
	   because the block after a list carries its own `doc-gap`. */
	margin-block: 1lh 0;
	margin-inline: 4ch 0;
	padding: 0;
	list-style: none;
	counter-reset: doc-item;
}

/* One spacing for every list item, set here rather than carried over from the source - the same
   decision as the indent above, taken later and for the same reason.

   This rule used to be absent on purpose, so that `doc-gap-1` could reproduce the blank line Word
   puts between items 1 and 2 and not between 2, 3 and 4. Measured across the corpus, that is not a
   rhythm anybody chose: of 996 lists, 1,254 items came out tight, 601 came out a full line apart,
   1,335 carry no gap class at all - and **214 lists disagree with themselves**, spacing some of
   their own items one way and the rest the other. Reproducing that faithfully reproduces where
   somebody's thumb landed.

   Single-spaced: no gap at all, so the items run on like the lines of a paragraph and the list
   reads as one block. The hanging indent is what separates a wrapped item from the next one, not
   white space. `.doc-body .doc-list > li` is (0,2,1) against `.doc-body .doc-gap-1`'s (0,2,0), so
   this wins over whatever the source said - which is the point of it, and the one thing to check
   before adding any other rule here. */
.doc-body .doc-list > li {
	counter-increment: doc-item;
	padding-left: 4ch;
	text-indent: -4ch;
	margin-top: 0;
}

.doc-body .doc-list > li::before {
	display: inline-block;
	width: 4ch;
	text-indent: 0;
}

/* Three punctuations per numbering family, because Word records all three and the document means
   what it says: `-paren` is the one somebody typed as "(a)", `-paren-right` is Word's own "a)" out
   of `w:lvlText "%1)"`, and the bare name is a full stop. The reference block on a 2026 advisory is
   lowerLetter + "%1)" - a) b) c) - not the (a) the older hand-typed blocks use. */
.doc-body .doc-list-decimal > li::before { content: counter(doc-item) "."; }
.doc-body .doc-list-decimal-paren > li::before { content: "(" counter(doc-item) ")"; }
.doc-body .doc-list-decimal-paren-right > li::before { content: counter(doc-item) ")"; }

.doc-body .doc-list-alpha > li::before { content: counter(doc-item, lower-alpha) "."; }
.doc-body .doc-list-alpha-paren > li::before { content: "(" counter(doc-item, lower-alpha) ")"; }
.doc-body .doc-list-alpha-paren-right > li::before { content: counter(doc-item, lower-alpha) ")"; }

.doc-body .doc-list-roman > li::before { content: counter(doc-item, lower-roman) "."; }
.doc-body .doc-list-roman-paren > li::before { content: "(" counter(doc-item, lower-roman) ")"; }
.doc-body .doc-list-roman-paren-right > li::before { content: counter(doc-item, lower-roman) ")"; }

/* Word's upper-case formats, kept upper-case. Folding them into the lower-case rules above would be
   a content change on a regulatory document - "Annex A" and "annex a" are not the same reference. */
.doc-body .doc-list-upper-alpha > li::before { content: counter(doc-item, upper-alpha) "."; }
.doc-body .doc-list-upper-alpha-paren > li::before { content: "(" counter(doc-item, upper-alpha) ")"; }
.doc-body .doc-list-upper-alpha-paren-right > li::before { content: counter(doc-item, upper-alpha) ")"; }

.doc-body .doc-list-upper-roman > li::before { content: counter(doc-item, upper-roman) "."; }
.doc-body .doc-list-upper-roman-paren > li::before { content: "(" counter(doc-item, upper-roman) ")"; }
.doc-body .doc-list-upper-roman-paren-right > li::before { content: counter(doc-item, upper-roman) ")"; }

/* The literal character, not the "2" escape it used to be - that had been mangled to U+0082
   followed by a "2", so every bullet on the site rendered as a stray digit. */
.doc-body .doc-list-bullet > li::before { content: "•"; }

/* Word set these lines bold, marker included. The counter sits outside whatever the text is wrapped
   in, so without this a bold reference gets a light "(a)" in front of it. */
.doc-body .doc-list > li.doc-strong::before {
	font-weight: 700;
}

/* A one-inch indent is a third of a narrow screen, and these are mostly single sentences. */
@media (max-width: 30rem) {
	.doc-body .doc-indent-1,
	.doc-body .doc-indent-2,
	.doc-body .doc-indent-3,
	.doc-body .doc-indent-4,
	.doc-body .doc-indent-5,
	.doc-body .doc-indent-6 {
		margin-left: 3ch;
	}

	.doc-body .doc-list {
		margin-inline-start: 2ch;
	}

	.doc-body .doc-list > li {
		padding-left: 3.5ch;
		text-indent: -3.5ch;
	}

	.doc-body .doc-list > li::before {
		width: 3.5ch;
	}
}

.doc-body a {
	color: #00b0c6;
	overflow-wrap: anywhere;
}

/* The scanned annex pages are page-sized images. Constrained to the text column so a 1700px scan
   does not force a horizontal scrollbar on a phone. */
.doc-body img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 1.5rem auto;
	border: 1px solid #e5e7eb;
}

.doc-letterhead,
.doc-print-date,
.doc-print-type {
	display: none;
}

/* -------------------------------------------------------------- print = the download */

@media print {
	/* Letter at one-inch margins, which is not a default - it is the published PDF's own page. The
	   text column there measures 612 - 144 = 468pt, and print is already set in the PDF's face at the
	   PDF's size, so matching the margin makes the printed lines break where the filed document's
	   lines break. 18mm margins gave a 510pt column and wrapped everything 42pt late. */
	@page {
		size: letter;
		margin: 72pt 43.2pt;

		/* The published PDF numbers every page but the first, as a bare numeral centred 24pt under
		   the text column - no rule, no "page n of m". Chrome only grew margin boxes in 131; before
		   that the only page number available was the browser's own header/footer toggle, which is
		   the reader's to set and stamps the URL and the date alongside it. */
		@bottom-center {
			content: counter(page);
			font: 12pt "Times New Roman", Times, serif;
			color: #000;
			vertical-align: top;
			padding-top: 24pt;
		}
	}

	/* The letterhead starts 38.5pt above the one-inch margin, in the band the .docx keeps its header
	   part in, so page one gets a shorter top margin and `.doc` puts the inch back as padding. A
	   negative margin on the letterhead was the obvious way to do this and the wrong one: it collapses
	   straight through `.doc` and `.page` and drags the whole document up with it. */
	@page :first {
		margin-top: 33.5pt;

		/* Page one carries the letterhead instead, and the published PDF leaves it unnumbered. */
		@bottom-center {
			content: none;
		}
	}

	/* The page chrome is navigation, and navigation does not belong in a document somebody filed.

	   Structural, not a list of names. `.page` and `.MainEditorBodyStyle` are the layout's own
	   wrappers; everything inside them is the site chrome blob, which is editable content and has
	   already been renamed once. An earlier version of this rule named five classes off the top of
	   somebody's head and hid exactly one of them - the header logo, the search and video controls
	   and the entire cookie banner printed on page one of every download. Hiding every sibling of the
	   document instead cannot rot that way, because the only thing it has to keep knowing is where
	   the document is. */
	.page > *:not(.MainEditorBodyStyle),
	.MainEditorBodyStyle > *:not(.doc),
	.doc-crumbs-row {
		display: none !important;
	}

	/* The site pushes the body down to clear a fixed header: `.MainEditorBodyStyle` is
	   `position: relative; top: <header height>`. Printing hides the header but not the hole it left,
	   so the document started a header's height down the page. */
	.MainEditorBodyStyle {
		position: static !important;
		top: auto !important;
	}

	/* The cloned style-responsive.css carries `@media print { * { color: #000 !important;
	   background: #fff !important } }` - a universal reset that nothing without !important can
	   outrank, whatever its specificity. Both halves have to be undone here.

	   The background half is the one that shows: every element paints an opaque white box, and the
	   boxes of later siblings land on top of the crest, which by design sits outside the text column.
	   The symptom is a crest with its middle sliced out, which reads as a broken image rather than as
	   a stacking problem. The colour half flattens the navy letterhead to black.

	   Scoped to .doc, so the reset keeps doing its job everywhere else on the site. */
	.doc,
	.doc *,
	.doc *::before,
	.doc *::after {
		background: transparent !important;
	}

	/* The letterhead, placed at the coordinates measured off the published PDF rather than
	   approximated with a flow layout. First page only and in flow, which is where the source carries
	   it - page 2 onward has a page number and nothing else, so a `position: fixed` running header
	   would repeat something the original does not.

	   Absolute children inside a fixed-height box, because that is what a letterhead is: three blocks
	   at three fixed positions, two of which deliberately sit outside the text column. A grid cannot
	   express that - its middle column centres on the gap between the other two, where the PDF centres
	   the titles on the page, and nothing in a grid reaches past the margin to put the crest at
	   x=45.8pt. Every number below is a measurement, origin at the crest's top-left:

	     crest   x 45.8, y 33.5, 99.3 x 107.6pt      caption  8pt / 9.45pt, centred under the crest
	     titles  centred on x=306 (the page centre)  address  x 480.4, 7pt / 8.2pt
	     16pt bold at y 57.3, 14pt bold at y 75.7    contact values at x 516.9 */
	.doc-letterhead {
		display: block;
		position: relative;
		height: 146.2pt;
		margin: 0 -28.8pt 27.7pt;
		print-color-adjust: exact;
		-webkit-print-color-adjust: exact;
	}

	/* Every glyph in the PDF's letterhead is this blue, measured off it - the same ink as the shield,
	   where the body below is black. !important because of the universal print reset above. */
	.doc-letterhead,
	.doc-letterhead * {
		color: #33339a !important;
	}

	.doc-letterhead p,
	.doc-letterhead dl,
	.doc-letterhead dd {
		margin: 0;
	}

	.doc-letterhead-crest {
		position: absolute;
		top: 0;
		left: 2.6pt;
		width: 99.3pt;
	}

	/* The crest is served already inked in #33339a, the letterhead's own colour - see the view. Sized
	   exactly, never scaled up: 304x318 over 99.3x107.6pt is about 220 dpi, which is as much as the
	   source has. */
	.doc-letterhead-crest img {
		display: block;
		width: 99.3pt;
		height: 107.6pt;
	}

	.doc-letterhead-crest p {
		margin-top: 10pt;
		font-size: 8pt;
		line-height: 9.45pt;
		text-align: center;
	}

	/* Spans the text column, whose centre is the page centre - which is where the PDF centres these
	   two lines, rather than in the space left over beside the crest. */
	.doc-letterhead-title {
		position: absolute;
		top: 20.7pt;
		left: 0;
		right: 0;
		text-align: center;
	}

	.doc-letterhead-country {
		font-size: 16pt;
		line-height: 18.7pt;
		font-weight: 700;
	}

	.doc-letterhead-bureau {
		position: absolute;
		top: 18.8pt;
		left: 0;
		right: 0;
		font-size: 14pt;
		line-height: 16.4pt;
		font-weight: 700;
	}

	.doc-letterhead-address {
		position: absolute;
		top: 60pt;
		left: 437.2pt;
		font-size: 7pt;
		line-height: 8.2pt;
	}

	/* The three contact lines are tab-separated in the source and their values line up at 36.5pt. */
	.doc-letterhead-address dl {
		display: grid;
		grid-template-columns: 36.5pt auto;
	}

	/* The site stylesheet puts `dt` at 20px with a bottom margin; left alone it both breaks the row
	   and widens the block past the page, which Chrome answers by shrinking the entire document to
	   fit - every type size on all eleven pages 5.5% small, from one unset font-size. */
	.doc-letterhead-address dt {
		margin: 0;
		font-size: 7pt;
		line-height: 8.2pt;
		font-weight: 400;
	}

	/* Print is the download, and the download is meant to be the document - so it is set the way the
	   document is set: Times New Roman 12pt on 14pt leading, measured off the published PDF and
	   matching the .docx. On screen it stays in the site's own family and size, because there it is
	   a page on liscr.com rather than a reproduction of a filed document.
	
	   Two units carry the switch by themselves. `lh` makes every gap class follow the new leading,
	   and `ch` makes every indent class follow the new face - Times' digit is half an em, so the
	   6ch of `doc-indent-1` lands on exactly the 0.5in the PDF measures. Restating either per
	   medium would be two numbers to keep in agreement instead of none. */
	.doc {
		max-width: none;
		margin: 0;
		/* 43.2pt page margin plus 28.8pt padding is the PDF's one-inch text column; the letterhead
		   then reaches back out through the padding to the two things that sit outside it. */
		padding: 0 28.8pt;
		font-family: "Times New Roman", Times, serif;
		font-size: 12pt;
		line-height: 1.17;
		color: #000;
	}

	.doc-head {
		border-bottom: 1px solid #000;
	}

	/* The screen masthead - heading, Edition, Last updated - is the page's, and the document carries
	   its own below. Both would be the same facts twice. */
	.doc-head {
		border: 0;
		padding: 0;
		margin-bottom: 14pt;
	}

	.doc-head h1,
	.doc-meta {
		display: none;
	}

	/* Centred, 12pt on the body's own 14pt leading, one blank line between them - the two lines the
	   published PDF opens with, at the positions it puts them (y=209.7 and y=237.7). */
	.doc-print-date,
	.doc-print-type {
		display: block;
		margin: 0;
		text-align: center;
	}

	.doc-print-type {
		margin-top: 14pt;
		text-transform: uppercase;
	}

	/* A heading at the foot of a page with its text overleaf, or one line of a paragraph stranded,
	   is how a printed regulatory document stops looking like one. */
	.doc-body h1,
	.doc-body h2,
	.doc-body h3,
	.doc-body h4,
	.doc-body h5,
	.doc-body h6 {
		break-after: avoid;

		/* The document sets its own section headings as bold body text, not as display type - the
		   published PDF has "Purpose" at the same 12pt Times as the paragraph under it. The screen
		   scale above is the site's, this is the document's, and the download is the document. */
		font-family: inherit;
		font-size: inherit;
		color: inherit;
		line-height: inherit;
	}

	.doc-body p,
	.doc-body li {
		orphans: 3;
		widows: 3;
	}

	/* Each scanned annex page is a page. Breaking one across two sheets halves a photograph of a
	   document, which is worse than a short page before it.

	   The height has to be an absolute length. `max-height: 100%` resolves against the containing
	   block's height, `.doc-body` is auto-height, and a percentage against an auto height computes
	   to none - so the constraint silently did nothing and the tallest annex came out 720.8pt in a
	   648pt box. `break-inside: avoid` does not save it either: the spec drops a forced avoid when
	   the fragment cannot fit on any page, so Chrome sliced the scan and spilled 72pt of it onto a
	   page of its own. 648pt is the content box (792 - 72 - 72) less this rule's own margins. */
	.doc-body img {
		break-inside: avoid;
		border: 0;
		margin: 14pt auto;
		max-height: 620pt;
	}

	/* A URL nobody can click is a URL nobody can follow, so printed links carry their target. */
	.doc-body a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 9pt;
		color: #444;
	}
}
