/* Service Blog Cards Styles */

/* Hero Background Image with Blur Effect */
.hero-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(1px);
  z-index: 0;
}

/* Ensure video stays as fallback */
.hero-bg video {
  position: relative;
  z-index: 1;
}

/* When blog image is present, hide video */
.hero-bg:has(.hero-bg-image) video {
  opacity: 0;
  pointer-events: none;
}

/* Dark overlay for text readability */
.hero-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  z-index: 2;
}

/* Ensure hero content stays on top */
.hero-content {
  position: relative;
  z-index: 3;
}

#service-blog-cards {
  margin: 4rem 0;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 3rem;
}

/* Blog Card Styles */
.blog-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.blog-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 60%; /* 5:3 aspect ratio */
  overflow: hidden;
  background: var(--bg-secondary);
}

.blog-card-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.blog-card-categories {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.blog-card-category {
  background: rgba(14, 186, 177, 0.9);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

.blog-card-date {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 600;
}

.blog-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-excerpt {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-footer {
  margin-top: auto;
}

.blog-card-read-more {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: gap 0.3s ease;
}

.blog-card:hover .blog-card-read-more {
  gap: 0.75rem;
}

/* Loading State */
.blog-loading {
  text-align: center;
  padding: 3rem 0;
}

.blog-loading p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Dark Mode Styles */
[data-theme="dark"] .blog-card {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .blog-card:hover {
  background: rgba(26, 33, 48, 0.95);
  box-shadow: 0 8px 24px rgba(14, 186, 177, 0.2);
}

[data-theme="dark"] .blog-card-image-wrapper {
  background: var(--bg-secondary);
}

[data-theme="dark"] .blog-card-category {
  background: rgba(14, 186, 177, 0.95);
  box-shadow: 0 2px 8px rgba(14, 186, 177, 0.3);
}

[data-theme="dark"] .blog-card-title {
  color: var(--text-primary);
}

[data-theme="dark"] .blog-card-excerpt {
  color: var(--text-secondary);
}

[data-theme="dark"] .blog-card-read-more {
  color: var(--primary);
}

[data-theme="dark"] .blog-loading p {
  color: var(--text-secondary);
}

/* Responsive Grid Layout */
@media (max-width: 1200px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .blog-card-content {
    padding: 1rem;
  }

  .blog-card-title {
    font-size: 1.1rem;
  }

  .blog-card-excerpt {
    font-size: 0.9rem;
  }
}
