/* Blog-specific styles */

/* Blog Landing Page */
.blog-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 4rem 0;
  text-align: center;
}

.blog-hero h1 {
  color: #fff;
  margin-bottom: 0.5rem;
}

.blog-hero p {
  color: rgba(255,255,255,0.9);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Posts Grid */
.blog-listing {
  padding: 4rem 0;
  background: var(--bg-alt);
  min-height: 50vh;
}

.blog-listing h2 {
  text-align: center;
  margin-bottom: 2.5rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.post-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.post-card-thumbnail {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.post-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.post-card:hover .post-card-thumbnail img {
  transform: scale(1.05);
}

.post-card-content {
  padding: 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.post-card h3 a {
  color: var(--primary);
  text-decoration: none;
}

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

.post-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
}

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

.post-card-tags .tag {
  font-size: 0.75rem;
  background: var(--bg-alt);
  color: var(--text-muted);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: 1rem;
}

.read-more:hover {
  color: var(--accent-hover);
}

/* No posts message */
.no-posts {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* Blog Post Article Styles */
.blog-post {
  padding-bottom: 3rem;
}

.post-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 6rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.post-header::before {
  content: '';
  position: absolute;
  top: -20px; left: -20px; right: -20px; bottom: -20px;
  background-image: var(--header-bg);
  background-size: cover;
  background-position: center;
  filter: blur(10px) brightness(0.6);
  z-index: 0;
}

.post-header .container {
  position: relative;
  z-index: 1;
}

.post-header h1 {
  color: #fff;
  max-width: 800px;
  margin: 0 auto 1rem;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}

.post-meta {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.post-meta .separator {
  opacity: 0.5;
}

.post-excerpt {
  color: rgba(255,255,255,0.9);
  font-size: 1.125rem;
  max-width: 700px;
  margin: 0 auto 1.5rem;
  line-height: 1.7;
}

.post-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-tags .tag {
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Featured Image */
.post-featured-image {
  max-width: 100%;
  width: auto;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 1.5rem auto;
  display: block;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* Post Content */
.post-content {
  padding: 3rem 0;
}

.post-content .container {
  max-width: 800px;
}

.post-content h2 {
  color: var(--primary);
  font-size: 1.6rem;
  margin: 2.5rem 0 1rem;
  text-align: left;
}

.post-content h2:first-child {
  margin-top: 0;
}

.post-content h3 {
  color: var(--primary);
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  text-align: left;
}

.post-content p {
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 1.25rem;
  text-align: left;
  max-width: none;
}

.post-content ul,
.post-content ol {
  margin: 0 0 1.5rem 1.5rem;
  color: var(--text);
}

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

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(14, 165, 233, 0.3);
  text-underline-offset: 2px;
}

.post-content a:hover {
  text-decoration-color: var(--accent);
}

.post-content blockquote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  background: var(--bg-alt);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.post-content blockquote p {
  color: var(--text);
  font-style: italic;
  margin: 0;
}

.post-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.post-content code {
  font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
}

.post-content p code {
  background: var(--bg-alt);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--primary);
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 2rem 0;
}

/* Post CTA Section */
.post-cta {
  background: var(--bg-alt);
  padding: 4rem 0;
  text-align: center;
}

.post-cta h2 {
  margin-bottom: 0.75rem;
}

.post-cta p {
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 1.5rem;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.loading::after {
  content: '';
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 0.5rem;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  .blog-hero,
  .post-header {
    padding: 3rem 0;
  }

  .blog-listing {
    padding: 3rem 0;
  }

  .posts-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .post-card-content {
    padding: 1.5rem;
  }

  .post-content {
    padding: 2rem 0;
  }

  .post-content h2 {
    font-size: 1.4rem;
  }

  .post-cta {
    padding: 3rem 0;
  }
}
