/*
 * Shared by the static pages outside the app: /methodology and the research
 * write-ups. It lives in one file because those pages have to look like each
 * other and like the app, and two copies of this drifted the moment one of
 * them was edited.
 *
 * Not used by the React app, which is Tailwind. The palette below is the same
 * one, spelled out, so a change here is a deliberate match rather than an
 * import.
 */
:root {
  /* Harbour, matching the @theme block in src/index.css. */
  --paper: #f5f7fa; --card: #fff; --ink: #13233f; --muted: #4a5a73;
  --accent: #c2410c; --haze: #dfeeff; --line: #d1d6de; --line-soft: #e4e8ee;
  --peach: #fff0e5; --peach-line: #f6c9a6; --accent-deep: #9a3412;
  --palm: #0f6b4f; --pistachio: #eaf3c4;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 46rem; margin: 0 auto; padding: 2.5rem 1.25rem 5rem; }
h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); line-height: 1.15; color: var(--ink); margin: 0 0 .5rem; }
h2 { font-size: 1.3rem; line-height: 1.25; color: var(--ink); margin: 2.75rem 0 .75rem; }
h3 { font-size: 1.02rem; margin: 1.75rem 0 .4rem; }
p { margin: 0 0 1rem; }
.lede { font-size: 1.1rem; color: var(--muted); margin-bottom: 2rem; }
.muted { color: var(--muted); }
.small { font-size: .92rem; }
a { color: var(--accent); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95em; }
.formula {
  background: var(--card); border: 1px solid var(--line); border-radius: .75rem;
  padding: 1rem 1.1rem; margin: 1.25rem 0; overflow-x: auto; white-space: nowrap;
}
.box {
  background: var(--card); border: 1px solid var(--line); border-radius: .9rem;
  padding: 1.1rem 1.25rem; margin: 1.25rem 0;
}
.box.warm { background: var(--peach); border-color: var(--peach-line); }
.box.cool { background: #eef6f1; border-color: #bfdccd; }
.box h3 { margin-top: 0; }

/*
 * The dated banner on an archived study. Deliberately the loudest thing on the
 * page: its whole job is to stop somebody reading a figure from August as the
 * number the app is using today.
 */
.archive {
  background: var(--peach); border: 1px solid var(--peach-line); border-left: .35rem solid var(--accent);
  border-radius: .9rem; padding: 1.1rem 1.25rem; margin: 0 0 2rem;
}
.archive p { margin: 0 0 .6rem; }
.archive p:last-child { margin-bottom: 0; }

/*
 * A dated correction on a frozen page.
 *
 * The study does not get edited, because a measurement quietly revised
 * afterwards is not a measurement. It does get corrected, loudly and with a
 * date, because leaving a claim up that the underlying data contradicts is
 * the worse failure. The distinction is between changing the record and
 * adding to it.
 */
.correction {
  background: #fdf2f2; border: 1px solid #e0b4b4; border-left: .35rem solid #a13c3c;
  border-radius: .6rem; padding: .9rem 1.1rem; margin: 1rem 0 0;
  font-size: .94rem;
}
.correction p { margin: 0 0 .6rem; }
.correction p:last-child { margin-bottom: 0; }
.correction .stamp { font-weight: 700; color: #a13c3c; }

/*
 * A placeholder nobody can publish by accident.
 *
 * The policies carry two facts that are not settled yet, and a policy that
 * goes live saying "[[POSTAL ADDRESS]]" in body text is worse than one that
 * was never published. Loud on purpose.
 */
.todo {
  background: #ffe8a3; color: #6b4a00; font-weight: 700;
  padding: .05em .4em; border-radius: .25rem;
  outline: 2px dashed #b8860b; outline-offset: 1px;
}

.tablewrap { overflow-x: auto; margin: 1.25rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; background: var(--card); }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line-soft); }
th { background: var(--haze); font-weight: 600; font-size: .85rem; }
td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.group td { background: var(--line-soft); font-weight: 600; font-size: .85rem; letter-spacing: .02em; }
.tag { display: inline-block; font-size: .74rem; padding: .1rem .45rem; border-radius: .35rem; white-space: nowrap; }
.t-m { background: var(--pistachio); color: var(--palm); }
.t-d { background: var(--haze); color: var(--ink); }
.t-e { background: var(--peach); color: var(--accent-deep); }
ul { margin: 0 0 1rem; padding-left: 1.15rem; }
li { margin-bottom: .5rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0 1.5rem; }
.foot { font-size: .9rem; color: var(--muted); }

/*
 * The social row, matching the one the React pages render from
 * SocialLinks.tsx. Hand written here because these pages are not built by
 * React; `socialLinks.test.ts` fails if the two lists drift apart.
 */
.social { display: flex; justify-content: center; gap: .5rem; list-style: none; margin: 1.5rem 0 0; padding: 0; }
.social li { margin: 0; }
.social a { display: block; padding: .25rem; border-radius: .5rem; opacity: 1; transition: opacity .15s; }
.social a:hover, .social a:focus-visible { opacity: .7; }
.social img { display: block; width: 32px; height: 32px; }
