/* ----------------------------------------------------------------
	Mola photo viewer (WO-0017), used with js/mola-lightbox.js

	The rules under html.mola-lightbox apply only while the theme's own JS is
	missing (docs/brain/architecture/empty-js-files.md); the script adds that
	class only then.
-----------------------------------------------------------------*/

/* Room page photo tiles: the whole tile is a link to the full photo, above Canvas's overlay. */
.mola-lightbox-tile {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 6;
	cursor: zoom-in;
}

/* ---------- Fallbacks while the theme JS is missing ---------- */

/* Gallery: the Owl carousel never initialises, so show its slides as one photo grid. */
html.mola-lightbox .owl-carousel.carousel-widget:not(.owl-loaded) {
	display: block;
}

@media (max-width: 575.98px) {
	html.mola-lightbox #image-carousel:not(.owl-loaded) .carousel-column-container {
		flex-direction: column;
	}
	html.mola-lightbox #image-carousel:not(.owl-loaded) .column-1,
	html.mola-lightbox #image-carousel:not(.owl-loaded) .column-2 {
		padding: 0;
	}
}

/* Homepage cards and offers posters: show the hover overlay (and its "+" icon) on hover or focus. */
html.mola-lightbox .bg-overlay [data-hover-animate]:not(.animated) {
	transition: opacity .3s ease;
}

html.mola-lightbox .portfolio-image:hover .bg-overlay [data-hover-animate]:not(.animated),
html.mola-lightbox .portfolio-image:focus-within .bg-overlay [data-hover-animate]:not(.animated) {
	opacity: 1;
}

html.mola-lightbox [data-lightbox="image"],
html.mola-lightbox [data-lightbox="gallery-item"] {
	cursor: zoom-in;
}

/* ---------- The viewer ---------- */

html.mola-lightbox-open,
html.mola-lightbox-open body {
	overflow: hidden;
}

.mola-lightbox-viewer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.9);
	animation: mola-lightbox-fade .2s ease-out;
}

.mola-lightbox-viewer[hidden],
.mola-lightbox-viewer button[hidden] {
	display: none;
}

.mola-lightbox-figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 56px 64px 48px;
}

.mola-lightbox-image {
	max-width: 100%;
	max-height: calc(100% - 32px);
	object-fit: contain;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
	background: #222;
}

.mola-lightbox-caption {
	min-height: 24px;
	margin-top: 12px;
	color: #EEE;
	font-size: 15px;
	line-height: 1.5;
	text-align: center;
}

.mola-lightbox-counter {
	position: absolute;
	top: 18px;
	left: 20px;
	color: #CCC;
	font-size: 14px;
	letter-spacing: 1px;
}

.mola-lightbox-viewer button {
	position: absolute;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #FFF;
	font-size: 34px;
	line-height: 48px;
	text-align: center;
	cursor: pointer;
	transition: background .2s ease;
}

.mola-lightbox-viewer button:hover {
	background: rgba(255, 255, 255, 0.28);
}

.mola-lightbox-viewer button:focus {
	outline: 2px solid #FFF;
	outline-offset: 2px;
}

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

.mola-lightbox-prev,
.mola-lightbox-next {
	top: 50%;
	margin-top: -24px;
}

.mola-lightbox-prev {
	left: 10px;
}

.mola-lightbox-next {
	right: 10px;
}

@media (max-width: 575.98px) {
	.mola-lightbox-figure {
		padding: 56px 8px 72px;
	}
	.mola-lightbox-prev,
	.mola-lightbox-next {
		top: auto;
		bottom: 12px;
		margin-top: 0;
	}
	.mola-lightbox-prev {
		left: calc(50% - 60px);
	}
	.mola-lightbox-next {
		right: calc(50% - 60px);
	}
}

@keyframes mola-lightbox-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.mola-lightbox-viewer,
	html.mola-lightbox .bg-overlay [data-hover-animate]:not(.animated) {
		animation: none;
		transition: none;
	}
}
