/**
 * ThunderOT Wiki - Dark Gamer Theme
 * Immersive fantasy gaming experience
 * 
 * Uses Tailwind CSS via CDN for utilities
 * Custom properties for theming
 */

/* ============================================
   1. CSS VARIABLES / DESIGN TOKENS
   ============================================ */

:root {
  /* Colors - Ultra Dark Gamer Mode (Default) */
  --bg: #030508;
  --bg-2: #080c14;
  --bg-3: #0d1218;
  --card: rgba(20, 30, 50, 0.6);
  --card-hover: rgba(30, 45, 70, 0.8);
  --border: rgba(100, 140, 200, 0.15);
  --border-hover: rgba(100, 140, 200, 0.3);
  --text: rgba(220, 230, 255, 0.95);
  --text-heading: #ffffff;
  --muted: rgba(180, 195, 220, 0.8);
  --muted-2: rgba(140, 160, 190, 0.6);

  /* Primary Accent - Electric Purple/Blue */
  --accent: #7C3AED;
  --accent-hover: #8B5CF6;
  --accent-glow: rgba(124, 58, 237, 0.4);

  /* Secondary Accent - Cyan Lightning */
  --accent-2: #06B6D4;
  --accent-2-hover: #22D3EE;
  --accent-2-glow: rgba(6, 182, 212, 0.4);

  /* Tertiary - Gold/Orange for important highlights */
  --accent-3: #F59E0B;
  --accent-3-glow: rgba(245, 158, 11, 0.3);

  /* Status Colors - More vivid */
  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --success-border: rgba(16, 185, 129, 0.4);
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --warning-border: rgba(245, 158, 11, 0.4);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --danger-border: rgba(239, 68, 68, 0.4);
  --info: #3B82F6;
  --info-bg: rgba(59, 130, 246, 0.15);
  --info-border: rgba(59, 130, 246, 0.4);
  --link: #60A5FA;
  --link-hover: #93C5FD;

  /* Gradients - More dramatic */
  --gradient-arcane: linear-gradient(135deg, #7C3AED 0%, #06B6D4 100%);
  --gradient-fire: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
  --gradient-dark: linear-gradient(180deg, #030508 0%, #0d1218 100%);
  --gradient-card: linear-gradient(145deg, rgba(100, 140, 200, 0.1) 0%, rgba(60, 80, 120, 0.05) 100%);
  --gradient-glow: linear-gradient(180deg, rgba(124, 58, 237, 0.15) 0%, transparent 100%);

  /* Typography */
  --font-primary: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Cinzel', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Spacing */
  --header-height: 90px;
  --sidebar-width: 280px;
  --toc-width: 240px;
  --content-max-width: 850px;
  --page-padding: 24px;

  /* Effects - Enhanced */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 30px var(--accent-glow);
  --shadow-glow-strong: 0 0 60px var(--accent-glow), 0 0 100px rgba(124, 58, 237, 0.2);
  --shadow-neon: 0 0 10px var(--accent), 0 0 20px var(--accent-glow);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
}

/* Light Mode - Kept but darkened */
[data-theme="light"] {
  --bg: #0a0f1a;
  --bg-2: #101825;
  --bg-3: #182030;
  --card: rgba(30, 45, 70, 0.5);
  --card-hover: rgba(40, 60, 90, 0.7);
  --border: rgba(100, 140, 200, 0.2);
  --border-hover: rgba(100, 140, 200, 0.35);
  --text: rgba(220, 230, 255, 0.95);
  --text-heading: #ffffff;
  --muted: rgba(180, 195, 220, 0.8);
  --muted-2: rgba(140, 160, 190, 0.6);
  --accent: #8B5CF6;
  --accent-hover: #A78BFA;
  --accent-glow: rgba(139, 92, 246, 0.3);
  --link: #60A5FA;
  --link-hover: #93C5FD;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* ============================================
   2. BASE STYLES
   ============================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Background atmospheric effects */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(6, 182, 212, 0.1) 0%, transparent 40%),
    radial-gradient(ellipse 50% 30% at 0% 100%, rgba(124, 58, 237, 0.08) 0%, transparent 30%);
  z-index: 0;
}

/* Noise texture overlay */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  z-index: 0;
}

/* ============================================
   3. TYPOGRAPHY
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  color: var(--text-heading);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  margin-top: 0;
  background: var(--gradient-arcane);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

h4 {
  font-size: 1.125rem;
  font-family: var(--font-primary);
}

h5,
h6 {
  font-size: 1rem;
  font-family: var(--font-primary);
}

/* Heading anchors */
h1 a.anchor,
h2 a.anchor,
h3 a.anchor,
h4 a.anchor {
  color: var(--muted-2);
  text-decoration: none;
  margin-left: 0.5rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

h1:hover a.anchor,
h2:hover a.anchor,
h3:hover a.anchor,
h4:hover a.anchor {
  opacity: 1;
}

p {
  margin-bottom: 1rem;
  color: var(--text);
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

strong,
b {
  font-weight: 600;
  color: var(--text-heading);
}

em,
i {
  font-style: italic;
}

small {
  font-size: 0.875rem;
  color: var(--muted);
}

/* Lists */
ul,
ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

li::marker {
  color: var(--accent);
}

/* Inline code */
code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.125rem 0.375rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent-2);
}

/* Code blocks */
pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 1rem 1.25rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: 1rem;
  position: relative;
}

pre code {
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  background: none;
  border: none;
  color: var(--text);
}

/* Blockquotes */
blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--accent);
  background: var(--card);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--muted);
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Horizontal rule */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 2rem 0;
}

/* ============================================
   4. LAYOUT
   ============================================ */

.wiki-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.wiki-sidebar {
  position: fixed;
  left: 0;
  top: var(--header-height);
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.98) 0%, rgba(3, 5, 8, 0.98) 100%);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 40;
  transition: transform var(--transition-base);
  box-shadow: inset -1px 0 0 rgba(124, 58, 237, 0.05);
}

.wiki-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.wiki-content {
  width: 100%;
  max-width: var(--content-max-width);
  padding: 2rem var(--page-padding);
}

.wiki-toc {
  position: fixed;
  right: 0;
  top: var(--header-height);
  width: var(--toc-width);
  height: calc(100vh - var(--header-height));
  padding: 2rem 1rem;
  overflow-y: auto;
  border-left: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.95) 0%, rgba(3, 5, 8, 0.95) 100%);
  box-shadow: inset 1px 0 0 rgba(124, 58, 237, 0.05);
}

/* With TOC layout adjustment */
.has-toc .wiki-main {
  margin-right: var(--toc-width);
}

/* ============================================
   5. HEADER
   ============================================ */

.wiki-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(3, 5, 8, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), inset 0 -1px 0 rgba(124, 58, 237, 0.1);
}

[data-theme="light"] .wiki-header {
  background: rgba(10, 15, 26, 0.95);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-heading);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.header-logo img,
.header-logo svg {
  width: 32px;
  height: 32px;
}

.header-logo span {
  background: var(--gradient-arcane);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mobile-menu-btn {
  display: none;
  padding: 0.5rem;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.mobile-menu-btn:hover {
  background: var(--card);
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 2rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Search Trigger */
.search-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--muted);
  cursor: pointer;
  min-width: 240px;
  transition: all var(--transition-fast);
}

.search-trigger:hover {
  background: var(--card-hover);
  border-color: var(--border-hover);
}

.search-trigger .search-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.search-trigger .search-text {
  flex: 1;
  text-align: left;
  font-size: 0.875rem;
}

.search-trigger .search-shortcut {
  display: flex;
  gap: 0.25rem;
}

.search-trigger kbd {
  padding: 0.125rem 0.375rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

/* Header Actions */
.header-actions {
  display: flex;
  gap: 0.5rem;
}

.header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.header-btn:hover {
  background: var(--card-hover);
  border-color: var(--border-hover);
  color: var(--text);
}

.header-btn svg {
  width: 20px;
  height: 20px;
}

.header-btn.theme-toggle .icon-sun,
.header-btn.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .header-btn.theme-toggle .icon-sun {
  display: block;
}

[data-theme="light"] .header-btn.theme-toggle .icon-moon {
  display: block;
}

.header-link {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
}

.header-link.primary {
  background: var(--gradient-arcane);
  color: white;
  border: none;
}

.header-link.primary:hover {
  opacity: 0.9;
  text-decoration: none;
}

/* ============================================
   6. SIDEBAR
   ============================================ */

.sidebar-content {
  padding: 1.5rem;
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-2);
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.sidebar-section-title:hover {
  color: var(--muted);
  background: var(--card);
}

.sidebar-section-title .chevron {
  margin-left: auto;
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
}

.sidebar-section.collapsed .chevron {
  transform: rotate(-90deg);
}

.sidebar-section.collapsed .sidebar-nav {
  display: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 0.5rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.sidebar-link:hover {
  color: var(--text);
  background: var(--card);
  text-decoration: none;
}

.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-glow);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: var(--radius-full);
}

.sidebar-link svg,
.sidebar-link .emoji {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

/* Nested links */
.sidebar-nested {
  margin-left: 1.25rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
}

/* ============================================
   7. TABLE OF CONTENTS
   ============================================ */

.toc-container {
  position: sticky;
  top: 2rem;
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-2);
  margin-bottom: 1rem;
  padding: 0 0.5rem;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-link {
  display: block;
  padding: 0.375rem 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all var(--transition-fast);
}

.toc-link:hover {
  color: var(--text);
  background: var(--card);
  text-decoration: none;
}

.toc-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-glow);
}

.toc-link[data-level="2"] {
  padding-left: 0.5rem;
}

.toc-link[data-level="3"] {
  padding-left: 1rem;
  font-size: 0.75rem;
}

.toc-link[data-level="4"] {
  padding-left: 1.5rem;
  font-size: 0.75rem;
}

/* ============================================
   8. BREADCRUMBS
   ============================================ */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb-link {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb-separator {
  color: var(--muted-2);
}

.breadcrumb-current {
  color: var(--text);
}

/* ============================================
   9. SEARCH MODAL
   ============================================ */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.search-modal.active {
  display: flex;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.search-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: searchModalIn 0.2s ease;
}

@keyframes searchModalIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.search-input-wrapper svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text);
  outline: none;
}

.search-input::placeholder {
  color: var(--muted-2);
}

.search-close {
  padding: 0.25rem 0.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
}

.search-results {
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-result {
  display: block;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--transition-fast);
}

.search-result:hover,
.search-result.focused {
  background: var(--card);
  text-decoration: none;
}

.search-result-title {
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.search-result-path {
  font-size: 0.75rem;
  color: var(--muted-2);
}

.search-result mark {
  background: var(--accent-glow);
  color: var(--accent);
  padding: 0 0.125rem;
  border-radius: 2px;
}

.search-empty {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

.search-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted-2);
}

.search-hints {
  display: flex;
  gap: 1rem;
}

.search-hint {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.search-hint kbd {
  padding: 0.125rem 0.375rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

/* ============================================
   10. PAGINATION
   ============================================ */

.pagination {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.pagination-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--transition-fast);
  max-width: 45%;
}

.pagination-link:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pagination-link.next {
  text-align: right;
  margin-left: auto;
}

.pagination-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-2);
}

.pagination-title {
  font-weight: 500;
  color: var(--text);
}

/* ============================================
   11. FOOTER
   ============================================ */

.wiki-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted-2);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-meta {
  display: flex;
  justify-content: center;
  gap: 1rem;
  align-items: center;
}

/* ============================================
   12. RESPONSIVE
   ============================================ */

@media (max-width: 1280px) {
  .wiki-toc {
    display: none;
  }

  .has-toc .wiki-main {
    margin-right: 0;
  }
}

@media (max-width: 1024px) {
  .search-trigger {
    min-width: auto;
    padding: 0.5rem;
  }

  .search-trigger .search-text,
  .search-trigger .search-shortcut {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 100%;
    --page-padding: 16px;
    --header-height: 56px;
  }

  .wiki-sidebar {
    transform: translateX(-100%);
    width: 100%;
    max-width: 320px;
    z-index: 60;
  }

  .wiki-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 55;
    display: none;
  }

  .wiki-sidebar.open+.sidebar-backdrop {
    display: block;
  }

  .wiki-main {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .header-link {
    display: none;
  }

  .pagination {
    flex-direction: column;
  }

  .pagination-link {
    max-width: 100%;
  }

  .pagination-link.next {
    text-align: left;
  }
}

/* ============================================
   13. UTILITIES
   ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted-2);
}

/* Selection */
::selection {
  background: var(--accent-glow);
  color: var(--text);
}

/* Print styles */
@media print {

  .wiki-header,
  .wiki-sidebar,
  .wiki-toc,
  .pagination {
    display: none !important;
  }

  .wiki-main {
    margin: 0 !important;
  }

  body {
    background: white;
    color: black;
  }
}