/* ============================================================
   DHANIWIN.BLOG - Modern Editorial Stylesheet
   Dark charcoal/black theme with sleek violet/cyan accents
   ============================================================ */

:root {
  --bg-dark: #0b0f17;
  --bg-card: #121824;
  --bg-card-hover: #182030;
  --border-color: #1f293d;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --accent: #06b6d4;
}

html {
  scroll-behavior: smooth;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #0b0f17;
}
::-webkit-scrollbar-thumb {
  background: #232d42;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Ensure mobile content is never hidden behind the fixed bottom navigation */
@media (max-width: 1023px) {
  body {
    padding-bottom: 76px;
  }
}

/* Reading Progress Indicator */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #8b5cf6, #06b6d4);
  width: 0%;
  z-index: 9999;
  transition: width 0.1s ease-out;
}

/* Editorial Article Content Typography */
.article-content {
  color: #cbd5e1;
  font-size: 1.125rem;
  line-height: 1.85;
}

.article-content p {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
}

.article-content h2 {
  color: #f8fafc;
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #1f293d;
  scroll-margin-top: 5.5rem;
  display: flex;
  align-items: center;
}

.article-content h3 {
  color: #f1f5f9;
  font-size: 1.35rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  scroll-margin-top: 5.5rem;
}

.article-content h4 {
  color: #e2e8f0;
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.article-content ul, 
.article-content ol {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  padding-left: 1.75rem;
}

.article-content ul {
  list-style-type: disc;
}

.article-content ol {
  list-style-type: decimal;
}

.article-content li {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.article-content a {
  color: #a78bfa;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.article-content a:hover {
  color: #c4b5fd;
}

.article-content strong {
  color: #f8fafc;
  font-weight: 600;
}

.article-content blockquote {
  border-left: 4px solid #8b5cf6;
  background: rgba(139, 92, 246, 0.05);
  padding: 1rem 1.25rem;
  margin: 1.75rem 0;
  border-radius: 0 0.5rem 0.5rem 0;
  color: #cbd5e1;
  font-style: italic;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
  background: #121824;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #1f293d;
}

.article-content th {
  background: #182030;
  color: #f8fafc;
  font-weight: 600;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #1f293d;
}

.article-content td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #1f293d;
  color: #94a3b8;
}

.article-content tr:last-child td {
  border-bottom: none;
}

.article-content code {
  background: #1e293b;
  color: #38bdf8;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.article-content pre {
  background: #0f172a;
  border: 1px solid #1e293b;
  padding: 1.25rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin: 1.75rem 0;
}

.article-content pre code {
  background: transparent;
  color: #e2e8f0;
  padding: 0;
}

.article-content img {
  border-radius: 0.75rem;
  margin: 2rem auto;
  max-width: 100%;
  height: auto;
  border: 1px solid #1f293d;
  display: block;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

/* Card Glow Effect */
.glass-card {
  background: #121824;
  border: 1px solid #1f293d;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(139, 92, 246, 0.1);
  transform: translateY(-2px);
}

/* Table of Contents Highlight */
.toc-link.active {
  color: #a78bfa;
  font-weight: 600;
  border-left-color: #8b5cf6;
}
