/**
 * Blog Detail Page Styles
 * Custom styles for article content and prose
 */

/* Prose Styling for Article Content */
.prose {
  color: #374151;
  line-height: 1.75;
}

.prose h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #111827;
}

@media (min-width: 640px) {
  .prose h2 {
    font-size: 1.875rem;
  }
}

.prose h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #111827;
}

@media (min-width: 640px) {
  .prose h3 {
    font-size: 1.5rem;
  }
}

.prose p {
  margin-bottom: 1.25rem;
}

.prose a {
  color: #3b82f6;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.prose a:hover {
  color: #2563eb;
}

.prose ul,
.prose ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose img {
  border-radius: 0.75rem;
  margin: 1.5rem 0;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  max-width: 100%;
  height: auto;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.prose img:hover {
  transform: scale(1.02);
}

@media (min-width: 640px) {
  .prose img {
    margin: 2rem 0;
  }
}

.prose blockquote {
  border-left: 4px solid #3b82f6;
  padding-left: 1rem;
  font-style: italic;
  color: #6b7280;
  margin: 1.5rem 0;
  background: #f3f4f6;
  padding: 1rem;
  border-radius: 0.5rem;
}

.prose code {
  background-color: #f3f4f6;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  color: #dc2626;
  font-family: 'Courier New', monospace;
}

.prose pre {
  background-color: #1f2937;
  color: #f9fafb;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.prose pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  overflow-x: auto;
  display: block;
}

@media (min-width: 640px) {
  .prose table {
    display: table;
  }
}

.prose th,
.prose td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem;
  text-align: left;
}

@media (min-width: 640px) {
  .prose th,
  .prose td {
    padding: 0.75rem;
  }
}

.prose th {
  background-color: #f3f4f6;
  font-weight: 600;
}

.prose hr {
  border: none;
  border-top: 2px solid #e5e7eb;
  margin: 2rem 0;
}

.prose strong {
  font-weight: 700;
  color: #111827;
}

.prose em {
  font-style: italic;
}

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

/* 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 */
}

/* Sidebar Sticky Behavior */
@media (min-width: 1024px) {
  aside {
    position: sticky;
    top: 6rem;
    align-self: flex-start;
  }
}

/* Share Button Hover Effects */
.share-button {
  transition: all 0.3s ease;
}

.share-button:hover {
  transform: translateY(-2px);
}

/* Related Article Cards */
.related-article {
  transition: all 0.3s ease;
}

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

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

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

/* Category Badge Animation */
.category-badge {
  transition: all 0.2s ease;
}

.category-badge:hover {
  transform: scale(1.05);
}

/* Tag Cloud Hover */
.tag-link {
  transition: all 0.2s ease;
}

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

/* Author Box */
.author-box img {
  transition: transform 0.3s ease;
}

.author-box:hover img {
  transform: scale(1.1);
}

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

  .prose img {
    max-width: 100%;
    page-break-inside: avoid;
  }

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

  article {
    max-width: 100%;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .prose img,
  .related-article,
  .share-button,
  .tag-link {
    transition: none;
  }

  .prose img:hover,
  .related-article:hover,
  .share-button:hover,
  .tag-link:hover {
    transform: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: more) {
  .prose {
    color: #000;
  }

  .prose a {
    color: #0000ff;
    text-decoration: underline;
  }

  .prose code {
    background: #fff;
    border: 1px solid #000;
  }

  .prose blockquote {
    background: #fff;
    border-left: 4px solid #000;
  }
}

/* Responsive Adjustments */
@media (max-width: 639px) {
  .prose {
    font-size: 0.875rem;
  }

  .prose h2 {
    font-size: 1.25rem;
  }

  .prose h3 {
    font-size: 1.125rem;
  }

  .prose table {
    font-size: 0.75rem;
  }
}

/* Loading Animation for Images */
.prose img {
  opacity: 0;
  animation: fadeIn 0.5s ease-in forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Smooth Scroll Behavior */
html {
  scroll-behavior: smooth;
}

/* Focus States for Accessibility */
.prose a:focus-visible,
.share-button:focus-visible,
.tag-link:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

