/* =========================================================================
   BLOG & ARTICLE PAGES STYLES - VIDDOW.COM (v3.5.0)
   Tuân thủ quy chuẩn: Thuần Blog, Không Card phức tạp, Không Bảng,
   Tối ưu GEO Definition & SEO Typography, 6 Related Articles Grid
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Trang Danh Sách Blog (/blog)
   ------------------------------------------------------------------------- */
.main-content.blog-list-main-content {
  max-width: 1140px;
}

@media (max-width: 1360px) {
  .main-content.blog-list-main-content {
    max-width: 100%;
  }
}

/* Bố cục lưới danh sách bài viết (/blog):
   - Máy tính & Máy tính bảng: 3 card 1 dòng (3 bài / hàng)
   - Điện thoại di động: 1 card 1 dòng (1 bài / hàng) */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 32px 0 60px;
  width: 100%;
  box-sizing: border-box;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-sizing: border-box;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: rgba(249, 115, 22, 0.45);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.blog-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0b0f19;
  display: block;
}

.blog-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  box-sizing: border-box;
}

.blog-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #f97316;
  margin-bottom: 8px;
}

.blog-card-title {
  font-size: 17.5px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
}

.blog-card-title a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-card-title a:hover {
  color: #f97316;
}

.blog-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}

/* Máy tính bảng (Tablet: 768px - 1024px) - Giữ chuẩn 3 card 1 dòng, tối ưu padding & chữ */
@media (max-width: 1024px) and (min-width: 768px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 26px 0 48px;
  }

  .blog-body {
    padding: 15px 13px;
  }

  .blog-card-title {
    font-size: 15px;
    line-height: 1.35;
    margin-bottom: 8px;
  }

  .blog-summary {
    font-size: 13px;
    line-height: 1.5;
    -webkit-line-clamp: 3;
  }
}

/* Điện thoại di động (Mobile: < 768px) - 1 card 1 dòng */
@media (max-width: 767.98px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 20px 0 40px;
  }

  .blog-card {
    border-radius: var(--radius-md, 12px);
  }

  .blog-body {
    padding: 18px 16px;
  }

  .blog-card-title {
    font-size: 17px;
    line-height: 1.4;
    margin-bottom: 8px;
  }

  .blog-summary {
    font-size: 14px;
    line-height: 1.55;
    -webkit-line-clamp: 3;
  }
}

@media (max-width: 480px) {
  .blog-grid {
    gap: 16px;
  }

  .blog-body {
    padding: 15px 14px;
  }

  .blog-card-title {
    font-size: 16px;
  }
}

/* -------------------------------------------------------------------------
   2. Trang Chi Tiết Bài Viết (/blog/<slug>)
   ------------------------------------------------------------------------- */
.blog-detail-layout-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 0 60px;
  position: relative;
  box-sizing: border-box;
}

.blog-main-content {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 60px;
  box-sizing: border-box;
}

.blog-article-container {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding: 0;
}

.blog-breadcrumbs {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.blog-breadcrumbs a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-breadcrumbs a:hover {
  color: #f97316;
}

.blog-breadcrumbs span {
  color: #ffffff;
  font-weight: 500;
}

.blog-article-header {
  margin-bottom: 22px;
}

.blog-badge-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.blog-category-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #f97316;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
}

.blog-read-time {
  font-size: 13px;
  color: var(--text-muted);
}

.blog-article-title {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin: 0;
}

/* Author & 360° Radial Share Bar */
.article-author-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  margin-bottom: 28px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.author-block {
  display: flex;
  align-items: center;
  gap: 12px;
  transition: opacity 0.25s ease, filter 0.25s ease;
}

.article-author-bar.is-share-open .author-block {
  opacity: 0.35;
  filter: blur(1px);
}

.author-avatar {
  font-size: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.author-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.author-name {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.2;
}

.author-role {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.2;
}

.article-share-action {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 50;
}

/* Featured Image (WebP Vector/Icon-First) */
.blog-featured-figure {
  margin: 0 0 32px 0;
}

.blog-featured-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: #0b0f19;
  display: block;
}

.blog-img-caption {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
  line-height: 1.4;
}

/* -------------------------------------------------------------------------
   3. Khối Định Nghĩa Kỹ Thuật (Executive Definition Box)
   ------------------------------------------------------------------------- */
.geo-definition-box {
  background: rgba(249, 115, 22, 0.05);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 28px;
}

.geo-box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #f97316;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.geo-text {
  font-size: 15.5px;
  line-height: 1.65;
  color: #e2e8f0;
  margin: 0;
}

/* Key Takeaways Box */
.key-takeaways-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 32px;
}

.takeaways-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 12px 0;
}

.takeaways-list {
  margin: 0;
  padding-left: 20px;
}

.takeaways-list li {
  font-size: 14.5px;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.takeaways-list li:last-child {
  margin-bottom: 0;
}

/* -------------------------------------------------------------------------
   4. Table of Contents (Mục Lục Thuần Văn Bản)
   ------------------------------------------------------------------------- */
.blog-toc-nav {
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid #f97316;
  padding: 18px 22px;
  margin-bottom: 36px;
}

.toc-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0 0 10px 0;
}

.toc-list {
  margin: 0;
  padding-left: 20px;
}

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

.toc-list a {
  font-size: 14px;
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.2s ease;
}

.toc-list a:hover {
  color: #f97316;
  text-decoration: underline;
}

/* -------------------------------------------------------------------------
   5. Khối Nội Dung Thuần Blog (Pure Blog Article Body)
   Tuyệt đối: Không tạo card, không tạo bảng
   ------------------------------------------------------------------------- */
.blog-pure-content {
  font-size: 17px;
  line-height: 1.8;
  color: #cbd5e1;
}

.blog-pure-content h2 {
  font-size: clamp(22px, 3vw, 26px);
  font-weight: 800;
  color: #ffffff;
  margin: 44px 0 18px;
  line-height: 1.3;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.blog-pure-content h3 {
  font-size: 20px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 28px 0 12px;
  line-height: 1.35;
}

.blog-pure-content p {
  margin: 0 0 20px;
  color: #cbd5e1;
}

.blog-pure-content ul,
.blog-pure-content ol {
  margin: 0 0 24px;
  padding-left: 26px;
}

.blog-pure-content li {
  margin-bottom: 10px;
  color: #cbd5e1;
}

.blog-pure-content strong {
  color: #ffffff;
  font-weight: 700;
}

/* Contextual Inline Links */
.blog-pure-content a,
.inline-link-tool,
.inline-link-home {
  color: #f97316;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

.blog-pure-content a:hover,
.inline-link-tool:hover,
.inline-link-home:hover {
  color: #fb923c;
}

/* Blockquote & Geo Callout */
.blog-pure-content blockquote,
.geo-callout {
  border-left: 4px solid #f97316;
  background: rgba(249, 115, 22, 0.06);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #e2e8f0;
}

/* -------------------------------------------------------------------------
   6. FAQ Section (Câu Hỏi Đáp Chuyên Sâu)
   ------------------------------------------------------------------------- */
.blog-faq-section {
  margin-top: 52px;
  padding-top: 36px;
  border-top: 1px solid var(--border-color);
}

.faq-main-heading {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 24px;
}

.faq-items-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.faq-qa-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 18px;
}

.faq-question {
  font-size: 16.5px;
  font-weight: 700;
  color: #f97316;
  margin: 0 0 8px 0;
  line-height: 1.4;
}

.faq-answer {
  font-size: 15px;
  line-height: 1.65;
  color: #cbd5e1;
  margin: 0;
}

/* -------------------------------------------------------------------------
   7. Related Articles Section (6 Bài Viết Liên Quan Trong Chủ Đề)
   Định dạng thuần phẳng, thanh lịch, không đổ bóng card 3D
   ------------------------------------------------------------------------- */
.related-articles-section {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--border-color);
  content-visibility: auto;
  contain-intrinsic-size: 1px 450px;
}

.related-section-header {
  margin-bottom: 24px;
}

.related-title {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 6px 0;
}

.related-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.related-articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

@media (max-width: 900px) {
  .related-articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .related-articles-grid {
    grid-template-columns: 1fr;
  }
}

.related-article-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.related-article-item:hover {
  transform: translateY(-4px);
  border-color: rgba(249, 115, 22, 0.45);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.related-thumb-link {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0b0f19;
  position: relative;
}

.related-thumb-img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.related-article-item:hover .related-thumb-img {
  transform: scale(1.05);
}

.related-content-wrap {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.related-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.related-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #f97316;
  letter-spacing: 0.5px;
}

.related-read-time {
  font-size: 12px;
  color: var(--text-muted);
}

.related-item-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 8px 0;
  flex: 1;
}

.related-item-title a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.related-item-title a:hover {
  color: #f97316;
}

.related-item-summary {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-read-link {
  font-size: 12.5px;
  font-weight: 700;
  color: #f97316;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  transition: transform 0.2s ease, color 0.2s ease;
}

.related-read-link:hover {
  color: #fb923c;
  transform: translateX(3px);
}

/* -------------------------------------------------------------------------
   8. Infinite Scroll & Dynamic Batch Loading (/blog)
   ------------------------------------------------------------------------- */
.blog-card-fade-in {
  animation: blogCardFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes blogCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.blog-infinite-sentinel {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60px;
  padding: 36px 0 16px;
  text-align: center;
}

.blog-loading-spinner {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full, 9999px);
  backdrop-filter: blur(8px);
}

.spinner-circle {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(249, 115, 22, 0.2);
  border-top-color: #f97316;
  border-radius: 50%;
  animation: blogSpinnerRotate 0.7s linear infinite;
  display: inline-block;
}

@keyframes blogSpinnerRotate {
  to {
    transform: rotate(360deg);
  }
}

.spinner-text {
  font-size: 13.5px;
  font-weight: 600;
  color: #cbd5e1;
}

.blog-load-more-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px 0;
}

.blog-load-more-btn {
  padding: 10px 26px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-full, 9999px);
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: #f97316;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.blog-load-more-btn:hover {
  background: rgba(249, 115, 22, 0.22);
  border-color: #f97316;
  color: #ffedd5;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(249, 115, 22, 0.2);
}

.blog-end-notice {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full, 9999px);
  display: inline-block;
}

/* Responsive cho layout blog chi tiết có sidebar quảng cáo 2 bên */
@media (max-width: 1360px) {
  .blog-detail-layout-wrapper {
    padding: 0 0 40px;
  }
  .blog-main-content {
    max-width: 840px;
    padding: 20px 16px 40px;
  }
}

@media (max-width: 768px) {
  .blog-main-content {
    padding: 16px 12px 32px;
  }
}
