/* public/CSS/External_CSS/wiki.css
   The look of every wiki page and the legal pages: the chapter list, the
   article text, the equation plaques, tables, the parts only admins see and the previous / next links.
   Loaded by every wiki page (_Components/Wiki/wiki_head.ejs) and the legal pages. */
.wiki-layout {
  max-width: 1080px;
  padding-top: 10px;
}

/* Chapters: a folded box on phones, a parchment column from 900px. */
.wiki-nav-phone,
.wiki-nav-side {
  border: 2px solid var(--sheet-border);
  border-radius: 3px;
  background-color: var(--sheet-background);
  box-shadow: inset 0 0 0 3px var(--sheet-inner-border);
}

.wiki-nav-phone summary {
  padding: 10px 14px;
  font-weight: 700;
  font-size: 1.15rem;
  cursor: pointer;
}

.wiki-nav-phone .wiki-chapters {
  padding: 0 14px 14px;
}

.wiki-nav-side {
  display: none;
}

.wiki-chapters {
  display: grid;
  gap: 12px;
  list-style: none;
}

.wiki-chapters ul {
  display: grid;
  gap: 1px;
  margin-top: 4px;
  list-style: none;
}

.wiki-chapter-title {
  padding: 3px 8px;
  border: 1px solid var(--box-border);
  background-image: linear-gradient(var(--box-heading-top), var(--box-heading-bottom));
  font-weight: 700;
}

.wiki-chapters a {
  display: block;
  padding: 3px 0 3px 10px;
  color: var(--body-text);
  text-decoration: none;
}

.wiki-chapters a:hover {
  color: var(--link-text);
  text-decoration: underline;
}

.wiki-chapters a[aria-current="page"] {
  color: var(--link-text);
  font-weight: 700;
}

.wiki-nav-home {
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 1.2rem;
}

@media (min-width: 900px) {
  .wiki-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
  }

  .wiki-nav-phone {
    display: none;
  }

  .wiki-nav-side {
    position: sticky;
    top: 10px;
    display: block;
    max-height: calc(100vh - 20px);
    margin-top: 10px;
    padding: 14px;
    overflow-y: auto;
  }
}

/* The article sheet */
.wiki-article {
  padding: 18px 20px 24px;
}

.wiki-article > article {
  max-width: 70ch;
}

.wiki-breadcrumb {
  color: var(--muted-text);
  font-size: 0.95rem;
  font-style: italic;
}

.wiki-article h1 {
  margin-top: 4px;
}

.wiki-lead {
  margin-top: 8px;
  color: var(--muted-text);
  font-size: 1.2rem;
  font-style: italic;
}

.wiki-article h2 {
  margin-top: 28px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--box-border);
}

.wiki-article h3 {
  margin-top: 20px;
}

.wiki-article p,
.wiki-article ul,
.wiki-article ol,
.wiki-article table,
.wiki-article .wiki-plaque,
.wiki-article .wiki-table-scroll {
  margin-top: 10px;
}

.wiki-article ul,
.wiki-article ol {
  padding-left: 1.3em;
}

.wiki-article li + li {
  margin-top: 5px;
}

.wiki-article li::marker {
  color: var(--link-text);
}

/* An equation or a key rule, set apart like a framed notice. */
.wiki-plaque {
  padding: 10px 14px;
  border: 1px solid var(--box-border);
  border-left: 5px solid var(--primary-button-top);
  background-color: var(--box-background);
}

.wiki-plaque p:first-child {
  margin-top: 0;
}

.wiki-equation {
  font-weight: 700;
  font-size: 1.2rem;
}

/* Parts of an article only a signed-in admin sees (how the world is set up). */
.wiki-admin-part {
  margin-top: 14px;
  padding: 4px 14px 12px;
  border: 2px dashed var(--admin-only-border);
}

.wiki-admin-note,
.wiki-admin-inline {
  color: var(--admin-only-text);
}

.wiki-admin-note {
  font-weight: 700;
}

.wiki-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--box-border);
}

.wiki-table-scroll table {
  margin-top: 0;
  background-color: var(--box-background);
}

.wiki-table-scroll th,
.wiki-table-scroll td {
  padding: 6px 7px;
}

.wiki-article td.number,
.wiki-article th.number {
  text-align: right;
  white-space: nowrap;
}

/* Previous and next */
.wiki-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 70ch;
  margin-top: 32px;
}

.wiki-pager a {
  display: grid;
  gap: 1px;
  padding: 8px 12px;
  border: 1px solid var(--box-border);
  background-color: var(--box-background);
  color: var(--body-text);
  text-decoration: none;
}

.wiki-pager a:hover {
  border-color: var(--link-text);
  color: var(--link-text);
}

.wiki-pager-next {
  grid-column: 2;
  text-align: right;
}

/* The contents page */
.wiki-contents {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.wiki-contents ol {
  display: grid;
  gap: 8px;
  list-style: none;
}

.wiki-contents ol a {
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
}

.wiki-contents ol p {
  color: var(--muted-text);
  font-size: 1rem;
  font-style: italic;
}

/* The battle simulator: its table of soldiers and their fields, and the fields of
   the wall, tower, palace and luck side by side. */
.wiki-simulator-table th,
.wiki-simulator-table td {
  padding: 6px 4px;
  vertical-align: middle;
}

.wiki-simulator-input {
  width: 100%;
  min-width: 3.5em;
  max-width: 7.5em;
  text-align: right;
}

.wiki-simulator-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
