/* Blog-specific styles - layers on top of styles.css from the main site */

.blog-main {
  min-height: calc(100vh - 200px);
  padding-top: 120px;
  padding-bottom: 80px;
}

/* Force navbar to always look "scrolled" on blog pages
   (blog pages may not have enough content to trigger the scroll state) */
body.blog-page .navbar {
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  padding: 10px 0;
}

/* .container is inherited from styles.css — do not redefine here */

/* Blog index */
.blog-hero {
  text-align: center;
  margin-bottom: 60px;
}

.blog-hero h1 {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin: 0 0 16px;
}

.blog-hero-subtitle {
  font-size: 1.125rem;
  opacity: 0.75;
  max-width: 640px;
  margin: 0 auto;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 32px;
}

.blog-empty {
  text-align: center;
  opacity: 0.6;
  grid-column: 1 / -1;
  padding: 80px 0;
}

.blog-card {
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s, border-color 0.2s;
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.16);
}

.blog-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.blog-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-card-body {
  padding: 24px;
}

.blog-card-categories {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.blog-tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  color: rgb(165, 180, 252);
}

.blog-card-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.3;
}

.blog-card-excerpt {
  font-size: 0.95rem;
  opacity: 0.7;
  margin: 0 0 16px;
  line-height: 1.5;
}

.blog-card-meta {
  display: flex;
  gap: 8px;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* Blog post page */
.blog-post {
  max-width: 760px;
}

.blog-post-header {
  margin-bottom: 40px;
}

.blog-post-categories {
  margin-bottom: 16px;
}

.blog-post-title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 16px;
}

.blog-post-excerpt {
  font-size: 1.25rem;
  opacity: 0.75;
  line-height: 1.5;
  margin: 0 0 32px;
}

.blog-post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.blog-post-author-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.blog-post-author-name {
  font-weight: 600;
}

.blog-post-author-meta {
  font-size: 0.875rem;
  opacity: 0.6;
}

.blog-post-cover {
  margin: 0 0 48px;
  border-radius: 16px;
  overflow: hidden;
}

.blog-post-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.blog-post-body {
  font-size: 1.0625rem;
  line-height: 1.75;
}

.blog-post-body h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  margin: 48px 0 16px;
}

.blog-post-body h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.375rem;
  font-weight: 700;
  margin: 36px 0 12px;
}

.blog-post-body h4 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  margin: 28px 0 10px;
}

.blog-post-body p {
  margin: 0 0 20px;
}

.blog-post-body a {
  color: rgb(129, 140, 248);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-post-body ul,
.blog-post-body ol {
  margin: 0 0 20px;
  padding-left: 24px;
}

.blog-post-body li {
  margin-bottom: 8px;
}

.blog-post-body blockquote {
  border-left: 4px solid rgb(99, 102, 241);
  padding-left: 20px;
  margin: 24px 0;
  font-style: italic;
  opacity: 0.85;
}

.blog-post-body code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.blog-post-body .code-block {
  margin: 24px 0;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  overflow: hidden;
}

.blog-post-body .code-filename {
  padding: 8px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  opacity: 0.6;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.blog-post-body .code-block pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
}

.blog-post-body .code-block code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

.blog-post-body .post-image {
  margin: 32px 0;
}

.blog-post-body .post-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

.blog-post-image-caption,
.post-image-caption {
  text-align: center;
  font-size: 0.875rem;
  opacity: 0.6;
  margin-top: 8px;
}

.blog-post-footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.blog-back-link {
  color: rgb(165, 180, 252);
  text-decoration: none;
  font-weight: 500;
}

.blog-back-link:hover {
  text-decoration: underline;
}

.blog-footer {
  padding: 32px 0;
  text-align: center;
  font-size: 0.875rem;
  opacity: 0.6;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.blog-footer a {
  color: inherit;
}

/* Light theme overrides */
[data-theme='light'] .blog-card {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme='light'] .blog-card:hover {
  border-color: rgba(0, 0, 0, 0.16);
}

[data-theme='light'] .blog-tag {
  background: rgba(99, 102, 241, 0.1);
  color: rgb(79, 70, 229);
}

[data-theme='light'] .blog-post-body code {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme='light'] .blog-post-body .code-block {
  background: rgba(0, 0, 0, 0.85);
  color: white;
}
