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

html, body { height: 100%; }

body {
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  line-height: 1.6;
  font-size: 16px;
  transition: background-color 0.3s, color 0.3s;
}

.site-wrapper {
  display: flex;
  height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 260px;
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  padding: 1rem 0 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  overflow-y: auto;
  transition: width 0.3s ease, padding 0.3s ease;
  position: sticky;
  top: 0;
  max-height: 100vh;
}

.sidebar.collapsed {
  width: 70px;
  padding: 1rem 0;
}

.sidebar.collapsed .sidebar-header,
.sidebar.collapsed .sidebar-content {
  display: none;
}

.sidebar.collapsed .sidebar-icons {
  display: flex;
}

.sidebar.collapsed .sidebar-collapse-btn {
  margin-left: 0;
  align-self: center;
}

.sidebar-collapse-btn {
  align-self: flex-start;
  margin-left: 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.sidebar-header {
  text-align: center;
  padding: 0 1.5rem;
  width: 100%;
}

.sidebar-header .avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  margin-bottom: 1rem;
  object-fit: cover;
}

.sidebar-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar-content {
  flex: 1;
  width: 100%;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.resume-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: background-color 0.2s;
}

.resume-btn:hover {
  background: var(--accent-hover);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
}

.nav-link:hover {
  background: var(--accent-ghost);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--accent-ghost);
  color: var(--accent);
  font-weight: 500;
}

.nav-icon {
  display: inline-flex;
  width: 20px;
  justify-content: center;
}

.nav-label {
  flex: 1;
}

/* Collapsed sidebar icon list */
.sidebar-icons {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  align-items: center;
  padding: 1rem 0;
}

.sidebar-icon-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 20px;
  transition: color 0.2s;
}

.sidebar-icon-link:hover {
  color: var(--accent);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.top-bar {
  background: var(--surface-0);
  border-bottom: 1px solid var(--border-neutral);
  padding: 1rem 2rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 60px;
  flex-shrink: 0;
}

.theme-toggle {
  background: var(--surface-2);
  border: 1px solid var(--border-neutral);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-toggle:hover {
  background: var(--accent-ghost);
  color: var(--text-primary);
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

/* ===== HERO ===== */
.hero {
  text-align: center;
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.hero p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-size: 18px;
  font-weight: 600;
  margin: 2rem 0 1.5rem 0;
}

/* ===== POSTS LIST ===== */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-card {
  border: 1px solid var(--border-neutral);
  padding: 1.5rem;
  border-radius: 8px;
  background: var(--surface-0);
  transition: all 0.2s;
}

.post-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(9, 105, 218, 0.1);
}

.post-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.post-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

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

.post-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ===== SUBSCRIBE SECTION ===== */
.subscribe-section {
  background: var(--surface-2);
  border: 1px solid var(--border-neutral);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  margin-top: 2rem;
}

.subscribe-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.subscribe-section p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.connect-icons {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.connect-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-neutral);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 18px;
  transition: all 0.2s;
}

.connect-icons a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-ghost);
}

/* ===== SINGLE POST ===== */
.post-title-full {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 1rem;
}

.post-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.post-body {
  font-size: 16px;
  line-height: 1.8;
}

.post-body h2, .post-body h3, .post-body h4 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.post-body h2 { font-size: 24px; }
.post-body h3 { font-size: 20px; }
.post-body h4 { font-size: 18px; }

.post-body p {
  margin-bottom: 1rem;
}

.post-body ul, .post-body ol {
  margin: 1rem 0 1rem 2rem;
}

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

.post-body blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.post-body code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-body pre {
  background: var(--surface-2);
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-neutral);
}

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

.post-body a {
  color: var(--accent);
  text-decoration: underline;
}

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

/* ===== PAGE ===== */
.page-full h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.page-body {
  font-size: 16px;
  line-height: 1.8;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface-1);
}

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

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
  }

  .site-wrapper {
    flex-direction: column;
  }

  .main-content {
    width: 100%;
  }

  .content-area {
    padding: 1.5rem;
  }

  .hero h1 {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .top-bar {
    padding: 0.75rem 1rem;
  }

  .content-area {
    padding: 1rem;
  }

  .post-card {
    padding: 1rem;
  }
}
