/**
 * NIP Single Post (Article / Blog) UI Design System
 * Strictly compliant with nhainphat.com design tokens and SKILL.md rules.
 * Zero override tags used. Clean specificity hierarchy.
 */

/* ==========================================================================
   0. PAGE BACKGROUND & FRAME
   ========================================================================== */
body.single-post,
body.single-post #main {
  background: #f4f8fc;
}

/* ==========================================================================
   1. FEATURED HERO IMAGE (ẢNH CHÍNH NẰM NGOÀI KHUNG NỘI DUNG, BO GÓC CHUẨN)
   ========================================================================== */
body.single-post .article-inner > .entry-image,
body.single-post .nip-single-hero-wrap {
  margin: 0 0 28px 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 58, 92, 0.08);
  background: #ffffff;
  border: 1px solid #dce7ef;
}

body.single-post .article-inner > .entry-image img,
body.single-post .nip-single-hero-wrap img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 15px;
}

/* ==========================================================================
   2. UNIFIED CONTENT CARD (TOÀN BỘ NỘI DUNG NẰM TRONG KHUNG BO TRÒN CHUẨN SITE)
   ========================================================================== */
body.single-post .article-inner > .entry-content,
body.single-post .nip-single-content-card {
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid #dce7ef;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(15, 58, 92, 0.06);
  padding: 36px 42px;
  margin-bottom: 28px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Be Vietnam Pro", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: #1e293b;
}

/* Header metas & Title inside content card */
body.single-post .entry-header-metas {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef4f9;
  color: #64748b;
  font-size: 13.5px;
}

body.single-post .entry-header-metas .item-mt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.single-post .entry-header-metas i {
  color: #0195FF;
}

body.single-post .entry-title.single-page {
  color: #052F55;
  font-size: clamp(24px, 2.5vw, 32px);
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 24px 0;
  border: none;
  padding: 0;
}

body.single-post .entry-content p {
  margin-bottom: 20px;
  color: #334155;
}

body.single-post .entry-content .nip-article-eyebrow {
  margin: 28px 0 10px;
  color: #946b18;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

body.single-post .entry-content h2 {
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 700;
  color: #052F55;
  margin: 40px 0 16px 0;
  line-height: 1.3;
  padding: 0;
  border: none;
}

body.single-post .entry-content h3 {
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 700;
  color: #087ED6;
  margin: 30px 0 12px 0;
  line-height: 1.35;
}

body.single-post .entry-content strong {
  font-weight: 700;
  color: #0f172a;
}

body.single-post .entry-content a {
  color: #0195FF;
  text-decoration: none;
  transition: color 0.2s ease;
}

body.single-post .entry-content a:hover {
  color: #087ED6;
  text-decoration: underline;
}

body.single-post .entry-content a.button,
body.single-post .entry-content a.button span {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

body.single-post .entry-content ul,
body.single-post .entry-content ol {
  padding-left: 24px;
  margin-bottom: 22px;
}

body.single-post .entry-content li {
  margin-bottom: 8px;
  line-height: 1.7;
  color: #334155;
}

/* ==========================================================================
   2. COMPARISON TABLE (BẢNG SO SÁNH CHUYÊN SÂU CHUẨN RESPONSIVE)
   ========================================================================== */
body.single-post .entry-content .nip-table-wrap {
  margin: 30px 0 34px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #bfdaee;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(1, 149, 255, 0.05);
}

body.single-post .entry-content .nip-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  margin: 0;
  font-size: 14.5px;
}

body.single-post .entry-content .nip-table caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  font-size: 15px;
  color: #052F55;
  background: #eaf6ff;
  padding: 12px 18px;
  border-bottom: 1px solid #bfdaee;
}

body.single-post .entry-content .nip-table th {
  background: #eaf6ff;
  color: #052F55;
  font-weight: 700;
  padding: 13px 18px;
  text-align: left;
  border-bottom: 1px solid #d7e7f2;
  white-space: nowrap;
}

body.single-post .entry-content .nip-table td {
  padding: 13px 18px;
  border-bottom: 1px solid #eef4f9;
  color: #334155;
  vertical-align: top;
  line-height: 1.6;
}

body.single-post .entry-content .nip-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

body.single-post .entry-content .nip-table tbody tr:hover {
  background: #f0f7ff;
}

body.single-post .entry-content .nip-table tbody tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   3. IN-CONTENT IMAGES (HÌNH ẢNH TRONG BÀI VIẾT BO GÓC SẮC NÉT)
   ========================================================================== */
body.single-post .entry-content figure.wp-block-image {
  margin: 32px 0;
  text-align: center;
}

body.single-post .entry-content figure.wp-block-image img {
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  background: #f1f5f9;
}

body.single-post .entry-content figure.wp-block-image figcaption {
  font-size: 13.5px;
  color: #64748b;
  margin-top: 10px;
  font-style: italic;
}

/* ==========================================================================
   4. DEEP FAQ ACCORDION (KHỐI FAQ CHUYÊN SÂU 2 CỘT DESKTOP / 1 CỘT MOBILE)
   ========================================================================== */
:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-section {
  margin: 48px 0 28px 0;
  padding-top: 36px;
  border-top: 1px solid #e2e8f0;
}

:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-header {
  text-align: left;
  margin-bottom: 28px;
}

:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  color: #0195FF;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  background: #eaf6ff;
  padding: 4px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
}

:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-header h2 {
  font-size: clamp(22px, 2vw, 26px);
  color: #052F55;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
  border: none;
  padding: 0;
}

:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-subtitle {
  font-size: 15px;
  color: #64748b;
  margin: 0;
  line-height: 1.6;
}

:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

:is(body.postid-2981, body.postid-5664, body.postid-1336, body.postid-2984) .entry-content .nip-faq-grid {
  align-items: start;
}

/* Universal selector for both details and .nip-faq-item */
:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid details,
:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid .nip-faq-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.25s ease;
  margin: 0;
}

:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid details:hover,
:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid .nip-faq-item:hover {
  border-color: #bfdaee;
  box-shadow: 0 3px 12px rgba(1, 149, 255, 0.08);
}

:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid details[open],
:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid .nip-faq-item[open] {
  background: #ffffff;
  border-color: #0195FF;
  box-shadow: 0 4px 16px rgba(1, 149, 255, 0.12);
}

/* Universal selector for summary, .nip-faq-question, and summary strong */
:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid summary,
:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid .nip-faq-question {
  position: relative;
  padding: 16px 48px 16px 18px;
  font-size: 15px;
  font-weight: 700;
  color: #052F55;
  cursor: pointer;
  list-style: none;
  outline: none;
  line-height: 1.45;
  display: block;
  user-select: none;
}

:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid summary strong {
  font-weight: 700;
  color: inherit;
}

:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid summary::-webkit-details-marker,
:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid .nip-faq-question::-webkit-details-marker {
  display: none;
}

:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid summary::marker,
:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid .nip-faq-question::marker {
  display: none;
  content: "";
}

:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid summary::after,
:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid .nip-faq-question::after {
  content: '+';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  color: #0195FF;
  font-weight: 500;
  transition: transform 0.25s ease, color 0.25s ease;
  line-height: 1;
}

:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid details[open] summary,
:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid .nip-faq-item[open] .nip-faq-question {
  color: #0195FF;
}

:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid details[open] summary::after,
:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid .nip-faq-item[open] .nip-faq-question::after {
  transform: translateY(-50%) rotate(45deg);
  color: #087ED6;
}

/* Universal selector for answer body (div.nip-faq-answer or direct p) */
:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid details > p,
:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid details > div,
:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid .nip-faq-answer {
  padding: 0 18px 18px 18px;
  font-size: 14.5px;
  color: #334155;
  line-height: 1.65;
  border-top: 1px solid #f1f5f9;
  margin: 0;
  padding-top: 12px;
}

:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid details > p:last-child,
:is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid .nip-faq-answer p {
  margin: 0;
}

/* ==========================================================================
   5. SINGLE POST FOOTER NAVIGATION (THANH CHÂN TRANG ĐIỀU HƯỚNG)
   ========================================================================== */
body.single-post .entry-sigle-ft {
  background: #ffffff;
  border: 1px solid #dce7ef;
  border-radius: 14px;
  padding: 16px 24px;
  box-shadow: 0 4px 16px rgba(15, 58, 92, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

body.single-post .entry-sigle-ft .bdx {
  color: #475569;
  font-size: 14px;
}

body.single-post .entry-sigle-ft .bdx strong {
  color: #052F55;
}

body.single-post .entry-sigle-ft .bdx-nav a {
  display: inline-block;
  padding: 6px 14px;
  background: #f1f5f9;
  color: #0195FF;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

body.single-post .entry-sigle-ft .bdx-nav a:hover {
  background: #0195FF;
  color: #ffffff;
}

/* ==========================================================================
   6. RESPONSIVE MOBILE TWEAKS (MÀN HÌNH DI ĐỘNG DƯỚI 768PX)
   ========================================================================== */
@media (max-width: 767px) {
  body.single-post .article-inner > .entry-image,
  body.single-post .nip-single-hero-wrap {
    border-radius: 12px;
    margin-bottom: 16px;
  }
  body.single-post .article-inner > .entry-image img,
  body.single-post .nip-single-hero-wrap img {
    border-radius: 11px;
  }
  body.single-post .article-inner > .entry-content,
  body.single-post .nip-single-content-card {
    border-radius: 14px;
    padding: 20px 16px;
    margin-bottom: 20px;
  }
  body.single-post .entry-title.single-page {
    font-size: 21px;
    margin-bottom: 16px;
  }
  body.single-post .entry-header-metas {
    gap: 12px;
    font-size: 12.5px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    flex-wrap: wrap;
  }
  body.single-post .entry-sigle-ft {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 12px;
  }
  body.single-post .entry-content {
    font-size: 15px;
    line-height: 1.7;
  }
  :is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  :is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid summary,
  :is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid .nip-faq-question {
    font-size: 14.5px;
    padding: 14px 42px 14px 14px;
  }
  :is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid details > p,
  :is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid details > div,
  :is(body.single-post .entry-content, body.postid-2981 .entry-content, body.postid-1336, body.postid-2984 .entry-content) .nip-faq-grid .nip-faq-answer {
    padding: 0 14px 14px 14px;
    padding-top: 10px;
    font-size: 14px;
  }
  body.single-post .entry-content .nip-table-wrap {
    border-radius: 10px;
    margin: 20px 0;
  }
  body.single-post .entry-content .nip-table th,
  body.single-post .entry-content .nip-table td {
    padding: 10px 12px;
    font-size: 13.5px;
  }
  body.single-post .entry-content figure.wp-block-image img {
    border-radius: 12px;
  }
}

/* Formex article: its featured image is already embedded in the original content. */

body.single-post.postid-3802 .nip-content-body {
  overflow-wrap: anywhere;
}

body.single-post.postid-3802 .nip-content-body > p:first-child {
  font-size: 17px;
  line-height: 1.8;
  color: #052f55;
}

body.single-post.postid-3802 .nip-content-body .wp-caption {
  max-width: 100%;
  margin: 28px auto;
}

body.single-post.postid-3802 .nip-content-body #attachment_3806 {
  width: 560px;
  max-width: 100%;
}

body.single-post.postid-3802 .nip-content-body.is-collapsed {
  max-height: 900px;
}

body.single-post.postid-3802 .nip-content-body .wp-caption img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
}

body.single-post.postid-3802 .nip-content-body .wp-caption-text {
  margin: 8px 0 0;
  text-align: center;
  font-size: 13px;
  color: #64748b;
}

body.single-post.postid-3802 .nip-content-body .horizontal-scroll-wrapper {
  max-width: 100%;
  margin: 24px 0 32px;
  overflow-x: auto;
  border: 1px solid #d7e7f2;
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
}

body.single-post.postid-3802 .nip-content-body .horizontal-scroll-wrapper table {
  width: 100%;
  min-width: 700px;
  margin: 0;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.55;
}

body.single-post.postid-3802 .nip-content-body .horizontal-scroll-wrapper th,
body.single-post.postid-3802 .nip-content-body .horizontal-scroll-wrapper td {
  padding: 12px 14px;
  border: 1px solid #d7e7f2;
  text-align: left;
  vertical-align: top;
}

body.single-post.postid-3802 .nip-content-body .horizontal-scroll-wrapper th {
  background: #eaf5fb;
  color: #052f55;
  font-weight: 700;
}

body.single-post.postid-3802 .nip-content-body .horizontal-scroll-wrapper tr:nth-child(even) td {
  background: #f8fbfd;
}

@media (max-width: 767px) {
  body.single-post.postid-3802 .nip-content-body.is-collapsed {
    max-height: 920px;
  }

  body.single-post.postid-3802 .nip-content-body > p:first-child {
    font-size: 15.5px;
  }
}

body.postid-1336, body.postid-2984 .nip-hashtag-table{overflow-x:auto;margin:20px 0}
body.postid-1336, body.postid-2984 .nip-hashtag-table table{min-width:520px;border-collapse:collapse;width:100%}
body.postid-1336, body.postid-2984 .nip-hashtag-table th{background:#eaf5fb;color:#052f55}
body.postid-1336, body.postid-2984 .nip-hashtag-table th,body.postid-1336, body.postid-2984 .nip-hashtag-table td{padding:12px;border:1px solid #d1e4f1;text-align:left}
