/*
 * blog.css
 * Custom stylesheet for InstaAudio Blog Redesign
 */

/* Blog Section & Page Variables */
:root {
  --blog-primary: #4f46e5;      /* indigo-600 */
  --blog-primary-hover: #4338ca;/* indigo-700 */
  --blog-text-dark: #0f172a;    /* slate-900 */
  --blog-text-muted: #475569;   /* slate-600 */
  --blog-bg-light: #f8fafc;     /* slate-50 */
  --blog-border: #e2e8f0;       /* slate-200 */
  --blog-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --blog-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --blog-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --blog-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* --- BLOG GRID & LAYOUT --- */
.blog-section {
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
  background-color: #ffffff;
}

/* Background Gradients to match home page feel */
.blog-bg-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blog-shape-1 {
  position: absolute;
  top: -10%;
  right: -5%;
  width: 30rem;
  height: 30rem;
  border-radius: 50%;
  background-color: rgba(224, 231, 255, 0.4); /* indigo-100/40 */
  filter: blur(80px);
}

.blog-shape-2 {
  position: absolute;
  bottom: 5%;
  left: -5%;
  width: 25rem;
  height: 25rem;
  border-radius: 50%;
  background-color: rgba(243, 232, 255, 0.35); /* purple-100/35 */
  filter: blur(80px);
}

.blog-container {
  position: relative;
  z-index: 10;
  max-width: 80rem; /* max-w-7xl */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.blog-header {
  margin-bottom: 3.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .blog-header {
    flex-direction: row;
    align-items: flex-end;
  }
}

.blog-header-left {
  max-width: 42rem; /* max-w-2xl */
}

.blog-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid var(--blog-border);
  background-color: rgba(255, 255, 255, 0.8);
  padding: 0.375rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--blog-text-muted);
  box-shadow: var(--blog-shadow-sm);
  backdrop-filter: blur(4px);
}

.blog-section-title {
  margin-top: 1rem;
  font-size: 1.875rem; /* 30px */
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--blog-text-dark);
  line-height: 1.2;
}

@media (min-width: 768px) {
  .blog-section-title {
    font-size: 3rem; /* 48px */
  }
}

.blog-section-description {
  margin-top: 1rem;
  font-size: 1rem;
  line-height: 1.625;
  color: var(--blog-text-muted);
}

/* View All Button */
.blog-view-all-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  align-self: flex-start;
  border-radius: 1rem;
  border: 1px solid var(--blog-border);
  background-color: #ffffff;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--blog-text-muted);
  box-shadow: var(--blog-shadow-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  cursor: pointer;
}

.blog-view-all-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--blog-shadow-md);
  color: var(--blog-primary);
  border-color: rgba(79, 70, 229, 0.3);
}

/* --- BLOG GRID --- */
.blog-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

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

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

/* --- BLOG CARD --- */
.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%; /* Stretch to same height */
  overflow: hidden;
  border-radius: 1.5rem; /* rounded-2xl */
  border: 1px solid var(--blog-border);
  background-color: #ffffff;
  box-shadow: var(--blog-shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--blog-shadow-lg);
  border-color: rgba(79, 70, 229, 0.25);
}

/* Image container has exact same dimensions and aspect ratio */
.blog-card-image-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  background-color: #f1f5f9; /* slate-100 */
}

.blog-card-image {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card:hover .blog-card-image {
  transform: scale(1.05);
}

/* Aspect ratio gradient overlay */
.blog-card-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.15) 0%, transparent 100%);
  pointer-events: none;
}

.blog-card-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 1.5rem;
  justify-content: center; /* Vertically center the title */
}

.blog-card-title {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.25rem; /* 20px */
  font-weight: 700;
  line-height: 1.4;
  color: var(--blog-text-dark);
  transition: color 0.25s ease;
  
  /* Fixed 2 lines with ellipsis */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 2.8em; /* 2 lines * 1.4 line-height = 2.8em */
}

.blog-card:hover .blog-card-title {
  color: var(--blog-primary);
}

/* Empty state styling */
.blog-empty-state {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  border-radius: 1.5rem;
  border: 1px solid var(--blog-border);
  background-color: #ffffff;
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--blog-shadow-sm);
}

.blog-empty-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blog-text-dark);
  margin-bottom: 0.75rem;
}

.blog-empty-desc {
  font-size: 0.875rem;
  color: var(--blog-text-muted);
  line-height: 1.5;
}


/* --- ALL BLOGS PAGE REDESIGN --- */
.all-blogs-page {
  padding-top: 8rem; /* Space below header */
  padding-bottom: 5rem;
  background-color: #ffffff;
  position: relative;
}

.all-blogs-hero {
  text-align: center;
  margin-bottom: 4rem;
}

.all-blogs-hero .blog-badge {
  margin-bottom: 1rem;
}

.all-blogs-hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--blog-text-dark);
  margin-top: 0.5rem;
}

@media (min-width: 768px) {
  .all-blogs-hero-title {
    font-size: 4rem;
  }
}

.all-blogs-hero-desc {
  margin-top: 1rem;
  font-size: 1.125rem;
  color: var(--blog-text-muted);
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}


/* --- SINGLE BLOG PAGE REDESIGN --- */
.single-blog-page {
  padding-top: 8rem;
  padding-bottom: 5rem;
  background-color: #ffffff;
  position: relative;
}

.single-blog-container {
  max-width: 56rem; /* 900px */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  position: relative;
  z-index: 10;
}

.single-blog-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 1rem;
  border: 1px solid var(--blog-border);
  background-color: #ffffff;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--blog-text-muted);
  box-shadow: var(--blog-shadow-sm);
  transition: all 0.2s;
  text-decoration: none;
  margin-bottom: 2rem;
}

.single-blog-back-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--blog-shadow-md);
  color: var(--blog-primary);
  border-color: rgba(79, 70, 229, 0.3);
}

.single-blog-article {
  overflow: hidden;
  border-radius: 2rem;
  border: 1px solid var(--blog-border);
  background-color: #ffffff;
  box-shadow: var(--blog-shadow-md);
}

/* Featured Image on post */
.single-blog-featured-wrap {
  position: relative;
  aspect-ratio: 21 / 9; /* Sleek wider aspect ratio for single post banner */
  width: 100%;
  overflow: hidden;
  background-color: #f1f5f9;
  border-bottom: 1px solid var(--blog-border);
}

@media (max-width: 640px) {
  .single-blog-featured-wrap {
    aspect-ratio: 16 / 9; /* slightly taller on mobile */
  }
}

.single-blog-featured-img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.single-blog-content-wrap {
  padding: 2rem 1.5rem;
}

@media (min-width: 768px) {
  .single-blog-content-wrap {
    padding: 3.5rem 3rem;
  }
}

.single-blog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--blog-text-muted);
  font-weight: 500;
}

.single-blog-read-time {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 9999px;
  background-color: var(--blog-bg-light);
  padding: 0.25rem 0.75rem;
  color: var(--blog-text-muted);
  border: 1px solid var(--blog-border);
}

.single-blog-title {
  margin-top: 1.25rem;
  font-size: 2.25rem; /* 36px */
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--blog-text-dark);
  line-height: 1.2;
}

@media (min-width: 768px) {
  .single-blog-title {
    font-size: 3.25rem; /* 52px */
  }
}

.single-blog-author-divider {
  margin-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--blog-border);
}

.single-blog-author-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--blog-text-muted);
}

/* Rich Text Formatting for Blog Post Content */
.single-blog-body {
  margin-top: 2rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.125rem; /* 18px for better reading */
  line-height: 1.777;
  color: #334155; /* slate-700 */
}

/* Typography elements in rich text */
.single-blog-body p {
  margin-bottom: 1.5rem;
}

.single-blog-body h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--blog-text-dark);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.single-blog-body h3 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--blog-text-dark);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.single-blog-body ul, .single-blog-body ol {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.single-blog-body li {
  margin-bottom: 0.5rem;
}

.single-blog-body a {
  color: var(--blog-primary);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(79, 70, 229, 0.2);
  transition: all 0.2s;
}

.single-blog-body a:hover {
  color: var(--blog-primary-hover);
  border-bottom-color: var(--blog-primary-hover);
}

.single-blog-body blockquote {
  border-left: 4px solid var(--blog-primary);
  padding-left: 1.25rem;
  font-style: italic;
  color: var(--blog-text-muted);
  margin: 1.5rem 0;
}

.single-blog-body img {
  border-radius: 1rem;
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  border: 1px solid var(--blog-border);
}

/* Navigation widgets below blog post */
.single-blog-footer-widgets {
  margin-top: 2.5rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

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

.single-blog-widget-card {
  border-radius: 1.5rem;
  border: 1px solid var(--blog-border);
  background-color: #ffffff;
  padding: 1.75rem;
  box-shadow: var(--blog-shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.single-blog-widget-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--blog-text-dark);
  margin-bottom: 0.5rem;
}

.single-blog-widget-desc {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--blog-text-muted);
  margin-bottom: 1.5rem;
}

.single-blog-widget-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 1rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.single-blog-widget-btn-primary {
  background-color: var(--blog-text-dark);
  color: #ffffff;
}

.single-blog-widget-btn-primary:hover {
  background-color: #000000;
}

.single-blog-widget-btn-secondary {
  background-color: #ffffff;
  border: 1px solid var(--blog-border);
  color: var(--blog-text-muted);
}

.single-blog-widget-btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--blog-shadow-sm);
  color: var(--blog-primary);
  border-color: rgba(79, 70, 229, 0.3);
}

.blog-card-read-more{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: #555;
}