/* assets/css/blog.css */

.blog-header {
  text-align: center;
  margin-bottom: 3rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 5%;
}

@media (min-width: 768px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.blog-card, .blog-card * {
  box-sizing: border-box;
}

.blog-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.blog-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.blog-card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-meta {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.blog-date-pill {
  background: rgba(14, 165, 164, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  color: var(--primary-600);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.blog-tag-pill {
  background: rgba(107, 114, 128, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.blog-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: #111827;
  line-height: 1.3;
}

.blog-card p {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
}

.blog-read-more {
  margin-top: auto;
}

.blog-read-more .cta-button {
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
}

/* Featured Post (Latest) */
@media (min-width: 1024px) {
  .blog-card.featured {
    grid-column: span 3;
    flex-direction: row;
    min-height: 250px;
  }
  
  .blog-card.featured .blog-card-image {
    width: 40%;
    height: auto;
    min-height: 100%;
    border-bottom: none;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
  }

  .blog-card.featured.no-image {
    flex-direction: column;
  }
  
  .blog-card.featured .blog-card-content {
    width: 60%;
    padding: 2rem;
    justify-content: center;
  }

  .blog-card.featured.no-image .blog-card-content {
    width: 100%;
    align-items: center;
    text-align: center;
  }
  
  .blog-card.featured h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }
  
  .blog-card.featured p {
    font-size: 0.95rem;
  }
}

/* Default state for elements without image */
.blog-card.no-image .blog-card-image {
  display: none;
}

/* Fallback spacer if featured post has no image to maintain height */
.blog-card.featured.no-image {
  min-height: 300px;
}

/* Single Post View */
.post-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 5%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 3rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 3rem;
}

.post-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding-bottom: 2rem;
}

.post-header h1 {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.post-meta {
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.post-meta span {
  display: inline-flex;
  align-items: center;
}

.post-banner-wrapper {
  margin-bottom: 2rem;
}

.post-banner-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.post-content {
  line-height: 1.8;
  color: #333;
  font-size: 1.1rem;
}

.post-content h1, .post-content h2, .post-content h3, .post-content h4 {
  color: #111827;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.post-content h2 { font-size: 1.8rem; }
.post-content h3 { font-size: 1.5rem; }

.post-content p {
  margin-bottom: 1.5rem;
}

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

.post-content ul, .post-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

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

.post-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1.5rem 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.post-content pre {
  background: #282c34;
  color: #abb2bf;
  padding: 1.2rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.post-content code {
  font-family: 'Consolas', 'Monaco', monospace;
}

.post-content p code, .post-content li code {
  background: #f4f4f4;
  color: #e06c75;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-content blockquote {
  border-left: 4px solid var(--primary);
  margin: 0 0 1.5rem 0;
  padding: 0.5rem 1rem;
  background: rgba(181, 23, 158, 0.05);
  color: #555;
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

.back-to-blog {
  display: inline-flex;
  align-items: center;
  margin-bottom: 2rem;
  color: #555;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.back-to-blog:hover {
  color: var(--primary);
}
