/* =====================================================
   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: 0 15px;
}

@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;
  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);
  }
}

/* Wrapper */
.ntm-sforum-layout .rank-math-breadcrumb,
.ntm-sforum-layout .rank-math-breadcrumb p,
.ntm-sforum-layout .woocommerce-breadcrumb {
  max-width: 100%;
  justify-content: flex-start !important;
  text-align: left !important;
}

/* Line */
.ntm-sforum-layout .rank-math-breadcrumb p,
.ntm-sforum-layout .woocommerce-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

/* All Links - White rounded pills with subtle shadow */
.ntm-sforum-layout .rank-math-breadcrumb a,
.ntm-sforum-layout .woocommerce-breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: var(--color-text-body);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--color-border-subtle);
  transition: var(--ntm-transition);
}

/* Hover State - Red brand color border */
.ntm-sforum-layout .rank-math-breadcrumb a:hover,
.ntm-sforum-layout .woocommerce-breadcrumb a:hover {
  background: var(--color-brand-surface);
  color: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
}

/* Last Category Pill - Pink/Red theme */
.ntm-sforum-layout .rank-math-breadcrumb a:last-of-type:not(:first-child),
.ntm-sforum-layout .woocommerce-breadcrumb a:last-of-type:not(:first-child) {
  background: var(--color-status-error-bg);
  color: var(--color-status-error);
  border-color: transparent;
}

/* Last Item (Current Page Text) */
.ntm-sforum-layout .rank-math-breadcrumb .last {
  padding: 0;
  background: none;
  color: var(--color-text-body);
  font-weight: 400;
  white-space: normal;
}

/* Separator - Gray line */
.ntm-sforum-layout .rank-math-breadcrumb .separator {
  color: var(--color-border-strong);
  font-size: 14px;
  opacity: 0.5;
}

/* Home Icon - Red colored house svg mask */
.ntm-sforum-layout .rank-math-breadcrumb p a:first-child,
.ntm-sforum-layout .woocommerce-breadcrumb a:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ntm-sforum-layout .rank-math-breadcrumb p a:first-child::before,
.ntm-sforum-layout .woocommerce-breadcrumb a:first-child::before {
  content: "";
  width: 14px;
  height: 14px;
  display: inline-block;
  background-color: var(--color-brand-primary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'%3E%3Cpath d='M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c0 2.8-.2 5.5-.5 8.2V472c0 22.1-17.9 40-40 40H392c-22.1 0-40-17.9-40-40V376c0-13.3-10.7-24-24-24h-80c-13.3 0-24 10.7-24 24v96c0 22.1-17.9 40-40 40H104c-22.1 0-40-17.9-40-40V360c0-.9 0-1.9.1-2.8l.7-69.7V287H32c-18 0-32-14-32-32 0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7l266.4 223c7 7 10 15 10 25z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'%3E%3Cpath d='M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c0 2.8-.2 5.5-.5 8.2V472c0 22.1-17.9 40-40 40H392c-22.1 0-40-17.9-40-40V376c0-13.3-10.7-24-24-24h-80c-13.3 0-24 10.7-24 24v96c0 22.1-17.9 40-40 40H104c-22.1 0-40-17.9-40-40V360c0-.9 0-1.9.1-2.8l.7-69.7V287H32c-18 0-32-14-32-32 0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7l266.4 223c7 7 10 15 10 25z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* =====================================================
   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-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; }
}
