/* Magazine/comic table lightbox, styled to sit close to WordPress' native image lightbox. */
html.winx-lightbox-open,
html.winx-lightbox-open body {
	overflow: hidden;
}

.winx-lightbox {
	align-items: center;
	background: #fff;
	box-sizing: border-box;
	display: flex;
	inset: 0;
	justify-content: center;
	opacity: 0;
	padding: 72px 96px;
	position: fixed;
	touch-action: pan-y;
	transition: opacity 160ms ease;
	z-index: 200000;
}

.winx-lightbox[hidden] {
	display: none;
}

.winx-lightbox.is-open {
	opacity: 1;
}

.winx-lightbox .lightbox-image-container {
	align-items: center;
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	max-height: calc(100vh - 144px);
	max-width: calc(100vw - 192px);
	overflow: hidden;
}

.winx-lightbox .wp-block-image {
	line-height: 0;
	margin: 0;
	max-height: 100%;
	max-width: 100%;
}

.winx-lightbox img {
	border-radius: 0;
	box-shadow: none;
	display: block;
	height: auto !important;
	max-height: calc(100vh - 144px);
	max-width: calc(100vw - 192px);
	object-fit: contain !important;
	user-select: none;
	width: auto !important;
}

.winx-lightbox-close,
.winx-lightbox-nav {
	align-items: center;
	background: transparent;
	background-image: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: #000;
	cursor: pointer;
	display: inline-flex;
	justify-content: center;
	margin: 0;
	padding: 0;
	position: fixed;
}

.winx-lightbox-close:hover,
.winx-lightbox-close:focus,
.winx-lightbox-nav:hover,
.winx-lightbox-nav:focus {
	background: transparent;
	background-image: none;
	box-shadow: none;
	color: #000;
	outline: 0;
}

.winx-lightbox-close {
	height: 48px;
	right: 24px;
	top: 24px;
	width: 48px;
	z-index: 200002;
}

.winx-lightbox-close::before,
.winx-lightbox-close::after {
	background: currentColor;
	content: "";
	height: 1.5px;
	position: absolute;
	width: 16.25px;
}

.winx-lightbox-close::before {
	transform: rotate(45deg);
}

.winx-lightbox-close::after {
	transform: rotate(-45deg);
}

.winx-lightbox-nav {
	height: 48px;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	z-index: 200001;
}

.winx-lightbox-prev {
	left: 12px;
}

.winx-lightbox-next {
	right: 12px;
}

.winx-lightbox-nav::before {
	background: currentColor;
	content: "";
	display: block;
	height: 14px;
	mask: url("data:image/svg+xml,%3Csvg width='8' height='14' viewBox='0 0 8 14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L7 7L1 13' stroke='black' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	-webkit-mask: url("data:image/svg+xml,%3Csvg width='8' height='14' viewBox='0 0 8 14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L7 7L1 13' stroke='black' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	width: 7.7px;
}

.winx-lightbox-prev::before {
	transform: rotate(180deg);
}

.winx-lightbox-next::before {
	transform: none;
}

.winx-lightbox-trigger {
	background: transparent;
	background-image: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
	display: block;
	line-height: 0;
	margin: 0;
	padding: 0;
	position: relative;
}

.winx-lightbox-trigger:hover,
.winx-lightbox-trigger:focus {
	background: transparent;
	background-image: none;
	box-shadow: none;
	outline: 0;
}

.winx-lightbox-trigger:hover img,
.winx-lightbox-trigger:focus img {
	filter: brightness(0.5);
}

@media screen and (max-width: 600px) {
	.winx-lightbox {
		align-items: center;
		padding: 56px 0 76px;
	}

	.winx-lightbox .lightbox-image-container {
		width: 100vw;
		max-height: calc(100vh - 132px);
		max-width: 100vw;
	}

	.winx-lightbox .wp-block-image {
		width: 100vw;
	}

	.winx-lightbox img {
		width: 100vw !important;
		max-height: calc(100vh - 132px);
		max-width: 100vw;
	}

	.winx-lightbox-close {
		right: 12px;
		top: 12px;
	}

	.winx-lightbox-nav {
		height: 48px;
		top: auto;
		transform: none;
		width: 48px;
		bottom: 12px;
	}

	.winx-lightbox-prev {
		left: calc(50% - 56px);
	}

	.winx-lightbox-next {
		right: calc(50% - 56px);
	}
}

/* Native WordPress image lightbox adjustments. */
html:has(.wp-lightbox-overlay.active),
html:has(.wp-lightbox-overlay.show),
body:has(.wp-lightbox-overlay.active),
body:has(.wp-lightbox-overlay.show) {
	overflow: hidden !important;
}

.wp-lightbox-overlay {
	overflow: hidden !important;
}

.wp-lightbox-overlay,
.wp-lightbox-overlay:hover,
.wp-lightbox-overlay:focus,
.wp-lightbox-overlay:active,
.wp-lightbox-overlay .lightbox-image-container,
.wp-lightbox-overlay .lightbox-image-container *,
.wp-lightbox-overlay .wp-block-image,
.wp-lightbox-overlay .wp-block-image *,
.wp-lightbox-overlay img,
.wp-lightbox-overlay img:hover,
.wp-lightbox-overlay img:focus,
.wp-lightbox-overlay figure,
.wp-lightbox-overlay figure:hover,
.wp-lightbox-overlay figure:focus {
	cursor: default !important;
}

.wp-lightbox-overlay button {
	cursor: pointer !important;
}

.wp-lightbox-container,
.wp-block-image:has(.lightbox-trigger),
.wp-block-image figure:has(.lightbox-trigger),
figure.wp-block-image:has(.lightbox-trigger) {
	position: relative;
}

.wp-lightbox-container > img,
.wp-block-image:has(.lightbox-trigger) img,
.wp-block-image figure:has(.lightbox-trigger) img,
figure.wp-block-image:has(.lightbox-trigger) img {
	cursor: pointer !important;
	transition: filter 0.3s ease;
}

.wp-block-image .lightbox-trigger {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	cursor: pointer !important;
	height: 12px !important;
	opacity: 0 !important;
	padding: 0 !important;
	position: absolute !important;
	width: 12px !important;
}

.wp-block-image .lightbox-trigger svg {
	display: none !important;
}

.wp-lightbox-container:hover > img,
.wp-lightbox-container:focus-within > img,
.wp-block-image:has(.lightbox-trigger:hover) img,
.wp-block-image:has(.lightbox-trigger:focus) img,
.wp-block-image figure:has(.lightbox-trigger:hover) img,
.wp-block-image figure:has(.lightbox-trigger:focus) img,
figure.wp-block-image:has(.lightbox-trigger:hover) img,
figure.wp-block-image:has(.lightbox-trigger:focus) img {
	filter: brightness(0.5);
}

@media screen and (max-width: 600px) {
	.wp-lightbox-overlay button[class*="prev" i],
	.wp-lightbox-overlay button[class*="previous" i],
	.wp-lightbox-overlay button[class*="left" i],
	.wp-lightbox-overlay button[aria-label*="vorher" i],
	.wp-lightbox-overlay button[aria-label*="previous" i],
	.wp-lightbox-overlay button[aria-label*="zurück" i] {
		bottom: 12px !important;
		left: calc(50% - 56px) !important;
		right: auto !important;
		top: auto !important;
		transform: none !important;
	}

	.wp-lightbox-overlay button[class*="next" i],
	.wp-lightbox-overlay button[class*="right" i],
	.wp-lightbox-overlay button[aria-label*="nächst" i],
	.wp-lightbox-overlay button[aria-label*="next" i],
	.wp-lightbox-overlay button[aria-label*="weiter" i] {
		bottom: 12px !important;
		left: auto !important;
		right: calc(50% - 56px) !important;
		top: auto !important;
		transform: none !important;
	}
}
