/* TileForge Studio — Wiki Help System */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0d0d14;
  --bg-surface: #13131f;
  --bg-elevated: #1a1a2e;
  --bg-hover: #22223a;
  --text: #f2e9dd;
  --text-muted: #9a9aab;
  --gold: #d4a04a;
  --blue: #3ba8ff;
  --border: #2a2a3e;
  --sidebar-width: 260px;
  --font-heading: 'Cinzel', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.7;
  min-height: 100vh;
}

/* Layout */
.wiki-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.wiki-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  text-decoration: none;
}

.sidebar-brand img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.sidebar-brand .brand-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--gold);
}

.sidebar-brand .brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-top: -2px;
}

.sidebar-section {
  padding: 8px 20px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.sidebar-link {
  display: block;
  padding: 6px 20px 6px 28px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover {
  background: var(--bg-hover);
  color: var(--gold);
}

.sidebar-link.active {
  background: var(--bg-elevated);
  color: var(--gold);
  border-left: 3px solid var(--gold);
  padding-left: 25px;
}

/* Main content */
.wiki-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  max-width: 900px;
  padding: 32px 48px 80px;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--blue);
  text-decoration: none;
}

.breadcrumbs a:hover { text-decoration: underline; }

.breadcrumbs .sep { color: var(--text-muted); }

/* Headings */
h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--gold);
  margin-bottom: 8px;
  line-height: 1.2;
}

h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--gold);
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 32px;
  margin-bottom: 12px;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 24px;
  margin-bottom: 8px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 32px;
}

p { margin-bottom: 16px; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Lists */
ul, ol { margin: 0 0 16px 24px; }
li { margin-bottom: 6px; }

/* Code */
code {
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--gold);
}

pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
}

pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

th, td {
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--border);
}

th {
  background: var(--bg-elevated);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gold);
}

td { font-size: 0.9rem; }

tr:hover { background: var(--bg-surface); }

/* Keyboard shortcut styling */
kbd {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--border);
  color: var(--text);
  min-width: 24px;
  text-align: center;
}

/* Info/tip boxes */
.info-box {
  background: var(--bg-elevated);
  border-left: 4px solid var(--blue);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 20px;
}

.info-box.tip { border-left-color: #4caf50; }
.info-box.warning { border-left-color: #ff9800; }

.info-box strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

/* Related topics box */
.related-topics {
  margin-top: 56px;
  padding: 20px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.related-topics h3 {
  margin-top: 0;
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: 12px;
}

.related-topics ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.related-topics li {
  margin: 0;
}

.related-topics a {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  transition: border-color 0.15s, color 0.15s;
}

.related-topics a:hover {
  border-color: var(--gold);
  color: var(--gold);
  text-decoration: none;
}

/* Cards grid for index page */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, transform 0.15s;
}

.card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  text-decoration: none;
}

.card .card-title {
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: 6px;
}

.card .card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Anchor offset for fixed sidebar */
:target { scroll-margin-top: 20px; }

/* Responsive */
@media (max-width: 800px) {
  .wiki-sidebar {
    position: relative;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .wiki-main {
    margin-left: 0;
    padding: 24px 20px 60px;
  }
  .wiki-layout { flex-direction: column; }
}
