/* The default theme of coffer.

   Everything that decides how the theme looks is a custom property below, so a
   site theme can restyle the engine's pages by overriding variables only (see
   docs/themes.md). Light values are on :root; dark values are repeated under the
   system preference and under [data-theme="dark"], and light is forced under
   [data-theme="light"]. Nothing here animates or transitions. */

/* The measure is a registered length, set on :root only. An unregistered custom
   property keeps the unresolved "68ch", and every element would resolve ch in
   its own font size (the footer's smaller text made the footer narrower). A
   registered <length> is computed once, at the root, so every element sees the
   same width. The initial value is a placeholder: a registered length cannot
   have a ch initial value. */
@property --coffer-measure {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

:root {
  --coffer-bg: #ffffff;
  --coffer-text: #1b1b1f;
  --coffer-muted: #5a5a63;
  --coffer-accent: #0b5cad;
  --coffer-border: #d3d3da;
  --coffer-code-bg: #f3f3f6;
  --coffer-code-fg: #1b1b1f;

  --coffer-font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --coffer-font-heading: var(--coffer-font-body);
  --coffer-font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --coffer-measure: 68ch;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --coffer-bg: #16181d;
    --coffer-text: #e8e8ec;
    --coffer-muted: #a9a9b3;
    --coffer-accent: #7ab7ff;
    --coffer-border: #3a3e48;
    --coffer-code-bg: #20232a;
    --coffer-code-fg: #e8e8ec;

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --coffer-bg: #16181d;
  --coffer-text: #e8e8ec;
  --coffer-muted: #a9a9b3;
  --coffer-accent: #7ab7ff;
  --coffer-border: #3a3e48;
  --coffer-code-bg: #20232a;
  --coffer-code-fg: #e8e8ec;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --coffer-bg: #ffffff;
  --coffer-text: #1b1b1f;
  --coffer-muted: #5a5a63;
  --coffer-accent: #0b5cad;
  --coffer-border: #d3d3da;
  --coffer-code-bg: #f3f3f6;
  --coffer-code-fg: #1b1b1f;

  color-scheme: light;
}

/* Base ------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--coffer-bg);
  color: var(--coffer-text);
  font-family: var(--coffer-font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--coffer-font-heading);
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
}

h1 {
  font-size: 2rem;
  margin-top: 1rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

h4,
h5,
h6 {
  font-size: 1.0625rem;
}

p,
ul,
ol,
dl,
blockquote,
figure,
pre,
table {
  margin: 0 0 1rem;
}

/* Hanging punctuation. The engine wraps an opening quote, bracket or sentence
   dash at the start of a block in <span class="hang" data-m="...">. The span
   pulls the mark into the margin. Where the browser hangs it natively, the span
   margin is zeroed, so the mark does not hang twice. Lists keep their markers
   outside the text. */
.hang {
  margin-inline-start: calc(-1 * var(--hang, 0.5em));
}

.hang[data-m="quote"] {
  --hang: 0.45em;
}

.hang[data-m="dash"] {
  --hang: 0.8em;
}

.hang[data-m="bracket"] {
  --hang: 0.35em;
}

/* Line-start hanging. With `hangLines` the engine also wraps opening marks inside
   a paragraph in <span class="hang-l" data-m="...">. hang-lines.js adds
   "is-lead" and the mark width in --hang-w to the ones that start a line. The
   mark moves into the margin by its own width, and the negative end margin
   pulls the text after it to the content edge. */
.hang-l.is-lead {
  position: relative;
  inset-inline-start: calc(-1 * var(--hang-w, 0.5em));
  margin-inline-end: calc(-1 * var(--hang-w, 0.5em));
}

p,
h1,
h2,
h3,
h4,
h5,
h6,
li,
blockquote {
  hanging-punctuation: first;
}

ul,
ol {
  list-style-position: outside;
}

@supports (hanging-punctuation: first) {
  .hang {
    margin-inline-start: 0;
  }
}

a {
  color: var(--coffer-accent);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 0.15em;
}

:focus-visible {
  outline: 3px solid var(--coffer-accent);
  outline-offset: 2px;
}

hr {
  border: 0;
  border-top: 1px solid var(--coffer-border);
  margin: 2rem 0;
}

blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 4px solid var(--coffer-border);
  color: var(--coffer-muted);
}

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

table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

th,
td {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--coffer-border);
  text-align: left;
}

/* Code ------------------------------------------------------------------- */

code,
pre,
kbd,
samp {
  font-family: var(--coffer-font-mono);
  font-size: 0.9em;
}

:not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: var(--coffer-code-bg);
  color: var(--coffer-code-fg);
}

pre {
  padding: 1rem;
  border: 1px solid var(--coffer-border);
  border-radius: 4px;
  background: var(--coffer-code-bg);
  color: var(--coffer-code-fg);
  line-height: 1.5;
  overflow-x: auto;
  tab-size: 4;
}

/* Highlighted code: Shiki writes both colour schemes as variables, and these
   rules choose one. The three groups below must stay in the same order. */
.shiki,
.shiki span {
  color: var(--shiki-light);
}

.shiki {
  background-color: var(--shiki-light-bg);
}

@media (prefers-color-scheme: dark) {
  .shiki,
  .shiki span {
    color: var(--shiki-dark);
  }

  .shiki {
    background-color: var(--shiki-dark-bg);
  }
}

:root[data-theme="dark"] .shiki,
:root[data-theme="dark"] .shiki span {
  color: var(--shiki-dark);
}

:root[data-theme="dark"] .shiki {
  background-color: var(--shiki-dark-bg);
}

:root[data-theme="light"] .shiki,
:root[data-theme="light"] .shiki span {
  color: var(--shiki-light);
}

:root[data-theme="light"] .shiki {
  background-color: var(--shiki-light-bg);
}

/* Page frame ------------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--coffer-bg);
  border: 2px solid var(--coffer-accent);
  z-index: 10;
}

.skip-link:focus {
  top: 0.5rem;
}

.site-header,
.site-footer,
main {
  width: 100%;
  max-width: calc(var(--coffer-measure) + 22rem);
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--coffer-border);
}

.site-title {
  font-family: var(--coffer-font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--coffer-text);
  text-decoration: none;
}

.site-header nav {
  flex: 1 1 auto;
}

.site-header ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header nav a {
  display: inline-block;
  padding: 0.25rem 0;
}

main {
  padding-top: 1rem;
  padding-bottom: 2rem;
}

main > *,
main > article > * {
  max-width: var(--coffer-measure);
}

main > article > .post-layout {
  max-width: none;
}

.post-layout .post-body {
  max-width: var(--coffer-measure);
}

.site-footer {
  padding-top: 1rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--coffer-border);
  color: var(--coffer-muted);
  font-size: 0.875rem;
}

.site-footer p {
  margin: 0.25rem 0;
}

.site-footer a {
  color: inherit;
}

/* The theme switch: the script in the page adds the class "js" to <html>, so
   the button exists only where it can work. */
.theme-switch {
  display: none;
  margin-left: auto;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--coffer-border);
  border-radius: 4px;
  background: var(--coffer-bg);
  color: var(--coffer-text);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.js .theme-switch {
  display: inline-block;
}

/* Posts and lists -------------------------------------------------------- */

.post-meta,
.preview-note {
  color: var(--coffer-muted);
  font-size: 0.9375rem;
  margin: 0 0 0.75rem;
}

.preview-note {
  padding: 0.5rem 0.75rem;
  border: 1px dashed var(--coffer-border);
}

.preview-banner {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-style: solid;
  border-width: 1px 1px 1px 0.375rem;
}

.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--coffer-border);
}

.post-item h2,
.post-item h3 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.post-item .post-meta {
  margin-bottom: 0.25rem;
}

.post-summary {
  margin: 0;
}

/* Previous and next page of a paginated list; the current page is in the middle. */
.pagination ul {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.pagination-current {
  margin-inline: auto;
  color: var(--coffer-muted);
}

.pagination-next {
  margin-left: auto;
}

/* A post shown in full on a list page: its title is an h2, so the h2 of the
   text is an h3 there (and so on down). Each level keeps the size it has on the
   post page. */
.post-item .post-body {
  margin-top: 1rem;
}

.post-item .post-body h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.5rem;
}

.post-item .post-body h4 {
  margin: 2rem 0 0.75rem;
  font-size: 1.25rem;
}

.post-item .post-body h5,
.post-item .post-body h6 {
  margin: 2rem 0 0.75rem;
  font-size: 1.0625rem;
}

.post-layout {
  display: block;
}

.post-body {
  min-width: 0;
}

.post-body img,
.post-body pre {
  max-width: 100%;
}

.post-body figure {
  margin: 1.5rem 0;
}

.post-body figure picture,
.post-body figure img {
  display: block;
}

.js .post-body a.viewer-link {
  cursor: zoom-in;
}

.post-body figure a.viewer-link {
  display: block;
}

.post-body figcaption {
  margin-top: 0.4rem;
  color: var(--coffer-muted);
  font-size: 0.875rem;
}

.post-body pre {
  overflow-x: auto;
}

/* Carousels ---------------------------------------------------------------
   A carousel is a row of slides that scrolls sideways and snaps to each slide,
   so it can be swiped, and scrolled with the keyboard or a wheel, without a
   script. carousel.js adds buttons and a position on top. Nothing moves by
   itself and nothing is animated. */

.carousel {
  margin: 1.5rem 0;
}

.carousel .carousel-track {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  position: relative;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
}

.carousel .carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  box-sizing: border-box;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.carousel .carousel-slide figure {
  margin: 0;
}

.carousel .carousel-slide img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
}

.carousel .carousel-slide figcaption {
  margin-top: 0.4rem;
  color: var(--coffer-muted);
  font-size: 0.875rem;
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.carousel-button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--coffer-border);
  border-radius: 4px;
  background: transparent;
  color: var(--coffer-text);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.carousel-button[aria-disabled="true"] {
  color: var(--coffer-muted);
  cursor: default;
  opacity: 0.5;
}

.carousel-position {
  color: var(--coffer-muted);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

/* Videos ------------------------------------------------------------------
   A remote video starts as its preview: a link to the host's page with a play
   label over the image. video.js puts the host's player in its place, in a box
   of the same 16:9 size, so the page does not move. Without the script the
   preview opens the host's page. Nothing is animated. */

.video {
  margin: 1.5rem 0;
}

.video-preview,
.video-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--coffer-code-bg);
}

.video-preview {
  color: var(--coffer-text);
  text-decoration: none;
}

/* A preview of another shape, such as a 4:3 one with bars, fills the box. */
.video .video-preview img,
.video-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-placeholder {
  background: var(--coffer-code-bg);
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  max-width: calc(100% - 2rem);
  padding: 0.5rem 1rem;
  border: 2px solid var(--coffer-accent);
  border-radius: 4px;
  background: var(--coffer-bg);
  color: var(--coffer-text);
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
}

.video-play::before {
  content: "\25B6\FE0E\00A0" / "";
  color: var(--coffer-accent);
}

.video-preview:hover .video-play {
  text-decoration: underline;
}

.video-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video video {
  display: block;
  width: 100%;
  background: var(--coffer-code-bg);
}

.video figcaption {
  margin-top: 0.4rem;
  color: var(--coffer-muted);
  font-size: 0.875rem;
}

.video-chapters {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.video-chapters li {
  margin: 0.15rem 0;
}

.video-chapters time,
.video-seek {
  font-variant-numeric: tabular-nums;
}

.toc {
  margin: 0 0 1.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--coffer-border);
  border-radius: 4px;
  font-size: 0.9375rem;
}

.toc summary {
  cursor: pointer;
  font-weight: 600;
}

.toc ol {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.toc .toc-depth-3 {
  margin-left: 1rem;
}

/* On a wide screen the table of contents sits beside the text and stays open. */
@media (min-width: 60rem) {
  .post-layout.has-toc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 16rem;
    column-gap: 2rem;
    align-items: start;
  }

  .post-layout.has-toc .post-body {
    grid-column: 1;
    grid-row: 1;
  }

  .post-layout.has-toc .toc {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }

  .toc summary {
    cursor: default;
    pointer-events: none;
    list-style: none;
  }

  .toc summary::-webkit-details-marker {
    display: none;
  }

  .toc::details-content {
    content-visibility: visible;
    display: block;
  }
}

/* The home page: links under the about text, and the less prominent ones last. */
.home-links ul,
.secondary-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 1rem 0;
  padding: 0;
}

.secondary-links {
  margin-top: 2rem;
  font-size: 0.875em;
}

/* Search: the page explains itself until search.js (which needs Pagefind) sets
   data-search-ready on it; only then do the form and the results show. */
.search-form,
.search-status,
.search-results {
  display: none;
}

.search[data-search-ready] .search-form {
  display: block;
}

.search[data-search-ready] .search-status {
  display: block;
}

.search[data-search-ready] .search-results {
  display: block;
}

.search[data-search-ready] .search-nojs {
  display: none;
}

.search-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.search-input {
  width: 100%;
  max-width: var(--coffer-measure);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--coffer-border);
  border-radius: 4px;
  background: var(--coffer-bg);
  color: var(--coffer-text);
  font: inherit;
}

.search-status {
  min-height: 1.5em;
  margin: 0.75rem 0;
  color: var(--coffer-muted);
}

.search-results {
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-result {
  margin: 0 0 1.5rem;
  max-width: var(--coffer-measure);
}

.search-result-title {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
}

.search-result-excerpt {
  margin: 0;
}

.search-result-excerpt mark {
  background: transparent;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

/* Small screens ---------------------------------------------------------- */

@media (max-width: 30rem) {
  body {
    font-size: 1rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.375rem;
  }

  .theme-switch {
    margin-left: 0;
  }
}

/* Print ------------------------------------------------------------------ */

@media print {
  :root,
  :root[data-theme] {
    --coffer-bg: #ffffff;
    --coffer-text: #000000;
    --coffer-muted: #333333;
    --coffer-accent: #000000;
    --coffer-border: #999999;
    --coffer-code-bg: #ffffff;
    --coffer-code-fg: #000000;

    color-scheme: light;
  }

  .shiki,
  .shiki span,
  :root[data-theme] .shiki,
  :root[data-theme] .shiki span {
    color: var(--shiki-light);
  }

  .shiki,
  :root[data-theme] .shiki {
    background-color: var(--shiki-light-bg);
  }

  body {
    font-size: 11pt;
    line-height: 1.5;
  }

  .skip-link,
  .site-header nav,
  .theme-switch,
  .home-links,
  .secondary-links,
  .toc {
    display: none;
  }

  .site-header,
  .site-footer,
  main {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
  }

  .site-header,
  .site-footer {
    border: 0;
  }

  main > *,
  main > article > *,
  .post-layout .post-body {
    max-width: none;
  }

  a {
    color: inherit;
  }

  .post-body a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }

  pre {
    white-space: pre-wrap;
    overflow: visible;
    break-inside: avoid;
  }

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

  /* On paper every slide is printed, one under the other. */
  .carousel .carousel-track {
    display: block;
    overflow: visible;
  }

  .carousel-controls {
    display: none;
  }

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

.tags-link,
.feed-link,
.breadcrumbs,
.post-tags,
.tag-count,
.tag-description {
  color: var(--coffer-muted);
  font-size: 0.9375rem;
}

.tags-link,
.feed-link {
  margin: 0 0 1rem;
}

.breadcrumbs ol,
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 0.75rem;
}

.tag-tree ul {
  margin: 0.25rem 0;
  padding-left: 1.25rem;
}

.tag-tree > ul {
  padding-left: 0;
  list-style: none;
}

.tag-children ul {
  margin: 0;
  padding-left: 1.25rem;
}

.series-nav {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--coffer-border);
  font-size: 0.9375rem;
}

.series-nav .series-title {
  margin: 0;
}

.series-part,
.series-kicker,
.series-count,
.series-label {
  color: var(--coffer-muted);
}

.series-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.series-label {
  display: block;
  font-size: 0.8125rem;
}

.series-kicker,
.series-count,
.post-item > .series-part {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
}

/* Projects: the cards on the home page and on the projects page, and a project's page. */
.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: 1.25rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

.project-cards > li {
  display: flex;
}

.project-card {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  border: 1px solid var(--coffer-border);
  border-radius: 0.375rem;
  overflow: hidden;
}

.project-card-picture img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.project-card-text {
  padding: 0.75rem 1rem 1rem;
}

.project-card-title {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

/* The name is the link; it covers the whole card so the picture is clickable too. */
.project-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.project-meta {
  margin: 0 0 0.25rem;
  color: var(--coffer-muted);
  font-size: 0.875rem;
}

.project-pitch {
  margin: 0;
}

.project-header .project-pitch {
  font-size: 1.125rem;
}

.project-license,
.all-projects {
  color: var(--coffer-muted);
  font-size: 0.9375rem;
}

/* Posts about a project: the badge near the title, the block at the end, and the list on the project's page. */
.project-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
}

.project-badge {
  display: inline-block;
  padding: 0.0625rem 0.5rem;
  border: 1px solid var(--coffer-border);
  border-radius: 999px;
  color: var(--coffer-muted);
  font-size: 0.8125rem;
  text-decoration: none;
}

.project-badge:hover,
.project-badge:focus-visible {
  border-color: var(--coffer-accent);
  color: var(--coffer-accent);
}

.project-block {
  margin: 2rem 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--coffer-border);
  border-radius: 0.375rem;
}

.project-block-kicker {
  margin: 0 0 0.25rem;
  color: var(--coffer-muted);
  font-size: 0.875rem;
}

.project-block-title {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.project-block-links,
.project-latest-list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.project-block-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.project-block-posts h3 {
  margin: 0.75rem 0 0.25rem;
  color: var(--coffer-muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.project-block-posts ul {
  margin: 0;
  padding-left: 1.25rem;
}

.project-block-posts time,
.project-latest-item time {
  color: var(--coffer-muted);
  font-size: 0.875rem;
}

.project-latest {
  margin: 1.5rem 0;
}

.project-latest-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--coffer-border);
}

.project-latest-item .post-summary {
  color: var(--coffer-muted);
  font-size: 0.9375rem;
}

/* A tool's page: the facts box under the heading (source, documentation, license). */
.project-facts {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--coffer-border);
  border-radius: 0.375rem;
}

.project-facts h2 {
  margin: 0 0 0.5rem;
  color: var(--coffer-muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-facts dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 0.75rem 1.5rem;
  margin: 0;
}

.project-fact dt {
  color: var(--coffer-muted);
  font-size: 0.875rem;
}

.project-fact dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* A project's documentation: breadcrumbs, a sidebar with the pages in their order
   (above the text on a narrow screen, beside it on a wide one), the page, and
   previous and next. Theme colours only; nothing moves. */
.docs {
  max-width: none;
}

.docs-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  color: var(--coffer-muted);
  font-size: 0.875rem;
}

.docs-breadcrumbs li + li::before {
  content: "/";
  margin-right: 0.5rem;
}

.docs-sidebar {
  margin: 0 0 1.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--coffer-border);
  border-radius: 0.375rem;
  font-size: 0.9375rem;
}

.docs-sidebar-title {
  margin: 0 0 0.25rem;
  font-weight: 700;
}

.docs-sidebar ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-sidebar a {
  display: block;
  padding: 0.3rem 0;
  overflow-wrap: anywhere;
}

.docs-sidebar a[aria-current="page"] {
  color: var(--coffer-text);
  font-weight: 700;
  text-decoration: none;
}

.docs-page {
  min-width: 0;
}

.docs-page > * {
  max-width: var(--coffer-measure);
}

.docs-index-list {
  padding-left: 1.25rem;
}

.docs-pager ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin: 2rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--coffer-border);
  list-style: none;
}

.docs-next {
  margin-left: auto;
  text-align: right;
}

.docs-pager-label {
  display: block;
  color: var(--coffer-muted);
  font-size: 0.875rem;
}

.docs-source {
  color: var(--coffer-muted);
  font-size: 0.875rem;
}

@media (min-width: 60rem) {
  .docs-layout {
    display: grid;
    grid-template-columns: 14rem minmax(0, 1fr);
    column-gap: 2rem;
    align-items: start;
  }

  .docs-sidebar {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    margin: 0;
    overflow-y: auto;
  }
}

@media print {
  .docs-breadcrumbs,
  .docs-sidebar,
  .docs-pager {
    display: none;
  }
}

/* A game's page. Only the wrapper .game-page is restyled: the site header and
   footer are outside it. A game may set --project-accent, --project-on-accent
   (a readable text colour on the accent) and --project-font in the style
   attribute of the wrapper; without them the theme's own colours and heading
   font apply. */
.game-page h1,
.game-page h2,
.game-page h3,
.game-page .project-pitch {
  font-family: var(--project-font, var(--coffer-font-heading));
}

.game-hero {
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--project-accent, var(--coffer-border));
}

.game-logo {
  margin: 0 0 0.75rem;
}

.game-logo img {
  display: block;
  max-width: min(100%, 20rem);
  height: auto;
}

.game-key-art {
  margin-top: 1rem;
}

.game-key-art img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.375rem;
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 1.25rem 0;
}

.game-actions p {
  margin: 0;
}

.game-button {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 0.375rem;
  background: var(--project-accent, var(--coffer-accent));
  color: var(--project-on-accent, var(--coffer-bg));
  font-family: var(--project-font, var(--coffer-font-body));
  font-weight: 600;
  text-decoration: none;
}

.game-button:hover {
  text-decoration: underline;
}

.game-trailer video,
.game-trailer .game-embed {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 0.375rem;
  background: var(--coffer-code-bg);
}

.game-features ul {
  padding-left: 1.25rem;
}

.game-features li::marker {
  color: var(--project-accent, var(--coffer-accent));
}

.game-details {
  border-color: var(--project-accent, var(--coffer-border));
}

/* The press kit of a game: factsheet, descriptions, and thumbnails with a link
   to the full-resolution file. */
.press-kit {
  margin: 2rem 0 1rem;
  padding-top: 1rem;
  border-top: 3px solid var(--project-accent, var(--coffer-border));
}

.press-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 0.75rem 1.5rem;
  margin: 1rem 0;
}

.press-fact dt {
  color: var(--coffer-muted);
  font-size: 0.875rem;
}

.press-fact dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.press-description h3,
.press-assets h3 {
  font-size: 1.0625rem;
}

.press-asset-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.press-asset figure {
  margin: 0;
}

.press-thumbnail {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 6rem;
  padding: 0.5rem;
  border: 1px solid var(--coffer-border);
  border-radius: 0.375rem;
  background: var(--coffer-code-bg);
}

.press-thumbnail picture {
  display: contents;
}

.press-thumbnail img {
  display: block;
  max-width: 100%;
  max-height: 10rem;
  width: auto;
  height: auto;
  object-fit: contain;
}

.press-asset figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.4rem;
  font-size: 0.9375rem;
}

.press-asset-name {
  font-weight: 600;
}

.press-download {
  overflow-wrap: anywhere;
}

/* The share summary at the end of a post: collapsed until the visitor opens it. The copy
   button comes with the `hidden` attribute and is shown by share.js, so that it is only
   there when it works. */
.share {
  margin: 2rem 0 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--coffer-border);
  border-radius: 4px;
  font-size: 0.9375rem;
}

.share summary {
  cursor: pointer;
  font-weight: 600;
}

.share-hint {
  margin: 0.75rem 0 0.5rem;
  color: var(--coffer-muted);
}

.share-text {
  margin: 0;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--coffer-code-bg);
  color: var(--coffer-code-fg);
  font-family: var(--coffer-font-body);
  font-size: 0.9375rem;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0.75rem 0 0;
}

.share-copy[hidden] {
  display: none;
}

.share-status {
  color: var(--coffer-muted);
}
