/* Blog custom styles - complements Tailwind utility classes */

/* --- Typography (prose content) --- */
.prose {
  font-size: 18px;
  line-height: 1.8;
  color: #1e293b;
}

.prose h2 {
  font-size: 1.75em;
  font-weight: 800;
  margin-top: 2em;
  margin-bottom: 0.5em;
  color: #0f172a;
  line-height: 1.3;
}

.prose h3 {
  font-size: 1.375em;
  font-weight: 700;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  color: #0f172a;
  line-height: 1.4;
}

.prose h4 {
  font-size: 1.125em;
  font-weight: 700;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

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

.prose a {
  color: #2563eb;
  text-decoration: underline;
  text-decoration-color: #93c5fd;
  text-underline-offset: 2px;
}

.prose a:hover {
  color: #1d4ed8;
  text-decoration-color: #2563eb;
}

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

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

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

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

.prose li > ul,
.prose li > ol {
  margin-top: 0.5em;
  margin-bottom: 0;
}

.prose blockquote {
  border-left: 4px solid #e2e8f0;
  padding-left: 1em;
  margin: 1.5em 0;
  color: #475569;
  font-style: italic;
}

.prose hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 2em 0;
}

.prose img {
  border-radius: 0.5rem;
  margin: 1.5em 0;
  max-width: 100%;
  height: auto;
}

/* --- Tables --- */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9em;
}

.prose th {
  text-align: left;
  font-weight: 700;
  padding: 0.75em 1em;
  border-bottom: 2px solid #e2e8f0;
  background: #f8fafc;
}

.prose td {
  padding: 0.75em 1em;
  border-bottom: 1px solid #f1f5f9;
}

/* --- Code Blocks --- */
.prose code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
  font-size: 0.875em;
}

.prose :not(pre) > code {
  background: #f1f5f9;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  color: #e11d48;
}

.prose pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.25em 1.5em;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin: 1.5em 0;
  line-height: 1.6;
  font-size: 0.875em;
  position: relative;
}

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

/* Copy button */
.copy-btn {
  position: absolute;
  top: 0.5em;
  right: 0.5em;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
}

/* --- Syntax Highlighting (highlight.js compatible) --- */
.hljs-comment,
.hljs-quote {
  color: #64748b;
  font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in {
  color: #c084fc;
}

.hljs-string,
.hljs-attr {
  color: #86efac;
}

.hljs-number,
.hljs-literal {
  color: #fb923c;
}

.hljs-type,
.hljs-class .hljs-title {
  color: #67e8f9;
}

.hljs-function .hljs-title,
.hljs-title.function_ {
  color: #93c5fd;
}

.hljs-variable,
.hljs-template-variable {
  color: #fca5a5;
}

.hljs-meta {
  color: #94a3b8;
}

.hljs-property {
  color: #7dd3fc;
}

.hljs-params {
  color: #fbbf24;
}

/* --- Article Layout with TOC --- */
.article-layout {
  display: block;
}

.article-layout.with-toc {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 3rem;
  align-items: start;
}

.toc-sidebar {
  position: relative;
}

.toc-link.active {
  color: #1e293b;
  font-weight: 600;
}

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

/* --- Responsive --- */
@media (max-width: 1024px) {
  .article-layout.with-toc {
    display: block;
  }

  .toc-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .prose {
    font-size: 16px;
  }
}
