/* Funpocalypse site styles */

/* Inter (variable weight), bundled locally so the site works offline.
   License: SIL Open Font License, see fonts/Inter-LICENSE.txt */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 150%;          /* 50% larger than the browser default */
  max-width: 60ch;          /* about 70 characters per line on wide screens */
  margin: 0 auto;           /* center the text column */
  padding: 0 16px;          /* breathing room at the edges on small screens */
  overflow-wrap: anywhere;  /* let very long numbers wrap instead of overflowing */
  line-height: 1.55;        /* room between lines of text */
  padding-bottom: 3em;
}

/* ---------- Readable spacing ---------- */

h1, h2, h3 {
  line-height: 1.2;
}

h2 {
  margin: 2.2em 0 0.6em;    /* clear break between major sections */
}

h3 {
  font-size: 1.1em;
  margin: 1.6em 0 0.4em;
}

p, ul, ol, dl {
  margin: 0 0 0.9em;
}

li + li {
  margin-top: 0.45em;       /* separate list items so they don't run together */
}

ul ul, dd ul {
  margin-top: 0.45em;
}

/* Definition lists (Concepts & Terms): bold term, text underneath */
dt {
  font-weight: 700;
  margin-top: 1em;
}

dd {
  margin: 0.2em 0 0;
}

dd p {
  margin: 0 0 0.5em;
}

/* Small italic note, e.g. "Play this step only if..." */
.note {
  font-style: italic;
}

/* The very long number in "Every game will be unique" */
.big-number {
  font-variant-numeric: tabular-nums;
  font-size: 0.85em;
}

/* Horizontal rule above each major section */
hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 2.5em 0 0;
}

hr + h2 {
  margin-top: 0.8em;        /* heading sits just below the rule */
}

/* "Jump to section" links at the top of a page */
.jump-nav {
  font-size: 0.8em;
  margin: 0 0 1.5em;
}

.jump-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em 1.2em;
}

.jump-nav li + li {
  margin-top: 0;            /* override the list-item spacing used elsewhere */
}

/* When jumping to a section, leave a little space above the heading */
h2[id] {
  scroll-margin-top: 0.8em;
}

/* Smooth scrolling for jump links (skipped if the reader prefers reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* "Back to top" link at the end of each section */
.back-to-top {
  font-size: 0.75em;
  text-align: right;
  margin: 1.5em 0 0;
}
