/* Modal xem nhanh — GPVL Post Grid */
.gpvl-qv {
	--gpvl-qv-primary: var(--e-global-color-2cee41b);
	position: fixed;
	inset: 0;
	z-index: 100090;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	box-sizing: border-box;
}

.gpvl-qv[hidden] {
	display: none !important;
}

.gpvl-qv__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	cursor: pointer;
}

.gpvl-qv__dialog {
	--gpvl-qv-font-size: 16px;
	position: relative;
	z-index: 1;
	width: min(720px, 100%);
	max-height: min(88vh, 900px);
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
	overflow: hidden;
	font-size: var(--gpvl-qv-font-size);
}

.gpvl-qv__sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.gpvl-qv__close-x {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(15, 23, 42, 0.1);
	border-radius: 50%;
	background: #fff;
	box-shadow:
		0 1px 2px rgba(15, 23, 42, 0.06),
		0 4px 14px rgba(15, 23, 42, 0.1);
	cursor: pointer;
	color: #475569;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition:
		background 0.15s ease,
		color 0.15s ease,
		box-shadow 0.15s ease,
		border-color 0.15s ease,
		transform 0.15s ease;
}

.gpvl-qv__close-x:hover {
	background: #f8fafc;
	color: #0f172a;
	border-color: rgba(15, 23, 42, 0.14);
	box-shadow:
		0 2px 4px rgba(15, 23, 42, 0.08),
		0 8px 20px rgba(15, 23, 42, 0.12);
}

.gpvl-qv__close-x:active {
	transform: scale(0.96);
}

.gpvl-qv__close-x:focus-visible {
	outline: 2px solid var(--gpvl-qv-primary, #2563eb);
	outline-offset: 3px;
}

.gpvl-qv__close-icon {
	display: block;
	pointer-events: none;
}

.gpvl-qv__header {
	display: flex;
	flex-direction: column;
	gap: 0.05rem;
	flex-shrink: 0;
	z-index: 1;
	box-shadow: 0.5px 0.5px 3px 0.5px rgba(46, 45, 45, 0.5);
}

.gpvl-qv__title {
	margin: 0;
	padding: 8px 20px 0px;
	padding-right: 3.75rem;
	font-size: var(--gpvl-qv-modal-title, 1.35em)!important;
	line-height: 1.35;
	font-weight: 700;
	color: #0f172a;
}

.gpvl-qv__meta {
	padding: 0 1.25rem 0px;
	margin: 0;
	font-size: 0.88em;
	color: #64748b;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1rem;
}

.gpvl-qv__meta time {
	font-variant-numeric: tabular-nums;
}

.gpvl-qv__meta-cat {
	font-weight: 500;
}

.gpvl-qv__meta-cats {
	font-weight: 500;
}

.gpvl-qv__meta-cat-link {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid transparent;
}

.gpvl-qv__meta-cat-link:hover,
.gpvl-qv__meta-cat-link:focus-visible {
	color: var(--gpvl-qv-primary, #2563eb);
	border-bottom-color: currentColor;
	text-decoration: none;
}

.gpvl-qv__meta-sep {
	font-weight: 400;
	color: #64748b;
}

.gpvl-qv__content {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 10px 12px;
	font-size: 1em;
	line-height: 1.65;
	color: #1e293b;
}

/* Ảnh & embed: căn giữa, vừa khung modal */
.gpvl-qv__content > *:first-child {
	margin-top: 0;
}

.gpvl-qv__content img {
	display: block;
	max-width: 100%;
	width: auto;
	height: auto;
	margin-left: auto;
	margin-right: auto;
}

.gpvl-qv__content img.alignleft,
.gpvl-qv__content img.alignright,
.gpvl-qv__content img.aligncenter,
.gpvl-qv__content .alignleft,
.gpvl-qv__content .alignright,
.gpvl-qv__content .aligncenter {
	float: none;
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.gpvl-qv__content figure {
	margin-left: auto;
	margin-right: auto;
	max-width: 100%;
	text-align: center;
}

.gpvl-qv__content figure img {
	display: inline-block;
}

.gpvl-qv__content .wp-block-image,
.gpvl-qv__content .wp-block-embed {
	margin-left: auto;
	margin-right: auto;
	max-width: 100%;
	text-align: center;
}

.gpvl-qv__content .wp-block-embed__wrapper {
	position: relative;
	margin-left: auto;
	margin-right: auto;
	max-width: min(100%, 640px);
}

.gpvl-qv__content iframe {
	display: block;
	margin-left: auto;
	margin-right: auto;
	max-width: 100%;
	width: min(100%, 640px);
	border: 0;
}

/* YouTube / video nhúng thường có chiều cao cố định — responsive 16:9 */
.gpvl-qv__content iframe[src*="youtube.com"],
.gpvl-qv__content iframe[src*="youtube-nocookie.com"],
.gpvl-qv__content iframe[src*="youtu.be"] {
	aspect-ratio: 16 / 9;
	height: auto !important;
	min-height: 180px;
}

.gpvl-qv__loading {
	padding: 2rem 1.25rem;
	text-align: center;
	color: #64748b;
}

/* Skeleton — chờ tải AJAX */
@keyframes gpvl-qv-shimmer {
	0% {
		background-position: 100% 0;
	}
	100% {
		background-position: -100% 0;
	}
}

.gpvl-qv__sk-line {
	display: block;
	height: 0.9em;
	border-radius: 6px;
	background: linear-gradient(
		90deg,
		#e2e8f0 0%,
		#f8fafc 45%,
		#e2e8f0 90%
	);
	background-size: 200% 100%;
	animation: gpvl-qv-shimmer 1.15s ease-in-out infinite;
}

.gpvl-qv__title.gpvl-qv__title--skeleton {
	display: flex;
	flex-direction: column;
	gap: 0.55em;
	align-items: flex-start;
	min-height: 2.65em;
	margin: 0;
	line-height: 1.35;
	font-weight: 400;
	color: transparent;
	box-shadow: none;
	padding: 8px 12px;
	padding-right: 3.75rem;
	box-sizing: border-box;
}

.gpvl-qv__title--skeleton .gpvl-qv__sk-line {
	height: 0.85em;
}

.gpvl-qv__sk-line--title-long {
	width: min(100%, 22em);
}

.gpvl-qv__sk-line--title-short {
	width: min(55%, 12em);
}

.gpvl-qv__content--skeleton {
	min-height: 12rem;
}

.gpvl-qv__content--skeleton .gpvl-qv__sk-block {
	display: flex;
	flex-direction: column;
	gap: 0.7em;
	padding: 0.15rem 0 0.5rem;
}

.gpvl-qv__content--skeleton .gpvl-qv__sk-line--p {
	width: 100%;
	height: 0.75em;
}

.gpvl-qv__sk-line--p-short {
	width: 72%;
}

.gpvl-qv__sk-line--p-mid {
	width: 88%;
}

@media (prefers-reduced-motion: reduce) {
	.gpvl-qv__sk-line {
		animation: none;
		background: #e2e8f0;
	}
}

.gpvl-qv__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 8px 10px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	background: #fafafa;
	font-size: 1em;
}

.gpvl-qv__actions-end {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem;
	margin-left: auto;
}

@media (max-width: 480px) {
	.gpvl-qv__actions {
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 0.85rem;
		padding: 10px 12px;
		text-align: center;
	}

	/* Cụm chia sẻ trên (đã đứng trước trong DOM) */
	.gpvl-share {
		justify-content: center;
	}

	/* Cụm Đóng + Đi đến bài viết dưới, căn giữa */
	.gpvl-qv__actions-end {
		margin-left: 0;
		width: 100%;
		justify-content: center;
	}
}

.gpvl-qv__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 1.15rem;
	border-radius: 8px;
	font-size: 0.94em;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	border: 1px solid transparent;
	box-sizing: border-box;
}

.gpvl-qv__btn--ghost {
	background: #fff;
	border-color: #cbd5e1;
	color: #334155;
}

.gpvl-qv__btn--ghost:hover {
	background: #f1f5f9;
	color: #000;
}

.gpvl-qv__btn--primary {
	background: var(--gpvl-qv-primary);
	color: #fff;
}

.gpvl-qv__btn--primary:hover {
	background: color-mix(in srgb, var(--gpvl-qv-primary) 85%, black);
	color: #fff;
}

@supports not (background: color-mix(in srgb, red, blue)) {
	.gpvl-qv__btn--primary:hover {
		filter: brightness(0.92);
	}
}

body.gpvl-qv-open {
	overflow: hidden;
}
