/**
 * Viet Thanh — blog + search components (inc/blog/class-vt-blog.php).
 * Enqueued only when a [vt_latest_posts] / [vt_post_*] / [vt_search_results] shortcode renders.
 * Ported from align-function css pages/journals.css, pages/blogdetails.css,
 * our-blocks/search/style.css and our-blocks/search-results/style.css.
 */

/* ─── Shared list reset ─────────────────────────────────── */
.vt-posts,
.vt-posts ul,
.vt-search-results .catalog-wrap,
.vt-search-results .pagination ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.vt-posts img {
	display: block;
	max-width: 100%;
}

/* ─── Layout: list (journals) ───────────────────────────── */
.vt-posts--list {
	display: flex;
	flex-direction: column;
}

.vt-posts--list .news-item {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 32px;
	margin-bottom: 120px;
	width: 100%;
}

.vt-posts--list .news-item:nth-child(odd) {
	flex-direction: row-reverse;
}

.vt-posts--list .news-item__img {
	position: relative;
	display: block;
	width: 50%;
	flex: 0 0 calc(50% - 16px);
	height: 0;
	padding-top: calc((50% - 16px) * 0.6781);
	overflow: hidden;
}

.vt-posts--list .news-item__img img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s ease-out;
}

.vt-posts--list .news-item__img:hover img {
	transform: scale(1.1);
}

.vt-posts--list .news-item__content {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 50%;
	flex: 1 1 50%;
	padding: 0 30px;
}

.vt-posts--list .news-date {
	display: block;
	color: rgba(0, 0, 0, .6);
	font-size: 20px;
	line-height: 1.6;
}

.vt-posts--list .news-item__ttl {
	font-size: clamp(28px, 3vw, 40px);
	font-weight: 400;
	line-height: 1;
	text-align: left;
	color: #2a1001;
}

.vt-posts--list .news-item__ttl a {
	color: #2a1001;
	transition: color .2s linear;
}

.vt-posts--list .news-item__ttl a:hover {
	color: #58331e;
	text-decoration: underline;
}

.vt-posts--list .news-item__des {
	font-size: clamp(18px, 1.25vw, 24px);
	line-height: 1.2;
}

.vt-posts--list .news-item__des + .btn-read-more {
	margin-top: 10px;
}

.vt-posts--list .btn-read-more {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 276px;
	max-width: 100%;
	margin-top: 26px;
	padding: 18px 32px;
	border-radius: 47px;
	background: #2b1001;
	color: #fff;
	font-size: 26px;
	line-height: 1.2;
	text-transform: uppercase;
	transition: background-color .2s, color .2s;
}

.vt-posts--list .btn-read-more:hover,
.vt-posts--list .btn-read-more:focus-visible {
	background-color: #58331e;
	color: #fff;
}

@media screen and (max-width: 1024px) {
	.vt-posts--list .news-item,
	.vt-posts--list .news-item:nth-child(odd) {
		flex-direction: column;
		align-items: flex-start;
		gap: 20px;
		margin-bottom: 80px;
	}

	.vt-posts--list .news-item__img {
		width: 100%;
		flex-basis: auto;
		padding-top: 67.81%;
	}

	.vt-posts--list .news-item__content {
		width: 100%;
		padding: 0;
	}

	.vt-posts--list .btn-read-more {
		width: 100%;
	}
}

/* ─── Layout: grid (latest news / related) ──────────────── */
.vt-posts--grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

.vt-posts--grid .vt-posts__media {
	position: relative;
	display: block;
	height: 0;
	padding-top: 67.81%;
	overflow: hidden;
}

.vt-posts--grid .vt-posts__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .3s ease;
}

.vt-posts--grid .vt-posts__media:hover img {
	transform: scale(1.05);
}

.vt-posts--grid .vt-posts__content {
	padding: 25px 15px 15px;
}

.vt-posts--grid .vt-posts__title {
	margin-bottom: 12px;
	font-size: 19.2px;
	font-weight: 400;
	line-height: 24px;
}

.vt-posts--grid .vt-posts__title a:hover {
	text-decoration: underline;
}

.vt-posts--grid .vt-posts__date {
	display: block;
	font-size: 13px;
	line-height: 1.2;
}

@media screen and (max-width: 768px) {
	.vt-posts--grid {
		grid-template-columns: 1fr;
	}
}

/* ─── Layout: slider (home journals) ────────────────────── */
.vt-posts--slider .vt-posts__media {
	position: relative;
	display: block;
	height: 0;
	padding-top: 67.81%;
	overflow: hidden;
}

.vt-posts--slider .vt-posts__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s ease;
}

.vt-posts--slider .vt-posts__media:hover img {
	transform: scale(1.08);
}

/* ─── Single post ───────────────────────────────────────── */
.vt-post-hero__title.hdg-lv1 {
	padding-bottom: 12px;
	text-transform: capitalize;
}

.vt-post-hero__date {
	display: block;
	margin-bottom: 24px;
	font-size: 20px;
	text-align: center;
}

.vt-post-body {
	line-height: 1.2;
}

.vt-post-body p {
	margin: 0 0 24px;
}

.vt-post-body .wp-block-image {
	margin: 0 auto 40px;
}

.vt-post-body img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
}

.vt-post-body a {
	text-decoration: underline;
}

.vt-post-body ul,
.vt-post-body ol {
	margin: 0 0 24px 24px;
}

.vt-post-body li {
	list-style: disc;
	margin-bottom: 8px;
}

.vt-post-body ol li {
	list-style: decimal;
}

.vt-post-body h2,
.vt-post-body h3,
.vt-post-body h4 {
	margin: 32px 0 16px;
	font-weight: 400;
	line-height: 1.2;
}

/* ─── Search header + form ──────────────────────────────── */
.vt-search {
	padding: 45px 0;
	margin-bottom: 45px;
}

.vt-search .container {
	width: calc(100% * 10 / 12);
}

.vt-search__title.title-h1 {
	margin: 0 0 40px;
	line-height: 1;
}

.vt-search__form {
	width: 1100px;
	max-width: 100%;
	margin: 0 auto;
}

.vt-search__field {
	position: relative;
}

.vt-search__input {
	display: block;
	width: 100%;
	padding: 16px 64px 14px 40px;
	border: 1px solid #2b1001;
	border-radius: 999px;
	background: transparent;
	color: #2b1001;
	font-size: clamp(16px, 1.0416666667vw, 20px);
	line-height: 1.2;
}

.vt-search__input::placeholder {
	color: #767676;
	opacity: 1;
}

.vt-search__input:focus-visible {
	outline: 2px solid #2b1001;
	outline-offset: 2px;
}

.vt-search__submit {
	position: absolute;
	top: 50%;
	right: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	cursor: pointer;
	transform: translateY(-50%);
}

.vt-search__submit img {
	width: 24px;
	height: 24px;
}

@media screen and (max-width: 1024px) {
	.vt-search {
		margin-bottom: 0;
	}
}

@media screen and (max-width: 768px) {
	.vt-search .container {
		width: 100%;
		padding: 0 8px;
	}

	.vt-search__title.title-h1 {
		margin-bottom: 20px;
	}
}

/* ─── Search results grid ───────────────────────────────── */
.vt-search-results {
	width: 100%;
	max-width: 1920px;
	margin: 0 auto;
	padding: 45px 0;
	overflow: hidden;
}

.vt-search-results .catalog-wrap {
	display: flex;
	flex-wrap: wrap;
	margin: 0 -2px;
}

.vt-search-results .col-3 {
	width: 25%;
	margin-bottom: 95px;
	padding: 0 2px;
}

.vt-search-results .catalog-item-img {
	display: block;
	position: relative;
	width: 100%;
	height: 0;
	margin-bottom: 30px;
	padding-top: 106%;
	overflow: hidden;
}

.vt-search-results .catalog-item-img::after {
	content: "";
	position: absolute;
	z-index: 9;
	inset: 0;
	background: url("/wp-content/uploads/2025/08/background-new.webp") center / 90% 100% no-repeat;
}

.vt-search-results .catalog-item-img img {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 10;
	width: 73%;
	height: auto;
	transform: translate(-50%, -40%);
	object-fit: cover;
	transition: .5s linear;
}

.vt-search-results .catalog-item-title {
	display: block;
	padding: 0 30px;
	font-size: clamp(22px, 1.4583333333vw, 28px);
	font-weight: 400;
	line-height: 1.2;
	text-align: center;
	text-transform: capitalize;
}

.vt-search-results .catalog-item-title a {
	color: #2b1001;
	transition: .2s linear;
}

.vt-search-results .catalog-item-color {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	margin-bottom: 30px;
	padding: 0 30px;
}

.vt-search-results .color-item {
	display: block;
	width: 40px;
	height: 40px;
	margin: 5px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background-color: transparent;
	background-position: center;
	background-size: cover;
	cursor: pointer;
}

.vt-search-results .color-item:focus-visible {
	outline: 2px solid #58331e;
	outline-offset: 3px;
}

.align-search-results__empty {
	width: 100%;
	padding: 45px 8px 90px;
	text-align: center;
}

.vt-search-results .pagination {
	display: block;
	padding: 90px 0;
}

.vt-search-results .pagination ul {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
}

.vt-search-results .pagination span.page-numbers,
.vt-search-results .pagination a.page-numbers {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-left: 4px;
	padding: 1px 0 0 1px;
	border-radius: 999px;
	background-color: #fff;
	color: #2b1001;
	font-size: clamp(14px, .8333333333vw, 16px);
	font-weight: 600;
	transition: .2s linear;
}

.vt-search-results .pagination .page-numbers.current {
	background-color: #58331e;
	color: #fff;
}

.vt-search-results .pagination .page-numbers img {
	display: block;
	height: 12px;
	width: auto;
	transition: .2s linear;
}

@media screen and (min-width: 1025px) {
	.vt-search-results .catalog-item-img:hover img {
		transform: translate(-50%, -50%) scale(1.1);
	}

	.vt-search-results .catalog-item-title a:hover {
		color: #58331e;
		text-decoration: underline;
	}

	.vt-search-results .pagination a.page-numbers:hover {
		background-color: #58331e;
		color: #fff;
	}

	.vt-search-results .pagination a.page-numbers:hover img {
		filter: brightness(0) invert(1);
	}
}

@media screen and (max-width: 1440px) {
	.vt-search-results .catalog-item-color {
		margin-bottom: 10px;
		padding: 0 10px;
	}

	.vt-search-results .color-item {
		width: 30px;
		height: 30px;
		margin: 3px;
	}

	.vt-search-results .pagination {
		padding: 80px 0;
	}
}

@media screen and (max-width: 1024px) {
	.vt-search-results .col-3 {
		width: calc(100% / 3);
		margin-bottom: 75px;
	}

	.vt-search-results .catalog-item-img {
		margin-bottom: 20px;
	}

	.vt-search-results .catalog-item-color {
		padding: 0 20px;
	}

	.vt-search-results .color-item {
		margin: 5px;
	}

	.vt-search-results .pagination {
		padding: 70px 0;
	}
}

@media screen and (max-width: 768px) {
	.vt-search-results {
		padding: 0 4px;
	}

	.vt-search-results .catalog-wrap {
		margin: 0;
	}

	.vt-search-results .col-3 {
		width: 50%;
		margin-bottom: 50px;
		padding: 0 4px;
	}

	.vt-search-results .catalog-item-color {
		display: none;
	}

	.vt-search-results .pagination {
		padding: 60px 0;
	}

	.vt-search-results .pagination span.page-numbers,
	.vt-search-results .pagination a.page-numbers {
		width: 30px;
		height: 30px;
	}

	.vt-search-results .pagination .page-numbers img {
		height: 10px;
	}
}

@media screen and (max-width: 480px) {
	.vt-search-results .col-3 {
		margin-bottom: 25px;
	}

	.vt-search-results .catalog-item-title {
		padding: 0;
		font-size: 14px;
	}

	.vt-search-results .catalog-item-img {
		margin-bottom: 13px;
		padding-top: 120%;
	}

	.vt-search-results .catalog-item-img img {
		width: 80%;
	}
}
