/**
 * Thư viện Dự án – Front-end styles
 * Mỗi dự án gồm ảnh + video, mở lightbox xem chi tiết.
 *
 * @package Flatsome Child - Library
 */

/* ===== Grid dự án ===== */
.lh-library-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 24px;
}

/* ===== Card ===== */
.lh-card {
	position: relative;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
	cursor: pointer;
	transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.lh-card:hover {
	box-shadow: 0 16px 44px rgba(15, 23, 42, 0.16);
	transform: translateY(-5px);
}

/* Image */
.lh-card__image {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #f1f5f9;
}

.lh-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.lh-card:hover .lh-card__image img {
	transform: scale(1.06);
}

.lh-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: #cbd5e1;
}

/* Overlay khi hover */
.lh-card__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 40%, rgba(15, 23, 42, 0.6) 100%);
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding-bottom: 20px;
	opacity: 0;
	transition: opacity 0.35s ease;
}

.lh-card:hover .lh-card__overlay {
	opacity: 1;
}

.lh-card__view {
	color: #fff;
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	padding: 8px 20px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.2);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Badges (số ảnh / video) */
.lh-card__badges {
	position: absolute;
	top: 10px;
	left: 10px;
	display: flex;
	gap: 6px;
	z-index: 2;
}

.lh-card__badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 600;
	color: #fff;
	background: rgba(15, 23, 42, 0.6);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.lh-card__badge svg {
	width: 12px;
	height: 12px;
}

/* Body */
.lh-card__body {
	padding: 16px 18px 20px;
}

.lh-card__title {
	margin: 0 0 6px;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.45;
	color: #1e293b;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.lh-card__meta {
	margin: 0;
	font-size: 0.8rem;
	color: #64748b;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
}

/* Empty */
.lh-library-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 80px 20px;
	color: #94a3b8;
	font-size: 1rem;
}

/* ===== LIGHTBOX ===== */
.lh-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.lh-lightbox[hidden] {
	display: none;
}

.lh-lightbox__overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.75);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
}

.lh-lightbox__container {
	position: relative;
	z-index: 1;
	background: #fff;
	border-radius: 20px;
	max-width: 960px;
	width: 100%;
	max-height: 88vh;
	overflow-y: auto;
	box-shadow: 0 24px 64px rgba(15, 23, 42, 0.35);
	padding: 28px;
}

/* Close */
.lh-lightbox__close {
	position: sticky;
	top: 0;
	float: right;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: none;
	background: #f1f5f9;
	color: #0f172a;
	font-size: 22px;
	line-height: 42px;
	text-align: center;
	cursor: pointer;
	z-index: 10;
	transition: background 0.2s ease, transform 0.2s ease;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.lh-lightbox__close:hover {
	background: #e2e8f0;
	transform: rotate(90deg);
}

/* Header */
.lh-lightbox__header {
	margin-bottom: 16px;
	padding-right: 50px;
}

.lh-lightbox__title {
	margin: 0 0 8px;
	font-size: 1.3rem;
	font-weight: 800;
	color: #0f172a;
	line-height: 1.3;
}

.lh-lightbox__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	font-size: 0.82rem;
	color: #64748b;
}

.lh-lb-meta__item {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

/* Tabs */
.lh-lightbox__tabs {
	display: flex;
	gap: 6px;
	margin-bottom: 18px;
	border-bottom: 2px solid #f1f5f9;
	padding-bottom: 0;
}

.lh-lightbox__tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	border: none;
	background: transparent;
	color: #64748b;
	font-size: 0.88rem;
	font-weight: 600;
	cursor: pointer;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.lh-lightbox__tab:hover {
	color: #1e293b;
}

.lh-lightbox__tab.is-active {
	color: var(--lh-primary, #F5A623);
	border-bottom-color: var(--lh-primary, #F5A623);
}

.lh-lightbox__tab-count {
	font-weight: 400;
	opacity: 0.7;
}

/* Panels */
.lh-lightbox__panel {
	display: none;
}

.lh-lightbox__panel.is-active {
	display: block;
}

/* Gallery ảnh */
.lh-lightbox__gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
}

.lh-lightbox__img-item {
	border-radius: 12px;
	overflow: hidden;
	background: #f1f5f9;
}

.lh-lightbox__img-item img {
	width: 100%;
	height: auto;
	display: block;
	transition: transform 0.3s ease;
	cursor: zoom-in;
}

.lh-lightbox__img-item:hover img {
	transform: scale(1.03);
}

/* Video */
.lh-lightbox__videos {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 16px;
}

.lh-lightbox__video-item {
	border-radius: 14px;
	overflow: hidden;
	background: #0f172a;
}

.lh-lightbox__video-item iframe,
.lh-lightbox__video-item video {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border: none;
}

.lh-lightbox__video-title {
	margin: 0;
	padding: 10px 14px;
	font-size: 0.85rem;
	font-weight: 600;
	color: #e2e8f0;
	background: #1e293b;
}

/* Description */
.lh-lightbox__desc {
	margin-top: 18px;
	padding-top: 14px;
	border-top: 1px solid #f1f5f9;
	font-size: 0.9rem;
	line-height: 1.7;
	color: #475569;
}

.lh-lightbox__desc:empty {
	display: none;
}

/* ===== Responsive ===== */
@media only screen and (max-width: 48em) {
	.lh-library-grid {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
		gap: 14px;
	}

	.lh-card__body {
		padding: 12px 12px 14px;
	}

	.lh-card__title {
		font-size: 0.88rem;
	}

	.lh-card__badges {
		top: 6px;
		left: 6px;
	}

	.lh-card__badge {
		font-size: 0.68rem;
		padding: 3px 8px;
	}

	.lh-lightbox__container {
		padding: 18px;
		border-radius: 16px;
		max-height: 92vh;
	}

	.lh-lightbox__title {
		font-size: 1.1rem;
	}

	.lh-lightbox__gallery {
		grid-template-columns: 1fr 1fr;
		gap: 8px;
	}

	.lh-lightbox__videos {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.lh-lightbox__tabs {
		margin-bottom: 14px;
	}

	.lh-lightbox__tab {
		padding: 8px 14px;
		font-size: 0.82rem;
	}
}

@media only screen and (max-width: 30em) {
	.lh-library-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.lh-card__image {
		aspect-ratio: 16 / 10;
	}

	.lh-lightbox__gallery {
		grid-template-columns: 1fr;
	}
}

/* ===== SINGLE DỰ ÁN (trang chi tiết) ===== */
.lh-project-single {
	padding: 40px 0 60px;
}

.lh-project-single__header {
	margin-bottom: 36px;
}

.lh-project-single__title {
	margin: 0 0 12px;
	font-size: clamp(1.5rem, 4vw, 2rem);
	font-weight: 800;
	color: #0f172a;
	line-height: 1.25;
}

.lh-project-single__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
	margin-bottom: 20px;
	padding: 16px 20px;
	background: #f8fafc;
	border: 1px solid #f1f5f9;
	border-radius: 14px;
}

.lh-project-single__meta-item {
	font-size: 0.88rem;
	color: #475569;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	font-weight: 500;
}

.lh-project-single__desc {
	font-size: 0.95rem;
	line-height: 1.75;
	color: #475569;
	max-width: 720px;
}

.lh-project-single__desc p {
	margin: 0 0 10px;
}

/* Section (ảnh / video) */
.lh-project-single__section {
	margin-bottom: 40px;
}

.lh-project-single__section-title {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 18px;
	font-size: 1.05rem;
	font-weight: 700;
	color: #1e293b;
}

.lh-project-single__count {
	font-weight: 400;
	color: #94a3b8;
}

/* Gallery ảnh – grid đều, cùng tỉ lệ */
.lh-project-single__gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 14px;
}

.lh-project-single__img-item {
	display: block;
	border-radius: 14px;
	overflow: hidden;
	background: #f1f5f9;
	aspect-ratio: 4 / 3;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lh-project-single__img-item:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
}

.lh-project-single__img-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.lh-project-single__img-item:hover img {
	transform: scale(1.03);
}

/* Video grid */
.lh-project-single__videos {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
	gap: 18px;
}

.lh-project-single__video-item {
	border-radius: 14px;
	overflow: hidden;
	background: #0f172a;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.lh-project-single__video-item iframe,
.lh-project-single__video-item video {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border: none;
}

.lh-project-single__video-title {
	margin: 0;
	padding: 12px 16px;
	font-size: 0.88rem;
	font-weight: 600;
	color: #e2e8f0;
	background: #1e293b;
}

/* Nút quay lại */
.lh-project-single__back {
	margin-top: 40px;
	padding-top: 24px;
	border-top: 1px solid #f1f5f9;
}

.lh-project-single__back-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 22px;
	border-radius: 999px;
	background: #f1f5f9;
	color: #475569;
	font-size: 0.88rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lh-project-single__back-btn:hover {
	background: var(--lh-primary, #F5A623);
	color: #fff;
	transform: translateX(-3px);
}

/* Responsive single */
@media only screen and (max-width: 48em) {
	.lh-project-single {
		padding: 24px 0 40px;
	}

	.lh-project-single__gallery {
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}

	.lh-project-single__videos {
		grid-template-columns: 1fr;
		gap: 14px;
	}

	.lh-project-single__section-title {
		font-size: 0.95rem;
	}
}

@media only screen and (max-width: 30em) {
	.lh-project-single__gallery {
		grid-template-columns: 1fr;
	}
}

/* ===== LIGHTBOX GALLERY ẢNH (custom, prev/next + counter) ===== */
.lh-img-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lh-img-lightbox[hidden] {
	display: none !important;
}

.lh-img-lightbox__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.92);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.lh-img-lightbox__wrap {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 40px;
}

.lh-img-lightbox__img {
	max-width: 90vw;
	max-height: 85vh;
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	user-select: none;
}

/* Nút đóng */
.lh-img-lightbox__close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.15);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	color: #fff;
	font-size: 28px;
	line-height: 48px;
	text-align: center;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.lh-img-lightbox__close:hover {
	background: rgba(255, 255, 255, 0.3);
	transform: rotate(90deg);
}

/* Nút prev / next */
.lh-img-lightbox__prev,
.lh-img-lightbox__next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.15);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	color: #fff;
	font-size: 22px;
	line-height: 48px;
	text-align: center;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.lh-img-lightbox__prev {
	left: 16px;
}

.lh-img-lightbox__next {
	right: 16px;
}

.lh-img-lightbox__prev:hover,
.lh-img-lightbox__next:hover {
	background: rgba(255, 255, 255, 0.3);
	transform: translateY(-50%) scale(1.1);
}

/* Counter */
.lh-img-lightbox__counter {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	padding: 6px 16px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.15);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	color: #fff;
	font-size: 0.85rem;
	font-weight: 600;
}

@media only screen and (max-width: 48em) {
	.lh-img-lightbox__wrap {
		padding: 20px;
	}

	.lh-img-lightbox__prev,
	.lh-img-lightbox__next {
		width: 40px;
		height: 40px;
		font-size: 18px;
		line-height: 40px;
	}

	.lh-img-lightbox__prev {
		left: 8px;
	}

	.lh-img-lightbox__next {
		right: 8px;
	}
}
