/* Readable max width for screenshots in the article column (screen + PDF) */
:root {
  --wiki-content-img-max: 520px;
}

/* SDT main wiki: header icon row — obvious links (same colors as .card a, always underlined) */
.wiki-guide .wiki-sdt-header-links a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Anchor Setup (getting-started): three columns — text | screenshot | text (no flex-wrap stacking) */
.wiki-guide .wiki-anchor-setup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px) minmax(0, 1fr);
  gap: 24px 32px;
  align-items: center;
  margin: 20px 0;
  width: 100%;
  box-sizing: border-box;
}
.wiki-guide .wiki-anchor-setup-layout .wiki-anchor-setup-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.wiki-guide .wiki-anchor-setup-layout .wiki-anchor-setup-left {
  text-align: right;
}
.wiki-guide .wiki-anchor-setup-layout .wiki-anchor-setup-right {
  text-align: left;
}
.wiki-guide .wiki-anchor-setup-layout .wiki-anchor-setup-img {
  text-align: center;
}
.wiki-guide .wiki-anchor-setup-layout .wiki-anchor-setup-img img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}
@media (max-width: 900px) {
  .wiki-guide .wiki-anchor-setup-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .wiki-guide .wiki-anchor-setup-layout .wiki-anchor-setup-img {
    order: -1;
  }
  .wiki-guide .wiki-anchor-setup-layout .wiki-anchor-setup-left,
  .wiki-guide .wiki-anchor-setup-layout .wiki-anchor-setup-right {
    text-align: left;
  }
}

.wiki-breadcrumb { margin-bottom: 16px; font-size: 0.9rem; }
.wiki-breadcrumb a { color: var(--sky-deep); font-weight: 600; }
.wiki-breadcrumb a:hover { text-decoration: underline; }
/* Page title is outside .wiki-guide; body starts at ## */
.wiki-guide h1 { color: var(--wood); margin: 0 0 18px; font-size: 1.35rem; font-weight: 700; }
.wiki-guide h2 { color: var(--wood); margin: 32px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--cream-border); font-size: 1.3rem; font-weight: 700; }
.wiki-guide h2:first-of-type { margin-top: 0; }
.wiki-guide h3 { color: var(--wood-light); margin: 24px 0 10px; font-size: 1.08rem; font-weight: 600; }
.wiki-guide p { line-height: 1.7; margin: 0 0 14px; }
.wiki-guide ul, .wiki-guide ol { margin: 0 0 16px; padding-left: 24px; }
.wiki-guide li { margin-bottom: 6px; }
.wiki-guide .steps {
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 16px 0;
}
.wiki-guide .step {
  display: block;
  margin: 0;
  padding: 16px 18px 16px 56px;
  position: relative;
  background: rgba(255, 252, 248, 0.9);
  border: 1px solid var(--cream-border);
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(92, 61, 46, 0.03);
}
.wiki-guide .step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 28px;
  height: 28px;
  background: var(--wood);
  color: #fff;
  border-radius: 50%;
  text-align: center;
  line-height: 28px;
  font-weight: 700;
  font-size: 0.85rem;
}
.wiki-guide .step strong { display: block; margin-bottom: 6px; color: var(--wood); }
.wiki-guide table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.95rem; }
.wiki-guide th, .wiki-guide td { border: 1px solid var(--cream-border); padding: 10px 12px; text-align: left; }
.wiki-guide th { background: rgba(212,184,150,0.3); font-weight: 700; }
.wiki-guide tr:nth-child(even) { background: rgba(255,248,231,0.4); }
.wiki-guide .tip { background: rgba(107,168,79,0.08); border-left: 4px solid var(--leaf); padding: 14px 18px; margin: 18px 0; border-radius: 0 12px 12px 0; }
.wiki-guide .tip strong { color: var(--wood); }
.wiki-guide .note { background: rgba(91,155,213,0.08); border-left: 4px solid var(--sky-deep); padding: 14px 18px; margin: 18px 0; border-radius: 0 12px 12px 0; }
.wiki-guide .warning { background: rgba(200,100,50,0.1); border-left: 4px solid #c86432; padding: 14px 18px; margin: 18px 0; border-radius: 0 12px 12px 0; }
.wiki-guide code { background: rgba(0,0,0,0.06); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
.wiki-guide .token-gate-block { margin: 24px 0; padding: 24px; background: rgba(255,255,255,0.7); border-radius: 12px; }

/* Wiki images — drop files in assets/wiki/images/ and paste <figure class="wiki-figure">… (see WIKI-IMAGES.md) */
.wiki-guide .wiki-figure {
  margin: 20px 0;
  padding: 12px;
  background: rgba(255, 252, 248, 0.95);
  border: 1px solid var(--cream-border);
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(92, 61, 46, 0.06);
  text-align: center;
}
.wiki-guide .wiki-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  vertical-align: middle;
}
.wiki-guide .wiki-figure figcaption {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.45;
}

/* ---- Inline / markdown images (screen) — keeps huge PNGs from overflowing or dominating print preview ---- */
.wiki-guide img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* Honor small toolbar icons; cap large width="500" style screenshots to the column */
.wiki-guide img[width] {
  max-width: min(100%, var(--wiki-content-img-max));
}

/* Centered figure wrappers from the markdown often use inline divs — contain overflow */
.wiki-guide > div {
  max-width: 100%;
  box-sizing: border-box;
}

/* ---- Print & Save as PDF (Getting Started review copies, etc.) ---- */
@media print {
  body {
    background: #fff !important;
  }

  .site-header .brand img {
    max-height: 48px !important;
    width: auto !important;
  }

  .site-header nav {
    display: none !important;
  }

  .wiki-breadcrumb {
    display: none !important;
  }

  .site-footer {
    display: none !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    padding: 12px 16px !important;
  }

  .wiki-guide img {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
  }

  .wiki-guide h2,
  .wiki-guide h3 {
    page-break-after: avoid;
  }
}
