/* Modern Blog Styles */
:root {
  --primary-color: #3d59ab;
  --accent-color: #ffd700;
  --text-dark: #2c3e50;
  --text-light: #6c757d;
  --background-light: #f8f9fa;
  --white: #ffffff;
  --border-light: #e9ecef;
  --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Font Faces */
@font-face {
  font-family: "Avenir";
  src: url("../fonts/avenirlight.ttf") format("truetype");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Avenir";
  src: url("../fonts/avenirroman.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Avenir";
  src: url("../fonts/avenirmedium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Avenir";
  src: url("../fonts/avenirheavy.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

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

body {
  font-family: "Avenir", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--background-light);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  z-index: 1000;
  transition: width 0.3s ease;
}

/* Combined Hero Header Section */
.hero-header-section {
  background: linear-gradient(135deg, var(--white) 0%, var(--background-light) 100%);
  padding: 2rem 0 4rem 0;
  position: relative;
}

.blog-nav {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 0;
  transition: var(--transition);
}

.back-btn:hover {
  color: var(--primary-color);
  text-decoration: none;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.hero-text {
  max-width: 100%;
}

.category-badge {
  margin-bottom: 1.5rem;
}

.category-badge span {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.article-title {
  font-size: clamp(2.25rem, 4vw, 40px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
}

.article-description {
  font-size: 1.25rem;
  color: var(--text-light);
  line-height: 1.3;
  margin-bottom: 1rem;
}

.article-description p {
  margin: 0px;
}

.author-meta-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

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

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

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

.author-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.author-title {
  font-size: 0.875rem;
  color: var(--text-light);
  font-weight: 500;
}

.post-meta-info {
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.meta-label {
  color: var(--text-light);
  font-weight: 500;
}

.meta-value {
  color: var(--text-dark);
  font-weight: 600;
}

.reviewer {
  color: var(--primary-color);
  font-weight: 600;
}

.read-time {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--accent-color);
  color: var(--text-dark);
  text-decoration: none;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  box-shadow: var(--shadow-light);
  border: 2px solid var(--accent-color);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  text-decoration: none;
  color: var(--text-dark);
}

.hero-image {
  position: relative;
  align-self: start;
}

.image-container {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-medium);
  background: var(--white);
  padding: 1rem;
}

.featured-image {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 8px;
  transition: var(--transition);
}

.image-container:hover .featured-image {
  transform: scale(1.02);
}

/* Main Content */
.main-content {
  padding: 4rem 0;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
}

.article-content {
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-light);
}

.content-wrapper {
  padding: 2.5rem;
}

.article-text {
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--text-dark);
}

.article-text h1, .article-text h2, .article-text h3, .article-text h4, .article-text h5, .article-text h6 {
  color: black;
  margin: 1rem 0 1rem 0;
  line-height: 1.3;
}

.article-text h1 { font-size: 40px; }
.article-text h2 { font-size: 28px; }
.article-text h3 { font-size: 22px; }
.article-text h4 { font-size: 20px; }

.article-text p {
  margin-bottom: 5px;
}

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

.article-text li {
  margin-bottom: 0.5rem;
  list-style-type: disc;
}

.article-text a {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  height: 40px;
  font-size: 18px;
}

.article-text a:hover {
  border-bottom-color: var(--primary-color);
}

.article-text img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-light);
}

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

.article-text table {
  width: 100%;
  min-width: 600px; /* Ensures scroll on smaller screens */
  border-collapse: collapse;
  margin: 2rem 0;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden; /* Ensures rounded corners apply to contents */
  box-shadow: var(--shadow-light);
}

/* Wrap table in a scrollable container */
.article-text .table-container {
  width: 100%;
  overflow-x: auto;
}

.article-text th,
.article-text td {
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  text-align: left;
  font-size: 0.9rem;
}

.article-text th {
  background: #f9f9f9;
  font-weight: 600;
  color: var(--text-dark);
}

.article-text td {
  color: var(--text-light);
}

/* Optional: On hover row highlight */
.article-text tbody tr:hover {
  background: #f6f6f6;
  transition: background 0.2s ease;
}

/* Responsive: Hide min-width + enable scroll on small screens */
@media (max-width: 600px) {
  .article-text table {
    min-width: unset;
  }
}


/* Social Share */
.social-share {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}

.social-share h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.share-buttons {
  display: flex;
  gap: 0.75rem;
}

.share-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  cursor: pointer;
  transition: var(--transition);
}

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

.share-btn.linkedin {
  background: #0077b5;
  color: white;
}

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

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

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-light);
}

/* Sidebar */
.sidebar {
  position: relative;
}

.sidebar-sticky {
  position: sticky;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.toc-widget,
.related-articles {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-light);
}

.toc-widget h3,
.related-articles h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toc-nav a {
  color: var(--text-light);
  text-decoration: none;
  padding: 0.5rem 0;
  border-left: 3px solid transparent;
  padding-left: 1rem;
  font-size: 0.875rem;
  transition: var(--transition);
}

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

/* Related Articles */
.related-articles {
  padding: 1rem;
}

.articles-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.related-article {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0.75rem;
  border: 1px solid #eee;
  border-radius: 10px;
  transition: box-shadow 0.3s ease;
}

.related-article:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.related-article-image {
  width: auto;
  height: 100px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.related-article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


.related-article-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.4rem 0;
  line-height: 1.3;
}

.related-article-title a {
  text-decoration: none;
  color: var(--text-dark);
}

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


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


/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 100;
  box-shadow: var(--shadow-medium);
}

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

.back-to-top:hover {
  transform: translateY(-2px);
  background: var(--accent-color);
  color: var(--text-dark);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  background: var(--text-dark);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
  z-index: 1000;
  box-shadow: var(--shadow-medium);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toast-message {
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-text {
    order: 2;
  }

  .hero-image {
    order: 1;
    padding: 0px;
  }


  .featured-image {
    height: 300px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }


  .toc-widget {
    display: none;
  }

  .article-title {
    font-size: 2rem;
  }

  .content-wrapper {
    padding: 1.5rem;
  }

  .article-text {
    font-size: 1rem;
  }
  .article-text a{
    font-size: 1rem;
  }

  .blog-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .breadcrumb {
    display: none;
  }

  .hero-section {
    padding: 2rem 0;
  }

  .main-content {
    padding: 2rem 0;
  }

  .author-info {
    gap: 0.75rem;
  }

  .author-avatar {
    width: 50px;
    height: 50px;
  }

  .cta-button {
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
  }

  .share-buttons {
    justify-content: center;
  }

  .related-article {
    flex-direction: column;
    gap: 0.75rem;
  }

  .article-image {
    width: 100%;
    height: 120px;
  }
}

@media (max-width: 480px) {
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
  }

  .toast {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    padding: 0.75rem 1rem;
  }
}