/* ============================================
   UNIFIED TABLE OF CONTENTS STYLES
   Áp dụng cho cả Provider Review & Blog Post
   ============================================ */

/* ===== Container Layout ===== */
.container,
.review-container {
  display: grid;
  grid-template-columns: 2.5fr 7.5fr;
  gap: 40px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* ===== Sidebar Styles ===== */
.left-content,
.review-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
  max-height: calc(100vh - 120px); /* Giới hạn chiều cao */
  overflow-y: auto; /* Cho phép scroll */
  overflow-x: hidden;
}

/* ===== Ẩn scrollbar nhưng vẫn scroll được ===== */
.left-content,
.review-sidebar,
.left-content .toc,
.review-sidebar .toc {
  /* Ẩn scrollbar cho IE và Edge */
  -ms-overflow-style: none;
  /* Ẩn scrollbar cho Firefox */
  scrollbar-width: none;
}

/* Ẩn scrollbar cho Chrome, Safari, Edge (Webkit) */
.left-content::-webkit-scrollbar,
.review-sidebar::-webkit-scrollbar,
.left-content .toc::-webkit-scrollbar,
.review-sidebar .toc::-webkit-scrollbar {
  display: none;
}

/* TOC Container */
/* .toc {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
} */

.toc-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  background: inherit;
  padding-bottom: 10px;
  z-index: 1;
  background-color: #fff;
}

/* ===== Reset List Styles ===== */
#sidebar-menu,
#toc-list,
#toc-list-mobile {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

/* ===== H2 - Main Headings ===== */
#sidebar-menu li:not(.sidebar-sub):not(.toc-sub),
#toc-list li:not(.sidebar-sub):not(.toc-sub),
#toc-list-mobile li:not(.sidebar-sub):not(.toc-sub) {
  /* padding: 8px 0; */
  font-size: 15px;
  font-weight: 600;
}

#sidebar-menu li:not(.sidebar-sub):not(.toc-sub) a,
#toc-list li:not(.sidebar-sub):not(.toc-sub) a,
#toc-list-mobile li:not(.sidebar-sub):not(.toc-sub) a {
  display: block;
  text-decoration: none;
  transition:
    color 0.2s,
    background 0.2s;
  border-radius: 6px;
  padding: 4px 12px;
  color: #000;
  font-weight: 600;
  /* Text truncation */
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-line-clamp: 2;
  word-break: break-word;
  /* line-height: 1.4; */
}

/* ===== H3 - Sub Headings ===== */
#sidebar-menu li.sidebar-sub,
#sidebar-menu li.toc-sub,
#toc-list li.sidebar-sub,
#toc-list li.toc-sub,
#toc-list-mobile li.sidebar-sub,
#toc-list-mobile li.toc-sub {
  /* padding-left: 16px; */
}

#sidebar-menu li.sidebar-sub a,
#sidebar-menu li.toc-sub a,
#toc-list li.sidebar-sub a,
#toc-list li.toc-sub a,
#toc-list-mobile li.sidebar-sub a,
#toc-list-mobile li.toc-sub a {
  padding: 4px 12px;
  color: #666;
  text-decoration: none;
  font-weight: 400;
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.2s;
  display: block;
  /* Text truncation */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-line-clamp: 2;
  word-break: break-word;
  /* line-height: 1.4; */
}

/* Icon for H3 */
#sidebar-menu li.sidebar-sub a::before,
#sidebar-menu li.toc-sub a::before,
#toc-list li.sidebar-sub a::before,
#toc-list li.toc-sub a::before,
#toc-list-mobile li.sidebar-sub a::before,
#toc-list-mobile li.toc-sub a::before {
  content: "└ ";
  color: #999;
  margin-right: 5px;
}

/* ===== Hover States ===== */
#sidebar-menu li:not(.sidebar-sub):not(.toc-sub) a:hover,
#toc-list li:not(.sidebar-sub):not(.toc-sub) a:hover,
#toc-list-mobile li:not(.sidebar-sub):not(.toc-sub) a:hover {
  background: #188ffe;
  color: #fff;
}

#sidebar-menu li.sidebar-sub a:hover,
#sidebar-menu li.toc-sub a:hover,
#toc-list li.sidebar-sub a:hover,
#toc-list li.toc-sub a:hover,
#toc-list-mobile li.sidebar-sub a:hover,
#toc-list-mobile li.toc-sub a:hover {
  background: #188ffe;
  color: #fff;
}

/* ===== Active State ===== */
#sidebar-menu a.active-reviews,
#toc-list a.active-reviews,
#toc-list-mobile a.active-reviews {
  background: #188ffe;
  color: #fff !important;
}

#sidebar-menu li.sidebar-sub a.active-reviews,
#sidebar-menu li.toc-sub a.active-reviews,
#toc-list li.sidebar-sub a.active-reviews,
#toc-list li.toc-sub a.active-reviews,
#toc-list-mobile li.sidebar-sub a.active-reviews,
#toc-list-mobile li.toc-sub a.active-reviews {
  background: #188ffe;
  color: #fff !important;
}

/* ===== Mobile TOC ===== */
.toc-mobile {
  display: none;
  margin: 20px 0;
}

.toc-toggle {
  background: white;
  color: black;
  border: 1px solid #e5e7eb;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: center;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.toc-toggle:hover {
  background-color: #188ffe;
  color: white;
  border-color: #188ffe;
}

.toc-toggle i {
  font-size: 14px;
}

.toc-content {
  display: none;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 15px;
  margin-top: 10px;
  max-height: 400px;
  overflow-y: auto;
  /* Ẩn scrollbar cho mobile TOC */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.toc-content::-webkit-scrollbar {
  display: none;
}

.toc-content.show {
  display: block;
}

/* ===== Smooth Scroll ===== */
html {
  scroll-behavior: smooth;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
  .container,
  .review-container {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 20px auto;
    padding: 0 20px;
  }

  .left-content,
  .review-sidebar {
    display: none;
  }

  .toc-mobile {
    display: block;
  }

  .right-content,
  .content-right {
    width: 100%;
    padding-top: 80px;
  }
}

@media (min-width: 992px) {
  .toc-mobile {
    display: none;
  }

  .left-content,
  .review-sidebar {
    display: block;
  }
}

/* ===== Content Heading Styles ===== */
.review-content h2,
.article-body h2 {
  font-size: 32px;
  font-weight: 510;
  margin: 15px 0;
  color: #1a1a1a;
  scroll-margin-top: 100px;
}

.review-content h3,
.article-body h3 {
  font-size: 24px;
  font-weight: 510;
  margin: 15px 0;
  color: #1a1a1a;
  scroll-margin-top: 100px;
}

.review-content h4,
.article-body h4 {
  font-size: 18px;
  font-weight: 510;
  margin: 15px 0;
  color: #1a1a1a;
}

/* ===== Content Paragraph Styles ===== */
.content-post p,
.article-body p {
  margin: 10px 0;
  line-height: 22px;
  font-size: 14px;
  font-weight: 300;
}

.content-post p strong,
.article-body p strong {
  font-weight: 510;
}
