/* ===== BLOG STYLES (shared across index and post pages) ===== */

/* ----- RESET / BASE (only what's not in main style.css) ----- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: #ffffff;
  color: #1a1a1a;
  padding-top: 0;
}
a {
  text-decoration: none;
  color: inherit;
}

/* ----- STICKY TOP BAR (shared) ----- */
.blog-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  gap: 0.75rem;
}
.hamburger-btn {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  color: #1a1a1a;
  line-height: 1;
}
.search-wrap {
  flex: 1;
  max-width: 480px;
  margin: 0 0.5rem;
}
.search-wrap input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d0d0d0;
  border-radius: 40px;
  font-size: 0.9rem;
  background: #f5f5f5;
  transition: border 0.2s;
}
.search-wrap input:focus {
  outline: none;
  border-color: #64b5f6;
  background: #ffffff;
}
.site-home-btn {
  background: #64b5f6;
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 40px;
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.2s;
}
.site-home-btn:hover {
  background: #42a5f5;
}

/* ----- Back to Blog button (white bg, blue text) ----- */
.back-to-blog-btn {
  background: #ffffff;
  color: #64b5f6;
  padding: 0.4rem 1rem;
  border-radius: 40px;
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid #d0d0d0;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.back-to-blog-btn:hover {
  background: #f5f5f5;
  border-color: #64b5f6;
}

/* ----- SIDEBAR (slide-in) ----- */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.25);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}
.blog-sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  width: 280px;
  height: 100%;
  background: #ffffff;
  z-index: 201;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.08);
  transition: left 0.3s ease;
  padding: 1.5rem 1.25rem;
  overflow-y: auto;
}
.blog-sidebar.open {
  left: 0;
}
.sidebar-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  float: right;
  cursor: pointer;
  color: #888;
}
.sidebar-close:hover {
  color: #1a1a1a;
}
.sidebar-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0.5rem 0 1rem 0;
  display: block;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem 0;
}
.tag-item {
  background: #f0f0f0;
  border: none;
  padding: 0.3rem 0.9rem;
  border-radius: 30px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  color: #1a1a1a;
  border: 1px solid transparent;
}
.tag-item.active {
  background: #64b5f6;
  color: white;
  border-color: #64b5f6;
}
.tag-item:hover {
  transform: scale(1.03);
}
.clear-filters-btn {
  background: none;
  border: 1px solid #d0d0d0;
  padding: 0.3rem 1rem;
  border-radius: 30px;
  font-size: 0.8rem;
  cursor: pointer;
  color: #555;
  margin-top: 0.25rem;
}
.clear-filters-btn:hover {
  border-color: #64b5f6;
  color: #64b5f6;
}

/* ----- MAIN CONTENT ----- */
.blog-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* ----- HERO ----- */
.blog-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  background: #f8fafc;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 3rem;
  border: 1px solid #eaeef2;
}
.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16/9;
  max-height: 340px;
}
.hero-content {
  padding: 2rem 2rem 2rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-content h1 {
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}
.hero-content time {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  display: block;
}
.hero-content p {
  font-size: 1.05rem;
  color: #444;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}
.read-more-btn {
  align-self: flex-start;
  background: #64b5f6;
  color: white;
  padding: 0.5rem 1.4rem;
  border-radius: 40px;
  font-weight: 500;
  transition: background 0.2s;
}
.read-more-btn:hover {
  background: #42a5f5;
}

/* ----- GRID ----- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.blog-card {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s;
  background: #ffffff;
  border: 1px solid #eaeef2;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
  border-color: #64b5f6;
}
.blog-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}
.card-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #f0f2f5;
}
.card-content {
  padding: 1rem 1.25rem 1.25rem;
}
.card-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
}
.card-content time {
  color: #888;
  font-size: 0.85rem;
}
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: #888;
  font-size: 1.1rem;
}

/* ----- INDIVIDUAL POST PAGE ----- */

/* 1. Full-width gray wrapper for meta section (title, date, tags, image) */
.post-meta-wrapper {
  background: #f5f5f5;
  width: 100%;
  padding: 2rem 0;
}

/* 2. Centered container for meta content */
.post-meta-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
  text-align: center;
}

.post-meta-container h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.post-meta-container time {
  display: block;
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.post-meta-container .post-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem 0;
}

.post-meta-container .post-hero-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 12px;
  margin: 1rem 0 0 0;
}

/* 3. Body content – white background, only padding (no centering) */
.post-body-wrapper {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.post-body {
  line-height: 1.7;
  font-size: 1.1rem;
}

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

/* 4. Fix list indentation (bullets and numbered lists) */
.post-body ul,
.post-body ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

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

/* 5. Images inside the body */
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

/* 6. Tag pills (reuse from index) */
.tag-pill {
  background: #e3f0fa;
  color: #2c6b8f;
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  margin-right: 0.5rem;
  display: inline-block;
}

/* ----- NO RESULTS MESSAGE ----- */
#noResultsMessage {
  display: none;
  text-align: center;
  padding: 3rem 1rem;
  color: #888;
  font-size: 1.1rem;
  background: #f8fafc;
  border-radius: 16px;
  border: 1px dashed #d0d0d0;
  margin-bottom: 2rem;
}

/* ----- RESPONSIVE (shared) ----- */
@media (max-width: 992px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .blog-hero {
    grid-template-columns: 1fr;
  }
  .hero-image {
    max-height: 280px;
  }
  .hero-content {
    padding: 1.5rem;
  }
}
@media (max-width: 640px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .blog-topbar {
    padding: 0.5rem 0.75rem;
    flex-wrap: nowrap;
  }
  .search-wrap {
    margin: 0 0.25rem;
  }
  .search-wrap input {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }
  .hamburger-btn {
    font-size: 1.4rem;
  }
  .site-home-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
  }
  .blog-sidebar {
    width: 260px;
    left: -260px;
  }
  .hero-content h1 {
    font-size: 1.4rem;
  }
  /* Post page responsive */
  .post-meta-wrapper {
    padding: 1.5rem 0;
  }
  .post-meta-container {
    padding: 0 1rem;
  }
  .post-meta-container h1 {
    font-size: 1.6rem;
  }
  .post-body-wrapper {
    padding: 0 1rem;
  }
}
@media (max-width: 380px) {
  .blog-topbar {
    gap: 0.3rem;
  }
  .search-wrap input {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
  }
  .site-home-btn {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
  }
  .hamburger-btn {
    font-size: 1.2rem;
  }
}