/* Shared by every page of the site: the colours, the top bar with its tabs,
   and the layout of the reading pages (Guide, Principles, Rocks, Glossary).
   The problem page adds its own styles for the puzzle on top of these.
   (Tabs added 2026-10-03 at the instructor's request.) */
:root {
  --ink: #1c2228;
  --muted: #57626e;
  --line: #d7d4cc;
  --panel: #ffffff;
  --bg: #f3f1ec;
  --accent: #245e73;
  --accent-soft: #e0edf2;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- the top bar ---------- */
header {
  background: var(--accent);
  color: #fff;
  padding: 6px 20px;
  display: flex;
  align-items: center;
  gap: 6px 18px;
  flex-wrap: wrap;
}
header .brand { margin: 0; font-size: 19px; font-weight: 600; white-space: nowrap; }
header .brand a { color: #fff; text-decoration: none; }
header .brand a:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 3px; }
header .spacer { flex: 1; }
nav.tabs { display: flex; flex-wrap: wrap; gap: 2px; }
nav.tabs a {
  color: #fff; text-decoration: none; font-size: 16px;
  padding: 9px 12px 6px; border-bottom: 3px solid transparent; border-radius: 4px 4px 0 0;
}
nav.tabs a:hover { background: rgba(255,255,255,0.14); }
nav.tabs a:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
/* The tab for the page you are on: bold and underlined, not colour alone. */
nav.tabs a[aria-current="page"] { font-weight: 700; border-bottom-color: #fff; }
header button {
  font: inherit; border-radius: 6px; padding: 6px 12px; cursor: pointer; min-height: 36px;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.5); color: #fff;
}
header button:hover { background: rgba(255,255,255,0.24); }
header button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
header button[aria-expanded="true"] { background: #fff; color: var(--accent); }
/* On a phone the tabs sit under the name in two even rows of four, and My
   progress stays beside the name. (One row of six from 2026-11-01; two rows
   since 2026-11-04, when the Folds tab made seven, too many for one row at a
   size a phone can read.) */
@media (max-width: 600px) {
  header { padding: 6px 12px 0; gap: 4px 10px; }
  header .brand { font-size: 17px; }
  header button { font-size: 14px; padding: 4px 9px; min-height: 32px; }
  nav.tabs { order: 3; width: 100%; gap: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
  nav.tabs a { padding: 8px 2px 6px; font-size: 14px; text-align: center; }
}

/* ---------- the reading pages ---------- */
.page { max-width: 980px; margin: 0 auto; padding: 14px 16px 60px; }
.page h1 { font-size: 26px; margin: 10px 0 14px; }
.page a { color: var(--accent); }
nav.toc { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; }
nav.toc ul { margin: 6px 0 0; padding-left: 20px; columns: 2; column-gap: 24px; }
nav.toc li { margin: 2px 0; break-inside: avoid; }
@media (max-width: 600px) { nav.toc ul { columns: 1; } }
section { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
section h2 { font-size: 20px; margin: 0 0 8px; }
section h3 { font-size: 17px; margin: 18px 0 6px; }
h3:target, section:target > h2 { background: var(--accent-soft); padding: 2px 6px; border-radius: 4px; }
.page p { margin: 0 0 10px; max-width: 70ch; line-height: 1.55; }
.fig { margin: 8px 0 14px; max-width: 560px; }
.fig .xsec { width: 100%; height: auto; display: block; border-radius: 4px; background: #e7eff6; }
.fig .cap { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.fig .hl-line { animation: none; }
.rocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px 22px; align-items: start; }
.rock { display: flex; gap: 10px; align-items: flex-start; }
.rock .psw svg { display: block; border-radius: 3px; }
.rock b { font-weight: 600; }
.rock p { margin: 0; font-size: 15px; }
/* A rock or fossil card on the Rocks tab: pattern, name and note, then the
   photograph of the real thing. */
.rockcard { display: flex; flex-direction: column; gap: 8px; }
.photo { margin: 0; }
.photo img { width: 100%; height: auto; display: block; border-radius: 4px; background: #e9e6df; }
.photo figcaption { margin-top: 5px; font-size: 14px; color: var(--muted); line-height: 1.45; }
.photo .pcap { display: block; color: var(--ink); }
.photo .credit { display: block; font-size: 13px; margin-top: 2px; }
.wide-photo { max-width: 640px; margin-top: 16px; }
#photo-credits ul { margin: 0; padding-left: 20px; font-size: 14px; }
#photo-credits li { margin: 3px 0; }
.sw { display: inline-block; width: 14px; height: 14px; margin-right: 5px; border: 1px solid rgba(20,26,34,0.5); vertical-align: -2px; border-radius: 2px; }
