/* FMC zoomable picture viewer (assets/fmc-zoom.js, docs/gallery/ZOOM_WEB.md).
 * A dark full-screen viewer that looks the same on the website and in the dark and light admin skins: it brings its own colours and
 * does not inherit button, link or form styling from the page. Square corners, no emoji. */

html.fmc-zoom-noscroll,
html.fmc-zoom-noscroll body {
	overflow: hidden !important;
}

/* A picture the viewer owns shows it can be enlarged. */
img.fmc-zoom-able {
	cursor: zoom-in;
}

img.fmc-zoom-able:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.fmc-zoom,
.fmc-zoom *,
.fmc-zoom *::before,
.fmc-zoom *::after {
	box-sizing: border-box;
}

.fmc-zoom [hidden],
.fmc-zoom-host [hidden] {
	display: none !important;
}

.fmc-zoom {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	flex-direction: row;
	background: #050505;
	color: #fff;
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.45;
	text-align: left;
	-webkit-text-size-adjust: 100%;
}

.fmc-zoom-main {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
}

.fmc-zoom-stage {
	position: absolute;
	inset: 0;
}

/* The zoom surface. touch-action none lives only here, so while the viewer is closed nothing on the page loses its scrolling. */
.fmc-zoom-pane {
	position: absolute;
	inset: 0;
	overflow: hidden;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	overscroll-behavior: contain;
}

.fmc-zoom-pane.is-ready {
	cursor: zoom-in;
}

.fmc-zoom-pane.is-zoomed {
	cursor: grab;
}

.fmc-zoom-pane.is-dragging {
	cursor: grabbing;
}

.fmc-zoom-img {
	position: absolute;
	left: 50%;
	top: 50%;
	display: block;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	transform-origin: 50% 50%;
	will-change: transform;
	-webkit-user-drag: none;
	user-select: none;
	-webkit-user-select: none;
}

.fmc-zoom-img.is-anim {
	transition: transform 0.18s ease-out;
}

.fmc-zoom-video {
	position: absolute;
	left: 50%;
	top: 50%;
	max-width: 100%;
	max-height: 100%;
	transform: translate(-50%, -50%);
	background: #000;
}

.fmc-zoom-status {
	position: absolute;
	left: 50%;
	top: 64px;
	transform: translateX(-50%);
	max-width: min(86vw, 420px);
	padding: 6px 12px;
	background: rgba(0, 0, 0, 0.72);
	border: 1px solid rgba(255, 255, 255, 0.24);
	color: rgba(255, 255, 255, 0.86);
	font-size: 12px;
	letter-spacing: 0.04em;
	text-align: center;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.15s linear;
}

.fmc-zoom-status.is-on {
	opacity: 1;
}

.fmc-zoom-status:empty {
	display: none;
}

.fmc-zoom-err {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(86vw, 360px);
	padding: 18px;
	background: #111;
	border: 1px solid rgba(255, 255, 255, 0.4);
	text-align: center;
	z-index: 4;
}

.fmc-zoom-errtext {
	margin: 0 0 14px;
	color: #fff;
}

/* All buttons: 44 pixel targets, own colours (admin skins restyle plain buttons). */
.fmc-zoom .fmc-zoom-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	margin: 0;
	padding: 0 12px;
	background: rgba(0, 0, 0, 0.66);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 0;
	box-shadow: none;
	font: inherit;
	font-size: 12px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
}

.fmc-zoom .fmc-zoom-btn:hover:not(:disabled) {
	border-color: #fff;
	background: rgba(40, 40, 40, 0.9);
}

.fmc-zoom .fmc-zoom-btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.fmc-zoom :focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.fmc-zoom-top {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 8px 0 16px;
	padding-top: max(8px, env(safe-area-inset-top));
	pointer-events: none;
	z-index: 5;
}

.fmc-zoom-top > * {
	pointer-events: auto;
}

.fmc-zoom-topbtns {
	display: flex;
	align-items: center;
	gap: 10px;
}

.fmc-zoom-counter {
	font-size: 12px;
	letter-spacing: 0.16em;
	color: rgba(255, 255, 255, 0.72);
	text-shadow: 0 1px 2px #000;
}

.fmc-zoom .fmc-zoom-nav {
	position: absolute;
	top: 50%;
	margin-top: -22px;
	width: 44px;
	padding: 0;
	z-index: 5;
}

.fmc-zoom .fmc-zoom-nav.is-prev {
	left: 10px;
}

.fmc-zoom .fmc-zoom-nav.is-next {
	right: 10px;
}

/* The zoom buttons sit at the bottom centre of the surface. */
.fmc-zoom-tools {
	position: absolute;
	left: 50%;
	bottom: 12px;
	bottom: max(12px, env(safe-area-inset-bottom));
	transform: translateX(-50%);
	display: flex;
	gap: 6px;
	z-index: 5;
}

.fmc-zoom-cap {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 68px;
	padding: 0 70px;
	text-align: center;
	color: rgba(255, 255, 255, 0.86);
	font-size: 13px;
	text-shadow: 0 1px 3px #000;
	pointer-events: none;
	z-index: 3;
}

.fmc-zoom-side {
	flex: 0 0 340px;
	min-width: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	border-left: 1px solid rgba(255, 255, 255, 0.14);
	background: #0a0a0a;
}

/* A surface used by itself inside another screen (the administrator review grid). */
.fmc-zoom-host {
	position: relative;
	overflow: hidden;
	background: #000;
}

.fmc-zoom-host > .fmc-zoom-pane {
	color: #fff;
}

.fmc-zoom-host .fmc-zoom-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	margin: 0;
	padding: 0 12px;
	background: rgba(0, 0, 0, 0.66);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 0;
	box-shadow: none;
	font: inherit;
	font-size: 12px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
}

.fmc-zoom-host .fmc-zoom-btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.fmc-zoom-host .fmc-zoom-status {
	color: #fff;
}

.fmc-zoom-host .fmc-zoom-err {
	color: #fff;
}

@media (max-width: 799px) {
	.fmc-zoom.has-side {
		display: block;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.fmc-zoom.has-side .fmc-zoom-main {
		height: 62vh;
		height: 62dvh;
	}

	.fmc-zoom.has-side .fmc-zoom-side {
		overflow: visible;
		border-left: 0;
		border-top: 1px solid rgba(255, 255, 255, 0.14);
	}

	.fmc-zoom .fmc-zoom-nav.is-prev {
		left: 4px;
	}

	.fmc-zoom .fmc-zoom-nav.is-next {
		right: 4px;
	}

	.fmc-zoom-cap {
		padding: 0 56px;
		bottom: 66px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fmc-zoom-img.is-anim,
	.fmc-zoom-status {
		transition: none;
	}
}
