/* EqualMaple Blog - Chirpy-style Theme */

:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --text-muted: #6c757d;
  --border-color: #eaeaea;
  --sidebar-bg: #f8f9fa;
  --card-bg: #ffffff;
  --link-color: #2563eb;
  --link-hover: #1d4ed8;
  --code-bg: #f6f8fa;
  --tag-bg: #e8f4f8;
  --tag-color: #0366d6;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
}

[data-theme="dark"] {
  --bg-color: #1a1a2e;
  --text-color: #e0e0e0;
  --text-muted: #a0a0a0;
  --border-color: #2d2d44;
  --sidebar-bg: #16213e;
  --card-bg: #1f1f38;
  --link-color: #60a5fa;
  --link-hover: #93c5fd;
  --code-bg: #2d2d44;
  --tag-bg: #1e3a5f;
  --tag-color: #60a5fa;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

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

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

.container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  transition: var(--transition);
}

.sidebar-header {
  text-align: center;
  margin-bottom: 2rem;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 2rem;
  color: white;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.site-description {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.sidebar-nav {
  flex: 1;
  margin-bottom: 2rem;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
  border-radius: 8px;
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition);
}

.nav-item:hover {
  background-color: var(--border-color);
}

.nav-item.active {
  background-color: var(--link-color);
  color: white;
}

.nav-item i {
  width: 20px;
  margin-right: 0.75rem;
}

.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.social-links a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition);
}

.social-links a:hover {
  background-color: var(--link-color);
  color: white;
}

.theme-toggle {
  text-align: center;
}

.theme-toggle button {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-color);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition);
}

.theme-toggle button:hover {
  background-color: var(--border-color);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 2rem 3rem;
  max-width: 900px;
}

.content-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.content-header h2 {
  font-size: 1.75rem;
  font-weight: 600;
}

/* Post List */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-item {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  transition: var(--transition);
}

.post-item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.post-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.post-title a {
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition);
}

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

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.post-meta i {
  margin-right: 0.25rem;
}

.post-excerpt {
  color: var(--text-muted);
  line-height: 1.7;
}

.post-tags {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: var(--tag-bg);
  color: var(--tag-color);
  border-radius: 4px;
  font-size: 0.8rem;
  text-decoration: none;
  transition: var(--transition);
}

.tag:hover {
  opacity: 0.8;
}

/* Post Content */
.post-content {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.post-content h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.post-content h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
}

.post-content h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
}

.post-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.post-content ul, .post-content ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content code {
  background-color: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: "Courier New", monospace;
  font-size: 0.9em;
}

.post-content pre {
  background-color: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0;
}

.post-content pre code {
  background: none;
  padding: 0;
}

/* Categories & Tags Pages */
.category-group, .tag-group {
  margin-bottom: 2rem;
}

.category-title, .tag-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--link-color);
}

.category-count, .tag-count {
  display: inline-block;
  background-color: var(--tag-bg);
  color: var(--tag-color);
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

.post-list-compact {
  list-style: none;
}

.post-list-compact li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.post-list-compact li:last-child {
  border-bottom: none;
}

.post-list-compact a {
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition);
}

.post-list-compact a:hover {
  color: var(--link-color);
}

.post-date {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-left: 0.5rem;
}

/* Archives */
.archive-year {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: var(--link-color);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  color: var(--text-color);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
  background-color: var(--link-color);
  color: white;
  border-color: var(--link-color);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination .active {
  background-color: var(--link-color);
  color: white;
  border-color: var(--link-color);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--link-color);
  color: white;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 1000;
  box-shadow: var(--shadow);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 999;
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
    padding: 1rem;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .post-title {
    font-size: 1.25rem;
  }
}

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

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
