/* ═══════════════════════════════════════════════════════════════════
   TERMSTUDIO — wiki/wiki.css
   Specialized stylesheet for documentation wiki layout
   ═══════════════════════════════════════════════════════════════════ */

/* ── WIKI CONTAINER & LAYOUT ── */
.wiki-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  align-items: start;
}

/* ── SIDEBAR ── */
.wiki-sidebar {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green-dim);
  padding: 1.5rem;
}

.wiki-sidebar::-webkit-scrollbar {
  width: 4px;
}
.wiki-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.wiki-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
}

.wiki-sidebar-nav h3 {
  font-size: 0.85rem;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
}
.wiki-sidebar-nav h3:first-of-type {
  margin-top: 0;
}

.wiki-sidebar-nav ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1rem;
}

.wiki-sidebar-nav ul li {
  margin-bottom: 0.4rem;
}

.wiki-sidebar-nav ul li a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-decoration: none;
  display: block;
  padding: 2px 0;
  transition: color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wiki-sidebar-nav ul li a:hover {
  color: var(--green);
}

.wiki-sidebar-nav ul li a.active {
  color: var(--green-bright);
  font-weight: bold;
}
.wiki-sidebar-nav ul li a.active::before {
  content: "> ";
  color: var(--green);
}

/* ── MAIN CONTENT ── */
.wiki-content {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 2.5rem;
}

.wiki-breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  display: block;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.5rem;
}
.wiki-breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
}
.wiki-breadcrumb a:hover {
  color: var(--green);
}

.wiki-content h1 {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  color: var(--green-bright);
  margin-bottom: 1.2rem;
  line-height: 1.2;
}

.wiki-toc {
  background: #0a130c;
  border: 1px solid var(--border-green);
  padding: 1.2rem;
  margin-bottom: 2rem;
}
.wiki-toc-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--green);
  margin-bottom: 0.6rem;
  font-weight: bold;
}
.wiki-toc ul {
  list-style: none;
  padding-left: 0;
}
.wiki-toc ul li {
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
}
.wiki-toc ul li::before {
  content: "# ";
  color: var(--border-green);
  font-family: var(--font-mono);
}
.wiki-toc ul li a {
  text-decoration: none;
  font-family: var(--font-mono);
}

/* Callout Alerts */
.wiki-callout {
  padding: 1.2rem;
  margin: 1.5rem 0;
  border-left: 4px solid transparent;
  font-size: 0.95rem;
}
.wiki-callout p:last-child {
  margin-bottom: 0;
}

.wiki-note {
  background: rgba(68, 136, 204, 0.08);
  border-left-color: #4488cc;
  color: #aaccff;
}
.wiki-note h4 {
  color: #4488cc;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.wiki-tip {
  background: rgba(0, 204, 68, 0.08);
  border-left-color: #00cc44;
  color: #aaffcc;
}
.wiki-tip h4 {
  color: #00cc44;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.wiki-warning {
  background: rgba(255, 153, 0, 0.08);
  border-left-color: #ff9900;
  color: #ffe0b3;
}
.wiki-warning h4 {
  color: #ff9900;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.wiki-danger {
  background: rgba(204, 51, 0, 0.08);
  border-left-color: #cc3300;
  color: #ffb3b3;
}
.wiki-danger h4 {
  color: #cc3300;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

/* Code block adjustments for wiki */
.wiki-content pre {
  margin: 1.5rem 0;
}

/* Wiki Article Navigation (Prev/Next) */
.article-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  gap: 1rem;
}
.nav-prev, .nav-next {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 1rem;
  text-decoration: none;
  transition: border-color 0.15s;
}
.nav-prev:hover, .nav-next:hover {
  border-color: var(--green-dim);
}
.nav-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}
.nav-title {
  display: block;
  font-size: 0.9rem;
  color: var(--green);
  font-weight: bold;
  font-family: var(--font-mono);
}
.nav-next {
  text-align: right;
}

/* ── ADSENSE AD SLOTS ── */
.ad-slot {
  background: #080808;
  border: 1px dotted var(--border);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}
.ad-slot::before {
  content: "ADVERTISEMENT";
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.ad-slot-sidebar {
  background: #080808;
  border: 1px dotted var(--border);
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
  position: relative;
}
.ad-slot-sidebar::before {
  content: "ADVERTISEMENT";
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

/* ── RESPONSIVE WIKI ── */
@media (max-width: 960px) {
  .wiki-container {
    grid-template-columns: 1fr;
  }
  .wiki-sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 600px) {
  .wiki-content {
    padding: 1.5rem;
  }
  .wiki-content h1 {
    font-size: 1.7rem;
  }
  .article-nav {
    flex-direction: column;
  }
}
