@import url('https://fonts.googleapis.com/css2?family=Caladea:ital,wght@0,400;0,700;1,400;1,700&family=Ultra&display=swap');

:root {
    color-scheme: light dark; 

    --main-bg-color: light-dark(#fff, #111122);
    --main-color: light-dark(#111122, #eeeeee);
    --soft-bg-color: light-dark(#eee, #222233);
    --soft-color: light-dark(#333, #ccc);
    --mid-color: #999;
    --hover-color: #007bff;
}

/* Position the TOC as a fixed sidebar on the left */
#TOC {
  position: fixed;
  left: 0;
  top: 0;
  width: 200px;
  height: 100%;
  overflow-y: auto;
  background-color: var(--soft-bg-color);
  border-right: 1px solid var(--mid-color);
  padding: 20px;
  box-sizing: border-box;
}

/* Style the TOC lists and links */
#TOC ul {
  list-style-type: none;
  padding-left: 15px;
}

#TOC > ul {
  padding-left: 0;
}

#TOC a {
  text-decoration: none;
  color: var(--soft-color);
}

#TOC a:hover {
  color: var(--hover-color);
}

/* Shift the main content area right to clear the sidebar; once the window
   is wide enough, center it in the full window instead. */
body {
  margin-left: max(200px, calc(50% - 430px)); /* 430px = (800px content + 60px padding) / 2 */
  padding: 30px;
  max-width: 800px;
  font-family: "Caladea", Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.5;
  background-color: var(--main-bg-color);
  color: var(--main-color);
}

/* Responsiveness: Move TOC to top on small screens */
@media (max-width: 768px) {
  #TOC {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--mid-color);
    margin-bottom: 20px;
  }
  body {
    margin-left: 0;
    padding: 20px;
  }
}

#title-block-header {
  display: none;
}

.header {
    /* max-width: 600px; */
    h1, h2 {
        text-align: center;
    }
    h2 {
        font-family: "Caladea", serif;
        font-weight: 200;
        color: var(--soft-color);
    }
    h1 {
        font-family: "Ultra", serif;
        font-weight: 400;
        font-size: 3rem;
    }
}

blockquote {
    margin: 
1em 0 1em 1.7em;
    padding-left: 1em;
    border-left: 
2px solid var(--mid-color);
    color: var(--soft-color);
}

dl {
    margin-left: 20px;
}
dt {
    font-weight: 600;
    margin-top: 0.5em;
}
dd {
    margin-left: 20px;
}

body > h1 {
    margin-top: 2em;
}

figure {
  max-width: 800px;
}

img {
  max-width: 100%;
  height: auto;
}

/* Printing: hide the on-screen TOC, force light colours regardless of the
   viewer's OS theme, and avoid awkward breaks around headings/figures. */
@media print {
  :root {
    --main-bg-color: #fff;
    --main-color: #000;
    --soft-bg-color: #eee;
    --soft-color: #333;
  }

  @page {
    margin: 2cm;
  }

  #TOC {
    display: none;
  }

  body {
    margin-left: 0;
    max-width: none;
    padding: 0;
    font-size: 11pt;
  }

  .header h1 {
    font-size: 2.25rem;
  }

  h1, h2, h3 {
    break-after: avoid;
  }

  h1 + *, h2 + *, h3 + * {
    break-before: avoid;
  }

  figure, img, blockquote {
    break-inside: avoid;
  }

  /* Pandoc auto-generates a figcaption from the image alt text (e.g. "Point
     Assault map"), which just repeats the heading and adds no information,
     so don't print it. */
  figcaption {
    display: none;
  }

  /* Each mission (heading, map, and scoring rules) is grouped into a single
     div so the whole thing moves to the next page together rather than the
     heading and map being split by a page break. */
  .mission {
    break-inside: avoid;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  /* Printed links aren't clickable and the URLs are of no use on paper,
     so drop the References section entirely rather than print dead text. */
  hr:has(+ #references),
  #references,
  #references + ul {
    display: none;
  }
}