/* =====================================================
   SINGLE POST LAYOUT - CSS (may-in-toan-nhan)
   -----------------------------------------------------
   CSS cho layout bài viết đơn: Hero image + Card overlay,
   Verify Box (E-E-A-T), Breadcrumb, Reading Time...
   Template tương ứng: single.php
===================================================== */

/* ===== ROOT VARIABLES ===== */
:root {
  --ntm-hero-offset: 80px;
  --ntm-max-width: var(--container-max);
  --ntm-content-max-width: 960px;
  --ntm-gap: var(--s-6);
  
  /* Colors mapped to MITN Design Tokens */
  --ntm-primary: var(--color-brand-primary);
  --ntm-secondary: var(--color-brand-secondary);
  --ntm-text-primary: var(--color-text-primary);
  --ntm-text-secondary: var(--color-text-body);
  --ntm-text-muted: var(--color-text-subtle);
  --ntm-bg-light: var(--color-surface-sunken);
  --ntm-bg-lighter: var(--color-surface-raised);
  --ntm-border: var(--color-border-subtle);
  
  /* Shadows mapped to MITN Design Tokens */
  --ntm-shadow-sm: var(--shadow-sm);
  --ntm-shadow-md: var(--shadow-md);
  --ntm-shadow-lg: var(--shadow-lg);
  
  /* Transitions mapped to MITN Design Tokens */
  --ntm-transition: var(--duration-fast) var(--ease-standard);
  --ntm-transition-fast: var(--duration-fast) ease-in-out;
}

/* =====================================================
   MAIN LAYOUT
===================================================== */
.blog-single {
  background-color: var(--color-surface-sunken);
  padding-top: 24px;
  padding-bottom: 48px;
}

.blog-single .entry-content,
.blog-single .entry-content p,
.blog-single .entry-content li {
  color: #111111 !important;
}

/* Container */
.ntm-sforum-layout {
  max-width: var(--ntm-max-width);
  margin: 0 auto;
  padding: 0px;
}

@media (min-width: 1024px) {
  /* Flex Wrapper */
  .ntm-sforum-layout .rh-content-wrap-sidebar-menu {
    display: flex;
    align-items: flex-start;
    gap: var(--ntm-gap);
  }

  /* Main Content Area */
  .ntm-sforum-layout .main-content-with-sidebar {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
  }

  /* Content Inner Container */
  .ntm-sforum-layout .main-side {
    width: 100%;
    max-width: var(--ntm-content-max-width);
  }
}

/* =====================================================
   HERO SECTION
===================================================== */
@media (min-width: 1074px) {
  
  .ntm-hero {
    width: calc(100% + (var(--ntm-hero-offset) * 2));
    margin-left: calc(var(--ntm-hero-offset) * -1);
    margin-right: calc(var(--ntm-hero-offset) * -1);
    aspect-ratio: 12 / 5;
    border-radius: 20px;
    overflow: hidden;
  }

  /* Ảnh fill đầy hero container */
  .ntm-hero .ntm-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
  }

  /* Hero Card Overlay */
  .ntm-card-wrap {
    position: relative;
    z-index: 5;
    transform: translateY(-110px);
    margin-bottom: -110px;
    display: flex;
    justify-content: center;
  }

  .ntm-card {
    width: 100%;
    max-width: 100%;
    background: #fff;
    border-radius: 20px;
    padding: 30px 22px;
    box-shadow: var(--ntm-shadow-lg);
  }

  /* Badge */
  .ntm-badge {
    display: inline-block;
    background: var(--ntm-primary);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 10px;
  }
}

/* Base mobile fallback for hero */
@media (max-width: 1073px) {
  .ntm-hero {
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 20px;
  }
  .ntm-hero .ntm-hero-img {
    width: 100%;
    height: auto;
    display: block;
  }
  .ntm-card {
    background: #fff;
    padding: 20px 15px;
    border: 1px solid var(--color-border-subtle);
    box-shadow: var(--ntm-shadow-sm);
    border-radius: 14px;
  }
  .ntm-badge {
    display: inline-block;
    background: var(--ntm-primary);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    margin-bottom: 10px;
  }
}

/* =====================================================
   BREADCRUMB
===================================================== */
.ntm-sforum-layout .custom-breadcrumb {
  margin-top: 14px;
  margin-bottom: 24px;
  padding-left: 15px;
  padding-right: 15px;
  text-align: left;
}

@media (min-width: 1074px) {
  .ntm-sforum-layout .custom-breadcrumb {
    width: calc(100% + (var(--ntm-hero-offset) * 2));
    margin-left: calc(var(--ntm-hero-offset) * -1);
    margin-right: calc(var(--ntm-hero-offset) * -1);
  }
}

/* Style của breadcrumb (nav.rank-math-breadcrumb) nay dùng CHUNG với PDP:
   assets/css/components/breadcrumb.css — enqueue ở inc/enqueue.php mục 4b.
   Wrapper .custom-breadcrumb ở trên chỉ lo canh lề/độ rộng cho layout bài viết.
   Khối pill trắng/hồng cũ đã gỡ: nền pill ở cấp cha khiến người đọc tưởng đang
   đứng ở trang danh mục; điểm nhấn phải thuộc về mục cuối (trang hiện tại). */

/* =====================================================
   COMMENTS & SOCIAL
===================================================== */
.ntm-sforum-layout #comments {
  display: none;
}

.ntm-sforum-layout .rh-post-wrapper {
  padding-bottom: 50px;
}

.social_icon.row_social_inpost {
  margin-top: 50px;
}

/* =====================================================
   POST META
===================================================== */
.ntm-post-meta-under-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 15px;
  font-size: 14px;
  color: var(--ntm-text-secondary);
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--ntm-border);
}

.ntm-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ntm-meta-item i,
.ntm-meta-item svg {
  color: var(--ntm-text-muted);
}

.ntm-meta-sep {
  color: var(--ntm-border);
}

@media (max-width: 767px) {
  .ntm-post-meta-under-title {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    font-size: 13px;
  }
  .ntm-post-meta-under-title .ntm-meta-sep {
    display: none !important;
  }
  .ntm-post-meta-under-title .ntm-meta-item {
    white-space: normal;
    min-width: 0;
  }
}

.ntm-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ntm-text-primary);
  margin-top: 5px;
  margin-bottom: 15px;
}

/* =====================================================
   VERIFY BOX
===================================================== */
.ntm-verify-box {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 15px 20px;
  background: var(--ntm-bg-lighter);
  border-radius: 16px;
  border: 1px solid #eef1f4;
  margin: 30px 0;	
}

/* Avatar */
.ntm-verify-avatar {
  flex: 0 0 64px;
}

.ntm-verify-avatar img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: var(--ntm-shadow-sm);
}

/* Content */
.ntm-verify-content {
  flex: 1;
  min-width: 0;
}

/* Tag Pill */
.ntm-verify-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9px;
  background: #e7f5ff;
  color: #0969da;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.ntm-verify-tag i {
  font-size: 14px;
}

.ntm-verify-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

/* Title */
.ntm-verify-title {
  font-size: 16px;
  font-weight: 800;
}

.ntm-verify-title a {
  color: var(--ntm-text-primary);
  text-decoration: none;
  transition: var(--ntm-transition-fast);
}

.ntm-verify-title a:hover {
  color: var(--ntm-primary);
}

/* Description */
.ntm-verify-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ntm-text-secondary);
}

/* Actions */
.ntm-verify-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-left: 8px;
}

/* Buttons */
.ntm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 130px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--ntm-transition);
}

.ntm-btn-primary {
  background: #ff0000;
  color: #fff !important;
}

.ntm-btn-primary:hover {
  background: #d70018;
  color: #fff !important;
}

.ntm-btn-ghost {
  background: #fff;
  border: 1px solid #d1d5db;
  color: var(--ntm-text-primary) !important;
}

.ntm-btn-ghost:hover {
  background: var(--ntm-bg-light);
  color: var(--ntm-text-primary) !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .ntm-verify-box {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .ntm-verify-avatar {
    margin-bottom: 0;
  }

  .ntm-verify-content {
    display: contents;
  }

  .ntm-verify-heading {
    flex: 1 1 0;
    min-width: 0;
  }

  .ntm-verify-desc {
    flex: 1 1 100%;
    margin-top: 8px;
  }

  .ntm-verify-actions {
    flex: 1 1 100%;
    flex-direction: row;
    justify-content: flex-start;
    margin-left: 0;
    margin-top: 10px;
  }

  .ntm-btn {
    min-width: auto;
    flex: 1;
  }
}

/* =====================================================
   WP CAPTION (caption cho ảnh trong nội dung bài viết)
===================================================== */
.wp-caption p.wp-caption-text {
    margin: 12px 0 0 0;
    font-size: 90%;
    line-height: 20px;
    background: #f7f7f7;
    padding: 10px;
    border-radius: 5px;
}

/* =====================================================
   POST MOBILE – MATCH FORUM STYLE
===================================================== */
@media (max-width: 768px) {
  .ntm-hero {
    margin: 0;
    border-radius: 14px;
    aspect-ratio: 16 / 9;
  }

  .ntm-hero .ntm-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
  }

  .ntm-title {
    font-size: 22px;
  }
}


/* Custom Next/Prev Post Navigation */
.blog-single .next-prev-posts-nav { margin-top: 40px; margin-bottom: 40px; }
.blog-single .navigation-post .next-prev-nav { border: 1px solid var(--color-border-subtle) !important; border-radius: var(--radius-md); overflow: hidden; display: flex; flex-direction: row; }
.blog-single .navigation-post .nav-prev, .blog-single .navigation-post .nav-next { flex: 1; padding: 15px 20px; background: var(--color-surface-base); transition: background 0.3s ease; display: flex; align-items: center; justify-content: center; text-align: center; }
.blog-single .navigation-post .nav-prev:hover, .blog-single .navigation-post .nav-next:hover { background: var(--color-surface-sunken); }
.blog-single .navigation-post .nav-next { border-left: 1px solid var(--color-border-subtle); }
.blog-single .navigation-post a { font-weight: 600; font-size: 14px; line-height: 1.4; color: var(--color-text-primary); display: flex; align-items: center; gap: 10px; width: 100%; }
.blog-single .navigation-post .nav-prev a { justify-content: flex-start; text-align: left; }
.blog-single .navigation-post .nav-next a { justify-content: flex-end; text-align: right; }
.blog-single .navigation-post .nav-prev a span, .blog-single .navigation-post .nav-next a span { color: var(--color-brand-primary); font-size: 18px; flex-shrink: 0; display: inline-flex !important; }

@media (max-width: 768px) {
  .blog-single .navigation-post .next-prev-nav { flex-direction: column; }
  .blog-single .navigation-post .nav-next { border-left: none; border-top: 1px solid var(--color-border-subtle); }
  .blog-single .navigation-post .nav-prev, .blog-single .navigation-post .nav-next { padding: 12px 15px; }
  .blog-single .navigation-post a { justify-content: flex-start !important; text-align: left !important; flex-direction: row !important; }
}

/* =====================================================
   RELATED CONTENT SLIDERS (Tags / Category / Products)
===================================================== */
.ntm-fullwidth-section .flickity-page-dots .dot {
  width: 6px;
  height: 6px;
  margin: 0 10px;
}

/* Flatsome mặc định giới hạn dots trong 60% chiều rộng (left/right: 20%),
   không đủ chỗ khi nhiều sản phẩm (nhiều dot) + margin lớn -> dot cuối bị rớt xuống dòng 2 */
.ntm-fullwidth-section .flickity-page-dots {
  left: 5%;
  right: 5%;
}

/* Dots dùng position:absolute nên không chiếm chỗ trong flow -> đè lên nội dung card bên dưới.
   Chừa khoảng trống thật (padding-bottom) trên chính khung slider để dots nằm gọn trong đó. */
.ntm-fullwidth-section .flickity-enabled {
  padding-bottom: 40px;
}

/* =====================================================
   GUTENBERG IMAGE BLOCK (figure.wp-block-image)
   Nền xám nhạt + canh giữa ảnh, chú thích có padding.
===================================================== */
figure.wp-block-image.size-full {
  background: #cccccc5e;
  align-items: center;
  text-align: center;
}

figure.wp-block-image figcaption {
  padding: 10px;
}

/* =====================================================
   ẢNH NỘI DUNG IMPORT (img.img-fluid.o_we_custom_image)
   Ảnh nằm trực tiếp trong <p> nên mặc định là inline -> căn giữa
   bằng display:block + margin auto (text-align của <p> không đủ
   khi ảnh hẹp hơn cột và <p> căn trái).
===================================================== */
img.img-fluid.o_we_custom_image {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
