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

:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --text-color: #333;
  --bg-color: #fff;
  --sidebar-bg: #f8f9fa;
  --border-color: #dee2e6;
  --link-color: #3498db;
  --link-hover: #2980b9;
  --header-height: 60px;
  --sidebar-width: 280px;
  --footer-height: 120px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

/* External link indicator */
a[href^=http]::after,
a[href^="//"]::after {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-left: 0.15em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-weight: 600;
  line-height: 1.3;
  color: var(--primary-color);
}

h1 {
  font-size: 2.5em;
}

h2 {
  font-size: 2em;
}

h3 {
  font-size: 1.5em;
}

h4 {
  font-size: 1.25em;
}

/* Anchor links on headings */
h1, h2, h3, h4, h5, h6 {
  position: relative;
}
h1 .heading-anchor, h2 .heading-anchor, h3 .heading-anchor, h4 .heading-anchor, h5 .heading-anchor, h6 .heading-anchor {
  position: absolute;
  left: -1.2em;
  top: 0;
  color: var(--border-color);
  text-decoration: none;
  font-weight: 400;
  opacity: 0;
  transition: opacity 0.2s ease;
}
h1 .heading-anchor::after, h2 .heading-anchor::after, h3 .heading-anchor::after, h4 .heading-anchor::after, h5 .heading-anchor::after, h6 .heading-anchor::after {
  content: none; /* override external link indicator */
}
h1:hover .heading-anchor, h2:hover .heading-anchor, h3:hover .heading-anchor, h4:hover .heading-anchor, h5:hover .heading-anchor, h6:hover .heading-anchor {
  opacity: 1;
}
h1 .heading-anchor:hover, h2 .heading-anchor:hover, h3 .heading-anchor:hover, h4 .heading-anchor:hover, h5 .heading-anchor:hover, h6 .heading-anchor:hover {
  color: var(--link-color);
}

p {
  margin-bottom: 1em;
}

code {
  background-color: #f4f4f4;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: "SF Mono", Monaco, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

pre {
  background-color: #f4f4f4;
  padding: 1em;
  border-radius: 5px;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  margin-bottom: 1em;
}

pre code {
  background-color: transparent;
  padding: 0;
}

blockquote {
  border-left: 4px solid var(--secondary-color);
  padding-left: 1em;
  margin: 1em 0;
  color: #666;
  font-style: italic;
}

/* Callout blocks: <div class="callout-note"> etc. */
.callout-note, .callout-important, .callout-warning, .callout-tip {
  border-left: 4px solid;
  border-radius: 5px;
  padding: 0.75em 1em;
  margin: 1em 0;
}
.callout-note > p:first-child, .callout-important > p:first-child, .callout-warning > p:first-child, .callout-tip > p:first-child {
  font-weight: 600;
  margin-bottom: 0.25em;
}

.callout-note {
  border-left-color: #3498db;
  background-color: #ebf5fb;
}

.callout-important {
  border-left-color: #8e44ad;
  background-color: #f4ecf7;
}

.callout-warning {
  border-left-color: #e67e22;
  background-color: #fef5e7;
}

.callout-tip {
  border-left-color: #27ae60;
  background-color: #eafaf1;
}

ul, ol {
  margin-left: 2em;
  margin-bottom: 1em;
}

li {
  margin-bottom: 0.5em;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
}

th, td {
  padding: 0.75em;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--sidebar-bg);
  font-weight: 600;
}

/* Layout */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  display: flex;
  flex: 1;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

.content {
  flex: 1;
  padding: 2em 3em;
  max-width: 900px;
  margin-left: var(--sidebar-width);
}

.page {
  max-width: 100%;
}

.page-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 3em;
  padding-top: 2em;
  border-top: 1px solid var(--border-color);
}

.page-navigation a {
  padding: 0.5em 1em;
  background-color: var(--sidebar-bg);
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.page-navigation a:hover {
  background-color: var(--border-color);
}

.page-navigation .prev {
  margin-right: auto;
}

.page-navigation .next {
  margin-left: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
}
/* Left Sidebar - site navigation */
.sidebar {
  position: fixed;
  left: 0;
  top: var(--header-height);
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  z-index: 100;
}

.sidebar-content {
  padding: 1.5em;
}

.sidebar-section {
  margin-bottom: 2em;
}

.sidebar-section h3 {
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0;
  margin-bottom: 1em;
  color: #666;
  font-weight: 600;
}

.sidebar nav ul {
  list-style: none;
  margin: 0;
}

.sidebar nav li {
  margin-bottom: 0.5em;
}

.sidebar nav a {
  display: block;
  padding: 0.4em 0.8em;
  color: var(--text-color);
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.sidebar nav a:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--link-color);
}

.sidebar nav a.active {
  background-color: var(--secondary-color);
  color: white;
}

/* Export section */
.export-section {
  margin-top: auto;
  padding-top: 1em;
  border-top: 1px solid var(--border-color);
}

.btn-export {
  display: block;
  text-align: center;
  padding: 0.75em 1em;
  background-color: var(--secondary-color);
  color: white;
  border-radius: 4px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.btn-export:hover {
  background-color: var(--link-hover);
  color: white;
}

/* Hierarchical navigation */
.category-item {
  margin-bottom: 0.3em;
}

.category-header {
  display: flex;
  align-items: center;
  padding: 0.4em 0.8em;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  user-select: none;
}

.category-header:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.category-toggle {
  display: inline-block;
  width: 1em;
  margin-right: 0.5em;
  font-size: 0.8em;
  transition: transform 0.2s ease;
}

.category-name {
  font-weight: 600;
  color: var(--primary-color);
}

.category-children {
  list-style: none;
  margin-left: 0;
  margin-top: 0.3em;
  padding-left: 0;
}

.category-children li {
  margin-bottom: 0.3em;
}

.sidebar .category-children a {
  padding-left: 2.3em !important;
  font-size: 0.95em;
}

.category-item.expanded .category-toggle {
  transform: rotate(0deg);
}

/* Right TOC panel - toggle button */
.toc-toggle {
  position: fixed;
  right: 1em;
  bottom: 1.5em;
  z-index: 200;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background-color: var(--secondary-color);
  color: white;
  font-size: 1.4em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: background-color 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toc-toggle:hover {
  background-color: var(--link-hover);
  transform: scale(1.05);
}

/* Right TOC panel - overlay backdrop */
.toc-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 299;
}

.toc-overlay.active {
  display: block;
}

/* Right TOC panel */
.toc-panel {
  position: fixed;
  right: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--sidebar-bg);
  border-left: 1px solid var(--border-color);
  overflow-y: auto;
  z-index: 300;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
}

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

.toc-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1em 1.5em;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.95em;
}

.toc-panel-close {
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  color: #666;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease;
}

.toc-panel-close:hover {
  color: var(--text-color);
}

.toc-panel-content {
  padding: 1.5em;
}

/* Table of Contents styles */
.toc ul {
  list-style: none;
  margin: 0;
}

.toc li {
  margin-bottom: 0.3em;
}

.toc a {
  display: block;
  font-size: 0.9em;
  padding: 0.3em 0.6em;
  color: var(--text-color);
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.toc a:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--link-color);
}

.toc a.active {
  background-color: var(--secondary-color);
  color: white;
}

.toc ul ul {
  margin-left: 1em;
  margin-top: 0.3em;
}

.no-toc {
  color: #999;
  font-size: 0.9em;
  font-style: italic;
}

/* Sidebar overlay backdrop (mobile only) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    width: 280px;
    height: calc(100vh - var(--header-height));
    border-right: 1px solid var(--border-color);
    border-bottom: none;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .content {
    margin-left: 0;
    padding: 1em;
  }
  .site-header .header-content {
    padding: 0 1em;
  }
  .toc-panel {
    width: 85vw;
    max-width: 320px;
  }
}
/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  overflow: visible;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2em;
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* Hamburger toggle - hidden on desktop */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5em;
  margin-right: 0.5em;
  flex-shrink: 0;
}

.sidebar-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: white;
  margin: 5px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.sidebar-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.sidebar-toggle.active span:nth-child(2) {
  opacity: 0;
}

.sidebar-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.site-title a {
  font-size: 1.5em;
  font-weight: 700;
  color: white;
}

.site-title a:hover {
  color: #ecf0f1;
}

.top-nav {
  display: flex;
  gap: 1.5em;
}

.top-nav a {
  color: white;
  padding: 0.5em 1em;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.top-nav a:hover,
.top-nav a.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.search-container {
  position: relative;
  max-width: 300px;
}

/* Glossary toggle in header */
.glossary-toggle {
  display: flex;
  align-items: center;
  gap: 0.4em;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  padding: 0.3em 0.6em;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}
.glossary-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}
.glossary-toggle input[type=checkbox] {
  accent-color: white;
  cursor: pointer;
}

#search-input {
  width: 100%;
  padding: 0.5em 1em;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.9em;
}

#search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

#search-input:focus {
  outline: none;
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
  .sidebar-toggle {
    display: block;
  }
  .site-title a {
    font-size: 1.1em;
  }
  .site-title {
    white-space: nowrap;
  }
  .top-nav {
    display: none;
  }
  .glossary-toggle {
    display: none;
  }
  .search-container {
    flex-shrink: 1;
    min-width: 0;
    max-width: 150px;
  }
  #search-input {
    font-size: 0.8em;
    padding: 0.4em 0.6em;
  }
}
/* Footer */
.site-footer {
  background-color: var(--primary-color);
  color: white;
  padding: 2em 0;
  margin-top: auto;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2em;
  text-align: center;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 2em;
  margin-bottom: 1.5em;
  padding-bottom: 1em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-nav a {
  color: white;
  transition: opacity 0.3s ease;
}

.footer-nav a:hover {
  opacity: 0.8;
  color: white;
}

.footer-info p {
  margin: 0.5em 0;
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.8);
}

/* Search */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.5em;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 1001;
}

.search-results.active {
  display: block;
}

.search-result {
  padding: 1em;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-result:hover {
  background-color: var(--sidebar-bg);
}

.search-result:last-child {
  border-bottom: none;
}

.search-result-title {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.3em;
}

.search-result-excerpt {
  font-size: 0.9em;
  color: #666;
  line-height: 1.4;
}

.search-result-excerpt mark {
  background-color: #fff3cd;
  padding: 2px 4px;
  border-radius: 2px;
}

.search-no-results {
  padding: 1em;
  text-align: center;
  color: #666;
  font-style: italic;
}

/* Autocomplete suggestions */
.search-suggestion {
  padding: 0.6em 1em;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.15em;
}

.search-suggestion:last-child {
  border-bottom: none;
}

.search-suggestion:hover,
.search-suggestion.selected {
  background-color: var(--sidebar-bg);
}

.search-suggestion-title {
  font-weight: 500;
  color: var(--text-color);
  font-size: 0.95em;
}
.search-suggestion-title mark {
  background-color: #fff3cd;
  padding: 1px 2px;
  border-radius: 2px;
  font-weight: 600;
}

.search-suggestion-desc {
  font-size: 0.8em;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Glossary */
/* Glossary page styling */
.glossary-entry {
  margin-bottom: 2em;
  padding-bottom: 1.5em;
  border-bottom: 1px solid var(--border-color);
}

.glossary-entry:last-child {
  border-bottom: none;
}

.glossary-entry h3 {
  margin-top: 0;
  color: var(--primary-color);
}

/* Auto-linked glossary terms in content */
.glossary-link {
  text-decoration: none;
  color: inherit;
}

.glossary-term {
  position: relative;
  border-bottom: 1px dotted var(--link-color);
  cursor: help;
  display: inline-block;
}

.glossary-link:hover .glossary-term {
  border-bottom-color: var(--link-hover);
}

/* Glossary-annotated links (existing <a> tags with tooltips) */
a.glossary-annotated {
  border-bottom: 1px dotted var(--link-color);
  cursor: help;
}

.glossary-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background-color: var(--primary-color);
  color: white;
  padding: 0.75em 1em;
  border-radius: 6px;
  font-size: 0.875rem;
  line-height: 1.4;
  white-space: normal;
  width: 300px;
  max-width: 80vw;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  text-align: left;
}

/* Tooltip arrow */
.glossary-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--primary-color);
}

/* Show tooltip on hover or tap */
.glossary-term:hover .glossary-tooltip,
.glossary-term.glossary-active .glossary-tooltip {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* Tooltip link */
.glossary-tooltip-link {
  display: block;
  margin-top: 0.5em;
  color: white;
  text-decoration: underline;
  font-size: 0.8rem;
  opacity: 0.85;
}
.glossary-tooltip-link:hover {
  opacity: 1;
}

/* Adjust tooltip position if near edges */
.glossary-term .glossary-tooltip {
  margin-bottom: 8px;
}

/* Print styles - hide tooltips */
@media print {
  .glossary-tooltip {
    display: none;
  }
  .glossary-term {
    border-bottom: none;
  }
}
.hashtag {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
}
.hashtag:hover {
  text-decoration: underline;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  margin-top: 2em;
}

.tag-link {
  display: inline-flex;
  align-items: baseline;
  padding: 0.5em 1em;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.2s ease;
}
.tag-link:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.tag-name {
  font-weight: 500;
}

.tag-count {
  margin-left: 0.5em;
  font-size: 0.9em;
  opacity: 0.7;
}

.tag-posts {
  list-style: none;
  padding: 0;
  margin-top: 2em;
}
.tag-posts li {
  margin-bottom: 1.5em;
  padding-bottom: 1.5em;
  border-bottom: 1px solid var(--border-color);
}
.tag-posts li:last-child {
  border-bottom: none;
}
.tag-posts a {
  font-size: 1.2em;
  font-weight: 500;
}
.tag-posts .post-description {
  margin-top: 0.5em;
  color: var(--text-muted);
}

.page-footer {
  margin-top: 3em;
  padding-top: 1.5em;
  border-top: 1px solid var(--border-color);
}

.last-modified {
  font-size: 0.9em;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

.recent-updates {
  list-style: none;
  padding: 0;
  margin-top: 2em;
}
.recent-updates li {
  margin-bottom: 2em;
  padding-bottom: 2em;
  border-bottom: 1px solid var(--border-color);
}
.recent-updates li:last-child {
  border-bottom: none;
}

.update-entry {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.update-title {
  font-size: 1.2em;
  font-weight: 500;
  text-decoration: none;
  color: var(--link-color);
}
.update-title:hover {
  text-decoration: underline;
}

.update-date {
  font-size: 0.9em;
  color: var(--text-muted);
  font-style: italic;
}

.update-description {
  margin: 0.5em 0 0 0;
  color: var(--text-muted);
}

/*# sourceMappingURL=main.css.map */