/* Blog Post Styles */
:root {
  --bg-color: #fff;
  --text-color: #333;
  --secondary-text: #666;
  --accent-bg: #f0f0f0;
  --hover-bg: #e0e0e0;
  --blockquote-bg: #f8f8f8;
  --code-bg: #f0f0f0;
  --toc-bg: #fff;
  --toc-shadow: rgba(0,0,0,0.1);
  --border-color: #e0e0e0;
  transition: all 0.3s ease;
}

html[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #fff;
  --secondary-text: #ccc;
  --accent-bg: #333;
  --hover-bg: #444;
  --blockquote-bg: #333;
  --code-bg: #333;
  --toc-bg: #333;
  --toc-shadow: rgba(0,0,0,0.3);
  --border-color: #444;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

.post-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  background-color: var(--bg-color);
}

.post-cover {
  position: relative;
  width: 100%;
  height: 400px;
  margin-bottom: 40px;
  overflow: hidden;
  border-radius: 8px;
}

.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-cover-content {
  position: absolute;
  bottom: 40px;
  left: 40px;
  right: 40px;
  color: #000;
}

.post-cover-title {
  font-size: 42px;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 20px 0;
  line-height: 1.2;
}

.post-cover-meta {
  font-size: 16px;
  opacity: 0.9;
}

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

.post-title {
  font-size: 42px;
  line-height: 1.2;
  margin-bottom: 20px;
}

.post-meta {
  color: var(--secondary-text);
  margin-bottom: 24px;
  font-size: 14px;
}

.post-content {
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-color);
}

.post-content p {
  margin-bottom: 24px;
}

.post-content h2 {
  font-size: 28px;
  margin: 40px 0 20px;
  scroll-margin-top: 100px;
}

.post-content h3 {
  font-size: 22px;
  margin: 32px 0 16px;
  scroll-margin-top: 100px;
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 32px 0;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.post-content img:hover {
  transform: scale(1.02);
}

.post-content blockquote {
  border-left: 4px solid #000;
  margin: 32px 0;
  padding: 16px 24px;
  font-style: italic;
  background-color: var(--blockquote-bg);
  transition: background-color 0.3s ease;
}

.post-content blockquote:hover {
  background-color: #f0f0f0;
}

.post-content code {
  background-color: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.post-content pre {
  background-color: var(--code-bg);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 24px 0;
  position: relative;
}

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

.back-link {
  display: inline-block;
  margin-bottom: 60px;
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.back-link:hover {
  color: #000;
}

.category-tag {
  display: inline-block;
  padding: 4px 12px;
  background-color: var(--accent-bg);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-color);
  margin: 0 0 14px 0;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.category-tag:hover {
  background-color: var(--hover-bg);
}

.tags-container {
  margin: 32px 0;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  background-color: var(--accent-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-color);
  margin-right: 8px;
  margin-bottom: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.tag:hover {
  background-color: var(--hover-bg);
  transform: translateY(-1px);
}

.share-buttons {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e6e6e6;
}

.share-button {
  display: inline-block;
  padding: 8px 16px;
  margin-right: 8px;
  background-color: var(--accent-bg);
  border-radius: 20px;
  text-decoration: none;
  color: var(--text-color);
  font-size: 14px;
  transition: all 0.3s ease;
}

.share-button:hover {
  background-color: var(--hover-bg);
  transform: translateY(-1px);
}

/* Interactive elements */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: #f0f0f0;
  z-index: 1000;
}

.reading-progress-bar {
  height: 100%;
  background: #000;
  width: 0%;
  transition: width 0.1s ease;
}

.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 40px;
  height: 40px;
  background: #000;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  transform: translateY(-3px);
}

.table-of-contents {
  position: fixed;
  top: 100px;
  right: 30px;
  width: 250px;
  background: var(--toc-bg);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  display: none;
}

.table-of-contents.visible {
  display: block;
}

.toc-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 15px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item {
  margin-bottom: 8px;
}

.toc-link {
  color: #666;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
  display: block;
  padding: 4px 0;
}

.toc-link:hover {
  color: #000;
  transform: translateX(5px);
}

.toc-link.active {
  color: #000;
  font-weight: 500;
}

.copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
}

.post-content pre:hover .copy-button {
  opacity: 1;
}

.copy-button:hover {
  background: #f0f0f0;
}

.copy-success {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  background: #4CAF50;
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.copy-success.visible {
  opacity: 1;
}

/* Dark mode styles */
html[data-theme="dark"] {
  background-color: #1a1a1a;
  transition: background-color 0.3s ease;
}

html[data-theme="dark"] body {
  background-color: #1a1a1a;
  color: #fff;
  transition: background-color 0.3s ease, color 0.3s ease;
}

html[data-theme="dark"] .post-container {
  background-color: #1a1a1a;
  transition: background-color 0.3s ease;
}

html[data-theme="dark"] .post-cover-title,
html[data-theme="dark"] .post-content h2,
html[data-theme="dark"] .post-content h3,
html[data-theme="dark"] .post-content p,
html[data-theme="dark"] .post-content li,
html[data-theme="dark"] .back-link {
  color: #fff;
  transition: color 0.3s ease;
}

html[data-theme="dark"] .post-meta,
html[data-theme="dark"] .post-content blockquote,
html[data-theme="dark"] .tag,
html[data-theme="dark"] .share-button {
  color: #ccc;
  transition: color 0.3s ease;
}

html[data-theme="dark"] .category-tag,
html[data-theme="dark"] .tag,
html[data-theme="dark"] .share-button {
  background-color: #333;
  color: #fff;
  transition: background-color 0.3s ease, color 0.3s ease;
}

html[data-theme="dark"] .category-tag:hover,
html[data-theme="dark"] .tag:hover,
html[data-theme="dark"] .share-button:hover {
  background-color: #444;
  transition: background-color 0.3s ease;
}

html[data-theme="dark"] .post-content blockquote {
  background-color: #333;
  border-left-color: #fff;
  transition: background-color 0.3s ease, border-left-color 0.3s ease;
}

html[data-theme="dark"] .post-content code,
html[data-theme="dark"] .post-content pre {
  background-color: #333;
  color: #fff;
  transition: background-color 0.3s ease, color 0.3s ease;
}

html[data-theme="dark"] .table-of-contents {
  background: #333;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

html[data-theme="dark"] .toc-title {
  color: #fff;
  transition: color 0.3s ease;
}

html[data-theme="dark"] .toc-link {
  color: #ccc;
  transition: color 0.3s ease;
}

html[data-theme="dark"] .toc-link:hover,
html[data-theme="dark"] .toc-link.active {
  color: #fff;
  transition: color 0.3s ease;
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0f0f0;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 1000;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

[data-theme="dark"] .theme-toggle {
  background: #333;
  color: #fff;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Responsive styles */
@media screen and (max-width: 991px) {
  .post-cover {
    height: 350px;
  }
  
  .post-cover-title {
    font-size: 36px;
  }

  .table-of-contents {
    display: none !important;
  }
}

@media screen and (max-width: 767px) {
  .post-container {
    padding: 20px;
  }
  
  .post-cover {
    height: 300px;
    margin-bottom: 30px;
  }
  
  .post-cover-title {
    font-size: 32px;
  }

  .theme-toggle {
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    font-size: 18px;
  }
}

@media screen and (max-width: 479px) {
  .post-container {
    padding: 15px;
  }
  
  .post-cover {
    height: 250px;
    margin-bottom: 20px;
  }
  
  .post-cover-title {
    font-size: 28px;
  }
} 