/* NetRumahan Custom Styles */

/* Custom prose adjustments for better readability */
.prose pre {
  background-color: #0f172a !important;
  border-radius: 0.75rem !important;
  padding: 1.5rem !important;
}

.prose code {
  background-color: #f1f5f9 !important;
  color: #4f46e5 !important;
  padding: 0.125rem 0.375rem !important;
  border-radius: 0.25rem !important;
}

.dark .prose code {
  background-color: #1e293b !important;
  color: #818cf8 !important;
}

.dark .prose pre {
  background-color: #0f172a !important;
}

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

/* Table styling */
.prose table {
  width: 100%;
  font-size: 0.875rem;
  line-height: 1.5;
}

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

.dark .prose th {
  background-color: #1e293b;
}

.prose th, .prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.dark .prose th, .dark .prose td {
  border-bottom: 1px solid #334155;
}

/* Blockquote styling */
.prose blockquote {
  border-left-color: #6366f1;
  background-color: #eff6ff;
  color: #1e3a8a;
  font-style: italic;
  padding-left: 1.5rem;
  border-radius: 0 0.5rem 0.5rem 0;
  margin: 1.5rem 0;
}

.dark .prose blockquote {
  background-color: #1e3a8a;
  color: #dbeafe;
}

/* Link styling in prose */
.prose a {
  color: #4f46e5;
  text-decoration: none;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.prose a:hover {
  color: #4338ca;
}

/* Skip link improvements */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: #4f46e5;
  color: white;
  border-radius: 0.5rem;
  z-index: 9999;
  font-weight: 500;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* Copy button for code blocks */
.copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.375rem;
  font-size: 0.75rem;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 10;
}

.dark .copy-btn {
  color: #9ca3af;
  background: #1f2937;
}

.copy-btn:hover {
  color: #4f46e5;
  background: #eef2ff;
}

.dark .copy-btn:hover {
  color: #818cf8;
  background: #1e1b4b;
}

.copy-btn:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

/* TOC scrollbar styling */
.toc::-webkit-scrollbar {
  width: 6px;
}

.toc::-webkit-scrollbar-track {
  background: transparent;
}

.toc::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.dark .toc::-webkit-scrollbar-thumb {
  background: #475569;
}

.toc::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.dark .toc::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Table comparison responsive */
.compare-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.compare th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.compare tr > :last-child {
  position: sticky;
  right: 0;
  background: white;
}

.dark .compare tr > :last-child {
  background: #0f172a;
}

/* Mobile comparison cards */
@media (max-width: 639px) {
  .compare-wrap {
    display: none;
  }
  .compare-cards {
    display: grid;
    gap: 1rem;
  }
  .compare-cards a {
    display: block;
    width: 100%;
  }
}

/* Focus visible styles */
:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

/* Selection colors */
::selection {
  background-color: #c7d2fe;
  color: #1e1b4b;
}

.dark ::selection {
  background-color: #312e81;
  color: #e0e7ff;
}

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

/* Print styles */
@media print {
  .site-header, .site-footer, .article-toc, .affiliate-sidebar, .affiliate-cta,
  .trust-badges, .newsletter-form, .btn, .share-buttons, .theme-toggle,
  .mobile-menu-btn, .copy-btn, .mobile-menu-btn {
    display: none !important;
  }
  
  .article-layout {
    display: block !important;
  }
  
  .article-content {
    max-width: none !important;
    width: 100% !important;
  }
  
  .article-body a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
    word-break: break-all;
  }
  
  .article-body a[href^="#"]::after,
  .article-body a[href^="javascript:"]::after {
    content: "";
  }
  
  @page {
    margin: 2cm;
  }
  
  h1, h2, h3, h4 {
    page-break-after: avoid;
  }
  
  pre, blockquote, table, figure {
    page-break-inside: avoid;
  }
}
