/* SIDC Lab — shared tokens, header, footer */
:root {
  --text: #16171a;
  --muted: #63666d;
  --line: #e7e5e0;
  --hover: #f7f6f3;
  --surface: #faf9f6;
  --bg: #ffffff;
  --accent: #8c1515;      /* cardinal red: rules, markers, active nav */
  --accent-ink: #8c1515;  /* links and highlighted letters */
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --text: #ecebe8; --muted: #a5a39d; --line: #2f2e2b; --hover: #1e1d1b; --surface: #1b1a18;
    --bg: #141412; --accent: #e0726c; --accent-ink: #ef8f8a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --text: #ecebe8; --muted: #a5a39d; --line: #2f2e2b; --hover: #1e1d1b; --surface: #1b1a18;
  --bg: #141412; --accent: #e0726c; --accent-ink: #ef8f8a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; }

.wrap { max-width: 1000px; margin: 0 auto; padding-inline: 16px; }
main.wrap { padding-block: 40px 72px; }

/* Header */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px; padding-block: 12px; }
.brand { display: flex; align-items: baseline; gap: 8px; font-weight: 600; font-size: 1.05rem; }
.brand small { font-family: var(--mono); font-weight: 400; font-size: .72rem; color: var(--muted); letter-spacing: .04em; }
.site-nav { display: flex; gap: 20px; font-size: .9rem; overflow-x: auto; }
.site-nav a { color: var(--muted); padding-block: 4px; border-bottom: 2px solid transparent; white-space: nowrap; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

/* Highlight the S-I-D-C initials wherever the full lab name appears */
.ac { color: var(--accent-ink); font-weight: 700; }
.brand .ac { font-weight: 600; }

/* Shared section heading */
.section-title {
  font-size: .75rem; font-family: var(--mono); font-weight: 500; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); margin: 0 0 12px;
}
h1 { font-size: 1.75rem; font-weight: 600; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
.more { color: var(--accent-ink); font-size: .9rem; }
.more:hover { text-decoration: underline; }

/* News list (Home + News page) */
.news { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.news li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .925rem; }
.news time { font-family: var(--mono); font-size: .8rem; color: var(--muted); padding-top: 2px; }
.news a { color: var(--accent-ink); }
.news a:hover { text-decoration: underline; }
@media (max-width: 760px) { .news li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .825rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 24px; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }

/* Light/dark toggle: shows the moon in light mode, the sun in dark mode */
.site-nav { margin-left: auto; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0;
  color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
}
.theme-toggle:hover { color: var(--text); background: var(--hover); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
