/* Axis Mundi - Parchment Theme */
:root {
  --bg-primary: #f4e4c1;
  --bg-secondary: #e8d5a3;
  --bg-tertiary: #d4c089;
  --bg-panel: #f0dbb5;
  --text-primary: #3e2c1a;
  --text-secondary: #5a4430;
  --text-muted: #8a7460;
  --accent: #8b4513;
  --accent-hover: #a0522d;
  --border: #c4a872;
  --shadow: rgba(62, 44, 26, 0.3);
  --poi-glow: rgba(139, 69, 19, 0.4);
  --font-body: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  --font-heading: Georgia, 'Times New Roman', serif;
  --font-mono: 'Courier New', monospace;
  --radius: 4px;
  --radius-lg: 8px;
  --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  margin-bottom: 0.5em;
}

h1 { font-size: 2em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.25em; }

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

a:hover { color: var(--accent-hover); }

button {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5em 1em;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--transition);
}

button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
}

input, textarea, select {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5em;
  font-family: var(--font-body);
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

textarea {
  font-family: var(--font-mono);
  resize: vertical;
}

.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 100vh;
  background: var(--bg-panel);
  border-left: 3px double var(--border);
  box-shadow: -4px 0 20px var(--shadow);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
  padding: 1.5em;
}

.side-panel.open { transform: translateX(0); }

.side-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1em;
  padding-bottom: 0.5em;
  border-bottom: 2px solid var(--border);
}

.side-panel-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5em;
  cursor: pointer;
}

.side-panel-close:hover { color: var(--accent); }

.poi-marker {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: all var(--transition);
  z-index: 10;
  user-select: none;
}

.poi-marker:hover {
  transform: translate(-50%, -50%) scale(1.3);
  z-index: 20;
}

.poi-marker.active {
  transform: translate(-50%, -50%) scale(1.3);
  z-index: 20;
  box-shadow: 0 0 12px var(--poi-glow);
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  font-size: 0.8em;
  font-weight: 600;
  white-space: nowrap;
}

.markdown-content { line-height: 1.8; }
.markdown-content h1 { border-bottom: 2px solid var(--border); padding-bottom: 0.3em; }
.markdown-content h2 { border-bottom: 1px solid var(--border); padding-bottom: 0.2em; }
.markdown-content ul, .markdown-content ol { padding-left: 1.5em; margin: 0.5em 0; }
.markdown-content li { margin: 0.3em 0; }
.markdown-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1em;
  margin: 1em 0;
  color: var(--text-secondary);
  font-style: italic;
}
.markdown-content code {
  background: var(--bg-secondary);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.markdown-content pre {
  background: var(--bg-secondary);
  padding: 1em;
  border-radius: var(--radius);
  overflow-x: auto;
}
.markdown-content pre code { background: none; padding: 0; }
.markdown-content img { max-width: 100%; border-radius: var(--radius); }
.markdown-content table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.markdown-content th, .markdown-content td { border: 1px solid var(--border); padding: 0.5em; text-align: left; }
.markdown-content th { background: var(--bg-secondary); }

.poi-link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
}

.poi-link:hover {
  color: var(--accent-hover);
  text-decoration-style: solid;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
