/* style.css - extremely easy on eyes minimal dark theme */
:root{
  --bg:#0b1220;
  --panel:#0f1724;
  --muted:#9aa8b3;
  --text:#dbeafe;
  --accent:#14b8a6;
}
body{
  background:var(--bg);
  color:var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace;
  margin:0;
}
a{ color:inherit; text-decoration:none; }
header, footer{ background:transparent; }

/* Enhanced post cards with fixed dimensions */
.post-card{
  display:flex; 
  gap:1rem; 
  border:1px solid #21303a; 
  padding:0.75rem; 
  border-radius:0.5rem; 
  transition:border-color .15s; 
  align-items:center;
  background:linear-gradient(180deg, rgba(255,255,255,0.01), transparent);
  min-height: 160px;
}
.post-card:hover{ border-color:var(--accent); }

.card-img{ 
  width:140px; 
  height:92px; 
  object-fit:cover; 
  border-radius:0.375rem; 
  flex-shrink:0; 
}

.card-body{ flex:1; }
.post-date{ font-size:.8rem; color:#94a3b8; }
.post-title{ margin:.25rem 0; font-size:1.125rem; color:var(--text); }
.post-excerpt{ color:var(--muted); margin:0; }

/* post page image */
.post-feature-img{ 
  width:100%; 
  max-height:420px; 
  object-fit:cover; 
  border-radius:0.5rem; 
}

/* code block tweaks */
pre{ 
  background:var(--panel); 
  padding:1rem; 
  border-radius:0.5rem; 
  overflow-x:auto; 
  margin:0 0 1rem 0; 
}
code{ font-family:inherit; }

/* responsive grid */
.posts-grid{ 
  display:grid; 
  gap:1.5rem; 
  grid-template-columns:1fr; 
}
@media(min-width:768px){ 
  .posts-grid{ 
    grid-template-columns:1fr 1fr; 
  } 
}

/* footer smaller */
footer{ font-size:0.9rem; }

/* improve article typography slightly */
.prose img{ border-radius:0.5rem; }
.prose h2, .prose h3{ color:var(--text); margin-top:1.5rem; }

/* CLEAN TOC STYLE (like the design you showed) */
.toc-clean {
  margin: 1.5rem 0;
  max-width: 100%;
}

.toc-clean ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-clean li {
  margin: 0.5rem 0;
}

.toc-clean a {
  display: block;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
  text-decoration: none;
}

.toc-clean a:hover {
  color: #60a5fa !important;
}

/* Sub-items (H3+) styling */
.toc-clean ul ul {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.toc-clean ul ul li {
  margin: 0.25rem 0;
}

/* Remove sticky positioning */
.toc {
  position: static;
  z-index: auto;
}

/* MINIMAL TOC STYLE */
.toc-minimal {
  margin: 1rem 0;
}

.toc-minimal a {
  display: block;
  padding: 0.25rem 0;
  transition: all 0.2s ease;
  position: relative;
}

.toc-minimal a:hover {
  padding-left: 0.5rem;
}

.toc-minimal a.active {
  color: var(--accent);
  font-weight: 600;
}

.toc-minimal a.active::before {
  content: '▶';
  position: absolute;
  left: -1rem;
  color: var(--accent);
  font-size: 0.75rem;
}

/* NUMBERED TOC STYLE */
.counter-reset-toc {
  counter-reset: toc-counter;
}

.counter-increment-toc {
  counter-increment: toc-counter;
}

/* SIDEBAR TOC STYLE */
.toc-sidebar {
  max-height: 60vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--panel);
}

.toc-sidebar::-webkit-scrollbar {
  width: 4px;
}

.toc-sidebar::-webkit-scrollbar-track {
  background: var(--panel);
}

.toc-sidebar::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 2px;
}

.toc-sidebar a.active {
  color: var(--accent);
  background: rgba(20, 184, 166, 0.1);
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  margin: 0.125rem 0;
}

/* Tag styles */
.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--panel);
  color: var(--accent);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid rgba(20, 184, 166, 0.2);
  transition: all 0.2s ease;
}

.tag:hover {
  background: rgba(20, 184, 166, 0.1);
  border-color: var(--accent);
}

/* Reading time badge */
.reading-time {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Better responsive behavior for cards */
@media (max-width: 767px) {
  .post-card {
    flex-direction: column;
    text-align: left;
    min-height: auto;
  }
  
  .card-img {
    width: 100%;
    height: 180px;
    margin-bottom: 0.5rem;
  }
  
  /* Hide sidebar TOC on mobile */
  .toc-sidebar {
    display: none;
  }
}

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

/* Better heading spacing in articles */
.prose h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #374151;
  scroll-margin-top: 2rem; /* Account for sticky header */
}

.prose h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  scroll-margin-top: 2rem;
}

.prose h4, .prose h5, .prose h6 {
  scroll-margin-top: 2rem;
}

/* Custom TOC animations */
.toc a, .toc-minimal a, .toc-sidebar a {
  transform: translateX(0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toc a:hover, .toc-minimal a:hover {
  transform: translateX(4px);
}

/* Progress indicator for TOC (optional) */
.toc-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--scroll-progress, 0%), transparent var(--scroll-progress, 0%));
  z-index: 1000;
  transition: opacity 0.3s ease;
}