/*
 * document-preview — live's Document Library Pro lightbox, as a native
 * <dialog>: black to the edges, the file centred at 65vw × 70vh (80vw × 80vh
 * on narrow phones), a 24px close button top right at half opacity, and the
 * title in 13px grey along the bottom.
 */

.doc-preview {
	width: 100vw;
	max-width: none;
	height: 100vh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: #000;
	color: #ccc;
}

.doc-preview[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

.doc-preview::backdrop {
	background: #000;
}

.doc-preview__content iframe,
.doc-preview__content video,
.doc-preview__content audio {
	display: block;
	border: 0;
}

.doc-preview__content iframe {
	width: 65vw;
	height: 70vh;
	background: #fff;
}

.doc-preview__content img,
.doc-preview__content video {
	display: block;
	max-width: 90vw;
	max-height: calc(100vh - 90px);
}

.doc-preview__content audio {
	width: min(500px, 80vw);
}

@media (max-width: 500px) {
	.doc-preview__content iframe {
		width: 80vw;
		height: 80vh;
	}
}

.doc-preview__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	background: none;
	color: #fff;
	opacity: 0.5;
	cursor: pointer;
	transition: opacity 0.2s;
}

.doc-preview__close:hover,
.doc-preview__close:focus-visible {
	border: 0;
	background: none;
	color: #fff;
	opacity: 1;
}

.doc-preview__close svg {
	display: block;
	width: 24px;
	height: 24px;
}

.doc-preview__title {
	position: fixed;
	bottom: 0;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 10px;
	color: #ccc;
	font-size: 13px;
	line-height: 20px;
}

body.doc-preview-open {
	overflow: hidden;
}
