/* TGM Lightbox Embed */

/* ---------- Image trigger ---------- */

.tgm-lbe-image img {
	cursor: pointer;
}

.tgm-lbe-image img:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 3px;
}

.tgm-lbe-hit {
	--tgm-lbe-tint: rgba(0, 0, 0, 0.25);
	position: absolute;
	z-index: 2;
	display: flex;
	padding: 14px;
	cursor: pointer;
	background: transparent;
	transition: background-color 0.25s ease;
	box-sizing: border-box;
	line-height: 1;
}

.tgm-lbe-hit:hover {
	background-color: var(--tgm-lbe-tint);
}

.tgm-lbe-hit--center       { align-items: center;     justify-content: center; }
.tgm-lbe-hit--top-left     { align-items: flex-start; justify-content: flex-start; }
.tgm-lbe-hit--top-right    { align-items: flex-start; justify-content: flex-end; }
.tgm-lbe-hit--bottom-left  { align-items: flex-end;   justify-content: flex-start; }
.tgm-lbe-hit--bottom-right { align-items: flex-end;   justify-content: flex-end; }

.tgm-lbe-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border-radius: 999px;
	background: rgba(17, 17, 20, 0.78);
	color: #ffffff;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.01em;
	white-space: nowrap;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	transition: transform 0.25s ease, opacity 0.25s ease;
	pointer-events: none;
}

.tgm-lbe-badge--icon-only {
	padding: 14px;
}

.tgm-lbe-badge svg {
	width: 1.4em;
	height: 1.4em;
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
	display: block;
}

.tgm-lbe-badge svg .tgm-lbe__fill {
	fill: currentColor;
	stroke: none;
}

.tgm-lbe-hit:hover .tgm-lbe-badge {
	transform: scale(1.05);
}

/* Hover only badge (always visible on touch screens) */
@media (hover: hover) {
	.tgm-lbe-hit--hover .tgm-lbe-badge {
		opacity: 0;
		transform: scale(0.92);
	}

	.tgm-lbe-hit--hover:hover .tgm-lbe-badge {
		opacity: 1;
		transform: scale(1);
	}
}

/* ---------- Lightbox ---------- */

html.tgm-lbe-open,
html.tgm-lbe-open body {
	overflow: hidden !important;
}

.tgm-lbe {
	--tgm-lbe-bg: rgba(10, 10, 12, 0.94);
	--tgm-lbe-ui: #ffffff;
	--tgm-lbe-maxw: 1600px;
	--tgm-lbe-ratio: 1.7778;
	--tgm-lbe-radius: 6px;
	--tgm-lbe-bar: 64px;
	--tgm-lbe-pad: 24px;

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	background: var(--tgm-lbe-bg);
	color: var(--tgm-lbe-ui);
	opacity: 0;
	transition: opacity 0.25s ease;
	-webkit-tap-highlight-color: transparent;
	font-family: inherit;
}

.tgm-lbe[hidden] {
	display: none;
}

.tgm-lbe.is-visible {
	opacity: 1;
}

.tgm-lbe *,
.tgm-lbe *::before,
.tgm-lbe *::after {
	box-sizing: border-box;
}

.tgm-lbe__bar {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 16px;
	min-height: var(--tgm-lbe-bar);
}

.tgm-lbe__title {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	opacity: 0.92;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
}

.tgm-lbe__actions {
	display: flex;
	gap: 6px;
	margin-left: auto;
}

/* Hard reset, since themes often style every <button> */
.tgm-lbe button {
	all: unset;
	box-sizing: border-box;
	cursor: pointer;
	color: var(--tgm-lbe-ui);
}

.tgm-lbe button[hidden] {
	display: none !important;
}

.tgm-lbe button:focus-visible {
	outline: 2px solid var(--tgm-lbe-ui);
	outline-offset: 2px;
}

.tgm-lbe .tgm-lbe__btn {
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	opacity: 0.85;
	transition: opacity 0.2s, background-color 0.2s;
}

.tgm-lbe .tgm-lbe__btn:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.1);
}

.tgm-lbe svg {
	width: 24px;
	height: 24px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	display: block;
}

.tgm-lbe__stage {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 var(--tgm-lbe-pad) var(--tgm-lbe-pad);
}

/* Fill the screen (default) */
.tgm-lbe__frame {
	position: relative;
	width: 100%;
	height: 100%;
	max-width: var(--tgm-lbe-maxw);
	border-radius: var(--tgm-lbe-radius);
	overflow: hidden;
	background: #000;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
	transform: scale(0.97);
	transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.tgm-lbe.is-visible .tgm-lbe__frame {
	transform: none;
}

/* Fixed aspect ratio: largest box of that ratio that fits the space */
.tgm-lbe--ratio .tgm-lbe__frame {
	height: auto;
	width: min(
		var(--tgm-lbe-maxw),
		100%,
		calc((100vh - var(--tgm-lbe-bar) - var(--tgm-lbe-pad)) * var(--tgm-lbe-ratio))
	);
	width: min(
		var(--tgm-lbe-maxw),
		100%,
		calc((100dvh - var(--tgm-lbe-bar) - var(--tgm-lbe-pad)) * var(--tgm-lbe-ratio))
	);
	aspect-ratio: var(--tgm-lbe-ratio);
}

/* Kept as two rules: a browser that does not know one selector would drop both. */
.tgm-lbe__frame:fullscreen {
	max-width: none;
	width: 100%;
	height: 100%;
	border-radius: 0;
	aspect-ratio: auto;
}

.tgm-lbe__frame:-webkit-full-screen {
	max-width: none;
	width: 100%;
	height: 100%;
	border-radius: 0;
	aspect-ratio: auto;
}

.tgm-lbe__iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	opacity: 1;
	transition: opacity 0.3s ease;
}

.tgm-lbe__frame.is-loading .tgm-lbe__iframe {
	opacity: 0;
}

.tgm-lbe__spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 38px;
	height: 38px;
	margin: -19px 0 0 -19px;
	border-radius: 50%;
	border: 3px solid var(--tgm-lbe-ui);
	border-right-color: transparent;
	opacity: 0;
	animation: tgm-lbe-spin 0.8s linear infinite;
	transition: opacity 0.2s;
}

.tgm-lbe__frame.is-loading .tgm-lbe__spinner {
	opacity: 0.6;
}

@keyframes tgm-lbe-spin {
	to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
	.tgm-lbe {
		--tgm-lbe-bar: 56px;
		--tgm-lbe-pad: 0px;
	}

	.tgm-lbe__bar {
		padding: 6px 10px;
	}

	.tgm-lbe__frame {
		border-radius: 0;
	}

	.tgm-lbe-badge {
		font-size: 14px;
		padding: 8px 13px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tgm-lbe,
	.tgm-lbe__frame,
	.tgm-lbe-hit,
	.tgm-lbe-badge {
		transition-duration: 1ms !important;
	}
}
