/* Wiki page. Colors, top bar, buttons and base styles come from site.css. */

.wiki-body {
  --page-width: 1200px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --reading: #e9e0e6;
  --warn: #e7a73a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Lets <details> animate to their natural height where supported. */
  interpolate-size: allow-keywords;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------------- Layout */

.wiki-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 8px 16px 56px;
}

.wiki-sidebar {
  position: sticky;
  top: 16px;
}

.wiki-main {
  min-width: 0;
}

.wiki-footer {
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 16px 28px;
}

/* -------------------------------------------------------------- Explorer */

.explorer-panel {
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 10px 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: 0 24px 60px -32px rgb(0 0 0 / 0.6);
  scrollbar-width: thin;
}

.explorer-toggle {
  display: none;
}

.tree-group + .tree-group {
  margin-top: 10px;
}

.tree-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: color 200ms ease, background 200ms ease;
}

.tree-header:hover {
  color: var(--text);
  background: rgb(255 255 255 / 0.03);
}

.tree-chevron {
  transition: transform 360ms var(--ease-out), color 300ms ease;
}

.tree-group.collapsed .tree-chevron {
  transform: rotate(-90deg);
}

/* The header of the branch holding the open page lights up with it. */
.tree-group.has-active .tree-header {
  color: var(--text);
}

.tree-group.has-active .tree-chevron {
  color: var(--button);
}

.tree-count {
  margin-left: auto;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.tree-collapse {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 380ms var(--ease-out);
}

.tree-group.collapsed .tree-collapse {
  grid-template-rows: 0fr;
}

.tree-inner {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.tree-list {
  margin: 0;
  padding: 2px 0;
  list-style: none;
}

.tree-list li {
  padding-left: 28px;
}

.tree-list li + li {
  margin-top: 2px;
}

.tree-link {
  display: block;
  padding: 7px 10px 7px 16px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
  transition: color 200ms ease, background 200ms ease;
}

.tree-link:hover {
  color: var(--text);
  background: rgb(255 255 255 / 0.035);
}

.tree-link.active {
  color: var(--text);
  font-weight: 600;
  background: rgb(226 179 214 / 0.09);
}

.tree-header:focus-visible,
.tree-link:focus-visible,
.explorer-toggle:focus-visible,
.explorer-help:focus-visible {
  outline: 2px solid var(--input-focus);
  outline-offset: -2px;
}

/* Branch lines, drawn by wiki.js into an SVG over each list. */
.tree-lines {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  overflow: visible;
  pointer-events: none;
}

.tree-base {
  fill: none;
  stroke: var(--input-border);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.tree-node {
  fill: var(--card);
  stroke: #6a3a63;
  stroke-width: 1.5;
}

/* Hovering a page previews its route from the header. */
.tree-hover {
  fill: none;
  stroke: rgb(226 179 214 / 0.45);
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 220ms ease;
}

.tree-hover.show {
  opacity: 1;
}

/* The lit route to the open page draws itself in from the header. */
.tree-halo {
  fill: none;
  stroke: rgb(226 179 214 / 0.2);
  stroke-width: 7;
  stroke-linecap: round;
}

.tree-lit {
  fill: none;
  stroke: var(--button);
  stroke-width: 2;
  stroke-linecap: round;
}

.tree-halo,
.tree-lit {
  transition: stroke-dashoffset 760ms cubic-bezier(0.33, 1, 0.68, 1);
}

.tree-lit-glow {
  fill: rgb(226 179 214 / 0.22);
}

.tree-lit-node {
  fill: var(--button);
}

.tree-lit-glow,
.tree-lit-node {
  transform-box: fill-box;
  transform-origin: center;
}

/* The node at the end of the route lands once the line reaches it. */
.tree-lines.arrive .tree-lit-glow,
.tree-lines.arrive .tree-lit-node {
  animation: node-arrive 560ms var(--ease-out) 520ms both;
}

@keyframes node-arrive {
  from {
    transform: scale(0.2);
    opacity: 0;
  }
  60% {
    transform: scale(1.35);
    opacity: 1;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.explorer-help {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 4px 0;
  padding: 12px 8px 0;
  border-top: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 200ms ease;
}

.explorer-help:hover {
  color: var(--text);
}

/* --------------------------------------------------------------- Article */

.wiki-article {
  padding: 40px 48px 44px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: 0 24px 60px -32px rgb(0 0 0 / 0.6);
}

/* A short settle when switching pages; the article never starts invisible. */
.wiki-article.entering {
  animation: article-in 420ms var(--ease-out);
}

@keyframes article-in {
  from {
    opacity: 0.35;
    transform: translateY(6px);
  }
}

.article-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.wiki-article h1 {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.wiki-article h1:focus {
  outline: none;
}

.copy-link,
.copy-fix {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease;
}

.copy-link:hover,
.copy-fix:hover {
  color: var(--text);
  border-color: var(--input-border);
}

.copy-link.done,
.copy-fix.done {
  color: var(--button);
  border-color: rgb(226 179 214 / 0.4);
}

.copy-link:focus-visible,
.copy-fix:focus-visible {
  outline: 2px solid var(--input-focus);
  outline-offset: 2px;
}

.lead {
  max-width: 62ch;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

/* ----------------------------------------------------------------- Prose */

.prose {
  max-width: 70ch;
  margin-top: 8px;
  color: var(--reading);
  font-size: 15.5px;
  line-height: 1.7;
}

.prose h2 {
  margin: 44px 0 12px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  scroll-margin-top: 24px;
}

.prose h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
}

.prose p {
  margin: 12px 0;
}

.prose ol:not(.steps),
.prose ul:not(.link-list) {
  margin: 12px 0;
  padding-left: 22px;
}

.prose li + li {
  margin-top: 6px;
}

.prose em {
  color: var(--text);
  font-style: normal;
  font-weight: 600;
}

.prose a,
.lead a {
  color: var(--button);
  text-decoration: underline;
  text-decoration-color: rgb(226 179 214 / 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 200ms ease;
}

.prose a:hover {
  text-decoration-color: currentColor;
}

.prose a:focus-visible {
  outline: 2px solid var(--input-focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.prose code,
.prose kbd,
.prose pre {
  font-family: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
}

.prose code {
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 5px;
  background: #2a1226;
  color: var(--text);
  font-size: 0.86em;
}

.prose pre {
  margin: 10px 0;
  padding: 12px 14px;
  overflow-x: auto;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: #170815;
  font-size: 13px;
  line-height: 1.55;
}

.prose pre code {
  padding: 0;
  background: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.prose kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 6px;
  border: 1px solid var(--input-border);
  border-radius: 5px;
  background: #24101f;
  box-shadow: inset 0 -1.5px 0 var(--input-border);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
}

/* Windows Settings path: chips joined by drawn chevrons. */
.ui-path {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  vertical-align: baseline;
}

.ui-path > span {
  position: relative;
  padding: 0 8px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: #2a1226;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
}

.ui-path > span + span {
  margin-left: 18px;
}

.ui-path > span + span::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -12px;
  width: 5px;
  height: 5px;
  border-top: 1.5px solid var(--faint);
  border-right: 1.5px solid var(--faint);
  transform: translateY(-50%) rotate(45deg);
}

/* Numbered steps: nodes on a line, echoing the explorer's branches. */
.steps {
  margin: 20px 0 8px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  position: relative;
  padding: 0 0 22px 48px;
  counter-increment: step;
}

.steps > li + li {
  margin-top: 0;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #6a3a63;
  border-radius: 50%;
  background: #2b0c28;
  color: var(--button);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 36px;
  bottom: 6px;
  left: 15px;
  width: 1.5px;
  border-radius: 1px;
  background: var(--input-border);
}

.steps > li > h3 {
  padding-top: 4px;
}

.steps > li > p {
  margin: 4px 0 0;
}

/* Callouts: tinted panel with an icon, no side stripe. */
.callout {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  margin: 14px 0 4px;
  padding: 12px 16px;
  border: 1px solid rgb(226 179 214 / 0.22);
  border-radius: 10px;
  background: rgb(226 179 214 / 0.06);
}

.callout > .icon {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  color: var(--button);
}

.callout p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
}

.callout-warn {
  border-color: rgb(231 167 58 / 0.32);
  background: rgb(231 167 58 / 0.07);
}

.callout-warn > .icon {
  color: var(--warn);
}

/* Specification rows (System Requirements). */
.specs {
  margin: 28px 0 8px;
  border-top: 1px solid var(--card-border);
}

.specs > div {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--card-border);
}

.specs dt {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}

.specs dd {
  margin: 0;
}

/* Link rows (About Plum). */
.link-list {
  margin: 16px 0;
  padding: 0;
  border-top: 1px solid var(--card-border);
  list-style: none;
}

.link-list li + li {
  margin-top: 0;
}

.prose .link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--card-border);
  color: var(--text);
  text-decoration: none;
}

.link-list strong {
  display: block;
  font-size: 15px;
}

.link-list strong + span {
  color: var(--muted);
  font-size: 14px;
}

.link-list .icon {
  color: var(--faint);
  transition: transform 300ms var(--ease-out), color 200ms ease;
}

.link-list a:hover .icon {
  color: var(--button);
  transform: translateX(4px);
}

/* Troubleshooting fixes. */
.issues {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 8px;
}

.issue {
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: rgb(255 255 255 / 0.015);
  scroll-margin-top: 24px;
  transition: border-color 250ms ease, background 250ms ease, box-shadow 600ms ease;
}

.issue[open] {
  border-color: var(--input-border);
  background: rgb(226 179 214 / 0.035);
}

/* Briefly marks the fix a shared link pointed to. */
.issue.flash {
  border-color: rgb(226 179 214 / 0.6);
  box-shadow: 0 0 0 3px rgb(226 179 214 / 0.14);
}

.issue summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  list-style: none;
  cursor: pointer;
}

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

.issue summary:focus-visible {
  outline: 2px solid var(--input-focus);
  outline-offset: -2px;
}

.issue-chevron {
  color: var(--faint);
  transition: transform 360ms var(--ease-out), color 200ms ease;
}

.issue[open] .issue-chevron {
  color: var(--button);
  transform: rotate(180deg);
}

.issue::details-content {
  block-size: 0;
  overflow: clip;
  transition: block-size 380ms var(--ease-out), content-visibility 380ms allow-discrete;
}

.issue[open]::details-content {
  block-size: auto;
}

.issue-body {
  padding: 0 16px 16px;
}

.issue-body > p:first-child {
  margin-top: 0;
}

.copy-fix {
  height: 28px;
  margin-top: 6px;
  padding: 0 10px;
  font-size: 12.5px;
}

/* ------------------------------------------------- Pager and help strip */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.pager:empty {
  display: none;
}

.pager a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  transition: border-color 200ms ease;
}

.pager a:hover {
  border-color: var(--input-border);
}

.pager a:focus-visible {
  outline: 2px solid var(--input-focus);
  outline-offset: 2px;
}

.pager .next {
  grid-column: 2;
  justify-content: flex-end;
  text-align: right;
}

.pager small {
  display: block;
  color: var(--faint);
  font-size: 12.5px;
}

.pager strong {
  font-size: 15px;
}

.pager .icon {
  color: var(--faint);
  transition: transform 300ms var(--ease-out), color 200ms ease;
}

.pager .prev:hover .icon {
  color: var(--button);
  transform: translateX(-4px);
}

.pager .next:hover .icon {
  color: var(--button);
  transform: translateX(4px);
}

.help-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 14px 14px 14px 18px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
}

.help-strip p {
  margin: 0;
}

.help-strip strong {
  color: var(--text);
}

.help-strip .topbar-link {
  gap: 8px;
}

/* ------------------------------------------------------- Draft notes */

/* Notes for the site owner. Hidden unless the page is opened with ?draft. */
.todo {
  display: none;
}

.draft .todo {
  display: block;
  position: relative;
  margin: 10px 0;
  padding: 10px 14px 10px 64px;
  border: 1px dashed rgb(231 167 58 / 0.55);
  border-radius: 8px;
  background: rgb(231 167 58 / 0.06);
  color: #f2d39b;
  font-size: 13.5px;
  line-height: 1.55;
}

.draft .todo::before {
  content: "TODO";
  position: absolute;
  top: 10px;
  left: 14px;
  color: var(--warn);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* Draft view: how many notes each page still has. */
.tree-todo {
  float: right;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: rgb(231 167 58 / 0.16);
  color: var(--warn);
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.draft-banner {
  width: calc(100% - 32px);
  max-width: calc(var(--page-width) - 32px);
  margin: 0 auto 16px;
  padding: 10px 16px;
  border: 1px dashed rgb(231 167 58 / 0.55);
  border-radius: 10px;
  background: rgb(231 167 58 / 0.06);
  color: #f2d39b;
  font-size: 14px;
}

/* ----------------------------------------------------------------- Phones */

@media (max-width: 899px) {
  .wiki-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding-top: 0;
  }

  .wiki-sidebar {
    position: static;
  }

  .explorer-panel {
    max-height: none;
    padding: 0;
    overflow: visible;
  }

  .explorer-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 50px;
    padding: 0 16px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
  }

  .explorer-current {
    margin-left: auto;
    overflow: hidden;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .explorer-toggle-chevron {
    transition: transform 360ms var(--ease-out);
  }

  .explorer-panel.open .explorer-toggle-chevron {
    transform: rotate(180deg);
  }

  .explorer-drawer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 420ms var(--ease-out);
  }

  .explorer-panel.open .explorer-drawer {
    grid-template-rows: 1fr;
  }

  .explorer-drawer-inner {
    min-height: 0;
    overflow: hidden;
  }

  .explorer {
    padding: 0 10px 12px;
  }

  .explorer-help {
    margin: 0 14px;
    padding: 12px 8px 14px;
  }

  .wiki-article {
    padding: 28px 20px 30px;
  }

  .wiki-article h1 {
    font-size: 28px;
  }

  .lead {
    font-size: 16px;
  }

  .specs > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .help-strip {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .article-head {
    flex-direction: column;
    gap: 12px;
  }

  .pager {
    grid-template-columns: minmax(0, 1fr);
  }

  .pager .next {
    grid-column: 1;
  }

  .steps > li {
    padding-left: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wiki-body *,
  .wiki-body *::before,
  .wiki-body *::after,
  .issue::details-content {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
  }
}
