/**
 * Article Cards Styles
 * Styling for article cards used in section-latest and other components
 * Enhanced for mobile responsiveness and accessibility
 */

/* Article card container */
.article-card {
  transition: all 0.3s ease;
  transform: translateY(0);
}

.article-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Category badge positioning */
.article-card .category-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* Responsive image container */
.article-card .image-container {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

.article-card .image-container img {
  transition: transform 0.3s ease;
}

.article-card:hover .image-container img {
  transform: scale(1.05);
}

/* Text content improvements */
.article-card h3 a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

.article-card h3 a:hover {
  color: #f59e0b;
  /* batam-yellow */
}

/* Line clamp utilities for text truncation */
.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

/* Author avatar improvements */
.article-card .author-avatar {
  object-fit: cover;
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .article-card {
    margin-bottom: 1rem;
  }

  .article-card h3 {
    font-size: 1.125rem;
    line-height: 1.4;
  }

  .article-card p {
    font-size: 0.875rem;
    line-height: 1.5;
  }

  .article-card .category-badge {
    top: 12px;
    right: 12px;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
}

@media (min-width: 641px) and (max-width: 768px) {
  .article-card h3 {
    font-size: 1.25rem;
  }
}

/* Loading state for dynamic content */
.article-card.loading {
  opacity: 0.7;
  pointer-events: none;
}

.article-card.loading .image-container {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

/* Focus states for accessibility */
.article-card:focus-within {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
}

.article-card h3 a:focus {
  outline: none;
  color: #f59e0b;
}

/* Grid layout enhancements */
@media (min-width: 768px) {
  .articles-grid {
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .articles-grid {
    gap: 2.5rem;
  }
}

/* Empty state styling */
.articles-empty-state {
  background: linear-gradient(135deg, #ffffff, #f9fafb);
  border: 1px solid #e5e7eb;
}

.articles-empty-state i {
  opacity: 0.6;
}

/* Button hover improvements */
.articles-view-all-btn {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.articles-view-all-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.articles-view-all-btn:hover::before {
  left: 100%;
}

/* Print styles */
@media print {
  .article-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #e5e7eb;
  }

  .articles-view-all-btn {
    display: none;
  }
}