/* =========================================================================
 * X3SALES DV Projects — element vhm_thm_projects
 * Khối "Các dự án đã làm": tiêu đề + lưới ô dự án. Mỗi ô có 2 ảnh chồng nhau,
 * rê chuột thì ảnh trên mờ đi để lộ ảnh dưới (crossfade thuần CSS).
 * Lưới bằng CSS grid (responsive) thay cho absolute px. Scope dưới .thm-projects.
 * ========================================================================= */

@font-face {
	font-family: "THM Megante";
	src: url("https://w.ladicdn.com/5dadc2a03bf9ab4ea2cc8ccb/svn-megante-20231018093528-hgdbo.otf");
	font-display: swap;
}

.thm-projects,
.thm-projects * {
	box-sizing: border-box;
}

.thm-projects {
	position: relative;
	width: 100%;
	padding: 40px 15px 50px;
	background-color: var(--thm-projects-bg, #f1f3f4);
}

.thm-projects__inner {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
}

/* -------- Tiêu đề -------- */
.thm-projects__head {
	margin-bottom: 28px;
	text-align: center;
}

.thm-projects__title {
	margin: 0;
	font-family: "THM Megante", Arial, sans-serif;
	font-weight: bold;
	font-size: 30px;
	line-height: 1.6;
	color: var(--thm-projects-gold, #264b9c);
	text-transform: uppercase;
	text-align: center;
	animation: thmFadeInDown 1s ease 0s 1;
}

.thm-projects__bracket {
	display: block;
	width: 121px;
	height: 2px;
	margin: 10px auto 0;
	background-color: var(--thm-projects-gold, #264b9c);
}

/* -------- Lưới ô dự án -------- */
.thm-projects__grid {
	display: grid;
	grid-template-columns: repeat(var(--thm-projects-cols, 5), 1fr);
	gap: 9px;
}

.thm-projects__cell {
	position: relative;
	display: block;
	aspect-ratio: 232 / 149;
	overflow: hidden;
}

.thm-projects__img {
	position: absolute;
	inset: 0;
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
}

/* Lớp trên (ảnh hiển thị) mờ đi khi hover → lộ lớp dưới (ảnh hover). */
.thm-projects__img--over {
	z-index: 2;
	transition: opacity 200ms linear;
}

.thm-projects__cell:hover .thm-projects__img--over {
	opacity: 0;
}

/* Lớp dưới phóng to nhẹ khi hover cho sinh động. */
.thm-projects__img--base {
	z-index: 1;
	transition: transform 300ms ease;
}

.thm-projects__cell:hover .thm-projects__img--base {
	transform: scale(1.05);
}

@keyframes thmFadeInDown {
	0% { opacity: 0; transform: translateY(-20px); }
	100% { opacity: 1; transform: translateY(0); }
}

/* -------- Tablet (≤ 991px): 3 cột -------- */
@media (max-width: 991px) {
	.thm-projects__title {
		font-size: 25px;
	}

	.thm-projects__grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* -------- Mobile (≤ 575px): 2 cột -------- */
@media (max-width: 575px) {
	.thm-projects__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* -------------------------------------------------------------------------
 * Chế độ UX Builder ("chip viền builder"): các ô dự án hiện thành chip CÓ VIỀN
 * (nhãn + thumbnail) để dễ nhìn/kéo-thả/sửa. Frontend giữ lưới thật.
 * ---------------------------------------------------------------------- */
.thm-projects__builder-note {
	margin: 0 0 14px;
	color: #333;
	font-size: 13px;
	font-style: italic;
	text-align: center;
}

.thm-projects__builder-items {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

.thm-projects__b-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 150px;
	padding: 10px;
	border: 1px dashed rgba(0, 0, 0, 0.45);
	border-radius: 8px;
	background: #fff;
	color: #111;
}

.thm-projects__b-tag {
	align-self: flex-start;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--thm-projects-gold, #264b9c);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
}

.thm-projects__b-thumb {
	width: 100%;
	aspect-ratio: 232 / 149;
	background-color: #e7e9ea;
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
	border-radius: 4px;
}

.thm-projects__b-thumb--empty {
	display: flex;
}

.thm-projects__b-text {
	width: 100%;
	font-size: 12px;
	line-height: 1.4;
	text-align: center;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
