/* Blog Design System */

/* 1. Typography & Global */
.blog-post {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.125rem; /* Increased for readability */
  line-height: 1.7;
  color: var(--text);
}

.gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block; /* Ensure gradient works correctly */
}

/* Headings */
.blog-post h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.blog-post h2 {
  font-size: 1.85rem;
  margin-top: 3.5rem;
  margin-bottom: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(132, 75, 222, 0.1); /* Subtle purple border */
}

.blog-post h3 {
  font-size: 1.45rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.blog-post h4 {
  font-size: 1.2rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--text-heading);
}

.blog-post p {
  margin-bottom: 1.5rem;
}

.blog-post ul, .blog-post ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.blog-post li {
  margin-bottom: 0.5rem;
}

.blog-post hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3.5rem 0;
  opacity: 0.5;
}

/* 2. Components */

/* Code Blocks - High Contrast & Readability */
.blog-post pre {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 2rem 0;
  font-size: 0.95rem;
  line-height: 1.6;
  border: 1px solid rgba(132, 75, 222, 0.2);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  background: #1c2128;
  color: #e6edf3;
}

.blog-post pre code {
  background: none;
  padding: 0;
  font-family: 'SF Mono', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
  color: inherit;
}

/* Highlight.js syntax colors - bright on dark, no external theme */
.blog-post pre .hljs-keyword { color: #ff7b72; }
.blog-post pre .hljs-string { color: #a5d6ff; }
.blog-post pre .hljs-number { color: #79c0ff; }
.blog-post pre .hljs-title { color: #d2a8ff; }
.blog-post pre .hljs-built_in { color: #ffa657; }
.blog-post pre .hljs-comment { color: #8b949e; }
.blog-post pre .hljs-meta { color: #8b949e; }
.blog-post pre .hljs-params { color: #e6edf3; }
.blog-post pre .hljs-variable { color: #ffa657; }
.blog-post pre .hljs-attr { color: #79c0ff; }
.blog-post pre .hljs-function { color: #d2a8ff; }
.blog-post pre .hljs-punctuation { color: #e6edf3; }
.blog-post pre .hljs-operator { color: #ff7b72; }
.blog-post pre .hljs-class { color: #7ee787; }
.blog-post pre .hljs-deletion { color: #ff7b72; }
.blog-post pre .hljs-addition { color: #7ee787; }

/* Inline Code */
.blog-post :not(pre) > code {
  background: rgba(132, 75, 222, 0.1);
  color: var(--color-purple);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.9em;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-weight: 500;
}

/* Blockquotes */
.blog-post blockquote {
  background: linear-gradient(to right, rgba(132, 75, 222, 0.05), transparent);
  border-left: 4px solid var(--color-purple);
  padding: 1.5rem;
  margin: 2rem 0;
  color: var(--muted);
  font-style: italic;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.blog-post blockquote p:last-child {
  margin-bottom: 0;
}

/* Tables */
.blog-post table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2rem 0;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden; /* For rounded corners */
}

.blog-post th,
.blog-post td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.blog-post th {
  background: rgba(132, 75, 222, 0.08);
  font-weight: 600;
  color: var(--text-heading);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.blog-post tr:last-child td {
  border-bottom: none;
}

.blog-post tr:hover td {
  background: rgba(132, 75, 222, 0.02);
}

/* Images */
.blog-post .post-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  display: block;
  transition: transform 0.3s ease;
}

.blog-post .post-image:hover {
  transform: scale(1.01);
}

.blog-post .post-image-wrap {
  text-align: center;
  margin: 2.5rem 0;
}

/* Meta Info */
.blog-meta {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 2.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}

.blog-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Back Link */
.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 2.5rem;
  transition: all 0.2s ease;
  opacity: 0.8;
}

.blog-back:hover {
  color: var(--color-purple);
  opacity: 1;
  transform: translateX(-4px);
}

/* Blog Index Cards (Elevated) */
.blog-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid rgba(226, 232, 240, 0.8);
  padding: 2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-card .blog-card-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-purple);
  background: rgba(132, 75, 222, 0.12);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.blog-card .blog-card-media {
  width: 100%;
  height: 220px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: #0f172a;
  box-shadow: 0 10px 22px -14px rgba(15, 23, 42, 0.45);
  position: relative;
  flex: 0 0 auto;
}

.blog-card .blog-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .blog-card .blog-card-media {
    height: 200px;
  }
}

.blog-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--brand-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: rgba(132, 75, 222, 0.3);
}

.blog-card:hover::before {
  opacity: 1;
}

.blog-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.blog-card .muted {
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.blog-card p {
  flex-grow: 1;
  margin-bottom: 1.5rem;
  color: var(--muted);
  line-height: 1.6;
}

.blog-card .btn {
  align-self: flex-start;
}
