/* Blog Global Styles */
:root {
  --primary-color: #0066cc;
  --text-color: #333;
  --background: #ffffff;
  --border-color: #e0e0e0;
  --code-bg: #f5f5f5;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background: var(--background);
}

/* Blog Header */
.blog-header {
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.blog-nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo {
  background: var(--primary-color);
  color: white;
  padding: 0.5rem;
  border-radius: 4px;
}

.nav-links a {
  margin-left: 2rem;
  text-decoration: none;
  color: var(--text-color);
  transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-color);
}

/* Blog Content */
.blog-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: calc(100vh - 200px);
}

/* Blog Home */
.blog-hero {
  text-align: center;
  padding: 3rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 3rem;
}

.blog-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

/* Posts List */
.posts-list {
  display: grid;
  gap: 2rem;
}

.post-preview {
  display: flex;
  gap: 2rem;
  padding: 2rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.post-preview:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.post-thumbnail {
  flex: 0 0 300px;
}

.post-thumbnail img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
}

.post-preview-content {
  flex: 1;
}

.post-preview h2 {
  margin-bottom: 0.5rem;
}

.post-preview h2 a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s;
}

.post-preview h2 a:hover {
  color: var(--primary-color);
}

.post-meta {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.post-excerpt {
  margin-bottom: 1rem;
  color: #555;
}

.read-more {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

/* Individual Post */
.blog-post {
  max-width: 800px;
  margin: 0 auto;
}

.post-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.post-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.post-categories {
  margin-top: 1rem;
}

.category-tag {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-right: 0.5rem;
}

/* Post Content Styling */
.post-content {
  font-size: 1.1rem;
  line-height: 1.8;
}

.post-content h2 {
  margin: 2rem 0 1rem;
  color: var(--primary-color);
}

.post-content h3 {
  margin: 1.5rem 0 0.75rem;
}

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

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 2rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.post-content video {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 2rem 0;
}

.post-content ul,
.post-content ol {
  margin: 1rem 0 1.5rem 2rem;
}

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

.post-content code {
  background: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.post-content pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-content pre code {
  background: none;
  padding: 0;
}

/* Post Footer */
.post-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.post-navigation {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.btn-back,
.btn-portfolio {
  padding: 0.5rem 1rem;
  border: 1px solid var(--primary-color);
  border-radius: 4px;
  text-decoration: none;
  color: var(--primary-color);
  transition: all 0.3s;
}

.btn-back:hover,
.btn-portfolio:hover {
  background: var(--primary-color);
  color: white;
}

.post-tags {
  margin-top: 1rem;
}

.tag {
  background: #f0f0f0;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.85rem;
  margin-right: 0.5rem;
}

/* Blog Footer */
.blog-footer {
  background: #f8f8f8;
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.social-links {
  margin-top: 1rem;
}

.social-links a {
  margin: 0 0.5rem;
  color: var(--text-color);
  font-size: 1.2rem;
  transition: color 0.3s;
}

.social-links a:hover {
  color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
  .post-preview {
    flex-direction: column;
  }
  
  .post-thumbnail {
    flex: 1;
  }
  
  .post-title {
    font-size: 2rem;
  }
  
  .nav-links a {
    margin-left: 1rem;
  }
}

/* Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #0066cc, #00aaff);
  z-index: 1000;
  transition: width 0.2s;
}

/* Copy Code Button */
.copy-code-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 102, 204, 0.8);
  color: white;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s;
  z-index: 10;
}

.copy-code-btn:hover {
  background: rgba(0, 102, 204, 1);
  transform: scale(1.05);
}

/* Table of Contents */
.table-of-contents {
  background: #f8f9fa;
  border-left: 4px solid var(--primary-color);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 4px;
}

.table-of-contents h3 {
  margin-top: 0;
  color: var(--primary-color);
  font-size: 1.2rem;
}

.table-of-contents ul {
  list-style: none;
  margin: 1rem 0 0 0;
  padding: 0;
}

.table-of-contents li {
  margin: 0.5rem 0;
}

.table-of-contents li.h3 {
  margin-left: 1.5rem;
  font-size: 0.95rem;
}

.table-of-contents a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s;
}

.table-of-contents a:hover {
  color: var(--primary-color);
}

/* Post Images Enhancement */
.post-content figure {
  margin: 2rem 0;
  text-align: center;
}

.post-content figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
}

/* Callout Boxes */
.callout {
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-left: 4px solid var(--primary-color);
  background: #f8f9fa;
  border-radius: 4px;
}

.callout.info {
  border-color: #0066cc;
  background: #e7f3ff;
}

.callout.warning {
  border-color: #ff9800;
  background: #fff3e0;
}

.callout.success {
  border-color: #4caf50;
  background: #e8f5e9;
}

/* Mobile menu enhancement */
@media (max-width: 768px) {
  .blog-nav {
    flex-wrap: wrap;
  }
  
  .nav-links {
    width: 100%;
    margin-top: 1rem;
    display: flex;
    justify-content: space-around;
  }
  
  .nav-links a {
    margin: 0;
    font-size: 0.9rem;
  }
}

/* Print styles */
@media print {
  .blog-header,
  .blog-footer,
  .post-navigation,
  .copy-code-btn,
  .reading-progress {
    display: none;
  }
  
  .post-content {
    max-width: 100%;
  }
}

/* Post Featured Image */
.post-featured-image {
  margin: 2rem 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.post-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Share Buttons */
.post-share {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  text-align: center;
}

.post-share h4 {
  margin-bottom: 1rem;
  color: var(--text-color);
  font-size: 1.1rem;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
}

.share-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.share-btn.twitter {
  background: #1DA1F2;
}

.share-btn.linkedin {
  background: #0077B5;
}

.share-btn.email {
  background: #EA4335;
}

.share-btn.copy {
  background: #6c757d;
}

/* Enhanced Post Navigation */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  margin: 2rem 0;
  align-items: center;
}

.btn-prev,
.btn-next {
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-prev {
  text-align: left;
}

.btn-next {
  text-align: right;
  grid-column: 3;
}

.btn-prev:hover,
.btn-next:hover {
  border-color: var(--primary-color);
  background: rgba(0, 102, 204, 0.05);
  transform: translateY(-2px);
}

.nav-title {
  font-size: 0.85rem;
  color: #666;
  display: block;
}

.btn-back {
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--primary-color);
  transition: all 0.3s;
  white-space: nowrap;
  font-weight: 600;
}

.btn-back:hover {
  background: var(--primary-color);
  color: white;
}

.back-to-portfolio {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.btn-portfolio {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-portfolio:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}

/* Blog Hero Enhancement */
.blog-hero .subtitle {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 1rem;
}

.hero-meta {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
  color: #666;
  font-size: 0.95rem;
}

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

/* No Posts Placeholder */
.no-posts {
  text-align: center;
  padding: 4rem 2rem;
  color: #999;
}

.no-posts i {
  font-size: 4rem;
  margin-bottom: 1rem;
  color: #ddd;
}

.no-posts p {
  font-size: 1.2rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 3rem 0;
  padding: 2rem;
  border-top: 1px solid var(--border-color);
}

.pagination-btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--primary-color);
  transition: all 0.3s;
  font-weight: 600;
}

.pagination-btn:hover {
  background: var(--primary-color);
  color: white;
}

.page-number {
  color: #666;
  font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .post-navigation {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .btn-prev,
  .btn-next {
    grid-column: 1;
  }
  
  .btn-next {
    text-align: left;
  }
  
  .share-buttons {
    gap: 0.75rem;
  }
  
  .share-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .hero-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .pagination {
    flex-direction: column;
    gap: 1rem;
  }
}
