/*
  Gov Revenue Lab brand tokens for Gov Ready Audit.
  WCAG 2.2 AA. Gold #B8741A is a non-text mark only.
  Small text and icons on light surfaces use #8A5413.
  Text and icons on navy or dark surfaces use #E0A34A.
*/

:root {
  color-scheme: light;
  --grl-navy: #0e2744;
  --grl-navy-ink: #f4efe6;
  --grl-cream: #f6f1e7;
  --grl-card: #ffffff;
  --grl-ink: #1c1915;
  --grl-muted: #4a4036;
  --grl-gold-text: #8a5413;
  --grl-gold-on-navy: #e0a34a;
  --grl-gold-mark: #b8741a;
  --grl-line: #cdbfae;
  --grl-focus: #0b4f8a;
  --grl-danger: #7a1f1f;
  --grl-danger-bg: #f8e8e4;
  --grl-ok: #0f5c3a;
  --grl-ok-bg: #e5f3ec;
  --grl-link: #0b3a66;
  --grl-header: #0e2744;
  --grl-input: #ffffff;
  --grl-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --grl-sans: "Segoe UI", system-ui, -apple-system, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --grl-cream: #101820;
  --grl-card: #182430;
  --grl-ink: #f3ede3;
  --grl-muted: #d5cbbe;
  --grl-gold-text: #e0a34a;
  --grl-line: #3d5166;
  --grl-focus: #f0c36a;
  --grl-danger: #f0b4a8;
  --grl-danger-bg: #3a2422;
  --grl-ok: #8fd0b0;
  --grl-ok-bg: #163028;
  --grl-link: #f0c36a;
  --grl-header: #071018;
  --grl-input: #101820;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--grl-cream);
  color: var(--grl-ink);
  font-family: var(--grl-sans);
  font-size: 1.0625rem;
  line-height: 1.5;
}

img, svg { max-width: 100%; }

/*
  Two-tone ring: the gold band reads on navy and dark surfaces,
  the dark outline reads on cream and white. Both are at least 3:1
  against the surface they sit on.
*/
:focus {
  outline: 3px solid #1c1915;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px #f0c36a;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0;
  transform: translateY(-150%);
  background: var(--grl-card);
  color: var(--grl-ink);
  padding: 0.65rem 1rem;
  z-index: 20;
  font-weight: 700;
  text-decoration: underline;
}

.skip-link:focus { transform: none; }

.wrap {
  width: min(100% - 2rem, 52rem);
  margin-inline: auto;
}

.site-header {
  background: var(--grl-header);
  color: var(--grl-navy-ink);
  border-top: 4px solid var(--grl-gold-mark);
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.85rem 0;
}

.brand {
  color: var(--grl-navy-ink);
  text-decoration: underline;
  text-decoration-color: var(--grl-gold-on-navy);
  text-underline-offset: 0.2rem;
  min-height: 44px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
}

.brand-kicker {
  color: var(--grl-gold-on-navy);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-name {
  font-family: var(--grl-serif);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.header-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.lang-nav, .site-nav .nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.lang-nav a, .site-nav a, .theme-toggle, .btn, .text-link {
  min-height: 44px;
  min-width: 44px;
}

.lang-nav a {
  color: var(--grl-navy-ink);
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.15rem;
  font-weight: 650;
}

.lang-nav a[aria-current="page"] {
  text-decoration-thickness: 3px;
  color: var(--grl-gold-on-navy);
}

.theme-toggle {
  background: transparent;
  color: var(--grl-navy-ink);
  border: 2px solid var(--grl-gold-on-navy);
  border-radius: 4px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.site-nav {
  background: var(--grl-card);
  border-bottom: 1px solid var(--grl-line);
}

.site-nav .nav-list { padding: 0.15rem 0; }

.site-nav a {
  display: inline-flex;
  align-items: center;
  color: var(--grl-link);
  margin-right: 0.25rem;
  font-weight: 650;
}

.site-nav a[aria-current="page"] {
  text-decoration-thickness: 3px;
  color: var(--grl-ink);
}

main { padding: 1.75rem 0 3rem; }

h1, h2, h3 {
  font-family: var(--grl-serif);
  line-height: 1.25;
  font-weight: 700;
}

h1 { font-size: 2rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.5rem; margin: 1.75rem 0 0.5rem; }
h3 { font-size: 1.2rem; margin: 1.25rem 0 0.4rem; }

p { margin: 0 0 1rem; }

.lede {
  font-size: 1.2rem;
  max-width: 40rem;
}

.muted { color: var(--grl-muted); }

a { color: var(--grl-link); }

.site-footer {
  background: var(--grl-header);
  color: var(--grl-navy-ink);
  padding: 1.5rem 0 2rem;
}

.site-footer a { color: var(--grl-gold-on-navy); }

.site-footer p { margin: 0 0 0.6rem; }

.disclaimer { font-weight: 700; max-width: 40rem; }

.card, .notice, .form, .score-list, .queue-item {
  background: var(--grl-card);
  border: 1px solid var(--grl-line);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  margin: 0 0 1rem;
}

.notice-warn {
  border-color: var(--grl-gold-text);
}

.notice-bad {
  background: var(--grl-danger-bg);
  border-color: var(--grl-danger);
  color: var(--grl-ink);
}

.notice-ok {
  background: var(--grl-ok-bg);
  border-color: var(--grl-ok);
}

.form { max-width: 40rem; }

.field { display: flex; flex-direction: column; gap: 0.35rem; margin: 0 0 1rem; }

.field label, legend { font-weight: 700; }

fieldset {
  border: 2px solid var(--grl-line);
  border-radius: 6px;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem 0.25rem;
}

.check { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0 0 0.75rem; }

.check input { width: 1.5rem; height: 1.5rem; margin-top: 0.15rem; flex: 0 0 auto; }

input[type="text"], input[type="email"], input[type="password"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  color: var(--grl-ink);
  background: var(--grl-input);
  border: 2px solid var(--grl-line);
  border-radius: 4px;
}

textarea { min-height: 8rem; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: var(--grl-navy);
  color: var(--grl-navy-ink);
  border: 2px solid var(--grl-navy);
  border-radius: 4px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

html[data-theme="dark"] .btn {
  background: var(--grl-gold-on-navy);
  border-color: var(--grl-gold-on-navy);
  color: #1c1915;
}

.btn-secondary {
  background: transparent;
  color: var(--grl-ink);
  border-color: var(--grl-ink);
}

html[data-theme="dark"] .btn-secondary {
  background: transparent;
  color: var(--grl-ink);
  border-color: var(--grl-ink);
}

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.5rem 0 1rem; }

.error { color: var(--grl-danger); font-weight: 700; margin: 0; }

.error-summary { margin-bottom: 1rem; }

.error-summary a { color: var(--grl-danger); font-weight: 700; }

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

.score-list, .plain-list { list-style: none; padding: 0; margin: 0; }

.score-list li, .queue-item { margin-bottom: 0.75rem; }

.score-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.35rem 1rem; }

.badge {
  display: inline-block;
  min-height: 24px;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--grl-line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}

table { width: 100%; border-collapse: collapse; }

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--grl-line);
}

@media (max-width: 40rem) {
  table, thead, tbody, tr, th, td { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  td::before {
    content: attr(data-label);
    display: block;
    font-weight: 700;
  }
}

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

@media (max-width: 22rem) {
  h1 { font-size: 1.7rem; }
  .wrap { width: min(100% - 1.25rem, 52rem); }
}
