/* Post Layout Styles */

/* CSS Variables with Auto Dark Mode Detection */
:root {
  --bg-color: #ffffff;
  --text-color: #1a1a1a;
  --text-muted: #666;
  --text-light: #888;
  --border-color: #e1e1e1;
  --card-bg: #ffffff;
  --accent-color: #0066cc;
  --secondary-bg: #f8f9fa;
  --code-bg: #f5f5f5;
  --blockquote-bg: #f8f9fa;
  --blockquote-border: #0066cc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #1a1a1a;
    --text-color: #e1e1e1;
    --text-muted: #c9c9c9;
    --text-light: #aaa;
    --border-color: #333;
    --card-bg: #2a2a2a;
    --accent-color: #4dabf7;
    --secondary-bg: #252525;
    --code-bg: #2a2a2a;
    --blockquote-bg: #252525;
    --blockquote-border: #4dabf7;
  }
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.7;
  color: var(--text-color);
  background: var(--bg-color);
  transition: background-color 0.3s, color 0.3s;
}

/* Header & Navigation */
.post-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  transition: background-color 0.3s;
}

@media (prefers-color-scheme: dark) {
  .post-header {
    background: rgba(26, 26, 26, 0.95);
    border-bottom: 1px solid #333;
  }
}

.post-nav {
  padding: 1rem 0;
}

.nav-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 2rem;
}

.nav-home,
.nav-blog {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-home:hover,
.nav-blog:hover {
  color: var(--accent-color);
}

/* Main Content */
.post-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

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

.article-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.article-date {
  font-weight: 500;
}

.reading-time {
  position: relative;
  padding-left: 1rem;
}

.reading-time::before {
  content: "•";
  position: absolute;
  left: 0.5rem;
}

.article-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.article-subtitle {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.article-categories {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.category-tag {
  background: var(--secondary-bg);
  color: var(--text-muted);
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Article Content */
.article-content {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 3rem;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  color: var(--text-color);
  font-weight: 600;
  line-height: 1.3;
  margin: 2rem 0 1rem 0;
}

.article-content h1 { font-size: 2rem; }
.article-content h2 { font-size: 1.75rem; }
.article-content h3 { font-size: 1.5rem; }
.article-content h4 { font-size: 1.25rem; }
.article-content h5 { font-size: 1.1rem; }
.article-content h6 { font-size: 1rem; }

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

.article-content a {
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.article-content a:hover {
  border-bottom-color: var(--accent-color);
}

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

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

.article-content blockquote {
  background: var(--blockquote-bg);
  border-left: 4px solid var(--blockquote-border);
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-light);
}

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

/* Code Blocks */
.article-content pre {
  background: var(--code-bg) !important;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  overflow-x: auto;
  border: 1px solid var(--border-color);
}

.article-content code {
  font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
  font-size: 0.9em;
}

.article-content p code,
.article-content li code {
  background: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

/* Tables */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

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

.article-content th {
  background: var(--secondary-bg);
  font-weight: 600;
}

.article-content tr:last-child td {
  border-bottom: none;
}

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

.article-tags {
  margin-bottom: 1.5rem;
}

.tags-label {
  font-weight: 600;
  color: var(--text-color);
  margin-right: 1rem;
}

.tag {
  background: var(--secondary-bg);
  color: var(--text-muted);
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.85rem;
  margin-right: 0.5rem;
  display: inline-block;
}

.article-share {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.share-label {
  .lang-switch {
  color: var(--text-color);
}

.share-link {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent-color);
  border-radius: 6px;
  transition: all 0.2s;
}

.share-link:hover {
  background: var(--accent-color);
  color: white;
}

/* Post Navigation */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  .lang-switch .divider { color: var(--text-light); }
  margin: 3rem 0;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
}

.nav-previous,
.nav-next {
  display: block;
  text-decoration: none;
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.3s;
}

.nav-previous:hover,
.nav-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.nav-next {
  text-align: right;
}

.nav-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.nav-title {
  display: block;
  font-weight: 600;
  color: var(--text-color);
  line-height: 1.3;
}

/* Back to Blog */
.back-to-blog {
  text-align: center;
  margin-top: 2rem;
}

.back-link {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--accent-color);
  border-radius: 6px;
  transition: all 0.2s;
}

.back-link:hover {
  background: var(--accent-color);
  color: white;
}

/* Language Switch */


/* Responsive Design */
@media (max-width: 768px) {
  .post-main {
    padding: 1.5rem 1rem;
  }
  
  .article-title {
    font-size: 2rem;
  }
  
  .article-content {
    font-size: 1rem;
  }
  
  .nav-container {
    padding: 0 1rem;
  }
  
  .post-navigation {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .nav-next {
    text-align: left;
  }
  
  .article-share {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .article-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .reading-time::before {
    display: none;
  }
  
  .article-categories {
    justify-content: flex-start;
  }
}
