/* ============================================================
   COURTS NZ — design system
   Monochrome: pure black and white, heavy grotesk display type,
   white fern on a black header band, inverted-tab navigation,
   hard 2px rules, no colour anywhere.
   ============================================================ */

:root {
  --black:        #000000;
  --ink:          #111111;
  --text:         #161616;
  --text-2:       #3a3a3a;
  --muted:        #6b6b6b;
  --bg:           #ffffff;
  --panel:        #f3f3f3;
  --panel-2:      #e8e8e8;
  --rule:         #000000;
  --border:       #cfcfcf;
  --border-light: #e4e4e4;
  --focus:        #000000;
  --max:          1200px;
  --font-sans:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Archivo', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100%; display: flex; flex-direction: column;
  font-family: var(--font-sans); font-size: 1rem; line-height: 1.6;
  color: var(--text); background: var(--bg);
}
a { color: var(--black); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:visited { color: #444; }
a:hover { background: var(--black); color: #fff; text-decoration: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; color: #000; padding: .5rem 1rem; z-index: 999; border: 2px solid #000; }
.skip-link:focus { left: 0; }

h1, h2, h3, h4 { color: var(--black); line-height: 1.12; margin: 0 0 .75rem; font-family: var(--font-display); }
h1 { font-weight: 800; font-stretch: 85%; font-size: clamp(2.1rem, 4.6vw, 3.4rem); letter-spacing: -0.02em; text-transform: none; }
h2 { font-size: 1.35rem; font-weight: 800; margin-top: 2.5rem; letter-spacing: -0.005em; }
h3 { font-size: 1.05rem; font-weight: 700; margin-top: 1.5rem; }
p { margin: 0 0 1rem; }
code, .mono { font-family: var(--font-mono); font-size: .9em; }
hr { border: 0; border-top: 2px solid var(--rule); margin: 2rem 0; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
main { flex: 1; }
.page { padding-top: 2.25rem; padding-bottom: 4rem; }

/* ---- Header band: black, fern + wordmark left, search right ---- */
.band { background: var(--black); color: #fff; }
.band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 2rem; min-height: 96px; }
.brand { display: flex; align-items: center; gap: .85rem; color: #fff; text-decoration: none; }
.brand:visited, .brand:hover { color: #fff; background: transparent; }
.brand-fern { width: 40px; height: 64px; flex-shrink: 0; }
.brand-name { display: block; font-family: var(--font-display); font-weight: 900; font-stretch: 80%; font-size: 2.1rem; letter-spacing: -0.01em; word-spacing: .12em; line-height: .9; text-transform: uppercase; }
.brand-sub { display: block; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: #bdbdbd; margin-top: .45rem; }
.band-search { display: flex; align-items: stretch; border: 1px solid #fff; }
.band-search input { font: inherit; font-size: .92rem; width: 280px; background: transparent; border: 0; color: #fff; padding: .55rem .8rem; min-width: 0; }
.band-search input::placeholder { color: #9a9a9a; }
.band-search input:focus { outline: none; background: #1a1a1a; }
.band-search button { font: inherit; font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; background: #fff; color: #000; border: 0; padding: 0 1rem; cursor: pointer; }
.band-search button:hover { background: #d9d9d9; }

/* Nav: white bar, inverted active tab */
.navbar { border-bottom: 2px solid var(--rule); background: #fff; }
.navbar .wrap { display: flex; justify-content: space-between; align-items: stretch; gap: 1rem; }
.menu { display: flex; align-items: stretch; }
.menu a { color: #000; text-decoration: none; font-size: .88rem; font-weight: 600; padding: .8rem 1rem; border-right: 1px solid var(--border-light); }
.menu a:first-child { border-left: 1px solid var(--border-light); }
.menu a:hover { background: var(--panel); color: #000; }
.menu a[aria-current="page"] { background: #000; color: #fff; }
.indep { align-self: center; font-size: .76rem; color: var(--muted); letter-spacing: .02em; }
.indep a { color: var(--muted); }
.menu-toggle { display: none; background: none; border: 1px solid #fff; color: #fff; padding: .45rem .8rem; font: inherit; font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }

/* ---- Breadcrumb ---- */
.crumbs { font-size: .82rem; color: var(--muted); margin: 0 0 1.5rem; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; text-transform: uppercase; letter-spacing: .06em; }
.crumbs li + li::before { content: "→"; margin-right: .5rem; color: #000; }
.crumbs a { color: var(--text-2); text-decoration: none; border-bottom: 1px solid var(--border); }

/* ---- Kicker / page head ---- */
.kicker { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #fff; background: #000; padding: .2rem .55rem; margin: 0 0 .9rem; }
.page-head { border-bottom: 2px solid var(--rule); padding-bottom: 1.4rem; margin-bottom: 2rem; }
.page-head .lede { color: var(--text-2); font-size: 1.12rem; max-width: 66ch; margin: .75rem 0 0; }
.cite { font-size: .85rem; color: var(--muted); margin-top: .6rem; }

/* ---- Layout: main + rail ---- */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3rem; align-items: start; }
.rail { border: 2px solid var(--rule); padding: 1.25rem 1.3rem; font-size: .9rem; position: sticky; top: 1rem; }
.rail h2 { font-family: var(--font-sans); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: #000; margin: 0 0 .6rem; padding-bottom: .4rem; border-bottom: 1px solid #000; }
.rail h2:not(:first-child) { margin-top: 1.4rem; }
.rail ul { list-style: none; margin: 0; padding: 0; }
.rail li { padding: .35rem 0; border-bottom: 1px solid var(--border-light); }
.rail li:last-child { border-bottom: 0; }
.rail p { margin: 0; color: var(--text-2); }

/* ---- Search ---- */
.search { display: grid; grid-template-columns: minmax(0, 1fr) 240px auto; gap: 0; border: 2px solid #000; }
.search input, .search select, .search button {
  font: inherit; font-size: 1rem; padding: .85rem 1rem; border: 0; border-radius: 0; background: #fff; color: var(--text); min-width: 0;
}
.search select { border-left: 2px solid #000; }
.search input:focus, .search select:focus { outline: none; background: var(--panel); }
.search button { background: #000; color: #fff; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .85rem; padding: .85rem 1.75rem; cursor: pointer; }
.search button:hover { background: #2b2b2b; }
.search-panel { background: var(--panel); padding: 1.6rem 1.6rem 1.4rem; margin: 0 0 2.5rem; }
.search-panel h2 { margin: 0 0 1rem; font-size: 1.15rem; }
.search-help { font-size: .84rem; color: var(--muted); margin: .7rem 0 0; }

/* ---- Group index (home) ---- */
.index { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--rule); counter-reset: grp; }
.index li { border-bottom: 1px solid var(--border); counter-increment: grp; }
.index a { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr) auto; gap: 1rem; align-items: baseline; padding: 1rem .25rem; text-decoration: none; color: var(--text); }
.index a::before { content: counter(grp, decimal-leading-zero); font-family: var(--font-mono); font-size: .85rem; color: var(--muted); }
.index a:hover { background: #000; color: #fff; }
.index a:hover .index-title, .index a:hover .index-meta, .index a:hover::before { color: #fff; }
.index-code { display: none; }
.index-title { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; color: #000; }
.index-meta { font-size: .84rem; color: var(--muted); text-align: right; white-space: nowrap; }

/* ---- Tables ---- */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; border-top: 2px solid var(--rule); border-bottom: 2px solid var(--rule); }
.tbl th, .tbl td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--border-light); vertical-align: top; }
.tbl th { color: #000; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; white-space: nowrap; border-bottom: 1px solid #000; }
.tbl tbody tr:hover { background: var(--panel); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-family: var(--font-mono); }
.tbl .name a { font-weight: 600; }
.tbl caption { text-align: left; caption-side: top; font-size: .84rem; color: var(--muted); padding: 0 0 .6rem; }
.tag { display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; background: #000; color: #fff; padding: .12rem .45rem; line-height: 1.4; vertical-align: middle; }
.tag-muted { background: #fff; color: var(--muted); outline: 1px solid var(--border); outline-offset: -1px; }
.tag-ok { background: #000; color: #fff; }

/* ---- Definition list (record) ---- */
.dl { display: grid; grid-template-columns: 200px minmax(0, 1fr); margin: 0; border-top: 2px solid var(--rule); }
.dl dt, .dl dd { padding: .7rem .5rem; border-bottom: 1px solid var(--border-light); margin: 0; }
.dl dt { font-size: .72rem; font-weight: 700; color: #000; text-transform: uppercase; letter-spacing: .14em; padding-top: .85rem; }
.dl dd { color: var(--text); overflow-wrap: anywhere; }
.section-label { font-family: var(--font-sans); font-size: .72rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #000; margin: 2.25rem 0 .5rem; }

/* ---- Notices ---- */
.notice { border: 2px solid #000; padding: 1rem 1.2rem; font-size: .92rem; color: var(--text); margin: 1.5rem 0; }
.notice strong { text-transform: uppercase; letter-spacing: .08em; font-size: .82em; }
.note { background: var(--panel); padding: 1rem 1.2rem; font-size: .9rem; color: var(--text-2); margin: 1.5rem 0; }
.source-block { background: #000; color: #fff; padding: 1.15rem 1.35rem; font-size: .9rem; margin: 2rem 0; }
.source-block h2 { font-family: var(--font-sans); margin: 0 0 .6rem; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: #bdbdbd; }
.source-block dl { margin: 0; display: grid; grid-template-columns: 130px 1fr; gap: .3rem .9rem; }
.source-block dt { color: #bdbdbd; }
.source-block dd { margin: 0; overflow-wrap: anywhere; }
.source-block a, .source-block a:visited { color: #fff; }
.source-block a:hover { background: #fff; color: #000; }

/* ---- Stats strip ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border: 2px solid #000; margin: 2rem 0; }
.stat { padding: 1rem 1.15rem; border-right: 1px solid #000; }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-family: var(--font-display); font-weight: 900; font-size: 1.8rem; color: #000; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { font-size: .8rem; color: var(--muted); }

/* ---- Pagination ---- */
.pager { display: flex; flex-wrap: wrap; gap: 0; margin: 1.5rem 0; font-size: .9rem; border: 1px solid #000; width: fit-content; }
.pager a, .pager span { padding: .4rem .8rem; text-decoration: none; border-right: 1px solid #000; }
.pager > :last-child { border-right: 0; }
.pager span[aria-current] { background: #000; color: #fff; }

/* ---- Prose pages ---- */
.prose { max-width: 70ch; }
.prose p, .prose li { color: var(--text-2); }
.prose ul { padding-left: 1.2rem; list-style: square; }
.prose li { margin-bottom: .4rem; }

/* ---- Buttons ---- */
.btn { display: inline-block; background: #000; color: #fff; text-decoration: none; padding: .65rem 1.3rem; font-weight: 700; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; border: 2px solid #000; }
.btn:visited { color: #fff; }
.btn:hover { background: #fff; color: #000; }
.btn-outline { background: #fff; color: #000; }
.btn-outline:hover { background: #000; color: #fff; }

/* ---- Directory ---- */
.dir-court { border-bottom: 1px solid var(--border); padding: 1rem 0; }
.dir-court h3 { margin: 0 0 .15rem; font-size: 1.1rem; }
.dir-court .alt { font-size: .86rem; color: var(--muted); font-style: italic; }
.dir-court p { margin: .45rem 0 0; font-size: .9rem; color: var(--text-2); }
.dir-locs { font-size: .85rem; color: var(--muted); margin-top: .45rem; }
.dir-locs summary { cursor: pointer; color: #000; font-weight: 600; }

/* ---- Footer ---- */
.footer { background: #000; color: #d0d0d0; margin-top: 4rem; font-size: .88rem; position: relative; overflow: hidden; }
.footer .wrap { padding-top: 3rem; padding-bottom: 2rem; position: relative; }
.footer-fern { position: absolute; right: -10px; bottom: -40px; width: 220px; height: 352px; opacity: .09; pointer-events: none; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.25rem; }
.footer h2 { font-family: var(--font-sans); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: #fff; margin: 0 0 .9rem; padding-bottom: .45rem; border-bottom: 1px solid #444; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin: 0 0 .35rem; }
.footer a, .footer a:visited { color: #e8e8e8; }
.footer a:hover { background: #fff; color: #000; }
.footer-independence { border: 1px solid #fff; padding: .8rem 1rem; margin: 0 0 1rem; color: #fff; }
.footer-wordmark { font-family: var(--font-display); font-weight: 900; font-stretch: 80%; font-size: 2.6rem; letter-spacing: -0.01em; color: #fff; text-transform: uppercase; line-height: 1; margin-bottom: 1.75rem; }
.footer-meta { border-top: 1px solid #444; margin-top: 2.25rem; padding-top: 1rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; font-size: .78rem; color: #a0a0a0; }

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .cols { grid-template-columns: 1fr; }
  .rail { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .band-search { display: none; }
  .indep { display: none; }
}
@media (max-width: 720px) {
  .band .wrap { min-height: 74px; }
  .brand-fern { width: 30px; height: 48px; }
  .brand-name { font-size: 1.6rem; }
  .brand-sub { display: none; }
  .menu-toggle { display: inline-block; }
  .navbar { border-bottom-width: 0; }
  .menu { display: none; flex-direction: column; width: 100%; }
  .menu.open { display: flex; border-bottom: 2px solid #000; }
  .menu a, .menu a:first-child { border: 0; border-bottom: 1px solid var(--border-light); padding: .85rem .25rem; }
  .search { grid-template-columns: 1fr; }
  .search select { border-left: 0; border-top: 2px solid #000; }
  .index a { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .index-meta { grid-column: 2; text-align: left; white-space: normal; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { border-bottom: 0; padding-bottom: 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .source-block dl { grid-template-columns: 1fr; }
}
@media print {
  .navbar, .menu-toggle, .band-search, .footer, .search-panel, .pager, .crumbs { display: none !important; }
  .band { background: #fff; color: #000; border-bottom: 2px solid #000; }
  .brand, .brand-sub { color: #000 !important; }
  .brand-fern path { fill: #000; }
  .source-block { background: #fff; color: #000; border: 2px solid #000; }
  a { color: #000; text-decoration: none; }
  body { font-size: 11pt; }
}
