/* ==========================================================================
   TIMKHOANVAY.COM - SINGLE ARTICLE & SEO STYLES (E-E-A-T Optimized)
   High-legibility typography for Vietnamese content
   ========================================================================== */

/* Breadcrumb Navigation */
.breadcrumb-nav {
  padding: 1.5rem 0 0.75rem;
}
.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  list-style: none;
  font-size: 0.95rem;
  color: var(--text-light);
}
.breadcrumb-item a {
  color: var(--text-muted);
  font-weight: 500;
}
.breadcrumb-item a:hover {
  color: var(--primary);
}
.breadcrumb-separator {
  color: #cbd5e1;
}
.breadcrumb-item.active {
  color: var(--text-main);
  font-weight: 600;
}

/* Article Layout Grid */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 2.75rem;
  padding: 1.5rem 0 4.5rem;
  align-items: start;
}

.article-main {
  background: #ffffff;
  padding: 3rem;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

/* Article Header */
.article-header {
  margin-bottom: 2.25rem;
  border-bottom: 1.5px solid var(--border-color);
  padding-bottom: 1.75rem;
}
.article-title {
  font-size: 2.45rem;
  font-weight: 800;
  line-height: 1.3;
  color: #081938;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
}

.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-light);
}
.article-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.article-meta-item svg {
  color: var(--primary);
}

/* Featured Image */
.article-featured-image {
  margin-bottom: 2.25rem;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.article-featured-image img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

/* Table of Contents (TOC) */
.toc-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0 2.5rem;
}
.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.toc-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #081938;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.toc-toggle-btn {
  background: none;
  border: none;
  font-size: 0.95rem;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}
.toc-list {
  margin-top: 1.15rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.toc-list li {
  font-size: 1.02rem;
  line-height: 1.5;
}
.toc-list li.toc-level-3 {
  padding-left: 1.5rem;
  font-size: 0.96rem;
}
.toc-list a {
  color: var(--text-muted);
  font-weight: 500;
}
.toc-list a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Article Typography & Content Elements */
.article-content {
  font-size: 1.08rem;
  line-height: 1.78;
  color: #243247;
  letter-spacing: -0.01em;
}
.article-content p {
  margin-bottom: 1.35rem;
}
.article-content h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: #081938;
  margin: 2.25rem 0 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid #f1f5f9;
  letter-spacing: -0.02em;
}
.article-content h3 {
  font-size: 1.28rem;
  font-weight: 800;
  color: #1e293b;
  margin: 1.75rem 0 0.85rem;
}
.article-content ul, .article-content ol {
  margin: 1.15rem 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.article-content li {
  line-height: 1.7;
}

.article-content strong {
  color: #081938;
}

.article-content blockquote {
  border-left: 4px solid var(--primary);
  background: #f0f7ff;
  padding: 1.15rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.75rem 0;
  font-style: italic;
  color: #1e3a8a;
  font-size: 1.05rem;
}

/* Article Rating Widget */
.article-rating-widget {
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 2.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.rating-widget-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}
.rating-widget-title {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-main);
}
.rating-stars-row {
  display: inline-flex;
  gap: 4px;
  cursor: pointer;
}
.rating-star {
  font-size: 1.45rem;
  color: #cbd5e1;
  transition: color 0.15s ease, transform 0.1s ease;
  user-select: none;
}
.rating-star.active {
  color: #f59e0b;
}
.rating-star:hover {
  transform: scale(1.18);
  color: #f59e0b;
}
.rating-score-display {
  font-size: 0.95rem;
  color: var(--text-muted);
}
.rating-score-display strong {
  color: #d97706;
}
.rating-feedback-msg {
  font-size: 0.88rem;
  color: var(--text-light);
}

/* In-Content Loan CTA Box */
.incontent-loan-cta {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.incontent-cta-info h4 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 0.4rem;
}
.incontent-cta-info p {
  margin: 0;
  font-size: 1rem;
  color: #2563eb;
  font-weight: 500;
}

/* FAQ Accordion in Single Post */
.faq-section {
  margin: 3rem 0 2rem;
  padding-top: 2rem;
  border-top: 2px solid #f1f5f9;
}
.faq-section h3 {
  font-size: 1.45rem;
  color: #081938;
  margin-bottom: 1.5rem;
}
.faq-item {
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.85rem;
  overflow: hidden;
  background: #ffffff;
}
.faq-question {
  width: 100%;
  text-align: left;
  padding: 1.15rem 1.4rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: #081938;
  background: #f8fafc;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-answer {
  padding: 1.4rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.75;
  display: none;
}
.faq-item.active .faq-answer {
  display: block;
}

/* E-E-A-T Author & Reviewer Box */
.author-box {
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin: 3rem 0 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-border);
  flex-shrink: 0;
}
.author-info h4 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}
.author-role {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 0.6rem;
}
.author-bio {
  font-size: 0.96rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Social Share Bar */
.social-share-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 2.25rem 0;
  padding: 1.15rem 0;
  border-top: 1.5px solid var(--border-color);
  border-bottom: 1.5px solid var(--border-color);
}
.share-label {
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--text-main);
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.share-btn:hover {
  opacity: 0.9;
}
.share-btn.facebook { background: #1877f2; }
.share-btn.zalo { background: #0068ff; }
.share-btn.copy-link { background: #475569; }

/* Related Articles */
.related-posts-section {
  margin-top: 3.5rem;
}
.related-posts-section h3 {
  font-size: 1.45rem;
  margin-bottom: 1.75rem;
}

/* Sidebar Widgets */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 95px;
}

.widget-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-color);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}
.widget-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #081938;
  margin-bottom: 1.4rem;
  padding-bottom: 0.65rem;
  border-bottom: 2.5px solid var(--primary-light);
}

.popular-loans-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}
.popular-loan-item {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid var(--border-subtle);
}
.popular-loan-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}
.popular-loan-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
  border: 1.5px solid var(--border-color);
  padding: 3px;
}
.popular-loan-info {
  flex-grow: 1;
}
.popular-loan-title {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-main);
}
.popular-loan-sub {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 700;
}

/* ==========================================================================
   WIDGET: BÀI VIẾT XEM NHIỀU (POPULAR ARTICLES SIDEBAR)
   ========================================================================== */
.popular-posts-widget {
  margin-top: 1.75rem;
}

.sidebar-popular-posts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-post-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px dashed var(--border-subtle);
  position: relative;
  transition: transform 0.2s ease;
}
.sidebar-post-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}
.sidebar-post-item:hover {
  transform: translateX(3px);
}

.sidebar-post-rank {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-post-rank.rank-top {
  background: linear-gradient(135deg, var(--primary) 0%, #0040a1 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 86, 210, 0.3);
}

.sidebar-post-thumb {
  width: 66px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  display: block;
}
.sidebar-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.sidebar-post-item:hover .sidebar-post-thumb img {
  transform: scale(1.08);
}
.sidebar-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: var(--primary);
}

.sidebar-post-body {
  flex: 1;
  min-width: 0;
}

.sidebar-post-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.3rem;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sidebar-post-title a {
  color: var(--text-main);
  text-decoration: none !important;
  transition: color 0.2s ease;
}
.sidebar-post-title a:hover {
  color: var(--primary);
}

.sidebar-post-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-light);
}
.sidebar-post-meta svg {
  color: #94a3b8;
}

/* Responsive */
@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .article-main {
    padding: 1.75rem;
  }
  .article-title {
    font-size: 1.85rem;
  }
  .incontent-loan-cta {
    flex-direction: column;
    text-align: center;
  }
}
