/* The wiki, sitting inside the archive chrome [sc-51].
 *
 * django-wiki bundles its own Bootstrap 4 and every one of its screens — the
 * editor, history, permissions, the plugins — is drawn for a light page. Rather
 * than dark-mode all of that and keep chasing it through upgrades, the wiki's
 * content sits on a vellum sheet inside the dark rail: its own CSS keeps the
 * assumptions it was written with, and the page still reads as part of the
 * archive. A sheet of paper in a dark room is the right image for it anyway.
 *
 * Everything here is under `.wiki-body` or `.archive`, so none of it reaches
 * the wiki's markup when that markup is rendered on one of our own pages —
 * see project.css, which handles that case.
 */

.wiki-body {
  --wiki-sheet: #efe7d6;
  --wiki-ink: #2b2114;

  padding: 2.25rem 2.5rem 2.75rem;
  margin: 1.5rem 0;
  color: var(--wiki-ink);
  background:
    radial-gradient(120% 90% at 15% 0%, #f6efe0 0%, rgba(246, 239, 224, 0) 60%),
    var(--wiki-sheet);
  border: 1px solid var(--arc-line);
  border-radius: 3px;
  box-shadow:
    0 18px 50px -24px rgb(0 0 0 / 75%),
    inset 0 0 0 1px rgb(255 255 255 / 40%);
}

/* Bootstrap 4 sets these on the elements themselves, so the sheet has to be
   explicit rather than relying on inheritance from .archive. */
.wiki-body,
.wiki-body p,
.wiki-body li,
.wiki-body td,
.wiki-body th,
.wiki-body dd,
.wiki-body dt {
  font-family: var(--arc-prose);
}

.wiki-body h1,
.wiki-body h2,
.wiki-body h3,
.wiki-body h4,
.wiki-body h5,
.wiki-body h6 {
  color: #241b10;
  font-family: var(--arc-display);
}

.wiki-body a {
  color: #6b4a12;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wiki-body a:hover {
  color: #3f2b08;
}

/* The root's section cards are dark panels laid on the sheet, so the sheet's
   ink-coloured links and headings must not reach into them. */
.wiki-body .archive__section-cards {
  margin-top: 2rem;
}

.wiki-body .archive-section,
.wiki-body .archive-section:hover {
  text-decoration: none;
}

.wiki-body .archive-section h3 {
  color: var(--arc-title-lit);
}

/* The wiki's tables and code blocks, which its Bootstrap draws for white. */
.wiki-body pre,
.wiki-body code {
  color: #2b2114;
  background: #e2d8c2;
  border: 1px solid #cdbfa2;
}

.wiki-body hr {
  border-top-color: rgb(43 33 20 / 20%);
}

/* django-wiki's own footer credit, which the chrome's footer already replaces
   in spirit — kept, but quietened so it does not compete with the sheet. */
.wiki-body #wiki-footer {
  color: #6a5b42;
  font-size: 0.8rem;
}

/* The wiki's search box and the rail's both exist; the rail's is the one that
   belongs to the site, and base_site's navbar (which held the other) is gone
   with the block that drew it. */

/* The chronology beside a tagged article: the curators site's timeline in its
   single-column form, drawn on the sheet. */
.wiki-body .wiki-view--chronicle {
  display: grid;
  gap: 2.5rem;
}

.wiki-body .chronicle {
  padding-top: 1.25rem;
  border-top: 1px solid rgb(43 33 20 / 20%);
}

@media (min-width: 1100px) {
  .wiki-body .wiki-view--chronicle {
    grid-template-columns: minmax(0, 1fr) 17.5rem;
    align-items: start;
  }

  .wiki-body .chronicle {
    position: sticky;
    top: 1.5rem;
    padding: 0 0 0 1.5rem;
    border-top: 0;
    border-left: 1px solid rgb(43 33 20 / 20%);
  }
}

.wiki-body .chronicle__heading {
  margin: 0 0 1rem;
  color: #6b4a12;
  font-family: var(--arc-display);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.wiki-body .chronicle__timeline {
  position: relative;
  margin: 0;
  padding: 0 0 0 1.75rem;
  list-style: none;
}

.wiki-body .chronicle__timeline::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 8px;
  width: 2px;
  background: linear-gradient(
    180deg,
    transparent,
    var(--arc-gold-dim) 6%,
    var(--arc-gold-dim) 94%,
    transparent
  );
}

.wiki-body .chronicle__event {
  position: relative;
  padding: 0.35rem 0 0.9rem;
}

.wiki-body .chronicle__node {
  position: absolute;
  top: 0.6rem;
  left: calc(9px - 1.75rem - 5px);
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  background: var(--arc-gold);
  box-shadow: 0 0 0 3px var(--wiki-sheet);
}

.wiki-body .chronicle__event--major .chronicle__node {
  top: 0.45rem;
  left: calc(9px - 1.75rem - 7px);
  width: 14px;
  height: 14px;
}

.wiki-body .chronicle__date {
  display: block;
  color: var(--arc-gold-dim);
  font-family: var(--arc-display);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.wiki-body .chronicle__title {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--arc-prose);
  font-size: 1.05rem;
  line-height: 1.25;
}

.wiki-body .chronicle__event--major .chronicle__title {
  font-family: var(--arc-display);
  font-weight: 600;
}

.wiki-body .chronicle__title a {
  text-decoration: none;
}

.wiki-body .chronicle__title a:hover {
  text-decoration: underline;
}

.wiki-body .chronicle__empty {
  color: #6a5b42;
  font-style: italic;
}

.wiki-body .chronicle__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.wiki-body .chronicle__head .chronicle__heading {
  margin-bottom: 0;
}

.wiki-body .chronicle__new {
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--arc-gold-dim);
  border-radius: 2px;
  color: #6b4a12;
  font-family: var(--arc-display);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.wiki-body .chronicle__new:hover {
  color: var(--wiki-sheet);
  background: var(--arc-gold-dim);
  text-decoration: none;
}

.wiki-body .chronicle-form {
  max-width: 44rem;
}

.wiki-body .chronicle-form__heading {
  margin-top: 0.5rem;
}

.wiki-body .chronicle-form__lead {
  color: #6a5b42;
}

.wiki-body .chronicle-form__article {
  display: inline-block;
  padding: 0.375rem 0;
  font-weight: 600;
}
