/* ============================================
   BLOG STYLES
   Inherits all CSS variables from main style.css
   ============================================ */

/* Blog Layout */
.blog-section {
  position: relative;
  z-index: 10;
  padding: 6rem 2rem 4rem;
  min-height: 80vh;
}
.blog-inner {
  max-width: 72rem;
  margin: 0 auto;
}
.blog-header {
  text-align: center;
  margin-bottom: 3rem;
}
.blog-header h1 {
  font-size: 3rem;
  font-weight: 700;
  color: var(--boldColor);
  margin: 0 0 0.5rem;
}
.blog-header p {
  font-size: 1.15rem;
  color: var(--textColor);
  margin: 0;
}

/* Post Cards Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.post-card {
  background: var(--cardBg);
  border: 1px solid var(--cardBorder);
  border-radius: 1rem;
  padding: 2rem;
  text-decoration: none;
  display: block;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
}
.post-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.08);
  background: var(--cardHover);
}
.post-card .post-date {
  font-size: 0.85rem;
  color: var(--textColor);
  opacity: 0.7;
  margin: 0 0 0.75rem;
}
.post-card .post-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--boldColor);
  margin: 0 0 0.75rem;
  line-height: 1.3;
}
.post-card .post-description {
  font-size: 0.95rem;
  color: var(--textColor);
  margin: 0 0 1rem;
  line-height: 1.6;
}
.post-card .post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.post-card .post-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 100rem;
  background: var(--cardBorder);
  color: var(--textColor);
}
.posts-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--textColor);
  font-size: 1.1rem;
}

/* ============================================
   ARTICLE / POST VIEW
   ============================================ */

.article-section {
  position: relative;
  z-index: 10;
  padding: 6rem 2rem 4rem;
  min-height: 80vh;
}
.article-inner {
  max-width: 48rem;
  margin: 0 auto;
}

/* Article Header */
.article-meta {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--cardBorder);
}
.article-meta .post-date {
  font-size: 0.9rem;
  color: var(--textColor);
  opacity: 0.7;
  margin: 0 0 0.75rem;
}
.article-meta .post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.article-meta .post-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 100rem;
  background: var(--cardBorder);
  color: var(--textColor);
}

/* Article Content Typography */
.article-content {
  color: var(--textColor);
  line-height: 1.8;
  font-size: 1.05rem;
}
.article-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--boldColor);
  margin: 0 0 1rem;
  line-height: 1.2;
}
.article-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--boldColor);
  margin: 3rem 0 1rem;
  line-height: 1.3;
}
.article-content h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--boldColor);
  margin: 2rem 0 0.75rem;
  line-height: 1.3;
}
.article-content p {
  margin: 0 0 1.25rem;
}
.article-content a {
  color: var(--boldColor);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.article-content a:hover {
  opacity: 0.7;
}
.article-content strong {
  color: var(--boldColor);
  font-weight: 700;
}
.article-content ul, .article-content ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}
.article-content li {
  margin-bottom: 0.5rem;
}
.article-content blockquote {
  border-left: 3px solid var(--boldColor);
  margin: 1.5rem 0;
  padding: 0.75rem 1.5rem;
  background: var(--cardBg);
  border-radius: 0 0.5rem 0.5rem 0;
}
.article-content blockquote p {
  margin: 0;
}
.article-content code {
  font-family: 'Courier New', monospace;
  background: var(--cardBg);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
  color: var(--boldColor);
}
.article-content pre {
  background: var(--cardBg);
  border: 1px solid var(--cardBorder);
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.article-content pre code {
  background: none;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}
.article-content th, .article-content td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--cardBorder);
}
.article-content th {
  color: var(--boldColor);
  font-weight: 700;
}
.article-content hr {
  border: none;
  border-top: 1px solid var(--cardBorder);
  margin: 2.5rem 0;
}
.article-content img {
  max-width: 100%;
  border-radius: 0.5rem;
  margin: 1.5rem 0;
}

/* Back to blog link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--textColor);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2rem;
  transition: color 0.2s ease;
}
.back-link:hover {
  color: var(--boldColor);
}

/* Loading state */
.loading {
  text-align: center;
  padding: 4rem;
  color: var(--textColor);
  font-size: 1.1rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 48rem) {
  .blog-section {
    padding: 5rem 1.25rem 3rem;
  }
  .blog-header h1 {
    font-size: 2.2rem;
  }
  .posts-grid {
    grid-template-columns: 1fr;
  }
  .article-section {
    padding: 5rem 1.25rem 3rem;
  }
  .article-content h1 {
    font-size: 2rem;
  }
  .article-content h2 {
    font-size: 1.5rem;
  }
}

@media (prefers-reduced-motion) {
  .post-card {
    opacity: 1;
    transform: none;
  }
}
