/* BNHR Certificates. The brand's tokens (brand/tokens.css) mapped onto the page as the quizzes map them: core-light for
   the light theme, core-dark for the dark one, following the system setting. Valid and revoked are this site's own
   tokens, and never the only signal: each has its mark and its words. */

:root {
  --bg: var(--core-light-bg);
  --surface: var(--core-light-surface);
  --ink: var(--core-light-ink);
  --muted: var(--core-light-muted);
  --subtle: var(--core-light-subtle);
  --rule: var(--core-light-rule);
  --hair: var(--core-light-hair);
  --accent: var(--bnhr-orange);
  --on-accent: var(--bnhr-navy);
  --focus: #b35c00;
  --valid: #17663d;
  --valid-tint: #e5f3ea;
  --revoked: #a3241b;
  --revoked-tint: #fbe9e7;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(12 35 64 / 6%), 0 2px 8px rgb(12 35 64 / 5%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--core-dark-bg);
    --surface: var(--core-dark-surface);
    --ink: var(--core-dark-ink);
    --muted: var(--core-dark-muted);
    --subtle: var(--core-dark-subtle);
    --rule: var(--core-dark-rule);
    --hair: var(--core-dark-hair);
    --focus: var(--bnhr-orange);
    --valid: #7dd9a3;
    --valid-tint: #12402f;
    --revoked: #ff9f94;
    --revoked-tint: #4a1f25;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--bnhr-font-text);
}

main.page { flex: 1; width: 100%; max-width: 46rem; margin: 0 auto; padding: 2rem 1rem 4rem; }

h1, h2 { font-family: var(--bnhr-font-display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 0.5rem; }
h1 { font-size: clamp(2rem, 1.5rem + 2.5vw, 2.9rem); letter-spacing: -0.035em; }
h2 { font-size: 1.4rem; }
p { margin: 0 0 0.75rem; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 3px; }
code { font-family: var(--bnhr-font-mono); font-size: 0.95em; background: var(--hair); border-radius: 4px; padding: 0.05em 0.3em; overflow-wrap: anywhere; }

/* The highlight: navy on the orange block, the full stop outside it */
h1 em, .tagline em {
  font-style: normal;
  background: var(--bnhr-block);
  color: var(--bnhr-mark);
  padding: 0 0.12em;
  border-radius: 0.08em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 10;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  font-weight: 700;
}
.skip:focus { top: 0.75rem; }

/* Top bar and footer */

.topbar { border-bottom: 1px solid var(--hair); background: var(--surface); }
.topbar .inner, footer.site .inner { max-width: 46rem; margin: 0 auto; padding: 0.65rem 1rem; display: flex; align-items: center; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand img { height: 1.6rem; width: auto; display: block; }
.brand .name {
  font-family: var(--bnhr-font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtle);
  border-left: 1px solid var(--rule);
  padding-left: 0.6rem;
}

footer.site { border-top: 1px solid var(--hair); color: var(--subtle); font-size: 0.9rem; }
footer.site .inner { padding: 1.5rem 1rem 2rem; display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; }
footer.site .mark { grid-row: span 2; align-self: start; }
footer.site .mark img { height: 2.25rem; width: auto; display: block; }
footer.site .tagline { font-family: var(--bnhr-font-display); font-weight: 800; color: var(--ink); letter-spacing: -0.01em; margin: 0; }
footer.site .credit { margin: 0; }

/* Shared pieces */

.kicker {
  font-family: var(--bnhr-font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtle);
  margin: 0 0 0.4rem;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 38rem; }
.page-head { margin-bottom: 2rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem;
  margin: 0 0 1.5rem;
  box-shadow: var(--shadow);
}
.panel.quiet { background: transparent; box-shadow: none; border-style: dashed; border-color: var(--rule); }
.panel.quiet h2 { font-size: 1.15rem; }
.panel.quiet p { color: var(--muted); font-size: 0.97rem; }
.panel.notice { border-left: 6px solid var(--accent); }
.panel.notice.none { border-left-color: var(--revoked); }
.panel.notice p:last-child { margin-bottom: 0; }

/* The ID form */

label { display: block; font-weight: 700; margin-bottom: 0.2rem; }
.hint { color: var(--subtle); font-size: 0.92rem; margin-bottom: 0.5rem; }
.hint code { white-space: nowrap; }
.field { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.field input {
  flex: 1 1 14rem;
  min-width: 0;
  min-height: 2.9rem;
  padding: 0.55rem 0.75rem;
  border: 2px solid var(--rule);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.05rem/1.3 var(--bnhr-font-text);
}
#id { font-family: var(--bnhr-font-mono); letter-spacing: 0.08em; }
.field input:focus-visible { border-color: var(--focus); outline-offset: 0; }
button {
  appearance: none;
  min-height: 2.9rem;
  padding: 0.6rem 1.3rem;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 1rem/1.2 var(--bnhr-font-text);
  cursor: pointer;
}
button:hover { filter: brightness(1.05); }

/* The certificate */

.result { margin-bottom: 1.5rem; }
.certificate {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-top: 6px solid var(--valid);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 0.5rem;
  margin: 0 0 1.5rem;
  box-shadow: var(--shadow);
}
.certificate.revoked { border-top-color: var(--revoked); }
.certificate h2.status {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-family: var(--bnhr-font-text);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.45;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  margin: 0 0 1rem;
}
.status.valid { background: var(--valid-tint); color: var(--valid); }
.status.revoked { background: var(--revoked-tint); color: var(--revoked); }
.status .mark {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  font-size: 0.95rem;
  line-height: 1;
}
.status.valid .mark { background: var(--valid); color: var(--valid-tint); }
.status.revoked .mark { background: var(--revoked); color: var(--revoked-tint); }

.certificate .old { color: var(--muted); font-size: 0.95rem; margin: -0.4rem 0 1rem; padding-left: 0.8rem; border-left: 4px solid var(--accent); }

.pill { display: inline-block; font-weight: 700; padding: 0 0.55em; border-radius: 999px; }
.pill.valid { background: var(--valid-tint); color: var(--valid); }
.pill.revoked { background: var(--revoked-tint); color: var(--revoked); }
code.id { background: none; padding: 0; font-size: 1em; letter-spacing: 0.04em; }

.details { display: grid; grid-template-columns: max-content 1fr; gap: 0 1.25rem; margin: 0; }
.details dt, .details dd { padding: 0.65rem 0; border-top: 1px solid var(--hair); margin: 0; }
.details dt {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--subtle);
}
.courses { list-style: none; margin: 0; padding: 0; }
.courses li + li { margin-top: 0.6rem; }
.courses strong { display: block; }
.competence { display: block; color: var(--muted); }

@media (max-width: 30rem) {
  .details { grid-template-columns: 1fr; }
  .details dt { padding-bottom: 0; }
  .details dd { border-top: none; padding-top: 0.2rem; }
}


/* Printed: the certificate on paper colours, without the forms */
@media print {
  :root {
    --bg: #ffffff; --surface: #ffffff; --ink: #0c2340; --muted: #23324a; --subtle: #4a5a70; --rule: #c2c7cd; --hair: #d9dcdf;
    --valid: #17663d; --valid-tint: #e5f3ea; --revoked: #a3241b; --revoked-tint: #fbe9e7; --shadow: none;
    color-scheme: light;
  }
  body { font-size: 11pt; }
  .skip, .lookup, .about, noscript { display: none !important; }
  .topbar, footer.site { border: none; }
  .topbar .inner, footer.site .inner { max-width: none; padding-inline: 0; }
  .page-head .lede { display: none; }
  main.page { padding: 1rem 0; max-width: none; }
  .certificate { break-inside: avoid; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .status, .pill { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

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