/* ============================================
   Shared styles — used by every page
   (index.html, troubleshooting.html, ...)
   Page-specific tweaks live in each page's own
   <style> block, not here.
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  line-height: 1.6;
  color: #1f2937;
  background: #ffffff;
  font-size: 16px;
}
.wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: #3b82f6;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
a:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* ── Header ── */
header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #3b82f6;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-icon {
  height: 28px;
  width: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Cross-page nav links in the header (e.g. Install Guide <-> Troubleshooting) */
.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-right: auto;
  margin-left: 1.5rem;
}
.header-nav a {
  color: #6b7280;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.header-nav a:hover,
.header-nav a.active {
  color: #3b82f6;
}

.github-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #111827;
  color: #ffffff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.github-btn:hover {
  background: #1f2937;
}
.github-btn svg {
  height: 16px;
  width: 16px;
}

/* ── Hero ── */
.hero {
  padding: 3rem 0 2rem;
  margin-bottom: 2rem;
}
.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #111827;
  line-height: 1.2;
}
.hero p {
  font-size: 1rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}
.breadcrumb {
  font-size: 0.9rem;
  color: #9ca3af;
}

/* Generic "go back / go to related page" link, used across pages */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #3b82f6;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1rem;
}
.back-link:hover {
  text-decoration: underline;
}

/* ── Layout: sidebar TOC + content ── */
.main-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.toc {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 0.5rem;
}
.toc h2 {
  font-size: 0.95rem;
  color: #111827;
  margin-bottom: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.toc ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}
.toc a {
  color: #3b82f6;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
  display: block;
  padding: 0.3rem 0;
}
.toc a:hover {
  color: #2563eb;
  text-decoration: underline;
}

.sidebar-toc {
  display: none;
}

@media (min-width: 1200px) {
  .main-layout {
    grid-template-columns: 320px 1fr;
  }
  .toc {
    display: none;
  }
  .sidebar-toc {
    display: block;
    position: sticky;
    top: 5rem;
    height: fit-content;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    border-radius: 0.5rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
  }
  .sidebar-toc h2 {
    font-size: 0.85rem;
    color: #111827;
    margin-bottom: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .sidebar-toc ul {
    list-style: none;
  }
  .sidebar-toc li {
    padding: 0;
    margin-bottom: 0.5rem;
  }
  .sidebar-toc a {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: block;
    padding: 0.4rem 0.5rem;
    border-radius: 0.375rem;
  }
  .sidebar-toc a:hover {
    background: #e0e7ff;
    color: #2563eb;
  }
  .sidebar-toc a.active {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 600;
  }
}

/* ── Step / content sections (shared by guide steps and troubleshooting entries) ── */
.step {
  margin-bottom: 2.5rem;
  scroll-margin-top: 6rem;
}
.step h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
}
.step h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
  margin: 1.5rem 0 0.6rem;
}
.step p {
  margin-bottom: 1rem;
  color: #374151;
  line-height: 1.7;
}
.step strong {
  color: #111827;
  font-weight: 600;
}

/* ── Code blocks ── */

.code-block {
  position: relative;
  margin: 1.5rem 0;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  overflow: hidden;
  background: #111827;
  box-shadow:
    0 8px 24px rgba(15, 23, 42, 0.08),
    0 2px 4px rgba(15, 23, 42, 0.04);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

/* .code-block::before {
  content: "";
  display: block;
  height: 42px;
  background: linear-gradient(to bottom, #1f2937, #111827);
  border-bottom: 1px solid #374151;
}

.code-block::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow:
    18px 0 #f59e0b,
    36px 0 #22c55e;
} */

.code-block pre {
  margin: 0;
  padding: 1.25rem;
  overflow-x: auto;

  background: #111827;
  color: #e5e7eb;

  font-family: "SF Mono", "JetBrains Mono", "Fira Code", Consolas, monospace;

  font-size: 0.9rem;
  line-height: 1.7;
}

.code-block pre::-webkit-scrollbar {
  height: 8px;
}

.code-block pre::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 999px;
}

.code-block pre::-webkit-scrollbar-track {
  background: transparent;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 10;

  background: rgba(255, 255, 255, 0.08);
  color: #d1d5db;

  border: 1px solid rgba(255, 255, 255, 0.12);

  border-radius: 8px;

  padding: 0.45rem 0.8rem;

  font-size: 0.8rem;
  font-weight: 600;

  cursor: pointer;

  backdrop-filter: blur(8px);

  transition: 0.2s;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: white;
}

.copy-btn.copied {
  background: #10b981;
  color: white;
  border-color: #10b981;
}

/* ── Callout boxes ── */
.info-box {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  padding: 1rem;
  margin: 1.2rem 0;
  border-radius: 0.375rem;
  font-size: 0.95rem;
  line-height: 1.6;
}
.warning-box {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  padding: 1rem;
  margin: 1.2rem 0;
  border-radius: 0.375rem;
  font-size: 0.95rem;
}
.success-box {
  background: #f0fdf4;
  border-left: 4px solid #10b981;
  padding: 1rem;
  margin: 1.2rem 0;
  border-radius: 0.375rem;
  font-size: 0.95rem;
}

code {
  background: #f3f4f6;
  color: #1f2937;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-family: monospace;
  font-size: 0.9em;
}
pre code {
  background: none;
  color: inherit;
  padding: 0;
}

/* ── Footer ── */
footer {
  border-top: 1px solid #e5e7eb;
  padding: 3rem 0;
  margin-top: 4rem;
  background: #fafbfc;
}
.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-section h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-section ul {
  list-style: none;
}
.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 2rem 0;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: #6b7280;
  font-size: 0.85rem;
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .wrapper {
    padding: 0 1rem;
  }
  .hero h1 {
    font-size: 1.5rem;
  }
  .step h2 {
    font-size: 1.25rem;
  }
  .code-block pre {
    font-size: 0.8rem;
    padding: 0.75rem;
  }
  .copy-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    top: 0.5rem;
    right: 0.5rem;
  }
  .footer-content {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
  }
  .header-nav {
    display: none;
  }
}

a:focus,
button:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
