/* Reuse Fahrio's header typography and spacing. Cedvel's original rem base
   is 18px; Fahrio's is 10px, so normalize the shared tokens here. */
.archive-header {
  --archive-space: calc(var(--su) * 10 / 18);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--archive-space);
  padding: var(--archive-space);
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-family-serif);
  font-size: calc(var(--font-size) * 10 / 18);
  font-weight: normal;
  line-height: var(--archive-space);
}

.archive-header ol,
.archive-header ul {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--archive-space) / 2) var(--archive-space);
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive-header li {
  display: inline-flex;
  gap: var(--archive-space);
  margin: 0;
  white-space: nowrap;
}

.archive-header a,
.archive-header a:hover {
  color: inherit;
  border-bottom: none;
  text-decoration: underline;
  text-decoration-color: var(--c-text-accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.archive-header a:hover {
  color: var(--c-text-accent);
}

.archive-header a.active {
  color: var(--c-text-accent);
  font-family: var(--font-family-serif-bold);
  text-decoration: none;
}

.archive-header a:focus-visible {
  outline: 2px solid var(--c-text-accent);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .archive-header {
    padding: calc(var(--archive-space) / 1.5);
  }
}

@media (max-width: 1134px) {
  #wrapper {
    box-sizing: border-box;
    width: 100%;
  }

  #content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 1rem;
  }

  #content .block,
  #content .block.short {
    width: auto;
    height: auto;
    padding-right: 0;
  }

  #content .animation img {
    max-width: 100%;
  }

  #books .book,
  #books .book:nth-child(4n+1) {
    box-sizing: border-box;
    width: calc(50% - 0.5rem);
    margin-right: 1rem;
  }

  #books .book:nth-child(2n+1) {
    margin-right: 0;
  }
}

@media (max-width: 700px) {
  #wrapper {
    padding: 1.5rem;
  }

  #header {
    height: auto;
  }

  #header h1,
  #header h2 {
    float: none;
    width: auto;
    margin: 0 0 1rem;
  }

  #launcher #logo {
    float: none;
    width: auto;
    margin-bottom: 1.5rem;
  }

  #launcher p,
  #footer p,
  #books p {
    margin-left: 0;
  }

  a#launch_button {
    display: block;
    max-width: 100%;
    margin: 2rem 0 1rem;
  }

  #content {
    grid-template-columns: minmax(0, 1fr);
  }

  #content .animation {
    height: auto;
    min-height: 12rem;
    text-align: center;
  }

  #books .book,
  #books .book:nth-child(4n+1) {
    width: 100%;
    height: auto;
    min-height: 4rem;
    margin-right: 0;
  }

  #books .book-info {
    width: auto;
  }

  #books p {
    margin-bottom: 2rem;
  }
}
