/* ===================================================================
   LoreForge Documentation — style.css
   Dark theme: #0a0a0f bg, #7c6af7 accent, white text
   =================================================================== */

/* --- Reset & Base -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0a0a0f;
  --bg-surface:  #12121a;
  --bg-raised:   #1a1a26;
  --bg-code:     #15151f;
  --border:      #2a2a3a;
  --text:        #e8e8f0;
  --text-muted:  #9090a8;
  --accent:      #7c6af7;
  --accent-glow: rgba(124, 106, 247, 0.25);
  --accent-hover:#9585ff;
  --success:     #34d399;
  --warning:     #fbbf24;
  --danger:      #f87171;
  --sidebar-w:   280px;
  --header-h:    60px;
  --content-max: 860px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; }

/* --- Header -------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
}

.site-header .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.site-header .logo span { color: var(--text); }

.header-links {
  margin-left: auto;
  display: flex;
  gap: 20px;
  align-items: center;
}
.header-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color .15s;
}
.header-links a:hover { color: var(--accent); }

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  margin-right: 16px;
  padding: 4px;
  line-height: 1;
}

/* --- Sidebar ------------------------------------------------------- */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 24px 0;
  z-index: 90;
  transition: transform .25s ease;
}

.sidebar nav { padding: 0 16px; }

.sidebar .nav-section {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 20px 0 8px;
}
.sidebar .nav-section:first-child { margin-top: 0; }

.sidebar a {
  display: block;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all .15s;
}
.sidebar a:hover {
  color: var(--text);
  background: var(--bg-raised);
}
.sidebar a.active {
  color: var(--accent);
  background: var(--accent-glow);
  font-weight: 600;
}

/* --- Main content -------------------------------------------------- */
.main {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  padding: 48px 48px 96px;
  min-height: calc(100vh - var(--header-h));
}

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

/* --- Typography ---------------------------------------------------- */
h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  color: #fff;
}
h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 48px 0 16px;
  color: #fff;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 32px 0 12px;
  color: #fff;
}
h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--text);
}

p { margin-bottom: 16px; }
p.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

ul, ol { margin: 0 0 16px 24px; }
li { margin-bottom: 6px; }
li code { font-size: 0.88em; }

strong { color: #fff; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* --- Code ---------------------------------------------------------- */
code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--accent-hover);
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  overflow-x: auto;
  margin-bottom: 24px;
  line-height: 1.55;
}
pre code {
  background: none;
  padding: 0;
  font-size: 0.88rem;
  color: var(--text);
}

/* --- Tables -------------------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-raised);
}
td code {
  font-size: 0.84em;
}

/* --- Cards --------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  transition: border-color .2s, box-shadow .2s;
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px var(--accent-glow);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
.card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.card .icon {
  font-size: 1.6rem;
  margin-bottom: 12px;
  display: block;
}

/* --- Badges / Tags ------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-get    { background: rgba(52,211,153,0.15); color: var(--success); }
.badge-post   { background: rgba(124,106,247,0.15); color: var(--accent); }
.badge-put    { background: rgba(251,191,36,0.15); color: var(--warning); }
.badge-delete { background: rgba(248,113,113,0.15); color: var(--danger); }
.badge-patch  { background: rgba(251,191,36,0.15); color: var(--warning); }

/* --- Endpoint rows ------------------------------------------------- */
.endpoint-group { margin-bottom: 40px; }
.endpoint-group h3 { margin-bottom: 16px; }

.endpoint {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.endpoint:last-child { border-bottom: none; }

.endpoint .method { min-width: 70px; }
.endpoint .path {
  font-family: 'SFMono-Regular', Consolas, monospace;
  color: var(--text);
  font-size: 0.88rem;
}
.endpoint .desc {
  color: var(--text-muted);
  margin-left: auto;
  text-align: right;
  font-size: 0.85rem;
}

/* --- Callouts ------------------------------------------------------ */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--bg-raised);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 24px;
}
.callout.warning {
  border-left-color: var(--warning);
}
.callout.success {
  border-left-color: var(--success);
}
.callout strong {
  display: block;
  margin-bottom: 4px;
}

/* --- Prev / Next navigation ---------------------------------------- */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  gap: 16px;
}
.page-nav a {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color .2s;
  min-width: 180px;
}
.page-nav a:hover { border-color: var(--accent); }
.page-nav .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.page-nav .title {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}
.page-nav .next { text-align: right; margin-left: auto; }

/* --- Hero (landing page) ------------------------------------------- */
.hero {
  text-align: center;
  padding: 80px 0 64px;
}
.hero h1 {
  font-size: 3rem;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--accent), #a78bfa, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all .2s;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  box-shadow: 0 0 24px var(--accent-glow);
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Feature grid (landing) ---------------------------------------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  margin: 48px 0;
}

/* --- FAQ ----------------------------------------------------------- */
.faq-item { margin-bottom: 32px; }
.faq-item h3 {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 1.05rem;
}
.faq-item p { color: var(--text-muted); }

/* --- Footer -------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 48px;
  margin-left: var(--sidebar-w);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Mobile -------------------------------------------------------- */
@media (max-width: 900px) {
  .hamburger { display: block; }

  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0,0,0,0.5);
  }

  .main { margin-left: 0; padding: 32px 20px 80px; }
  .site-footer { margin-left: 0; padding: 24px 20px; }

  h1 { font-size: 1.75rem; }
  .hero h1 { font-size: 2.25rem; }
  .hero { padding: 48px 0 32px; }

  .endpoint {
    flex-wrap: wrap;
  }
  .endpoint .desc {
    margin-left: 0;
    text-align: left;
    flex-basis: 100%;
  }

  .page-nav { flex-direction: column; }
  .page-nav a { min-width: 0; }
  .page-nav .next { text-align: left; }
}

/* Sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 85;
}
@media (max-width: 900px) {
  .sidebar-overlay.open { display: block; }
}

/* --- Utilities ----------------------------------------------------- */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-center { text-align: center; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip: rect(0,0,0,0); overflow: hidden;
}
