/* Obsidian-inspired blog layout */

* {
  box-sizing: border-box;
}

body {
  background: #1e1e1e;
  color: #dcddde;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  margin: 0;
  height: 100vh;
  display: flex;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: #202020;
  border-right: 1px solid #2d2d2d;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
  z-index: 10;
}

.sidebar.collapsed {
  width: 0;
  min-width: 0;
  border-right: none;
  overflow: hidden;
}

.sidebar-header {
  padding: 12px;
  border-bottom: 1px solid #2d2d2d;
  display: flex;
  align-items: center;
}

.sidebar-toggle {
  background: transparent;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.sidebar-toggle:hover {
  background: #2d2d2d;
  color: #dcddde;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.sidebar-item {
  padding: 6px 12px;
  margin: 2px 0;
  cursor: pointer;
  border-radius: 4px;
  color: #999;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item:hover {
  background: #2d2d2d;
  color: #dcddde;
}

.sidebar-item.active {
  background: #A68AF9;
  color: #fff;
}

/* Main Container */
.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Tab Bar */
.tab-bar {
  background: #1e1e1e;
  border-bottom: 1px solid #2d2d2d;
  display: flex;
  align-items: center;
  padding: 0 8px;
  min-height: 40px;
  overflow-x: auto;
  overflow-y: hidden;
}

.tab {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  margin: 4px 2px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #999;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  gap: 8px;
}

.tab:hover {
  background: #2d2d2d;
  color: #dcddde;
}

.tab.active {
  background: #2d2d2d;
  color: #dcddde;
}

.tab-close {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  opacity: 0.6;
  transition: opacity 0.15s, background 0.15s;
}

.tab-close:hover {
  opacity: 1;
  background: rgba(255,255,255,0.1);
}

.sidebar-toggle-main {
  background: transparent;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.sidebar.collapsed ~ .main-container .sidebar-toggle-main {
  display: flex;
}

.sidebar-toggle-main:hover {
  background: #2d2d2d;
  color: #dcddde;
}

/* Breadcrumb */
.breadcrumb {
  padding: 12px 24px;
  font-size: 12px;
  color: #999;
  background: #1e1e1e;
  border-bottom: 1px solid #2d2d2d;
}

.breadcrumb span {
  margin: 0 4px;
}

/* Content Area */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 48px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  min-height: 0;
  box-sizing: border-box;
}

.sidebar.collapsed ~ .main-container .content {
  max-width: 1200px;
}

/* Typography */
h1 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #dcddde;
}

h2 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #dcddde;
}

h3 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: normal;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: #dcddde;
}

h4, h5, h6 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: normal;
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
  color: #dcddde;
}

p {
  line-height: 1.7;
  margin: 1rem 0;
  color: #dcddde;
}

a {
  color: #A68AF9;
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: #c9b6ff;
}

ul, ol {
  margin-left: 1.5rem;
  line-height: 1.7;
}

li {
  margin: 0.5rem 0;
}

blockquote {
  border-left: 3px solid #A68AF9;
  margin: 1.5rem 0;
  padding: 0.5rem 0 0.5rem 1.5rem;
  color: #999;
  font-style: italic;
}

code {
  background: #2d2d2d;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  color: #A68AF9;
}

pre {
  background: #2d2d2d;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code {
  background: transparent;
  padding: 0;
  color: #dcddde;
}

img {
  max-width: 100%;
  border-radius: 6px;
  margin: 1.5rem 0;
}

hr {
  border: none;
  border-top: 1px solid #2d2d2d;
  margin: 2rem 0;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
  background: #3d3d3d;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4d4d4d;
}
