 /**
 * Thủy Bích Vĩnh Long — Blog Single CSS
 *
 * Path:
 * wp-content/themes/flatsome-child/css/tb-blog-single.css
 *
 * Final clean version:
 * - Single blog only.
 * - Preserve current image/main/sidebar ratio.
 * - Only article text is allowed to extend right into the gap before sidebar.
 * - No header/footer edits.
 */

/* Kill old Flatsome single-post hero/title only inside single post. */
.single-post .page-title.blog-featured-title,
.single-post .featured-title,
.single-post .page-title-bg,
.single-post .title-overlay,
.single-post .entry-image {
	display: none !important;
}

.single-post .page-wrapper,
.single-post #main,
.single-post .row.row-large {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

.single-post .article-inner {
	padding-top: 0 !important;
}

/* Base */
.tb-blog-single {
	--tb-text: #111513;
	--tb-muted: #646b65;
	--tb-line: rgba(30, 35, 32, .065);
	--tb-line-soft: rgba(30, 35, 32, .035);
	--tb-brass: #a98a5e;
	--tb-surface: #f4f5f2;

	/* Keep current visual ratio */
	--tb-wide: 1380px;
	--tb-gutter: 32px;
	--tb-sidebar: 340px;
	--tb-gap: 72px;

	--tb-title-width: 900px;
	--tb-sidebar-title-offset: 48px;

	/* Text can extend into the space before sidebar without changing image width. */
	--tb-text-overflow: calc(var(--tb-gap) - 12px);

	padding: 58px 0 108px;
	background: #fff;
	color: var(--tb-text);
	font-family: "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	overflow: visible;
}

.tb-blog-single *,
.tb-blog-single *::before,
.tb-blog-single *::after {
	box-sizing: border-box;
}

.tb-blog-single a {
	color: inherit;
	text-decoration: none;
}

.tb-blog-single__container {
	width: min(var(--tb-wide), calc(100vw - 2 * var(--tb-gutter)));
	margin-inline: auto;
	overflow: visible;
}

.tb-blog-single__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--tb-sidebar);
	gap: var(--tb-gap);
	align-items: start;
	overflow: visible;
}

.tb-blog-single__main {
	min-width: 0;
	background: #fff;
	overflow: visible;
}

/* Header */
.tb-blog-single__header {
	max-width: var(--tb-title-width);
	margin: 0 0 28px;
	text-align: left;
}

.tb-blog-single__breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 9px;
	margin: 0 0 34px;
	color: #6f7670;
	font-size: 13px;
	line-height: 1.2;
	font-weight: 500;
}

.tb-blog-single__breadcrumb a {
	color: #6f7670;
	text-decoration: none;
}

.tb-blog-single__breadcrumb a:last-child {
	color: #111513;
	font-weight: 650;
}

.tb-blog-single__breadcrumb-sep {
	color: #b5bbb5;
}

.tb-blog-single__title {
	max-width: var(--tb-title-width);
	margin: 0;
	color: #1d211d;
	font-size: clamp(22px, 1.55vw, 31px);
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: -.018em;
}

.tb-blog-single__meta {
	width: 100%;
	max-width: none;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--tb-line);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	color: #6f7670;
	font-size: 12.5px;
	line-height: 1.5;
	font-weight: 500;
}

.tb-blog-single__meta span + span::before {
	content: "";
	display: inline-block;
	width: 3px;
	height: 3px;
	margin: 0 10px 3px 0;
	border-radius: 999px;
	background: rgba(30, 35, 32, .26);
}

.tb-blog-single__read-time {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.tb-blog-single__read-time svg {
	width: 14px;
	height: 14px;
	display: inline-block;
	flex: 0 0 auto;
	stroke-width: 1.75;
}

/* Featured image keeps current ratio/width. */
.tb-blog-single__featured {
	width: 100%;
	max-width: none;
	margin: 0 0 38px;
	background: var(--tb-surface);
	border: 1px solid var(--tb-line-soft);
	border-radius: 3px;
	overflow: hidden;
}

.tb-blog-single__featured-image {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
	object-position: center;
}

/* Article content — extends right only, image remains unchanged. */
.tb-blog-single__content-inner {
	width: calc(100% + var(--tb-text-overflow));
	max-width: calc(100% + var(--tb-text-overflow));
	margin-left: 0;
	margin-right: calc(-1 * var(--tb-text-overflow));
	padding: 0;
	color: #2c312d;
	font-size: 17px;
	line-height: 1.88;
	overflow: visible;
}

.tb-blog-single__content-inner > *:first-child {
	margin-top: 0;
}

.tb-blog-single__content-inner p {
	width: 100%;
	max-width: none;
	margin: 0 0 1.4em;
}

.tb-blog-single__content-inner h2,
.tb-blog-single__content-inner h3,
.tb-blog-single__content-inner h4 {
	max-width: none;
	color: #1d211d;
	font-weight: 700;
	letter-spacing: -.015em;
}

.tb-blog-single__content-inner h2 {
	margin: 2.05em 0 .72em;
	font-size: clamp(23px, 1.55vw, 30px);
	line-height: 1.24;
}

.tb-blog-single__content-inner h3 {
	margin: 1.7em 0 .56em;
	font-size: clamp(19px, 1.18vw, 23px);
	line-height: 1.32;
}

.tb-blog-single__content-inner h4 {
	margin: 1.45em 0 .5em;
	font-size: 18px;
	line-height: 1.35;
}

.tb-blog-single__content-inner ul,
.tb-blog-single__content-inner ol {
	width: 100%;
	max-width: none;
	margin: 0 0 1.45em 1.2em;
	padding: 0;
}

.tb-blog-single__content-inner li {
	margin: 0 0 .56em;
}

.tb-blog-single__content-inner a {
	color: var(--tb-brass);
	border-bottom: 1px solid rgba(169, 138, 94, .32);
}

.tb-blog-single__content-inner img {
	max-width: 100%;
	height: auto;
	border-radius: 4px;
}

.tb-blog-single__content-inner figure {
	margin: 2em 0;
}

.tb-blog-single__content-inner figcaption {
	margin-top: 10px;
	color: var(--tb-muted);
	font-size: 13px;
	line-height: 1.55;
	text-align: center;
}

.tb-blog-single__content-inner blockquote {
	max-width: none;
	margin: 2em 0;
	padding: 0 0 0 22px;
	border-left: 2px solid var(--tb-brass);
	color: #404741;
	font-size: 18px;
	line-height: 1.72;
}

/* Sidebar */
.tb-blog-single__sidebar {
	align-self: start;
	width: var(--tb-sidebar);
	min-width: 0;
	padding-top: var(--tb-sidebar-title-offset);
	overflow: visible;
}

.tb-blog-single__sidebar-sticky {
	display: grid;
	gap: 38px;
	position: sticky;
	top: 96px;
}

.tb-sidebar-block {
	background: transparent;
	border: 0;
}

.tb-sidebar-block__title {
	margin: 0 0 16px;
	padding: 0 0 12px;
	display: block;
	color: #111513;
	border-bottom: 1px solid var(--tb-line);
	font-size: 14.2px;
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: -.006em;
}

/* Related posts */
.tb-related-posts {
	display: grid;
	gap: 0;
}

.tb-related-post {
	display: grid;
	grid-template-columns: 84px minmax(0, 1fr);
	gap: 14px;
	align-items: start;
	padding: 14px 0;
	border-bottom: 1px solid rgba(30, 35, 32, .055);
	background: transparent;
}

.tb-related-post:first-child {
	padding-top: 0;
}

.tb-related-post:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.tb-related-post__thumb {
	display: block;
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #f3f4f2;
	border-radius: 2px;
}

.tb-related-post__thumb img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	transition: transform .55s ease;
}

.tb-related-post:hover .tb-related-post__thumb img {
	transform: scale(1.014);
}

.tb-related-post__fallback {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #798179;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .12em;
	background: linear-gradient(135deg, #f2f5ef, #e7ede6);
}

.tb-related-post__content {
	min-width: 0;
}

.tb-related-post__title {
	display: -webkit-box;
	margin: 0 0 8px;
	color: #111513;
	font-size: 12.9px;
	line-height: 1.42;
	font-weight: 650;
	letter-spacing: -.006em;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tb-related-post__meta {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	color: #6f7670;
	font-size: 10.1px;
	line-height: 1;
	font-weight: 500;
}

.tb-related-post__meta span:first-child {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Categories */
.tb-single-cats {
	display: grid;
}

.tb-single-cats ul,
.tb-single-cats li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tb-single-cats > li,
.tb-single-cats .cat-item {
	display: block;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tb-single-cats a {
	min-height: 38px;
	padding: 11px 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	border-bottom: 1px solid var(--tb-line);
	color: #59615b;
	font-size: 12.8px;
	line-height: 1.35;
	font-weight: 500;
}

.tb-single-cats a::after {
	content: "›";
	color: #8b918c;
	font-size: 15px;
	font-weight: 300;
}

/* TOC */
.tb-toc {
	display: grid;
	gap: 0;
}

.tb-toc.is-empty,
.tb-sidebar-block--toc:has(.tb-toc.is-empty) {
	display: none;
}

.tb-toc a {
	min-height: 38px;
	padding: 11px 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	border-bottom: 1px solid var(--tb-line);
	color: #59615b;
	font-size: 12.8px;
	line-height: 1.35;
	font-weight: 500;
}

.tb-toc a::after {
	content: "›";
	color: #8b918c;
	font-size: 15px;
	font-weight: 300;
}

.tb-toc a.is-active {
	color: var(--tb-brass);
}

/* Wide desktop */
@media (min-width: 1440px) {
	.tb-blog-single {
		--tb-wide: 1420px;
		--tb-sidebar: 360px;
		--tb-gap: 72px;
		--tb-title-width: 920px;
		--tb-text-overflow: calc(var(--tb-gap) - 12px);
		--tb-sidebar-title-offset: 48px;
	}
}

/* Laptop */
@media (min-width: 1025px) and (max-width: 1110px) {
	.tb-blog-single {
		--tb-wide: 100%;
		--tb-gutter: 28px;
		--tb-sidebar: 320px;
		--tb-gap: 48px;
		--tb-title-width: 100%;
		--tb-text-overflow: 0px;
		--tb-sidebar-title-offset: 48px;
	}

	.tb-blog-single__content-inner {
		width: 100%;
		max-width: 100%;
		margin-right: 0;
	}

	.tb-blog-single__sidebar-sticky {
		top: 92px;
	}
}

/* Tablet */
@media (max-width: 1024px) {
	.tb-blog-single {
		--tb-wide: 100%;
		--tb-gutter: 20px;
		--tb-sidebar: 100%;
		--tb-gap: 48px;
		--tb-title-width: 100%;
		--tb-text-overflow: 0px;
		--tb-sidebar-title-offset: 0px;
		padding-top: 44px;
	}

	.tb-blog-single__grid {
		grid-template-columns: 1fr;
		gap: var(--tb-gap);
	}

	.tb-blog-single__header,
	.tb-blog-single__content-inner {
		max-width: 100%;
		width: 100%;
		margin-left: 0;
		margin-right: 0;
	}

	.tb-blog-single__sidebar {
		width: 100%;
		padding-top: 0;
	}

	.tb-blog-single__sidebar-sticky {
		position: static;
		max-height: none;
		overflow: visible;
		padding-right: 0;
	}
}

/* Mobile */
@media (max-width: 849px) {
	.tb-blog-single {
		--tb-gutter: 16px;
		padding-top: 34px;
		padding-bottom: 78px;
	}

	.tb-blog-single__breadcrumb {
		margin-bottom: 22px;
		font-size: 12.5px;
	}

	.tb-blog-single__title {
		font-size: 25px;
		line-height: 1.18;
	}

	.tb-blog-single__meta {
		margin-top: 12px;
		padding-top: 12px;
		font-size: 12.5px;
	}

	.tb-blog-single__featured {
		margin-bottom: 28px;
	}

	.tb-blog-single__content-inner {
		max-width: 100%;
		width: 100%;
		font-size: 16px;
		line-height: 1.78;
	}

	.tb-related-post {
		grid-template-columns: 84px minmax(0, 1fr);
	}
}
/**
 * Thủy Bích Vĩnh Long — Single Blog Text + TOC Scroll Fix
 *
 * Path:
 * wp-content/themes/flatsome-child/css/tb-blog-single-fix.css
 *
 * Scope:
 * - Single post only.
 * - Keep current image/sidebar ratio.
 * - Make article text width equal featured image/main column.
 * - Justify paragraphs without letting text overflow beyond image column.
 */

/* Keep this patch scoped. Do not affect global blog/archive/header/footer. */
@media (min-width: 1025px) {
	.single-post .tb-blog-single__main {
		min-width: 0;
	}

	/* Image and text share the same main-column width. */
	.single-post .tb-blog-single__featured,
	.single-post .tb-blog-single__content-inner {
		width: 100% !important;
		max-width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	/* Remove old text max-width locks, but only inside the article body. */
	.single-post .tb-blog-single__content-inner > p,
	.single-post .tb-blog-single__content-inner > ul,
	.single-post .tb-blog-single__content-inner > ol,
	.single-post .tb-blog-single__content-inner > blockquote {
		width: 100% !important;
		max-width: 100% !important;
	}

	/* Keep headings readable; do not justify headings. */
	.single-post .tb-blog-single__content-inner h1,
	.single-post .tb-blog-single__content-inner h2,
	.single-post .tb-blog-single__content-inner h3,
	.single-post .tb-blog-single__content-inner h4 {
		text-align: left !important;
		max-width: 100% !important;
	}

	/* Justify body copy only. */
	.single-post .tb-blog-single__content-inner p {
		text-align: justify;
		text-align-last: left;
		text-justify: inter-word;
		overflow-wrap: break-word;
		word-break: normal;
		hyphens: auto;
	}

	.single-post .tb-blog-single__content-inner li {
		text-align: left;
		overflow-wrap: break-word;
		word-break: normal;
	}

	/* Prevent accidental overflow past featured image/main column. */
	.single-post .tb-blog-single__content-inner img,
	.single-post .tb-blog-single__content-inner iframe,
	.single-post .tb-blog-single__content-inner table {
		max-width: 100% !important;
	}

	.single-post .tb-blog-single__content-inner table {
		display: block;
		overflow-x: auto;
	}
}

/* Tablet/mobile: avoid ugly justified Vietnamese spacing on narrow screens. */
@media (max-width: 1024px) {
	.single-post .tb-blog-single__content-inner {
		width: 100% !important;
		max-width: 100% !important;
	}

	.single-post .tb-blog-single__content-inner p {
		text-align: left;
		overflow-wrap: break-word;
		word-break: normal;
	}
}

/* TOC link states for the JS scroll behavior. */
.single-post .tb-toc a {
	cursor: pointer;
}

.single-post .tb-toc a.is-active {
	color: var(--tb-brass, #a98a5e);
	font-weight: 650;
}

.single-post .tb-toc a.tb-toc__link--h3 {
	padding-left: 14px;
	font-size: 12px;
	color: #747b75;
}
