/* IDMS site stylesheet. One file, no framework. Colours per brief section 2. */

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/public-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/public-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/public-sans-latin-600-normal.woff2") format("woff2");
}
/* Wordmark only: the Institute's name in a serif. Everything else is Public Sans. */
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --ink: #14181F;
  --paper: #FFFFFF;
  --rule: #D9DDE3;
  --muted: #5B6470;
  --accent: #213FD5;
  --prose: 46rem; /* about 72 characters of body text */
  --wide: 1100px;
  --gutter: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E8EAED;
    --paper: #0F1216;
    --rule: #2A303A;
    --muted: #9AA3AF;
    --accent: #8EA2FF;
  }
}

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

html {
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
  background: var(--paper);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Links: accent colour only for links */
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  padding: 0.25rem 0.5rem;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 2px;
}
.skip:focus { top: 0.5rem; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 1.5rem 0 0;
}
.wordmark {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.25;
  color: var(--ink);
  text-decoration: none;
}
.site-header nav ul {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
}
.site-header nav a {
  display: inline-block;
  padding: 0.5rem 0 0.625rem;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.site-header nav a:hover { border-bottom-color: var(--rule); }
.site-header nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* Main */
main.wrap { padding-top: 2.5rem; padding-bottom: 4rem; }
.prose > * { max-width: var(--prose); }
.prose > .table-wrap { max-width: var(--wide); }
.nowrap { white-space: nowrap; }
.notice { padding: 0.75rem 1rem; border: 1px solid var(--rule); }
.copy-status { margin-left: 0.75rem; color: var(--muted); font-size: 0.9375rem; }
address { font-style: normal; margin: 0 0 1.5rem; }
table.contacts { width: auto; }
table.contacts th { font-weight: 500; padding-right: 3rem; }
tbody th[scope="row"] { white-space: nowrap; }

h1, h2, h3 { font-weight: 600; line-height: 1.25; margin: 0; }
h1 { font-size: 2rem; letter-spacing: -0.01em; margin-bottom: 1.5rem; }
h2 {
  font-size: 1.25rem;
  margin-top: 2.75rem;
  margin-bottom: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
h3 { font-size: 1.0625rem; margin-top: 2rem; margin-bottom: 0.5rem; }

p, ul, ol, dl, pre, .table-wrap { margin: 0 0 1rem; }
table { margin: 0; }
ul, ol { padding-left: 1.25rem; }
li { margin-bottom: 0.5rem; }
li::marker { color: var(--muted); }

.lead { font-size: 1.1875rem; }
.muted, small { color: var(--muted); }

/* Placeholders: unknown facts stay visible until filled (brief section 0) */
mark.ph {
  background: none;
  color: inherit;
  outline: 1px dashed var(--muted);
  outline-offset: 1px;
}

/* Tables: hairline rules only */
.table-wrap { max-width: var(--wide); overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 1rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}
th { font-weight: 600; }
thead th { border-bottom-color: var(--ink); }

/* Definition list for paper metadata */
dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 0.375rem 1.5rem; padding: 1rem 0 0; border-top: 1px solid var(--rule); }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; }

pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 1rem;
  border: 1px solid var(--rule);
}
pre.citation { font-family: inherit; font-size: 0.9375rem; }
pre + .button { margin-bottom: 1rem; }

/* The one button style: rectangular, 1px ink border, no fill, 2px radius */
.button {
  display: inline-block;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  background: none;
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 0.375rem 0.875rem;
  text-decoration: none;
  cursor: pointer;
}

/* Footer: one line */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.site-footer p { margin: 0; max-width: none; }
.site-footer a { color: var(--muted); }

@media (max-width: 720px) {
  h1 { font-size: 1.625rem; }
  .wordmark { font-size: 1.25rem; }
  dl.meta { grid-template-columns: 1fr; gap: 0; }
  .table-wrap > table:not(.contacts) { min-width: 40rem; }
  td.title { min-width: 15rem; }
  dl.meta dd { margin-bottom: 0.5rem; overflow-wrap: anywhere; }
  .site-header nav ul { gap: 0 1.125rem; margin-top: 0.75rem; }
  .site-header nav a { padding: 0.375rem 0 0.5rem; }
  main.wrap { padding-top: 1.75rem; }
}

/* Print: black on white, URLs expanded after links */
@media print {
  :root { --ink: #000; --paper: #fff; --rule: #999; --muted: #333; --accent: #000; }
  .skip, .site-header nav, .button { display: none; }
  .site-header { padding-top: 0; border-bottom: 1px solid #000; }
  main.wrap { padding: 1rem 0; }
  a { color: #000; text-decoration: none; }
  main a[href^="http"]::after, .site-footer a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
  main a[href^="/"]::after { content: " (https://idms.org" attr(href) ")"; font-size: 0.85em; }
  main a[href^="mailto:"]::after { content: ""; }
  h2 { break-after: avoid; }
  tr, pre, dl { break-inside: avoid; }
  mark.ph { outline: 1px dashed #000; }
}
