/*
 * Blog listing (index.php), post detail (single.php) and pages (page.php, page-right-sidebar.php). Same palette / typography / card look as the front page
 * (home.css), scoped under .itx-blog so Flatsome's own CSS (still loaded on these pages) is only overridden here.
 */
.itx-blog {
  --b: #024F9E;
  --b7: #023E7B;
  --sky: #8CC3FA;
  --ice: #DCE6F1;
  --bg: #F5F8FC;
  --ink: #0A182B;
  --text: #475A72;
  --line: #E5EBF3;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --top: calc(var(--position-sticky-offset, 72px) + 24px);   /* sticky header height, set by chrome.js */
  font-family: "Be Vietnam Pro", Poppins, system-ui, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.itx-blog *, .itx-blog *::before, .itx-blog *::after { box-sizing: border-box; }
.itx-blog :is(h1, h2, h3, h4):not(.dark *) { margin: 0; font-family: inherit; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; color: var(--ink); text-transform: none; }
.itx-blog a { text-decoration: none; }
.itx-blog-wrap { width: min(1240px, 100% - 48px); margin-inline: auto; }
.itx-arrow { width: 18px; height: 18px; flex: none; transition: transform .35s var(--ease); }

.itx-blog-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 13.5px; font-weight: 500; color: #5F7188; }
.itx-blog-crumb > * + *::before { content: "/"; margin-right: 8px; color: #9AA9BD; }
.itx-blog-crumb a { color: #5F7188; transition: color .25s; }
.itx-blog-crumb a:hover { color: var(--b); }
.itx-blog-crumb span { max-width: 60ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.itx-post-main h1 { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.25; text-wrap: balance; }
.itx-blog-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 16px 0 28px; padding-bottom: 22px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 500; color: #5F7188; }
.itx-blog-meta span { display: inline-flex; align-items: center; gap: 7px; }
.itx-blog-meta svg { width: 17px; height: 17px; color: var(--b); }

/* ---------- news cards (front-page look) ---------- */
.itx-blog-list { padding: clamp(40px, 5.5vw, 64px) 0; }
.itx-blog-search { margin-bottom: 32px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.itx-blog-search h1 { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.15; }
.itx-blog-search p { margin: 10px 0 0; font-size: 15px; font-weight: 500; color: #5F7188; }
.itx-blog-cats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.itx-blog-cats a { display: inline-flex; align-items: center; padding: 11px 22px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--b); font-size: 15px; font-weight: 600; line-height: 1.2; transition: background-color .3s, color .3s, transform .35s var(--ease); }
.itx-blog-cats a:hover { background: var(--ice); transform: translateY(-2px); }
.itx-blog-cats a.is-active { background: var(--b); color: #fff; border-color: var(--b); transform: none; box-shadow: 0 12px 26px rgba(2, 79, 158, .32); }
.itx-blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.itx-news-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 24px; background: #fff; border: 1px solid var(--line); transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .3s; }
.itx-news-card:hover { transform: translateY(-8px); border-color: rgba(2, 79, 158, .25); box-shadow: 0 28px 56px rgba(2, 62, 123, .16); }
.itx-news-img { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--ice); }
.itx-news-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.itx-news-card:hover .itx-news-img img { transform: scale(1.08); }
.itx-news-ph { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--b), #4F9BE6); }
.itx-news-tag { position: absolute; left: 16px; top: 16px; padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #fff; background: linear-gradient(135deg, var(--b), #2D78C8); }
.itx-news-body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 22px 24px 26px; }
.itx-news-body time { font-size: 13px; font-weight: 500; color: #5F7188; }
.itx-news-body strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; font-size: 16.5px; font-weight: 600; line-height: 1.45; color: var(--ink); transition: color .25s; }
.itx-news-card:hover .itx-news-body strong { color: var(--b); }
.itx-news-excerpt { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 14.5px; line-height: 1.6; }
.itx-link { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: var(--b); }
.itx-news-body .itx-link { margin-top: auto; padding-top: 10px; }
.itx-news-card:hover .itx-arrow { transform: translateX(5px); }
.itx-news-card.is-featured { grid-column: 1 / -1; flex-direction: row; }
.itx-news-card.is-featured .itx-news-img { flex: 0 0 52%; aspect-ratio: auto; min-height: 340px; }
.itx-news-card.is-featured .itx-news-body { justify-content: center; gap: 14px; padding: 36px 40px; }
.itx-news-card.is-featured .itx-news-body strong { font-size: clamp(20px, 2vw, 25px); line-height: 1.35; }
.itx-news-card.is-featured .itx-news-excerpt { -webkit-line-clamp: 3; font-size: 16px; }
.itx-blog-empty { margin: 0; font-size: 17px; text-align: center; }
/* search: "Bài viết" / "Văn bản luật" blocks (index.php) */
.itx-blog h2.itx-search-h {   /* (0,2,1): beats .itx-blog :is(h1…):not(.dark *) { margin: 0 } */
   margin: 0 0 20px; font-size: clamp(20px, 2.2vw, 26px); }
.itx-search-h span { font-weight: 500; color: #5F7188; }
.itx-search-vb { margin-top: clamp(40px, 5vw, 64px); }
.itx-search-vb .itx-link { margin-top: 20px; }
/* running-light border on hover (same technique as the front-page cards) */
@property --itx-ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.itx-news-card::before { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; padding: 2px; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: conic-gradient(from var(--itx-ang), transparent 0 52%, rgba(45, 120, 200, .25) 66%, var(--b) 90%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.itx-news-card:hover::before { opacity: 1; animation: itx-ang 2.4s linear infinite; }
@keyframes itx-ang { to { --itx-ang: 360deg; } }

/* pagination (the_posts_pagination) */
.itx-blog .pagination { margin-top: 44px; }
.itx-blog .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.itx-blog .nav-links .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--b); font-size: 15px; font-weight: 600; line-height: 1; transition: background-color .25s, color .25s, transform .3s var(--ease); }
.itx-blog .nav-links a.page-numbers:hover { background: var(--ice); transform: translateY(-2px); }
.itx-blog .nav-links .page-numbers.current { background: var(--b); color: #fff; border-color: var(--b); box-shadow: 0 12px 26px rgba(2, 79, 158, .32); }
.itx-blog .nav-links .page-numbers.dots { border: 0; background: none; color: #9AA9BD; }

/* ---------- post detail ---------- */
.itx-post { padding: clamp(36px, 5vw, 64px) 0; }
.itx-post-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(32px, 5vw, 72px); align-items: start; }
.itx-post-main { min-width: 0; }
.itx-post-aside { position: sticky; top: var(--top); display: flex; flex-direction: column; gap: 20px; max-height: calc(100vh - var(--top)); padding: 0 24px 40px; margin: 0 -24px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ice) transparent; }   /* taller than the viewport with "Bài mới đăng": scrolls inside; padding keeps the box shadows */
.itx-post-box { padding: 22px 24px; border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(2, 62, 123, .04), 0 24px 50px rgba(2, 62, 123, .08); }
.itx-post-box h2, .itx-post-box summary { display: block; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--b); }
.itx-post-box h2 a { color: inherit; transition: color .25s; }
.itx-post-box h2 a:hover { color: var(--b7); }
.itx-post-box ol { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.itx-post-box ol a { display: block; padding: 7px 0 7px 14px; border-left: 2px solid var(--line); font-size: 14px; line-height: 1.5; color: var(--text); transition: color .25s, border-color .25s; }
.itx-post-box ol .is-h3 a { padding-left: 28px; font-size: 13.5px; }
.itx-post-box ol a:hover, .itx-post-box ol a.is-active { color: var(--b); border-color: var(--b); }
.itx-post-toc-m { display: none; margin-bottom: 28px; }
.itx-post-toc-m summary { cursor: pointer; list-style: none; }
.itx-post-toc-m summary::-webkit-details-marker { display: none; }
.itx-post-toc-m summary::after { content: "+"; float: right; font-size: 16px; line-height: 1; }
.itx-post-toc-m[open] summary::after { content: "–"; }
.itx-post-toc-m:not([open]) summary { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.itx-post-recent { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.itx-post-recent:last-child { padding-bottom: 0; border-bottom: 0; }
.itx-post-recent img, .itx-post-recent .itx-news-ph { flex: none; width: 72px; height: 54px; border-radius: 10px; object-fit: cover; }
.itx-post-recent strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--ink); transition: color .25s; }
.itx-post-recent:hover strong { color: var(--b); }
.itx-post-recent time { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 500; color: #5F7188; }

/* article body (post_content) */
.itx-post-body { font-size: 17px; line-height: 1.75; }
.itx-post-body > * { margin: 0 0 20px; }
.itx-post-body > :last-child { margin-bottom: 0; }
.itx-post-body :is(h2, h3, h4) { margin: 36px 0 14px; scroll-margin-top: var(--top); }
.itx-post-body > :is(h2, h3, h4):first-child { margin-top: 0; }
.itx-post-body h2 { font-size: clamp(24px, 2.4vw, 30px); }
.itx-post-body h3 { font-size: clamp(20px, 2vw, 23px); }
.itx-post-body h4 { font-size: 18px; }
.itx-post-body :is(h2, h3, h4) strong { font-weight: inherit; }   /* posts wrap heading text in <strong> */
.itx-post-body strong { color: var(--ink); }
.itx-post-body a { color: var(--b); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(2, 79, 158, .35); }
.itx-post-body a:hover { color: var(--b7); text-decoration-color: currentColor; }
.itx-post-body img { max-width: 100%; height: auto; border-radius: 18px; }
.itx-post-body figure { margin: 28px 0; }
.itx-post-body figcaption { margin-top: 10px; font-size: 13.5px; text-align: center; color: #5F7188; }
.itx-post-body :is(ul, ol) { padding-left: 24px; }
.itx-post-body li { margin-bottom: 8px; }
.itx-post-body li::marker { color: var(--b); }
.itx-post-body blockquote { margin: 28px 0; padding: 20px 26px; border-left: 4px solid var(--b); border-radius: 0 18px 18px 0; background: var(--bg); color: var(--ink); font-style: normal; }
.itx-post-body :is(.itx-tblwrap, .wp-block-table) { margin: 28px 0 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 2px 6px rgba(2, 62, 123, .04), 0 14px 34px rgba(2, 62, 123, .07); }   /* same card as the page-built pricing table (.itx-sv-tblwrap) */
.itx-post-body table { width: 100%; margin: 0; border: 0; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.itx-post-body :is(.itx-tblwrap, .wp-block-table) table { min-width: 520px; }
.itx-post-body :is(th, td) { padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.itx-post-body th { background: var(--bg); color: var(--ink); font-weight: 600; }
.itx-post-body thead { background: linear-gradient(100deg, #4F9BE6, #024F9E); }
.itx-post-body thead :is(th, td) { background: none; border-bottom: 0; color: #fff; font-weight: 700; }
.itx-post-body tr:last-child td { border-bottom: 0; }
.itx-post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--line); }
.itx-post-tags a { padding: 7px 14px; border-radius: 999px; background: rgba(2, 79, 158, .08); color: var(--b); font-size: 13.5px; font-weight: 600; transition: background-color .25s, color .25s; }
.itx-post-tags a:hover { background: var(--b); color: #fff; }
.itx-post-back { display: inline-flex; align-items: center; gap: 8px; margin-top: 28px; font-size: 14.5px; font-weight: 600; color: var(--b); }
.itx-post-back .itx-arrow { transform: rotate(180deg); }
.itx-post-back:hover .itx-arrow { transform: rotate(180deg) translateX(5px); }

/* pages: Flatsome [title] shortcode as the page heading, classic [caption] figures; UX Builder sections (.dark banners) keep their own colours */
.itx-post-body .section-title-container { max-width: none; margin: 0 0 16px; padding: 0; }
.itx-post-body .section-title { display: block; overflow: visible; margin: 0; font-size: clamp(28px, 3.2vw, 42px); line-height: 1.15; letter-spacing: -.02em; text-transform: none; }
.itx-post-body .section-title b { display: none; }
.itx-post-body .section-title-main { display: block; padding: 0; border: 0; white-space: normal; font-size: inherit; font-weight: inherit; }
.itx-post-body .wp-caption { width: auto !important; max-width: 100%; margin: 28px auto; padding: 0; background: none; border: 0; }
.itx-post-body .wp-caption-text { margin: 10px 0 0; padding: 0; font-size: 13.5px; font-style: normal; text-align: center; color: #5F7188; }
.itx-page { font-size: 17px; line-height: 1.75; }
.itx-page .col-inner > :is(ul, ol) { padding-left: 24px; }
.itx-page li::marker { color: var(--b); }

/* related posts */
.itx-blog-related { padding: clamp(40px, 5.5vw, 72px) 0; border-top: 1px solid var(--line); background: var(--bg); }
.itx-blog-related h2 { margin-bottom: 28px; font-size: clamp(26px, 3vw, 38px); }

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .itx-post-grid { grid-template-columns: minmax(0, 1fr); }
  .itx-post-aside { position: static; max-height: none; padding: 0; margin: 0; overflow: visible; }
  .itx-post-toc { display: none; }
  .itx-post-toc-m:not([hidden]) { display: block; }
}
@media (max-width: 960px) {
  .itx-blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .itx-news-card.is-featured { flex-direction: column; }
  .itx-news-card.is-featured .itx-news-img { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
  .itx-news-card.is-featured .itx-news-body { padding: 24px; }
}
@media (max-width: 640px) {
  .itx-blog-wrap { width: min(1240px, 100% - 32px); }
  .itx-blog-grid { grid-template-columns: 1fr; gap: 12px; }
  /* compact list: thumbnail left, date + title right (no excerpt / "Đọc tiếp"), so several posts fit on one screen */
  .itx-news-card, .itx-news-card.is-featured { flex-direction: row; border-radius: 18px; }
  .itx-news-card .itx-news-img, .itx-news-card.is-featured .itx-news-img { flex: 0 0 36%; aspect-ratio: auto; min-height: 112px; }
  .itx-news-tag { left: 8px; top: 8px; padding: 3px 9px; font-size: 11px; }
  .itx-news-card .itx-news-body, .itx-news-card.is-featured .itx-news-body { justify-content: center; gap: 4px; padding: 12px 14px; }
  .itx-news-card .itx-news-body strong, .itx-news-card.is-featured .itx-news-body strong { font-size: 15px; line-height: 1.4; }
  .itx-news-card :is(.itx-news-excerpt, .itx-link) { display: none; }
  .itx-blog-crumb span { max-width: 30ch; }
  .itx-blog-cats a { padding: 10px 18px; }
  .itx-post-body { font-size: 16px; }
  .itx-post-body :is(h2, h3, h4) { margin-top: 28px; }
  .itx-post-body img { border-radius: 12px; }
}

/* [itx_related_posts] block inside an article: news cards (2 per row, the article column is narrower than the blog grid) and the service pages' graphic "Dịch vụ liên quan" cards */
.itx-post-body .itx-post-rel { margin: 40px 0 8px; }
.itx-post-body .itx-post-rel-err { margin: 0 0 16px; padding: 12px 16px 12px 32px; border: 1px solid #F5C2C0; border-radius: 12px; background: #FDF2F2; color: #B42318; font-size: 14px; line-height: 1.6; }   /* shown to editors only */
.itx-post-body .itx-post-rel .itx-blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.itx-post-body a.itx-news-card { color: inherit; text-decoration: none; }   /* not the article's underlined blue links */
.itx-post-body .itx-sv-grad { background: linear-gradient(100deg, #024F9E 0%, #4F9BE6 50%, #024F9E 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.itx-post-body .itx-sv-rel { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 32px) / 3); gap: 16px; margin: 24px 0 0; padding-bottom: 10px; overflow-x: auto; scroll-snap-type: x mandatory; }   /* ~3 compact cards per row, more scroll sideways */
.itx-post-body a.itx-sv-rel-i { position: relative; display: block; height: 210px; overflow: hidden; border-radius: 16px; background: #012858; color: #fff; text-decoration: none; scroll-snap-align: start; }   /* no shadow / lift: the scroll box would clip it into a grey band */
.itx-post-body a.itx-sv-rel-i:hover { color: #fff; }
.itx-post-body .itx-sv-rel-g { position: absolute; inset: 0; display: block; background: linear-gradient(145deg, #3B82D6, #02448A); }
.itx-post-body .itx-sv-rel-g svg { position: absolute; left: 0; top: 12px; width: 100%; height: 50%; overflow: visible; transition: transform .6s; }
.itx-post-body a.itx-sv-rel-i:hover .itx-sv-rel-g svg { transform: scale(1.05); }
.itx-post-body .itx-sv-rel-t { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; box-sizing: border-box; height: 112px; padding: 34px 14px 14px; background: linear-gradient(180deg, rgba(1, 40, 88, 0) 0, rgba(1, 40, 88, .9) 45%, rgba(1, 40, 88, .96) 100%); }   /* the graphic fades into the dark title area, fixed height whatever the title length */
.itx-post-body .itx-sv-rel-t b { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; line-height: 1.3; color: #fff; }
.itx-post-body .itx-sv-rel-t b svg { flex: none; width: 16px; height: 16px; }
.itx-post-body .itx-sv-rel-t i { display: block; margin-top: 4px; font-size: 12.5px; font-style: normal; line-height: 1.5; color: #fff; opacity: .92; }
@media (max-width: 640px) {
  .itx-post-body .itx-post-rel .itx-blog-grid { grid-template-columns: 1fr; }
  .itx-post-body .itx-sv-rel { grid-auto-columns: 46%; gap: 12px; }
  .itx-post-body a.itx-sv-rel-i { height: 196px; }
  .itx-post-body .itx-sv-rel-g svg { height: 42%; }
  .itx-post-body .itx-sv-rel-t { height: 112px; padding: 22px 12px 12px; }
  .itx-post-body .itx-sv-rel-t b { font-size: 13.5px; }
  .itx-post-body .itx-sv-rel-t i { font-size: 11.5px; line-height: 1.45; }
}

/* Jetpack Related Posts ("Bài khác nên xem") at the end of an article: spaced title under a rounded image, 3 per row (Jetpack builds it with JS, its own CSS gives a -20px right margin and tight text) */
.itx-post-body #jp-relatedposts { margin: 40px 0 8px; padding-top: 0; }
.itx-post-body #jp-relatedposts .jp-relatedposts-headline { margin: 0 0 18px; font-size: 20px; font-weight: 700; font-style: normal; line-height: 1.3; color: var(--ink, #0B1F3A); }
.itx-post-body #jp-relatedposts .jp-relatedposts-headline em { font-style: normal; font-weight: inherit; }
.itx-post-body #jp-relatedposts .jp-relatedposts-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; }
.itx-post-body #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post { float: none; width: auto; margin: 0; padding: 0; opacity: 1; }
.itx-post-body #jp-relatedposts .jp-relatedposts-post-a { text-decoration: none; border: 0; box-shadow: none; }
.itx-post-body #jp-relatedposts .jp-relatedposts-post-img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; }
.itx-post-body #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title { margin: 0; padding: 14px 4px 0; font-size: 16px; font-weight: 600; line-height: 1.45; letter-spacing: 0; }
.itx-post-body #jp-relatedposts .jp-relatedposts-post-title a { color: var(--ink, #0B1F3A); font-size: inherit; font-weight: inherit; text-decoration: none; }
.itx-post-body #jp-relatedposts .jp-relatedposts-post-title a:hover { color: var(--b, #024F9E); }
@media (max-width: 640px) { .itx-post-body #jp-relatedposts .jp-relatedposts-items { grid-template-columns: 1fr; } }
