/* Blog Page Styles - Using shared variables from style.css */

/* Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--color-border);
  z-index: 9999;
}

.reading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-highlight), var(--color-highlight-light));
  width: 0%;
  transition: width var(--transition-duration) ease;
}

/* Blog Header */
.blog-header {
  background: var(--color-primary);
  padding: 180px 0 60px; /* Increased from 120px to avoid overlap with top-bar (45px) + navbar (~90px) */
  color: var(--color-text-reverse);
  position: relative;
  overflow: hidden;
}

.blog-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.05)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,138.7C960,139,1056,117,1152,101.3C1248,85,1344,75,1392,69.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>')
    bottom center no-repeat;
  background-size: cover;
  opacity: 0.3;
}

.blog-header .container {
  position: relative;
  z-index: 2;
}

.blog-header h1{
  color: var(--white);
}

.blog-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.blog-breadcrumb a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition);
}

.blog-breadcrumb a:hover {
  color: var(--white);
}

.blog-breadcrumb i {
  font-size: 12px;
  opacity: 0.6;
}

.blog-meta-header {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.blog-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.9);
}

.blog-meta-item i {
  color: var(--color-highlight);
}

/* Blog Content Container */
.blog-content-wrapper {
  padding: 60px 0;
  background: var(--color-body);
}

/* Main Content */
.blog-main-content {
  background: var(--color-body);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  margin-bottom: 30px;
}

.blog-featured-image {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  margin-bottom: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.blog-content h2,
.blog-content h3,
.blog-content h4 {
  color: var(--color-primary);
  margin-top: 30px;
  margin-bottom: 15px;
  font-weight: 600;
}

.blog-content h2 {
  font-size: 28px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--color-highlight);
  display: inline-block;
}

.blog-content h3 {
  font-size: 24px;
}

.blog-content h4 {
  font-size: 20px;
}

.blog-content p {
  line-height: 1.8;
  margin-bottom: 20px;
  color: var(--color-text-muted);
  font-size: 16px;
}

.blog-content ul,
.blog-content ol {
  margin: 20px 0;
  padding-left: 30px;
}

.blog-content li {
  margin-bottom: 10px;
  line-height: 1.7;
  color: var(--color-text-muted);
}

.blog-content strong {
  color: var(--color-primary);
  font-weight: 600;
}

/* Highlight Boxes */
.highlight {
  background: linear-gradient(135deg, var(--color-highlight-bg) 0%, var(--color-highlight-bg-alt) 100%);
  border-left: 4px solid var(--color-highlight);
  padding: 20px 25px;
  margin: 25px 0;
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--color-highlight-shadow);
}

.highlight p {
  margin-bottom: 10px;
}

.highlight p:last-child {
  margin-bottom: 0;
}

/* Stats List */
.stats-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.stats-item {
  background: var(--neutral);
  padding: 25px;
  border-radius: 10px;
  text-align: center;
  border: 2px solid var(--color-border);
  transition: var(--transition);
}

.stats-item:hover {
  border-color: var(--color-highlight);
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-highlight);
  margin-bottom: 10px;
  line-height: 1.2;
}

.stat-number .counter {
  display: inline-block !important;
  color: var(--color-highlight) !important;
  font-size: inherit !important;
  font-weight: inherit !important;
}

.stats-item span:last-child {
  color: var(--color-text-muted);
  font-size: 14px;
}

/* Sidebar */
.blog-sidebar {
  position: sticky;
  top: 100px;
}

.sidebar-widget {
  background: var(--neutral);
  padding: 25px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  margin-bottom: 30px;
}

.sidebar-widget h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-border);
}

/* Table of Contents */
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 12px;
}

.toc-link {
  color: var(--color-text-muted);
  text-decoration: none;
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  transition: var(--transition);
  font-size: 14px;
}

.toc-link:hover,
.toc-link.active {
  background: var(--color-highlight-bg);
  color: var(--color-highlight);
  padding-left: 20px;
}

/* Share Buttons */
.share-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--white);
  text-decoration: none;
  transition: var(--transition);
  font-size: 18px;
}

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

.share-btn.facebook {
  background: #1877f2;
}

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

.share-btn.linkedin {
  background: #0a66c2;
}

.share-btn.zalo {
  background: #0068ff;
}

.share-btn.copy {
  background: var(--color-text-muted);
}

/* Related Posts */
.related-post-card {
  background: var(--neutral);
  border-radius: 10px;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-light);
  height: 100%;
}

.related-post-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.related-post-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.related-post-content {
  padding: 20px;
}

.related-post-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-post-excerpt {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-post-link {
  color: var(--color-highlight);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: var(--transition);
}

.related-post-link:hover {
  color: var(--color-highlight-light);
}

/* Contact CTA */
.contact-cta {
  background: linear-gradient(135deg, var(--color-highlight) 0%, var(--color-highlight-light) 100%);
  color: var(--white);
  padding: 30px;
  border-radius: var(--border-radius);
  text-align: center;
}

.contact-cta h4 {
  color: var(--white);
  margin-bottom: 15px;
}

.contact-cta p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 20px;
}

.contact-cta .btn {
  background: var(--white);
  color: var(--color-highlight);
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-weight: 600;
  transition: var(--transition);
}

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

/* Author Box */
.author-box {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 25px;
  background: var(--neutral);
  border-radius: var(--border-radius);
  margin: 30px 0;
}

.author-avatar {
  padding: 5px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-highlight);
}

.author-info h5 {
  margin-bottom: 5px;
  color: var(--color-primary);
}

.author-info p {
  margin-bottom: 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

/* Back to Top Button */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--color-highlight);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 1000;
  box-shadow: 0 4px 12px var(--color-highlight-shadow);
}

#backToTop.visible {
  opacity: 1;
  visibility: visible;
}

#backToTop:hover {
  background: #218838;
  transform: translateY(-5px);
}

/* Source Citation */
.blog-source {
  margin-top: 40px;
  padding-top: 25px;
  border-top: 2px solid var(--color-border);
}

.blog-source p {
  color: var(--color-text-muted);
  font-size: 14px;
  font-style: italic;
}

.blog-source a {
  color: var(--color-highlight);
  word-break: break-all;
}

/* Tags */
.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.blog-tag {
  display: inline-block;
  background: var(--color-border);
  color: var(--color-text-muted);
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 14px;
  text-decoration: none;
  transition: var(--transition);
}

.blog-tag:hover {
  background: var(--color-highlight);
  color: var(--white);
}

/* Responsive Design */
@media (max-width: 991px) {
  .blog-header {
    padding: 140px 0 40px; /* Increased from 100px to accommodate navbar on mobile */
  }

  .blog-main-content {
    padding: 25px;
  }

  .blog-sidebar {
    position: static;
    margin-top: 30px;
  }

  .stats-list {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

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

@media (max-width: 576px) {
  .blog-header h1 {
    font-size: 24px;
  }

  .blog-main-content {
    padding: 20px;
  }

  .blog-content h2 {
    font-size: 22px;
  }

  .blog-content h3 {
    font-size: 20px;
  }

  .stats-list {
    grid-template-columns: 1fr;
  }

  #backToTop {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
  }
}

/* Print Styles */
@media print {
  .blog-header,
  .blog-sidebar,
  .share-buttons,
  .contact-cta,
  #backToTop,
  .reading-progress {
    display: none !important;
  }

  .blog-main-content {
    box-shadow: none;
  }
}
