/**
 * Blog Page Styles
 * Custom styles for blog layout and interactions
 */

/* Line Clamp Utilities */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

/* Article Card Transitions */
.article-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-card:hover {
  transform: translateY(-4px);
}

/* Custom Scrollbar - Invisible but Functional */
.custom-scrollbar {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.custom-scrollbar::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Sticky Sidebar - Smooth Scrolling */
.lg\:sticky {
  position: sticky;
}

/* Filter Button Active State Enhancement */
.filter-btn {
  position: relative;
  overflow: hidden;
}

.filter-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.filter-btn:active::before {
  width: 200px;
  height: 200px;
}

/* Tag Button Hover Effects */
.tag-btn {
  transition: all 0.2s ease;
}

.tag-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* AdSense Container */
.adsense-container {
  transition: opacity 0.3s ease;
}

.adsense-container:hover {
  opacity: 0.95;
}

/* Pagination Hover Effects */
nav a,
nav span {
  transition: all 0.3s ease;
}

nav a:hover {
  transform: translateY(-2px);
}

/* Featured Article Enhancement */
.featured-article {
  position: relative;
}

.featured-article::after {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 51, 234, 0.1) 100%);
  border-radius: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.featured-article:hover::after {
  opacity: 1;
}

/* Loading Spinner Animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Smooth Fade In for Cards */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.article-card {
  animation: fadeIn 0.5s ease-out;
}

.article-card:nth-child(1) { animation-delay: 0s; }
.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.2s; }
.article-card:nth-child(4) { animation-delay: 0.3s; }
.article-card:nth-child(5) { animation-delay: 0.4s; }
.article-card:nth-child(6) { animation-delay: 0.5s; }

/* Responsive Adjustments */
@media (max-width: 768px) {
  .article-card:hover {
    transform: translateY(-2px);
  }

  .filter-btn,
  .tag-btn {
    font-size: 0.875rem;
  }
}

/* Print Styles */
@media print {
  .filter-btn,
  .tag-btn,
  .adsense-container,
  nav,
  aside {
    display: none !important;
  }

  .article-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .shadow-md,
  .shadow-lg,
  .shadow-xl {
    box-shadow: none !important;
    border: 1px solid #e5e7eb;
  }
}

/* Accessibility - Focus States */
.filter-btn:focus-visible,
.tag-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .article-card,
  .filter-btn,
  .tag-btn,
  nav a {
    animation: none;
    transition: none;
  }

  .article-card:hover {
    transform: none;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: more) {
  .article-card {
    border: 2px solid #000;
  }

  .bg-gradient-to-r,
  .bg-gradient-to-br {
    background: #fff !important;
    border: 2px solid #000;
  }

  .text-gray-600,
  .text-gray-700 {
    color: #000 !important;
  }
}

