/* ============================================================
   GLOBAL
   ============================================================ */
body {
  background-color: #f8f8f6;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1a1a1a;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 33.333%;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 40px 32px;
  z-index: 100;
  overflow-y: auto;
}

.avatar-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #e5e5e5;
  background: #e0e7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  color: #4f46e5;
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #1a1a1a;
}

.site-tagline {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.6;
}

/* ── Nav links ── */
.sidebar-nav {
  display: inline-flex;
  /* display: flex; */
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin-top: 48px;
  margin-bottom: 48px;
}

.sidebar-nav a {
  font-size: 0.85rem;
  font-weight: 500;
  color: #555;
  text-decoration: none;
  transition: color 0.15s ease;
}

.sidebar-nav a:hover {
  color: #1a1a1a;
}

.sidebar-nav a.active {
  color: #1a1a1a;
  font-weight: 600;
}

/* ── Social icons ── */
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  color: #666;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.social-links a:hover {
  color: #1a1a1a;
  border-color: #bbb;
  background: #f4f4f4;
}

.sidebar-footer {
  font-size: 0.75rem;
  color: #aaa;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
#main {
  margin-left: 33.333%;
  padding: 48px 40px;
  min-height: 100vh;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #aaa;
}

/* ============================================================
   PROJECT CARDS (index.html — 2-per-row grid)
   ============================================================ */
.project-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  height: 100%;
  min-height: 120px;
}

.project-card:hover {
  border-color: #ccc;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  color: inherit;
}

/* Inner content div stretches to fill card height */
.project-card > div:last-child {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-card .card-desc {
  flex: 1;
}

.card-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #e5e5e5;
}

.card-thumb-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  flex-shrink: 0;
  background: #f4f4f0;
  border: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #bbb;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.card-desc {
  font-size: 0.8rem;
  color: #777;
  line-height: 1.6;
  margin: 0;
}

/* ============================================================
   BLOG CARDS (index.html — no image, equal height)
   ============================================================ */
.blog-card {
  flex-direction: column;
}

.card-date {
  font-size: 0.72rem;
  color: #aaa;
  margin-bottom: 8px;
}

.blog-card .card-desc {
  flex: 1;
}

/* ============================================================
   ARTICLE PAGE (article.html — single full-width card)
   ============================================================ */
.article-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  padding: 48px 52px;
}

.article-card .article-meta {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #aaa;
}

.article-card .article-headline {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.5px;
  color: #1a1a1a;
}

.article-card .article-body p {
  font-size: 1rem;
  color: #444;
  line-height: 1.8;
}

.article-card .article-body p + p {
  margin-top: 1.25rem;
}

.article-card .article-body a {
  font-weight: 700;
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.15s ease;
}

.article-card .article-body a:hover {
  color: #444;
  text-decoration: underline;
}

.article-divider {
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 2rem 0;
}

/* ── Sidebar header (avatar + title/tagline) ── */
.sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0;
}

.sidebar-header .avatar-circle {
  margin-bottom: 20px;
}

.sidebar-header-text .site-tagline {
  margin-bottom: 0;
}

.sidebar-header-text a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.15s ease;
}

.sidebar-header-text a:hover {
  color: #555;
}

/* ============================================================
   VIEW COUNT
   ============================================================ */
.view-count {
  font-size: 0.72rem;
  color: #bbb;
  margin-top: 2rem;
  margin-bottom: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
  #sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e5e5e5;
    padding: 32px 24px;
  }

  /* Avatar left, title + tagline alongside it */
  .sidebar-header {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    margin-bottom: 0;
  }

  .sidebar-header .avatar-circle {
    flex-shrink: 0;
    margin-bottom: 0;
  }

  .sidebar-header-text .site-tagline {
    margin-bottom: 0;
  }

  .sidebar-nav {
    margin-top: 24px;
    margin-bottom: 24px;
  }

  #main {
    margin-left: 0;
    padding: 32px 24px;
  }

  .article-card {
    padding: 32px 28px;
  }

  .article-card .article-headline {
    font-size: 1.6rem;
  }
}

@media (max-width: 575px) {
  #main {
    padding: 24px 16px;
  }

  .article-card {
    padding: 24px 20px;
  }

  .article-card .article-headline {
    font-size: 1.35rem;
  }
}
