/* ==========================================================================
   GSA BLOG – trang bài viết chi tiết
   ========================================================================== */

.gsa-single-page {
	/* Giữ tên biến cũ để không ảnh hưởng file khác, giá trị đã đổi sang xanh thương hiệu */
	--gsa-gold: #1f8538;
	--gsa-gold-dark: #1f8538; /* xanh cho chữ/link trên nền trắng (độ tương phản ~4.7:1) */
	--gsa-black: #0f0f0f;
	--gsa-ink: #1a1a1a;
	--gsa-muted: #6b6b6b;
	--gsa-line: #ececec;
	--gsa-font: "Fahkwang", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	padding: 20px 0 20px;
	background: #fff;
	color: var(--gsa-ink);
}
.gsa-single-page *,
.gsa-single-page *::before,
.gsa-single-page *::after { box-sizing: border-box; }

/* Reset link/heading của Flatsome (đặt đầu file) */
.gsa-post :where(a) { color: #111111; text-decoration: none; }
.gsa-post :where(a):hover { color: inherit; }
.gsa-post :where(ul) { margin: 0; padding: 0; list-style: none; }
.gsa-post :where(li) { margin: 0; }

.gsa-single-page .gsa-container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---------- Bố cục 2 cột ---------- */
.gsa-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 44px;
	align-items: start;
}
.gsa-layout--full { grid-template-columns: minmax(0, 820px); justify-content: center; }

.gsa-post { font-family: var(--gsa-font); }

/* ---------- Breadcrumb ---------- */
.gsa-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	margin-bottom: 18px;
	color: var(--gsa-muted);
	font-size: 14px;
}
.gsa-breadcrumb a:hover { color: var(--gsa-gold-dark); }
.gsa-breadcrumb__sep {
	width: 7px;
	height: 7px;
	margin: 0 4px;
	border-top: 2px solid var(--gsa-gold);
	border-right: 2px solid var(--gsa-gold);
	transform: rotate(45deg);
}
.gsa-breadcrumb__current { color: var(--gsa-ink); }

/* ---------- Tiêu đề + meta ---------- */
.gsa-post__title {
	margin: 0 0 16px;
	color: var(--gsa-ink);
	font-size: clamp(22px, 3.4vw, 26.8px);
	font-weight: 700;
	line-height: 1.45;
}
.gsa-post__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 22px;
	font-weight: 500;
	margin: 0 0 28px;
	padding: 0 0 18px;
	border-bottom: 1px solid var(--gsa-line);
	color: var(--gsa-muted);
	font-size: 14px;
}
.gsa-post__meta li { display: inline-flex; align-items: center; gap: 7px; }
.gsa-ico { flex: none; width: 16px; height: 16px; color: var(--gsa-gold); }

/* ---------- Mục lục ---------- */
.gsa-toc {
	margin: 0 0 28px;
	overflow: hidden;
	border: 1px solid var(--gsa-line);
	border-radius: 6px;
	background: #fafafa;
}
.gsa-toc__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 22px;
	background: var(--gsa-gold);
	color: #fff;
}
.gsa-toc__title { font-size: 16px; font-weight: 700; }
.gsa-toc .gsa-toc__toggle {
	margin: 0;
	min-height: 0;
	padding: 3px 14px;
	border: 1px solid rgba(255, 255, 255, .6);
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
	transition: background .2s, color .2s;
}
.gsa-toc .gsa-toc__toggle:hover { border-color: #fff; background: #fff; color: var(--gsa-gold); }

.gsa-toc__list { padding: 10px 20px 14px; }
.gsa-toc:not(.is-open) .gsa-toc__list { display: none; }
.gsa-toc__item { padding: 3px 0; }
.gsa-toc__item--3 { padding-left: 15px; font-size: .95em; }
.gsa-toc__item a { position: relative; display: inline-block; padding-left: 16px; line-height: 1.5; }
.gsa-toc__item a::before {
	content: "";
	position: absolute;
	left: 0;
	top: .6em;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--gsa-gold);
}
.gsa-toc__item a:hover { color: var(--gsa-gold-dark); }

/* ---------- Nội dung bài ---------- */
.gsa-post__content {
	padding: 0;
	color: #000;
	font-size: 17px;
	line-height: 1.8;
	overflow-wrap: break-word;
	padding-top: 0px !important;
	margin-top: -10px;
	text-align: justify;
}
.gsa-post__content > :first-child { margin-top: 0; }
.gsa-post__content p { margin: 0 0 .9em; }

.gsa-post__content :is(h2, h3, h4) { scroll-margin-top: 110px; color: var(--gsa-ink); font-weight: 700; line-height: 1.35; }
.gsa-post__content h2 {
	margin: .8em 0 .7em;
	padding-left: 14px;
	border-left: 4px solid var(--gsa-gold);
	font-size: clamp(22px, 2.4vw, 25px);
}
.gsa-post__content h3 { margin: .7em 0 .6em; font-size: clamp(19px, 2vw, 22px); }
.gsa-post__content h4 { margin: 1.5em 0 .5em; font-size: 18px; }

.gsa-post__content a:not([class]) {
	color: var(--gsa-gold-dark);
	font-weight: 700;
	text-decoration: underline;
	text-decoration-color: rgba(31, 133, 56, .6);
	text-underline-offset: 3px;
}
.gsa-post__content a:not([class]):hover { color: var(--gsa-black); text-decoration-color: var(--gsa-gold); }

.gsa-post__content ul,
.gsa-post__content ol { margin: 0 0 1.2em 1.4em; padding: 0; }
.gsa-post__content ul { list-style: disc; }
.gsa-post__content ol { list-style: decimal; }
.gsa-post__content li { margin-bottom: .4em; }
.gsa-post__content li::marker { color: var(--gsa-gold-dark); }

.gsa-post__content img { max-width: 100%; height: auto; }
.gsa-post__content figure { margin: 1.1em 0; }
.gsa-post__content figcaption { color: #161616; font-size: 14px; text-align: center; }

/* Chú thích ảnh: nền xanh thương hiệu, chữ trắng */
.wp-caption .wp-caption-text {
	background: #1f8538 !important;
	color: #fff !important;
	padding: .3em !important;
}

.gsa-post__content blockquote {
	margin: 1.6em 0;
	padding: 18px 24px;
	border-left: 4px solid var(--gsa-gold);
	background: #f1f8f3;
	font-style: italic;
}
.gsa-post__content blockquote p:last-child { margin-bottom: 0; }






/* Table */


/* GSA TABLE */
.gsa-post__content .gsa-table-scroll {
    width: 100%;
    max-width: 100%;
    margin: 1.3em 0 1.1em;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
	border-radius: 9px;
}

/* Desktop */
.gsa-post__content .gsa-table-scroll table {
    width: 100%;
    min-width: 0;
    margin: 0;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 15px;
    table-layout: auto;
    font-family: 'SVN-Gilroy', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}


.gsa-post__content .gsa-table-scroll th {
    background: var(--gsa-black);
    color: #fff;
    padding: 18px 14px;
    font-size: 16.8px;
	border-bottom: 5px solid var(--gsa-gold);
}


.gsa-post__content .gsa-table-scroll td {
    white-space: nowrap;
    padding: 15px 14px;
    color: #333;
    font-size: 16.8px;
    border: 1px solid var(--gsa-line);
    vertical-align: middle;
    white-space: nowrap;
	background: #f7fbf8;
	font-weight: 500;
}

/* Mobile */

/* GSA TABLE - MOBILE COMPACT */
@media (max-width: 767px) {

    .gsa-post__content .gsa-table-scroll {
        width: 100%;
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .gsa-post__content .gsa-table-scroll table {
        width: max-content !important;
        min-width: 0 !important;
        table-layout: auto;
    }

    .gsa-post__content .gsa-table-scroll th,
    .gsa-post__content .gsa-table-scroll td {
        white-space: nowrap !important;
        width: auto;
        min-width: 0;
        padding: 14px 10px;
        font-size: 16px;
    }

    /* Giới hạn độ rộng cột đầu tiên */
    .gsa-post__content .gsa-table-scroll th:first-child,
    .gsa-post__content .gsa-table-scroll td:first-child {
        padding-left: 10px;
        padding-right: 10px;
    }

.gsa-toc__list {padding: 1px 10px 3px;}
.gsa-toc__item a {font-size:12px;}
.gsa-toc__item {padding:0;}
.gsa-toc__head {padding:6px 12px;}
.gsa-post__meta {margin:0 0 15px;}
}





/* ---------- Bài trước / sau ---------- */
.gsa-postnav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 4px; }
.gsa-postnav__item {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 18px 20px;
	border: 1px solid var(--gsa-line);
	border-radius: 6px;
	transition: border-color .2s, transform .2s;
}
.gsa-postnav__item:hover { border-color: var(--gsa-gold); transform: translateY(-2px); }
.gsa-postnav__item--next { grid-column: 2; text-align: right; }
.gsa-postnav__label { color: var(--gsa-gold-dark); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.gsa-postnav__title {
	font-weight: 700;
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---------- Bài viết liên quan ---------- */
.gsa-related { margin-top: 46px; padding-top: 36px; border-top: 1px solid var(--gsa-line); }
.gsa-related__heading {
	margin: 0 0 22px;
	padding-left: 14px;
	border-left: 4px solid var(--gsa-gold);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
}
.gsa-related__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.gsa-related__media {
	position: relative;
	display: block;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	border-radius: 6px;
	background: #e9e9e9;
}
.gsa-related__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s ease;
}
.gsa-related__item:hover .gsa-related__media img { transform: scale(1.06); }
.gsa-related__title {
	margin: 12px 0 6px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.gsa-related__title a:hover { color: var(--gsa-gold-dark); }
.gsa-related__date { color: var(--gsa-muted); font-size: 13px; }

.gsa-thumb-placeholder { position: absolute; inset: 0; background: linear-gradient(135deg, #1a1a1a, #2d2d2d); }
.gsa-thumb-placeholder::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--gsa-gold); }

/* ---------- Sidebar ---------- */
.gsa-sidebar .widget { margin-bottom: 28px; }
.gsa-sidebar .widget:last-child { margin-bottom: 0; }
/* Dính theo khi cuộn: chỉ bật trên màn hình đủ cao để form không bị cắt */
@media (min-width: 1025px) and (min-height: 900px) {
	.gsa-sidebar__inner { position: sticky; top: 110px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.gsa-layout { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}
@media (max-width: 640px) {
	.gsa-single-page { padding: 20px 0 56px; }
	.gsa-post__content { font-size: 15px; line-height:1.5;}
	.gsa-related__grid { grid-template-columns: 1fr; }
	.gsa-postnav { grid-template-columns: 1fr; }
	.gsa-postnav__item--next { grid-column: auto; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
	.gsa-single-page * { transition: none !important; }
}
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }



/* ---------- Thanh tiến độ đọc (JS tạo ra, nằm ngoài .gsa-single-page nên dùng màu trực tiếp) ---------- */
.gsa-progress {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 99990;
	width: 100%;
	height: 3px;
	background: #1f8538;
	transform: scaleX(0);
	transform-origin: left;
	pointer-events: none;
}
body.admin-bar .gsa-progress { top: 32px; }
@media (max-width: 782px) { body.admin-bar .gsa-progress { top: 46px; } }

/* ---------- Mục lục: mục đang đọc ---------- */
.gsa-toc__item a.is-active { color: var(--gsa-gold-dark); font-weight: 600; }
.gsa-toc__item a.is-active::before { transform: scale(1.5); }
.gsa-toc__item a::before { transition: transform .2s; }









/* ---------- Đoạn mở đầu (Excerpt) ---------- */
.gsa-post__intro {
	position: relative;
	margin: 0 0 28px;
	padding: 22px 28px 22px 30px;
	border-left: 4px solid var(--gsa-gold);
	border-radius: 0 8px 8px 0;
	background: linear-gradient(90deg, #e8f5ec 0%, #fbfefc 100%);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
	color: #000;
	font-size: 18px;
	font-weight: 500;
	line-height: 1.75;
	text-align: justify;
}
/* Dấu trích dẫn mờ ở góc phải */
.gsa-post__intro::before {
	content: "\201C";
	position: absolute;
	top: 15px;
	right: 20px;
	color: rgba(31, 133, 56, .25);
	font-family: Georgia, "Times New Roman", serif;
	font-size: 88px;
	line-height: 1;
	pointer-events: none;
	display: none;
}
.gsa-post__intro > * { position: relative; }
.gsa-post__intro p { margin: 0 0 .8em; }
.gsa-post__intro p:last-child { margin-bottom: 0; }
.gsa-post__intro strong { color: var(--gsa-ink); font-weight: 700; }
.gsa-post__intro a {
	color: var(--gsa-gold-dark);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: rgba(31, 133, 56, .6);
	text-underline-offset: 3px;
}
.gsa-post__intro a:hover { color: var(--gsa-black); }

@media (max-width: 640px) {
	.gsa-post__intro { padding: 18px 18px 18px 20px; font-size: 16.5px; }
	.gsa-post__intro::before { font-size: 64px; right: 12px; }
}



/* Breadcrumb trên mobile: chỉ hiện "Trang chủ > Chuyên mục", ẩn tên bài viết */
@media (max-width: 640px) {
	.gsa-breadcrumb__current,
	.gsa-breadcrumb__sep:nth-last-child(2) { display: none; }
	.wp-caption .wp-caption-text {font-size:.65em !important;}
}


/* ---------- Ảnh trong bài: luôn căn giữa nếu nhỏ hơn khung ---------- */
.gsa-post__content img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: 0px;
}
/* Emoji/icon nhỏ chèn giữa chữ thì giữ nguyên dạng inline */
.gsa-post__content img:is(.emoji, .wp-smiley) {
	display: inline;
	margin: 0 .1em;
	border-radius: 0;
}


/* Khi bạn chủ động chọn căn trái/phải trong trình soạn thảo thì vẫn giữ nguyên */
.gsa-post__content .aligncenter { float: none; margin-left: auto; margin-right: auto; }
.gsa-post__content .alignleft  { float: left;  margin: .4em 1.6em 1em 0; }
.gsa-post__content .alignright { float: right; margin: .4em 0 1em 1.6em; }
.gsa-post__content::after { content: ""; display: block; clear: both; } /* gom float, tránh tràn xuống dưới */

@media (max-width: 640px) {
	/* Trên điện thoại, ảnh căn trái/phải trở về căn giữa cho gọn */
	.gsa-post__content .alignleft,
	.gsa-post__content .alignright { float: none; display: block; margin: 1.2em auto; }
	.gsa-post__content .kk-star-ratings.kksr-valign-bottom {
	margin-top: 1.4rem !important;
}
	.gsa-related__title {
		font-size: 20px;
	}
}


/* KK Rating */
.gsa-post__content .kk-star-ratings.kksr-valign-bottom {
	margin-top: 2rem;
	margin-bottom: 0;
}