/* Blog Styles - Medium-like Design */
/* Inherits from main portfolio design system */

:root {
  --bg-body: #ffffff;
  --bg-subtle: #f9fafb;
  --bg-dark: #111827;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --text-main: #111827;
  --text-body: #374151;
  --text-muted: #6b7280;
  --text-inverted: #ffffff;
  --border-light: #f3f4f6;
  --border-medium: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-serif: 'Georgia', 'Cambria', 'Times New Roman', serif;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;
  --transition: 0.2s ease-in-out;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-body);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

/* Blog Header */
.blog-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 0;
}

.blog-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.blog-header .brand {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--text-main);
  text-decoration: none;
}

.blog-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.blog-header .back-link:hover {
  color: var(--primary);
}

/* Container */
.container {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-wide {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Article Layout */
.article {
  padding: 4rem 0;
}

/* Article Header */
.article-header {
  margin-bottom: 3rem;
  text-align: center;
}

.article-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.article-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 1.5rem;
}

.article-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 36rem;
  margin: 0 auto 2rem;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  object-fit: cover;
}

.author-details {
  text-align: left;
}

.author-name {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.9375rem;
}

.publish-date {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.read-time {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Featured Image */
.featured-image {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radius-2xl);
  margin-bottom: 3rem;
}

/* Article Content - Medium-like Typography */
.article-content {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.9;
  color: var(--text-body);
}

.article-content h1 {
  font-family: var(--font-sans);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-main);
  margin: 3rem 0 1.5rem;
  letter-spacing: -0.02em;
}

.article-content h2 {
  font-family: var(--font-sans);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-main);
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.01em;
}

.article-content h3 {
  font-family: var(--font-sans);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-main);
  margin: 2rem 0 0.75rem;
}

.article-content h4 {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-main);
  margin: 1.5rem 0 0.5rem;
}

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

.article-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition);
}

.article-content a:hover {
  color: var(--primary-hover);
}

.article-content strong {
  font-weight: 700;
  color: var(--text-main);
}

.article-content em {
  font-style: italic;
}

/* Lists */
.article-content ul,
.article-content ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.75rem;
}

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

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

/* Blockquote - Medium style */
.article-content blockquote {
  margin: 2rem 0;
  padding: 1rem 0 1rem 1.5rem;
  border-left: 4px solid var(--primary);
  background: transparent;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--text-main);
}

.article-content blockquote p {
  margin-bottom: 0;
}

/* Code */
.article-content code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.9em;
  background: var(--bg-subtle);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  color: var(--text-main);
}

.article-content pre {
  background: var(--bg-dark);
  color: #e5e7eb;
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  overflow-x: auto;
  margin: 2rem 0;
  font-size: 0.875rem;
  line-height: 1.7;
}

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

/* Images in content */
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
  margin: 2rem 0;
}

.article-content figure {
  margin: 2rem 0;
}

.article-content figcaption {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
}

/* Horizontal Rule */
.article-content hr {
  border: none;
  height: 1px;
  background: var(--border-medium);
  margin: 3rem 0;
}

/* Pull Quote / Highlight */
.article-content .highlight {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-main);
  text-align: center;
  padding: 2rem 0;
  margin: 2rem 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

/* Table */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
}

.article-content th,
.article-content td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-medium);
}

.article-content th {
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-subtle);
}

/* Article Footer */
.article-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-medium);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tag {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  background: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  color: var(--text-body);
  text-decoration: none;
  transition: all var(--transition);
}

.tag:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Author Box */
.author-box {
  display: flex;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-2xl);
  margin-top: 2rem;
}

.author-box-avatar {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-box-content h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.author-box-content p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.author-box-links {
  display: flex;
  gap: 1rem;
}

.author-box-links a {
  font-size: 0.875rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.author-box-links a:hover {
  text-decoration: underline;
}

/* Related Posts */
.related-posts {
  padding: 4rem 0;
  background: var(--bg-subtle);
  margin-top: 4rem;
}

.related-posts h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2rem;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.related-card {
  background: var(--bg-body);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  padding: 1.5rem;
  text-decoration: none;
  transition: all var(--transition);
}

.related-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.related-card h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.related-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Blog Footer */
.blog-footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.blog-footer p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.blog-footer a {
  color: var(--primary);
  text-decoration: none;
}

.blog-footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .article {
    padding: 2rem 0;
  }

  .article-content {
    font-size: 1.0625rem;
  }

  .article-content h1 {
    font-size: 1.75rem;
  }

  .article-content h2 {
    font-size: 1.5rem;
  }

  .author-box {
    flex-direction: column;
    text-align: center;
  }

  .author-box-avatar {
    margin: 0 auto;
  }

  .author-box-links {
    justify-content: center;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
