/* ==========================================================================
   Wiki & Documentation — Full Width, Clean Typography & Zero Scrollbar
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Large Documentation Layout Container
   -------------------------------------------------------------------------- */
.docs-layout-wrapper {
  padding: 2.5rem 0 5rem;
  width: 100%;
}

.docs-wide-container {
  max-width: 1480px;
  width: 94%;
  margin: 0 auto;
}

.docs-grid-container {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

/* --------------------------------------------------------------------------
   2. Left Sidebar (Zero Scrollbars, Pure Fluid Height)
   -------------------------------------------------------------------------- */
.docs-left-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow: visible;
  height: auto;
  position: sticky;
  top: 85px;
}

.docs-mod-header-box {
  background: #131520;
  border: 1px solid #202436;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.docs-mod-identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.docs-mod-mini-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: #1a1d2d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.docs-mod-name {
  font-size: 1.125rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.docs-mod-author {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.docs-mod-author strong {
  color: var(--modrinth-green);
}

.docs-nav-card {
  background: #131520;
  border: 1px solid #202436;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.docs-nav-section-title {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #1c2032;
}

.docs-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}

.docs-nav-item a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.docs-nav-item a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.docs-nav-item.active a {
  color: var(--modrinth-green);
  background: rgba(27, 217, 106, 0.08);
  font-weight: 600;
  border-left: 3px solid var(--modrinth-green);
}

/* --------------------------------------------------------------------------
   3. Main Center Documentation Panel (Airy, Spacious & Beautiful)
   -------------------------------------------------------------------------- */
.docs-center-content {
  background: #131520;
  border: 1px solid #202436;
  border-radius: var(--radius-xl);
  padding: 3rem 3.5rem;
  min-width: 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

/* Typography & Heading Anchors */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  color: #ffffff;
  font-weight: 800;
  letter-spacing: -0.025em;
  position: relative;
}

.markdown-body h1 {
  font-size: 2.25rem;
  margin-top: 0;
  margin-bottom: 1.25rem;
  border-bottom: none;
  padding-bottom: 0;
}

.markdown-body h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 0.85rem;
  border-bottom: none;
  padding-bottom: 0;
}

.markdown-body h3 {
  font-size: 1.2rem;
  margin-top: 1.75rem;
  margin-bottom: 0.65rem;
}

/* Heading anchor # only visible on hover */
.heading-anchor {
  position: absolute;
  left: -1.25rem;
  opacity: 0;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 400;
  transition: opacity var(--transition-fast);
}

.markdown-body h1:hover .heading-anchor,
.markdown-body h2:hover .heading-anchor,
.markdown-body h3:hover .heading-anchor {
  opacity: 0.75;
}

.markdown-body p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #c9d1d9;
  margin-bottom: 1.25rem;
}

.markdown-body ul,
.markdown-body ol {
  color: #c9d1d9;
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.markdown-body li {
  margin-bottom: 0.4rem;
}

.markdown-body strong {
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   4. Right Technical Sidebar (Clean Chips & ToC)
   -------------------------------------------------------------------------- */
.docs-right-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow: visible;
  height: auto;
  position: sticky;
  top: 85px;
}

.docs-info-box {
  background: #131520;
  border: 1px solid #202436;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.docs-info-box-title {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.85rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #1c2032;
}

.docs-info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  font-size: 0.8125rem;
}

.docs-info-row:last-child {
  margin-bottom: 0;
}

.docs-info-label {
  color: var(--text-dim);
}

.docs-info-value {
  color: #ffffff;
  font-weight: 600;
  text-align: right;
}

.modrinth-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.modrinth-mini-chip {
  background: #1c2033;
  border: 1px solid #282e4a;
  color: #a5b4fc;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  display: inline-flex;
}

/* --------------------------------------------------------------------------
   5. Wiki Hub Controls & Grids
   -------------------------------------------------------------------------- */
.wiki-hub-container {
  padding: 2.5rem 0 5rem;
}

.wiki-hub-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.wiki-hub-title h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.wiki-hub-title p {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.wiki-hub-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.wiki-search-box {
  flex: 1;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #131520;
  border: 1px solid #202436;
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.25rem;
  color: var(--text-dim);
  transition: all var(--transition-fast);
}

.wiki-search-box:focus-within {
  border-color: var(--modrinth-green);
  box-shadow: 0 0 0 3px rgba(27, 217, 106, 0.15);
}

.wiki-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9375rem;
  outline: none;
}

.view-toggle-pill {
  display: inline-flex;
  align-items: center;
  background: #131520;
  border: 1px solid #202436;
  border-radius: var(--radius-md);
  padding: 0.25rem;
  gap: 0.25rem;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 34px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.view-toggle-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.view-toggle-btn.active {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

/* Grid Layout (Default Cards) */
.wiki-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.wiki-mod-card {
  background: #131520;
  border: 1px solid #202436;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.wiki-mod-card:hover {
  background: #171a28;
  border-color: #2e344e;
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.wiki-card-top {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.wiki-card-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: #1a1d2d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.wiki-card-title-group {
  flex: 1;
  min-width: 0;
}

.wiki-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.wiki-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wiki-card-tags {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid #202436;
}

.wiki-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* List Layout */
.wiki-list-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wiki-mod-row {
  background: #131520;
  border: 1px solid #202436;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.wiki-mod-row:hover {
  background: #171a28;
  border-color: #2e344e;
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.wiki-row-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
}

.wiki-row-icon {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: #1a1d2d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.wiki-row-title-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}

.wiki-row-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.wiki-row-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tables (Responsive Horizontal Scroll) */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border: 1px solid #202436;
  border-radius: var(--radius-lg);
  background: #10121c;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 460px;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #202436;
  font-size: 0.875rem;
}

th {
  background: #171a28;
  color: #ffffff;
  font-weight: 700;
}

td {
  color: #c9d1d9;
}

tr:last-child td {
  border-bottom: none;
}

/* Callouts / Alerts */
.callout {
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  border-left: 4px solid var(--primary);
  background: rgba(139, 92, 246, 0.08);
}

.callout-note {
  border-left-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}

.callout-tip {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.callout-warning {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.callout-caution {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.callout-content {
  font-size: 0.875rem;
  color: #c9d1d9;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   6. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .docs-grid-container {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1.75rem;
  }
}

@media (max-width: 860px) {
  .docs-grid-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .docs-left-sidebar {
    position: static;
  }
  .docs-center-content {
    padding: 1.75rem 1.25rem;
  }
  .wiki-grid-view {
    grid-template-columns: 1fr;
  }
  .wiki-mod-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .wiki-card-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .wiki-card-actions .btn {
    width: 100%;
  }
}
