/* ============================================================
   Ardivee Wiki — static rebuild
   Palette pulled directly from the original site's custom CSS:
   panel #323232 · accent #f6992a · muted text #b1b1b1 · code #1B2426
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg-body: #232323;
  --bg-panel: #323232;
  --bg-panel-raised: #3a3a3a;
  --accent: #f6992a;
  --accent-dim: #c97c22;
  --text-main: #e9e6df;
  --text-muted: #b1b1b1;
  --code-bg: #1b2426;
  --border: #454545;
  --font-display: 'JetBrains Mono', 'Courier New', monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width: 900px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  display: flex;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Skip link / focus ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #1b1b1b;
  padding: 8px 14px;
  z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 270px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 24px 0 60px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
  display: inline;
}

.brand-cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
  font-weight: 700;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.brand-tagline {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.nav-section { margin-bottom: 4px; }

.nav-category {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 9px 20px;
  cursor: pointer;
  text-align: left;
}

.nav-category:hover { color: var(--accent); text-decoration: none; }

.nav-category .count {
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-left: auto;
}

.nav-category .chevron {
  color: var(--accent);
  transition: transform 0.15s ease;
  font-size: 0.7rem;
  width: 10px;
}

.nav-section.open .chevron { transform: rotate(90deg); }

.nav-articles {
  list-style: none;
  margin: 0;
  padding: 0 20px 10px 36px;
  display: none;
}

.nav-section.open .nav-articles { display: block; }

.nav-articles li { margin: 0; }

.nav-articles a {
  display: block;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 5px 0;
  border-left: 2px solid transparent;
  padding-left: 10px;
  margin-left: -12px;
}

.nav-articles a:hover,
.nav-articles a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  text-decoration: none;
}

.sidebar-footer {
  padding: 16px 20px 0;
  margin-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- Mobile nav toggle ---------- */
.nav-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  background: var(--bg-panel-raised);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1rem;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
}

/* ---------- Main content ---------- */
.main {
  flex: 1;
  min-width: 0;
  padding: 48px 40px 100px;
}

.content-wrap { max-width: var(--max-width); margin: 0 auto; }

.breadcrumb {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-family: var(--font-display);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 6px; opacity: 0.5; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--accent);
  font-weight: 700;
  line-height: 1.3;
}

h1 { font-size: 2rem; margin: 0 0 6px; }
h2 { font-size: 1.5rem; margin-top: 2.2em; }
h3 { font-size: 1.25rem; margin-top: 1.8em; }
h4 { font-size: 1.08rem; margin-top: 1.6em; }
h5, h6 { font-size: 0.95rem; margin-top: 1.4em; text-transform: uppercase; letter-spacing: 0.03em; }

.article-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2em;
  font-family: var(--font-display);
}

.article-meta .cat-tag {
  display: inline-block;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 2px 9px;
  border-radius: 3px;
  margin-right: 10px;
}

p { margin: 1em 0; color: var(--text-main); }

ul, ol { padding-left: 1.4em; }
li { margin: 0.35em 0; }

hr {
  border: none;
  height: 1px;
  background: var(--accent);
  opacity: 0.35;
  margin: 2.5em 0;
}

blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5em 0;
  padding: 0.3em 1.2em;
  color: var(--text-muted);
  background: var(--bg-panel);
  border-radius: 0 4px 4px 0;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin: 1.2em 0;
  display: block;
}

/* ---------- Code ---------- */
code {
  font-family: var(--font-display);
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: #e3d9c6;
}

pre {
  background: var(--code-bg);
  border: 1px solid #0f1517;
  border-radius: 6px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 1.4em 0;
  position: relative;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.86rem;
  line-height: 1.6;
  color: #d8d3c4;
}

.code-block { position: relative; margin: 1.4em 0; }
.code-block pre { margin: 0; }

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg-panel-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.7rem;
  padding: 4px 9px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.code-block:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

/* pygments token colors, tuned for the code-bg */
.codehilite { margin: 0; }
.codehilite .k, .codehilite .kd, .codehilite .kn, .codehilite .kr { color: #f6992a; }
.codehilite .s, .codehilite .s1, .codehilite .s2 { color: #a8cf8e; }
.codehilite .c, .codehilite .c1, .codehilite .cm { color: #6f7f82; font-style: italic; }
.codehilite .n { color: #d8d3c4; }
.codehilite .nf, .codehilite .nx, .codehilite .nb { color: #e0b96a; }
.codehilite .mi, .codehilite .m, .codehilite .mf { color: #d38f6e; }
.codehilite .o { color: #b1b1b1; }

/* ---------- Download button (maxbutton shortcode) ---------- */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #201400;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 18px;
  border-radius: 5px;
  margin: 0.6em 0;
}
.btn-download:hover { background: #ffb04d; text-decoration: none; }

/* ---------- Video embed (YouTube) ---------- */
.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  margin: 1.4em 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}
.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

video {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin: 1.4em 0;
  display: block;
  background: #000;
}

/* ---------- Home page category grid ---------- */
.home-hero {
  margin-bottom: 2.5em;
  padding-bottom: 1.5em;
  border-bottom: 1px solid var(--border);
}
.home-hero h1 { font-size: 2.1rem; margin-bottom: 8px; }
.home-hero p { color: var(--text-muted); font-size: 1.02rem; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 700px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .cat-grid { grid-template-columns: 1fr; }
}

.cat-card {
  display: block;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  color: var(--text-main);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.cat-card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-2px);
}

.cat-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--accent);
}

.cat-count {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-display);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 4em;
  padding-top: 1.5em;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: var(--font-display);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .sidebar {
    position: fixed;
    left: -290px;
    top: 0;
    z-index: 150;
    width: 270px;
    transition: left 0.2s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  .sidebar.open { left: 0; }
  .main { padding: 70px 20px 80px; }
  .overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 140;
  }
  .overlay.open { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-cursor { animation: none; }
  * { scroll-behavior: auto !important; }
}
