/* Chris Bartlett: site styles.
   Colour: Okabe-Ito blues only (safe for colour-blind readers); meaning never carried by colour alone.
   Type: the reader's own system sans-serif, so pages load instantly and CJK text uses native fonts. */

:root {
  --bg: #fcfcfa;
  --text: #1b1c1e;
  --muted: #55595f;
  --rule: #dcdcd6;
  --link: #005f94;
  --accent: #0072b2;
  --button-text: #ffffff;
  --card: #ffffff;
  /* The page frame is wide (owner, 2026-10-09: the site looked narrow); running text keeps a readable
     line length inside it, and the spare width goes to card grids and the paper pages' side column. */
  --frame: 62rem;
  --text-measure: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141619;
    --text: #e8e6e3;
    --muted: #a7abb1;
    --rule: #33373d;
    --link: #7cc3ec;
    --accent: #56b4e9;
    --button-text: #0b1620;
    --card: #1b1e22;
  }
}

* { box-sizing: border-box; }

html { font-size: 112.5%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Hiragino Sans", "Yu Gothic UI", "Noto Sans CJK JP", "Microsoft YaHei", "Malgun Gothic", sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, .button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--card); padding: 0.5rem 1rem;
}
.skip:focus { left: 1rem; }

header.site, main, footer.site {
  max-width: var(--frame);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Running text never wider than a comfortable reading line. */
main h1, main p, main li, .subtitle { max-width: var(--text-measure); }

header.site {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.5rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}
/* The name is the largest text on every page (owner, 2026-10-08: smaller than an article title looked wrong). */
.brand { font-weight: 700; font-size: 2rem; line-height: 1.15; color: var(--text); text-decoration: none; }
header.site nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
header.site nav a { text-decoration: none; font-weight: 600; }
header.site nav a:hover { text-decoration: underline; }
@media (max-width: 30rem) {
  /* Keep all four tabs on one line on a phone. */
  header.site nav { gap: 0.25rem 0.8rem; font-size: 0.92rem; }
}

main { padding-top: 1.5rem; padding-bottom: 3rem; }

h1 { font-size: 1.7rem; line-height: 1.2; margin: 0.25rem 0 0.5rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 0.5rem; }
h3 { font-size: 1.15rem; line-height: 1.3; margin: 0.15rem 0 0.35rem; }
h3 a { text-decoration: none; }
h3 a:hover { text-decoration: underline; }

.lede { color: var(--muted); font-size: 1.05rem; margin-top: 0; }

.intro p:first-child { font-size: 1.1rem; }
.intro p.site-note { color: var(--muted); font-size: 0.95rem; margin-top: 1.25rem; }

.kind {
  margin: 0;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}

.subtitle { font-size: 1.1rem; color: var(--muted); margin: 0 0 0.75rem; }
.engtitle, .byline, .dateline, .licence, .meta, .langs-inline { color: var(--muted); font-size: 0.9rem; margin: 0.2rem 0; }
.note { font-size: 0.95rem; border-left: 3px solid var(--accent); padding-left: 0.75rem; }

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.card p { margin: 0.4rem 0; }

/* Home page: the introduction, with the ORCID box at the right on wide screens (below it on phones). */
.intro-row { display: grid; gap: 1.25rem 3rem; align-items: start; }
@media (min-width: 52rem) {
  .intro-row { grid-template-columns: minmax(0, var(--text-measure)) 1fr; }
  .id-box { justify-self: end; margin-top: 0.35rem; }
}
.id-box {
  justify-self: start;
  background: var(--card); border: 1px solid var(--rule); border-radius: 6px;
  padding: 0.7rem 1.1rem;
}
.id-box p { margin: 0.15rem 0; }
.id-box p.kind + p + p.kind { margin-top: 0.7rem; }
.id-box a { font-weight: 600; white-space: nowrap; }

/* Cards side by side when there is room; a lone card takes the full width. */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
  gap: 1.25rem;
  margin: 1rem 0;
}
.cards .card { margin: 0; }

/* Paper pages: text on the left, buttons / licence / languages in a column on the right.
   On narrow screens the right column moves to the top, so the PDF button comes first. */
.paper-body { display: grid; gap: 0 3rem; }
@media (min-width: 52rem) {
  .paper-body { grid-template-columns: minmax(0, 1fr) 15rem; }
  .paper-side { align-self: start; position: sticky; top: 1.5rem; padding-top: 1rem; }
  .paper-side .actions { flex-direction: column; align-items: stretch; margin-top: 0; }
  .paper-side .button { text-align: center; }
  .paper-side ul.langs { flex-direction: column; gap: 0.25rem; }
}
@media (max-width: 51.99rem) {
  .paper-side { order: -1; }
}
.paper-side h2 { font-size: 1rem; margin-top: 1.5rem; }

/* Contact page: the email button sits at the bottom right. */
main p.contact-button { max-width: none; display: flex; justify-content: flex-end; margin-top: 2.5rem; }

ul.books { padding-left: 1.1rem; margin: 0.5rem 0; }
ul.books li { margin: 0.3rem 0; max-width: none; }

.actions { margin: 1.25rem 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.button {
  display: inline-block;
  background: var(--accent); color: var(--button-text);
  padding: 0.55rem 1.1rem; border-radius: 4px;
  font-weight: 700; text-decoration: none;
}
.button.secondary { background: transparent; color: var(--link); border: 2px solid var(--accent); }
button.button { font: inherit; font-weight: 700; cursor: pointer; }

/* Line breaking: no stranded last words in headings, no orphan in paragraphs, and Japanese broken
   at phrase boundaries where the browser supports it. No automatic hyphenation (owner's rule). */
h1, h2, h3, .subtitle { text-wrap: balance; }
p, li { text-wrap: pretty; }
:lang(ja) { word-break: auto-phrase; }
.nowrap { white-space: nowrap; }

.cite { font-size: 0.95rem; overflow-wrap: anywhere; }

ul.langs { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
ul.langs li[aria-current="page"] a { color: var(--text); font-weight: 700; text-decoration: none; }

footer.site {
  border-top: 1px solid var(--rule);
  padding-top: 1rem; padding-bottom: 2rem;
  color: var(--muted); font-size: 0.9rem;
}
footer.site p { margin: 0.3rem 0; }

/* PROM1's Figure 1 under the abstract (2026-10-25): the full-resolution picture, fitted to the column; a click or
   the download link gives the original file. */
.paper-figure { margin: 1.75rem 0 0.5rem; }
.paper-figure img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 4px; background: #ffffff; }
.paper-figure figcaption { font-size: 0.95rem; margin-top: 0.5rem; }
.figure-description { font-size: 0.9rem; margin: 0.25rem 0; }
.figure-description summary { cursor: pointer; color: var(--link); }
.figure-download { color: var(--muted); font-size: 0.9rem; margin: 0.4rem 0 1.5rem; }
