/* Blog-specific styles */

/* Prose styling for article content */
.prose {
  color: #374151;
  line-height: 1.75;
}

.prose h1 {
  color: #111827;
  font-weight: 800;
  font-size: 2.25rem;
  margin-top: 0;
  margin-bottom: 2rem;
  line-height: 1.2;
}

.prose h2 {
  color: #111827;
  font-weight: 700;
  font-size: 1.875rem;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  line-height: 1.3;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.prose h3 {
  color: #111827;
  font-weight: 600;
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

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

.prose p {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 1.125rem;
  line-height: 1.75;
}

.prose a {
  color: #2563eb;
  text-decoration: underline;
  font-weight: 500;
}

.prose a:hover {
  color: #1d4ed8;
}

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

.prose ul {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  padding-left: 1.625rem;
}

.prose ul > li {
  position: relative;
  padding-left: 0.375rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.prose ul > li::before {
  content: "";
  position: absolute;
  background-color: #6b7280;
  border-radius: 50%;
  width: 0.375rem;
  height: 0.375rem;
  top: calc(0.875rem - 0.1875rem);
  left: -1.5rem;
}

.prose ol {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  padding-left: 1.625rem;
  counter-reset: list-counter;
}

.prose ol > li {
  position: relative;
  counter-increment: list-counter;
  padding-left: 0.375rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.prose ol > li::before {
  content: counter(list-counter) ".";
  position: absolute;
  font-weight: 400;
  color: #6b7280;
  left: -1.625rem;
}

.prose blockquote {
  font-weight: 500;
  font-style: italic;
  color: #111827;
  border-left-width: 0.25rem;
  border-left-color: #e5e7eb;
  quotes: "\201C" "\201D" "\2018" "\2019";
  margin-top: 1.6rem;
  margin-bottom: 1.6rem;
  padding-left: 1rem;
  background: #f9fafb;
  padding: 1rem;
  border-radius: 0.5rem;
}

.prose code {
  color: #111827;
  font-weight: 600;
  font-size: 0.875rem;
  background-color: #f3f4f6;
  padding: 0.25rem 0.375rem;
  border-radius: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.prose pre {
  color: #e5e7eb;
  background-color: #1f2937;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.7142857;
  margin-top: 1.7142857em;
  margin-bottom: 1.7142857em;
  border-radius: 0.375rem;
  padding: 1rem;
  position: relative;
}

.prose pre code {
  background-color: transparent;
  border-width: 0;
  border-radius: 0;
  padding: 0;
  font-weight: 400;
  color: inherit;
  font-size: inherit;
  font-family: inherit;
  line-height: inherit;
}

/* Copy code button */
.prose pre {
  position: relative;
}

.prose pre:hover .copy-button {
  opacity: 1;
}

.copy-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.copy-button:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* Image styling */
.prose img {
  margin-top: 2rem;
  margin-bottom: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  max-width: 100%;
  height: auto;
}

/* Tables */
.prose table {
  width: 100%;
  table-layout: auto;
  text-align: left;
  margin-top: 2rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  line-height: 1.7142857;
  border-collapse: collapse;
}

.prose thead {
  color: #111827;
  font-weight: 600;
  border-bottom-width: 1px;
  border-bottom-color: #d1d5db;
}

.prose thead th {
  vertical-align: bottom;
  padding-right: 0.5714286em;
  padding-bottom: 0.5714286em;
  padding-left: 0.5714286em;
}

.prose tbody tr {
  border-bottom-width: 1px;
  border-bottom-color: #e5e7eb;
}

.prose tbody td {
  vertical-align: top;
  padding-top: 0.5714286em;
  padding-right: 0.5714286em;
  padding-bottom: 0.5714286em;
  padding-left: 0.5714286em;
}

/* Alert boxes */
.prose .alert {
  padding: 1rem;
  margin: 1.5rem 0;
  border-radius: 0.5rem;
  border-left: 4px solid;
}

.prose .alert-info {
  background-color: #eff6ff;
  border-left-color: #3b82f6;
  color: #1e40af;
}

.prose .alert-warning {
  background-color: #fffbeb;
  border-left-color: #f59e0b;
  color: #92400e;
}

.prose .alert-success {
  background-color: #ecfdf5;
  border-left-color: #10b981;
  color: #065f46;
}

.prose .alert-error {
  background-color: #fef2f2;
  border-left-color: #ef4444;
  color: #991b1b;
}

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

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

/* Search highlighting */
.search-highlight {
  background-color: #fef3c7;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
}

/* Reading progress bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(to right, #3b82f6, #8b5cf6);
  transform: translateX(-100%);
  transition: transform 0.1s ease-out;
  z-index: 1000;
}

/* Mobile improvements */
@media (max-width: 640px) {
  .prose {
    font-size: 1rem;
  }
  
  .prose h1 {
    font-size: 1.875rem;
  }
  
  .prose h2 {
    font-size: 1.5rem;
  }
  
  .prose h3 {
    font-size: 1.25rem;
  }
  
  .prose p {
    font-size: 1rem;
  }
  
  .prose pre {
    font-size: 0.8125rem;
    margin-left: -1rem;
    margin-right: -1rem;
    border-radius: 0;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .prose {
    color: #d1d5db;
  }
  
  .prose h1,
  .prose h2,
  .prose h3,
  .prose h4,
  .prose strong {
    color: #f9fafb;
  }
  
  .prose h2 {
    border-bottom-color: #374151;
  }
  
  .prose code {
    color: #f9fafb;
    background-color: #374151;
  }
  
  .prose blockquote {
    color: #f9fafb;
    border-left-color: #6b7280;
    background: #1f2937;
  }
  
  .prose ul > li::before {
    background-color: #9ca3af;
  }
  
  .prose ol > li::before {
    color: #9ca3af;
  }
}

/* Print styles */
@media print {
  .prose {
    color: #000;
  }
  
  .prose a {
    color: #000;
    text-decoration: none;
  }
  
  .prose a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
  
  .prose pre {
    background: #f8f9fa;
    color: #000;
    border: 1px solid #dee2e6;
  }
}