/* Commercial Context: the public pages of a register.
   Layout: white masthead with emblem and listing search, a navy navigation band, a grey title
   band with breadcrumb on every inner page, then a contents column beside one text column.
   Type: TeX Gyre Schola (a Century Schoolbook design, the face of court documents) throughout.
   Colour: ink on white paper, grey for bands, navy for navigation, links and the main action.
   Light only, by decision. */

@font-face { font-family: "Schola"; src: url("fonts/texgyreschola-regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Schola"; src: url("fonts/texgyreschola-italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Schola"; src: url("fonts/texgyreschola-bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #ffffff;
  --band: #eef1f5;
  --ink: #1a2130;
  --ink-2: #4f5866;
  --rule: #c9cfd8;
  --navy: #1f3d6e;
  --navy-dark: #142a4d;
  --navy-tint: #e6ecf5;
  --ok: #1e6b3a;
  --bad: #a1271b;
  --serif: "Schola", "TeX Gyre Schola", "Century Schoolbook", "Century Schoolbook L", "New Century Schoolbook", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --wrap: 70rem;
  --gutter: 24px;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  font-kerning: normal;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--navy); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--navy-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #f2b705; outline-offset: 1px; }
p, ul, ol, dl, table, pre, figure { margin: 0 0 1rem; }
ul, ol { padding-left: 1.3rem; }
li + li { margin-top: 0.3rem; }
strong, b { font-weight: 700; }
code, kbd, samp { font-family: var(--mono); font-size: 0.84em; }
:not(pre) > code { background: var(--band); padding: 0.05em 0.3em; overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

h1, h2, h3, h4 { margin: 0 0 0.6rem; font-weight: 700; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(1.85rem, 1.4rem + 1.6vw, 2.5rem); line-height: 1.15; max-width: 26ch; }
h2 { font-size: 1.4rem; line-height: 1.25; }
h3 { font-size: 1.08rem; line-height: 1.35; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.quiet { color: var(--ink-2); }
.small { font-size: 0.92rem; }
.lead { font-size: 1.2rem; line-height: 1.5; max-width: 40em; margin: 0; }
.measure { max-width: 42em; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 12px; top: -48px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { top: 12px; }

/* Buttons: rectangular; one filled action per view */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0.5rem 1.15rem;
  background: var(--navy); color: var(--paper);
  border: 1px solid var(--navy); border-radius: 2px;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2;
  text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: var(--paper); }
.button--plain { background: var(--paper); color: var(--navy); border-color: var(--navy); }
.button--plain:hover { background: var(--navy-tint); color: var(--navy-dark); }
.button[disabled] { opacity: 0.45; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 0; }

/* Masthead */
.masthead-row { display: flex; align-items: center; gap: 1rem 2rem; flex-wrap: wrap; padding-block: 18px; }
.masthead-title { display: flex; align-items: center; gap: 0.85rem; color: var(--ink); text-decoration: none; margin-right: auto; min-width: 0; }
.masthead-title:hover { color: var(--ink); }
.emblem { width: 48px; height: 48px; flex: none; }
.masthead-text { display: flex; flex-direction: column; min-width: 0; }
.masthead-name { font-size: 1.55rem; font-weight: 700; line-height: 1.1; }
.masthead-sub { font-style: italic; color: var(--ink-2); font-size: 0.98rem; margin-top: 0.2rem; }
.masthead-search { display: flex; gap: 0.5rem; flex: 0 1 27rem; }
.masthead-search input { flex: 1; min-width: 0; }

/* Navigation band */
.site-nav { background: var(--navy); color: var(--paper); }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0 0.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav li + li { margin-top: 0; }
.site-nav a { display: block; padding: 0.7rem 0.85rem; color: var(--paper); text-decoration: none; }
.site-nav li:first-child a { margin-left: -0.85rem; }
.site-nav a:hover { background: var(--navy-dark); text-decoration: underline; color: var(--paper); }
.site-nav a[aria-current="page"] { background: var(--navy-dark); box-shadow: inset 0 -4px 0 var(--paper); font-weight: 700; }
.menu-toggle { display: none; }

@media (max-width: 860px) {
  .masthead-row { padding-block: 14px; }
  .emblem { width: 40px; height: 40px; }
  .masthead-name { font-size: 1.3rem; }
  .masthead-sub { font-size: 0.9rem; }
  .masthead-search { flex-basis: 100%; }
  .nav-row { padding-block: 6px; }
  .menu-toggle {
    display: inline-flex; min-height: 40px; padding: 0.35rem 0.9rem;
    background: transparent; color: var(--paper); border: 1px solid var(--paper); border-radius: 2px;
    font: inherit; font-size: 0.98rem; cursor: pointer;
  }
  .site-nav ul { display: none; flex-direction: column; margin-top: 6px; }
  .site-nav.is-open ul, .no-js .site-nav ul { display: flex; }
  .site-nav a, .site-nav li:first-child a { margin: 0; padding: 0.7rem 0; border-top: 1px solid rgb(255 255 255 / 0.25); }
  .site-nav a[aria-current="page"] { background: none; box-shadow: none; text-decoration: underline; }
}

/* Title band and breadcrumb */
main { padding-bottom: 56px; }
.title-band { background: var(--band); border-bottom: 1px solid var(--rule); padding: 22px 0 32px; }
.title-band h1 { margin-bottom: 0.7rem; }
.title-band .actions { margin-top: 1.25rem; }
.crumbs ol { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 1.4rem; font-size: 0.92rem; color: var(--ink-2); }
.crumbs li + li { margin-top: 0; }
.crumbs li + li::before { content: "›"; padding: 0 0.5rem; color: var(--ink-2); }
.crumbs [aria-current="page"] { color: var(--ink); }

/* Document: contents column beside the text */
.doc { padding-top: 36px; }
.doc--toc { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 0 3.5rem; align-items: start; }
.doc-body { min-width: 0; }
.toc { position: sticky; top: 1rem; padding-top: 0.2rem; font-size: 0.95rem; }
.toc h2 { font-size: 1rem; margin: 0 0 0.6rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--navy); }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 0.35rem 0; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); line-height: 1.35; }
.toc a:hover { color: var(--navy); text-decoration: underline; }
@media (max-width: 900px) {
  .doc--toc { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; margin-bottom: 1.5rem; padding: 0.9rem 1.1rem; background: var(--band); border: 1px solid var(--rule); }
  .toc a { border-bottom: 0; padding: 0.2rem 0; color: var(--navy); text-decoration: underline; }
}

/* Sections of a document */
.row { padding: 28px 0 12px; border-top: 1px solid var(--rule); }
.doc-body > .row:first-child, .doc-body > .notice + .row, .doc-body > form + .row { border-top: 0; padding-top: 0; }
.doc-body > .notice + .row, .doc-body > form + .row, #lookup-results + .row { padding-top: 12px; }
.row > h2 { margin-bottom: 0.9rem; }
.row-body { min-width: 0; }
.row-body > :last-child { margin-bottom: 1rem; }
.row-body h3 { margin-top: 1.6rem; }
.row-body h3:first-child { margin-top: 0; }

/* Definition lists */
.kv { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr); margin: 0 0 1rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.kv > dt, .kv > dd { margin: 0; padding: 0.7rem 0; border-top: 1px solid var(--rule); }
.kv > dt { font-weight: 700; padding-right: 1.5rem; }
.kv > dd > :last-child { margin-bottom: 0; }
.kv > dt:first-of-type, .kv > dt:first-of-type + dd { border-top: 0; }
.row-body > .kv:last-child { border-bottom: 0; }
@media (max-width: 560px) {
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv > dd { border-top: 0; padding-top: 0; }
}

/* Home */
.home-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 23rem); gap: 2rem 3.5rem; align-items: start;}
.home-intro .note { margin: 1.1rem 0 0; font-size: 0.95rem; color: var(--ink-2); max-width: 40em; }
.home-intro h1 { margin-top: 50px;}
.glance { background: var(--paper); border: 1px solid var(--rule); border-top: 4px solid var(--navy); padding: 1rem 1.25rem 0.5rem; }
.glance h2 { font-size: 1.08rem; margin: 0 0 0.4rem; }
.glance dl { margin: 0; }
.glance dl div { padding: 0.5rem 0; border-top: 1px solid var(--rule); }
.glance dt { font-size: 0.88rem; color: var(--ink-2); }
.glance dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .home-intro { grid-template-columns: minmax(0, 1fr); } .glance { max-width: 36rem; } }

.home-section { padding: 40px 0 8px; }
.home-section + .home-section { border-top: 1px solid var(--rule); }
.home-section > h2 { margin-bottom: 0.5rem; }
.home-section > .measure { margin-bottom: 1.5rem; }
.audiences { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.audiences li { margin: 0; border: 1px solid var(--rule); border-top: 4px solid var(--navy); padding: 1rem 1.25rem 1.1rem; }
.audiences h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.audiences p { margin: 0; }
@media (max-width: 860px) { .audiences { grid-template-columns: minmax(0, 1fr); } }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 3.5rem; }
@media (max-width: 860px) { .columns { grid-template-columns: minmax(0, 1fr); } }

/* The register extract */
.extract { border: 1px solid var(--ink); background: var(--paper); margin: 0; }
.extract-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem; padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--ink); background: var(--band); }
.extract-title { margin: 0; font-weight: 700; font-size: 1.1rem; }
.extract-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; margin: 0; }
.extract-meta div { display: flex; gap: 0.45rem; align-items: baseline; }
.extract-meta dt { color: var(--ink-2); font-style: italic; }
.extract-meta dd { margin: 0; font-weight: 700; }
.extract-meta .id { font-family: var(--mono); font-size: 0.95rem; letter-spacing: 0.02em; }
.extract .extract-table { width: 100%; border-collapse: collapse; margin: 0; border: 0; font-size: 1rem; }
.extract .extract-table th, .extract .extract-table td { text-align: left; vertical-align: top; padding: 0.55rem 1.25rem; border: 0; border-top: 1px solid var(--rule); }
.extract .extract-table thead th { border-top: 0; border-bottom: 0; background: none; font-weight: 400; font-style: italic; color: var(--ink-2); font-size: 0.92rem; padding-top: 0.7rem; }
.extract .extract-table tbody th { font-weight: 400; color: var(--ink-2); width: 11rem; }
.extract .extract-table tr.group th { padding-top: 0.9rem; font-family: var(--serif); font-size: 1rem; font-weight: 700; color: var(--ink); background: none; border-top: 1px solid var(--ink); }
.extract .extract-table td.source { width: 12.5rem; font-size: 0.92rem; color: var(--ink-2); white-space: nowrap; }
.extract .extract-table td.statement { font-style: italic; }
.extract-foot { margin: 0; padding: 0.8rem 1.25rem; border-top: 1px solid var(--ink); font-size: 0.95rem; }
.caption { margin: 0.6rem 0 0; font-size: 0.92rem; color: var(--ink-2); font-style: italic; }
@media (max-width: 640px) {
  .extract-head, .extract-foot { padding-inline: 1rem; }
  .extract .extract-table thead { display: none; }
  .extract .extract-table tr { display: grid; grid-template-columns: minmax(0, 1fr); padding: 0.55rem 1rem; border-top: 1px solid var(--rule); }
  .extract .extract-table tr.group { border-top: 1px solid var(--ink); padding-top: 0.9rem; }
  .extract .extract-table th, .extract .extract-table td { display: block; padding: 0; border: 0; width: auto !important; }
  .extract .extract-table tr.group th { padding: 0; border: 0; }
  .extract .extract-table tbody th { font-size: 0.9rem; }
  .extract .extract-table td.source { font-style: italic; margin-top: 0.15rem; white-space: normal; }
}

/* Disclosure */
details.disclosure { margin-top: 1.25rem; }
details.disclosure > summary { cursor: pointer; color: var(--navy); text-decoration: underline; text-underline-offset: 0.15em; width: fit-content; }
details.disclosure[open] > summary { margin-bottom: 0.75rem; }

/* Numbered procedure (only for real sequences) */
.steps { list-style: none; padding: 0; margin: 0 0 1rem; counter-reset: step; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 0 0.9rem; padding: 0.9rem 0; border-top: 1px solid var(--rule); margin: 0; }
.steps > li:first-child { border-top: 0; padding-top: 0.2rem; }
.steps > li::before {
  content: counter(step); display: flex; align-items: center; justify-content: center;
  width: 2.1rem; height: 2.1rem; border: 2px solid var(--navy); border-radius: 50%;
  color: var(--navy); font-weight: 700; font-size: 1rem; line-height: 1;
}
.steps h3 { margin: 0.2rem 0 0.2rem; }
.steps p { margin: 0; }

/* Figures from the API, shown only when it answers */
.figures { display: flex; flex-wrap: wrap; gap: 0.5rem 2.5rem; margin: 1rem 0; }
.figures div { display: flex; gap: 0.5rem; align-items: baseline; }
.figures dt { font-style: italic; color: var(--ink-2); }
.figures dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Tables: ruled grid with a grey header row */
.table-wrap { overflow-x: auto; margin: 0 0 1.25rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.98rem; margin: 0; border: 1px solid var(--rule); }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.8rem; border: 1px solid var(--rule); }
thead th { background: var(--band); font-weight: 700; font-size: 0.93rem; border-bottom: 2px solid var(--ink-2); }
tbody th { font-weight: 700; }
tbody th[colspan] { background: var(--band); font-family: var(--mono); font-size: 0.85rem; }
td code, th code { white-space: nowrap; }
.col-code { width: 6.5rem; }
.code-wrap code { white-space: normal; overflow-wrap: anywhere; }
.status { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 700; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }

/* Code */
.code { position: relative; margin: 0 0 1.25rem; }
.code-label { font-size: 0.92rem; font-style: italic; color: var(--ink-2); margin: 0 0 0.35rem; }
pre {
  background: var(--band); color: var(--ink); border: 1px solid var(--rule); border-radius: 0;
  padding: 0.9rem 1rem; overflow-x: auto; font-family: var(--mono); font-size: 0.84rem; line-height: 1.55; tab-size: 2;
}
pre code { background: none; padding: 0; font-size: inherit; white-space: pre; }
.code .copy {
  position: absolute; top: 6px; right: 6px; min-height: 30px; padding: 0.15rem 0.6rem;
  background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: 2px;
  font: inherit; font-size: 0.85rem; cursor: pointer;
}
.code .copy:hover { border-color: var(--ink); }

/* Notices */
.notice { border: 1px solid var(--rule); border-left: 5px solid var(--navy); background: var(--navy-tint); padding: 0.85rem 1.1rem; margin: 0 0 1.75rem; max-width: 46em; }
.notice > :last-child { margin-bottom: 0; }
.notice strong { display: block; margin-bottom: 0.15rem; }

/* Lists that say what is and is not allowed */
.dos, .donts { list-style: none; padding: 0; }
.dos li, .donts li { position: relative; padding-left: 1.6rem; }
.dos li::before, .donts li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.dos li::before { content: "✓"; color: var(--ok); }
.donts li::before { content: "✕"; color: var(--bad); }

/* Forms */
.form { max-width: 40rem; margin-bottom: 2rem; }
.field { margin: 0 0 1.25rem; }
.field label, .field legend { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.field .hint { display: block; font-size: 0.92rem; font-style: italic; color: var(--ink-2); margin: -0.1rem 0 0.4rem; }
input[type="text"], input[type="email"], input[type="search"], textarea {
  width: 100%; min-height: 44px; padding: 0.5rem 0.7rem;
  background: var(--paper); color: var(--ink); border: 1px solid var(--ink-2); border-radius: 0;
  font: inherit; font-size: 1rem;
}
textarea { min-height: 7.5rem; resize: vertical; }
input:focus-visible, textarea:focus-visible { outline: 3px solid #f2b705; outline-offset: 0; border-color: var(--ink); }
input[disabled] { background: var(--band); cursor: not-allowed; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400 !important; }
.check input { margin-top: 0.35rem; width: 18px; height: 18px; flex: none; }
.search-row { display: flex; gap: 0.75rem; }
.search-row input { flex: 1; min-width: 0; }
@media (max-width: 560px) { .search-row { flex-direction: column; } }
.form-message { margin-top: 1rem; }
.form-message[data-kind="error"] { color: var(--bad); }
#lookup-results:not(:empty) { margin-bottom: 2rem; }

/* Listing check result: a short extract */
.result { border: 1px solid var(--ink); max-width: 40rem; margin-top: 1.25rem; }
.result h3 { margin: 0; padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--ink); background: var(--band); font-size: 1.1rem; }
.result .kv { margin: 0; padding: 0 1.1rem; border: 0; }
.result > p, .result > a { display: block; margin: 0; padding: 0.75rem 1.1rem; border-top: 1px solid var(--rule); }

/* Footer */
.site-footer { background: var(--band); border-top: 4px solid var(--navy); padding: 36px 0 0; font-size: 0.95rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.footer-about p { max-width: 34em; color: var(--ink-2); }
.footer-name { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.4rem; color: var(--ink) !important; }
.site-footer h2 { font-size: 0.98rem; margin: 0 0 0.5rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li + li { margin-top: 0.35rem; }
.site-footer a { color: var(--ink); }
.site-footer a:hover { color: var(--navy); }
.footer-base { margin-top: 32px; padding-bottom: 28px; color: var(--ink-2); font-size: 0.88rem; }
.footer-base p { margin: 0; padding-top: 16px; border-top: 1px solid var(--rule); }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }
@media (max-width: 420px) { .footer-grid { grid-template-columns: 1fr; } }

@media (max-width: 560px) {
  :root { --gutter: 16px; }
  body { font-size: 1rem; }
  .title-band { padding: 16px 0 24px; }
  .crumbs ol { margin-bottom: 1rem; }
  .doc { padding-top: 24px; }
  .lead { font-size: 1.1rem; }
  .home-section { padding-top: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .masthead-search, .menu-toggle, .site-nav, .copy, .skip, .toc { display: none !important; }
  .title-band, .site-footer { background: none; }
  .doc--toc { display: block; }
  a { color: inherit; }
}

/* A definition list read top to bottom, for narrow columns */
.kv--stacked { grid-template-columns: minmax(0, 1fr); border-bottom: 0; }
.kv--stacked > dt { padding-bottom: 0.15rem; }
.kv--stacked > dd { border-top: 0; padding-top: 0; }
