/* Board of Tax Appeals, Republic of Liberia. Shared stylesheet.
   Structure: tokens > base > layout > components > pages > print */

/* ---------- Tokens ---------- */
:root {
  --navy: #0F2447;
  --navy-2: #1B3A6B;
  --red: #B3202D;
  --gold: #8F6F1F;
  --gold-soft: #E9DDB8;
  --bg: #FAFBFD;
  --surface: #FFFFFF;
  --ink: #1A2233;
  --muted: #55607A;
  --rule: #D5DAE3;
  --tint: #EEF2F8;
  --link: #1B3A6B;
  --ph-bg: #FFF4D6;
  --ph-ink: #7A5A00;
  --ok: #1F6B45;
  --ok-bg: #E3F3EA;
  --err: #B3202D;
  --err-bg: #FBE6E8;
  --field-border: #8A94AB;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --measure: 68ch;
  --radius: 4px;
  --space: clamp(2.5rem, 6vw, 4rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --navy: #0A1830;
    --bg: #0B1220;
    --surface: #121B2E;
    --ink: #E8ECF4;
    --muted: #9AA6C0;
    --rule: #2A3654;
    --tint: #17223A;
    --link: #9DB8EA;
    --gold: #D8B45A;
    --gold-soft: #3A3116;
    --red: #E5525F;
    --ph-bg: #3A2F0C;
    --ph-ink: #F1CE72;
    --ok: #7FD3A4;
    --ok-bg: #12301F;
    --err: #FF8A94;
    --err-bg: #3A1519;
    --field-border: #5A6A92;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 6rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.6 var(--sans);
}
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); line-height: 1.15; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 3.3rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; max-width: var(--measure); }
a { color: var(--link); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
main:focus { outline: none; }

.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: #000; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: .5rem; top: .5rem; }
.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; border-bottom: 4px solid var(--red); }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; padding-block: .7rem; position: relative; }
.brand { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.seal { width: 46px; height: 46px; border-radius: 50%; background: #fff; border: 2px solid var(--gold); display: grid; place-items: center; flex: none; }
.seal img { width: 26px; height: 26px; }
.brand-name { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; line-height: 1.1; display: block; }
.brand-sub { color: #C9D3E8; font-size: .78rem; display: block; }

.primary-nav { margin-left: auto; }
.primary-nav ul { list-style: none; display: flex; gap: .1rem; margin: 0; padding: 0; }
.primary-nav a { color: #E4EAF6; text-decoration: none; padding: .5rem .6rem; border-radius: var(--radius); font-size: .92rem; display: block; }
.primary-nav a:hover { background: rgba(255,255,255,.12); }
.primary-nav a[aria-current="page"] { background: #fff; color: #0F2447; font-weight: 600; }

.menu-button { display: none; margin-left: auto; background: transparent; color: #fff; border: 1px solid #6b7fa8; border-radius: var(--radius); padding: .5rem .9rem; font: inherit; cursor: pointer; }

@media (max-width: 1100px) {
  .menu-button { display: block; }
  .primary-nav { position: absolute; left: 0; right: 0; top: calc(100% + .7rem); margin: 0; background: var(--navy); border-bottom: 4px solid var(--red); display: none; }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; padding: .5rem 1rem 1rem; }
  .primary-nav a { padding: .75rem .6rem; }
}

/* ---------- Buttons and forms ---------- */
.btn { display: inline-block; background: var(--red); color: #fff; border: 2px solid var(--red); border-radius: var(--radius); padding: .65rem 1.2rem; font: 600 1rem var(--sans); text-decoration: none; cursor: pointer; line-height: 1.3; }
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn-navy { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.btn-outline { background: transparent; border-color: currentColor; color: inherit; }
.btn-sm { padding: .4rem .8rem; font-size: .9rem; }
.btn[aria-disabled="true"] { background: var(--tint); border-color: var(--rule); color: var(--muted); cursor: not-allowed; filter: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .3rem; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--field-border); border-radius: var(--radius); padding: .65rem .75rem; }
textarea { min-height: 140px; resize: vertical; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--err); }
.field { margin-bottom: 1.1rem; }
.hint { color: var(--muted); font-size: .88rem; margin: .25rem 0 0; }
.field-error { color: var(--err); font-size: .9rem; margin: .25rem 0 0; min-height: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem; }
.filters > div { flex: 1 1 220px; }

/* ---------- Layout blocks ---------- */
.section { padding-block: var(--space); }
.section-tint { background: var(--tint); }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

/* ---------- Hero (letterhead + docket) ---------- */
.hero { background: var(--navy); color: #fff; padding: clamp(2.5rem, 7vw, 4.5rem) 0 clamp(3rem, 7vw, 4.5rem); position: relative; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 6px; background: linear-gradient(90deg, var(--red) 0 33.3%, #fff 33.3% 66.6%, var(--gold) 66.6%); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(1.5rem, 5vw, 3.5rem); align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { color: #fff; max-width: 16ch; }
.hero p { color: #D3DCEE; font-size: 1.12rem; }
.hero .btn-outline { color: #fff; }

.docket { background: var(--surface); color: var(--ink); border-radius: 6px; border-top: 6px solid var(--gold); box-shadow: 0 14px 34px rgba(0,0,0,.28); padding: 1.3rem 1.4rem 1.1rem; }
.docket h2 { font-size: 1.35rem; margin-bottom: .2rem; }
.hero .docket p, .docket-sub { color: var(--muted); font-size: .92rem; margin-bottom: .6rem; }
.docket ul { list-style: none; margin: 0; padding: 0; }
.docket li + li { border-top: 1px solid var(--rule); }
.docket a { display: block; padding: .8rem .2rem; color: var(--ink); text-decoration: none; }
.docket a:hover strong { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: .2em; }
.docket strong { font-family: var(--serif); font-size: 1.1rem; display: block; }
.docket span { color: var(--muted); font-size: .9rem; }

/* ---------- Page head (docket caption) ---------- */
.page-head { background: var(--tint); border-bottom: 1px solid var(--rule); border-top: 1px solid var(--rule); padding: 2rem 0 1.7rem; position: relative; }
.page-head::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--gold); }
.page-head p { font-size: 1.08rem; color: var(--muted); margin-bottom: 0; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: .7rem; }
.crumbs a { color: var(--muted); }

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 1.2rem 1.3rem; }
.card h3 { margin-bottom: .4rem; }
.card > :last-child { margin-bottom: 0; }
a.card { display: block; text-decoration: none; color: var(--ink); border-left: 5px solid var(--navy-2); }
a.card:hover { border-left-color: var(--red); }
a.card span { color: var(--muted); font-size: .94rem; }

.chip { display: inline-block; font-size: .8rem; font-weight: 600; padding: .12rem .6rem; border-radius: 999px; background: var(--tint); border: 1px solid var(--rule); color: var(--muted); }
.ph { background: var(--ph-bg); color: var(--ph-ink); padding: .05rem .4rem; border-radius: 3px; font-weight: 600; font-size: .92em; }
.callout { border-left: 5px solid var(--gold); background: var(--tint); padding: 1rem 1.2rem; border-radius: 0 6px 6px 0; margin: 1.2rem 0; }
.callout > :last-child { margin-bottom: 0; }

.empty { text-align: center; padding: 2rem 1.2rem; color: var(--muted); border: 2px dashed var(--rule); border-radius: 6px; }
.empty strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 1.15rem; margin-bottom: .3rem; }
.empty p { margin-inline: auto; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; }
.steps li { counter-increment: step; position: relative; padding-left: 3.3rem; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--navy-2); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 1.1rem; }
.steps h3 { margin-bottom: .2rem; }
.steps p { margin-bottom: 0; }

details { border-bottom: 1px solid var(--rule); padding: .85rem 0; }
details:first-of-type { border-top: 1px solid var(--rule); }
summary { cursor: pointer; font-weight: 600; }
details p { margin: .6rem 0 0; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .9rem 0; border-bottom: 1px solid var(--rule); display: flex; gap: 1rem; flex-wrap: wrap; align-items: baseline; }
.date-tag { font-family: var(--serif); font-weight: 700; color: var(--link); min-width: 6rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 640px; }
caption { text-align: left; padding: .8rem .9rem; font-weight: 600; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--rule); font-size: .94rem; vertical-align: top; }
th { background: var(--tint); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }

.gallery { margin: 0; }
.gallery-tile { aspect-ratio: 4 / 3; border-radius: 6px; background: repeating-linear-gradient(135deg, var(--tint) 0 12px, var(--surface) 12px 24px); border: 1px dashed var(--field-border); display: grid; place-items: center; color: var(--muted); font-size: .88rem; text-align: center; padding: .6rem; }
.gallery figcaption { font-size: .88rem; color: var(--muted); margin-top: .4rem; }

.form-status { margin-top: 1rem; padding: .8rem 1rem; border-radius: var(--radius); }
.form-status:empty { display: none; }
.form-status.is-error { background: var(--err-bg); color: var(--err); border: 1px solid var(--err); }
.form-status.is-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #C9D3E8; padding: 2.5rem 0 1.5rem; border-top: 4px solid var(--red); }
.site-footer h2 { color: #fff; font-size: 1.05rem; margin-bottom: .6rem; }
.site-footer a { color: #E4EAF6; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .35rem 0; }
.site-footer .ph { background: rgba(255,244,214,.14); color: #F1CE72; }
.fine { border-top: 1px solid #33487a; margin-top: 1.6rem; padding-top: 1rem; font-size: .86rem; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero h1 { animation: rise .6s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .skip, .filters, .btn-row { display: none; }
  body { background: #fff; color: #000; }
  .page-head, .section-tint { background: none; }
  a { color: #000; }
}
