/* Additions on top of the "Read Only" theme: inline videos + BibTeX popup. */

/* Images keep their aspect ratio now that they carry width/height attributes. */
.features article .image img,
.image.avatar img {
	height: auto;
}

/* ---- Playable media ---- */

.features article .image.video {
	border-bottom: 0;
	cursor: pointer;
}

.media {
	display: block;
	position: relative;
	overflow: hidden;
	background: #111;
}

	.media img {
		display: block;
		width: 100%;
		transition: opacity 0.2s ease-in-out, transform 0.3s ease-in-out;
	}

	.media video,
	.media iframe {
		display: block;
		width: 100%;
		border: 0;
		background: #000;
	}

	.media iframe {
		aspect-ratio: 16 / 9;
		height: auto;
	}

/* Round play button, centred on the thumbnail. */
.media .play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 3.5em;
	height: 3.5em;
	margin: -1.75em 0 0 -1.75em;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85);
	transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
	pointer-events: none;
}

	.media .play:after {
		content: '';
		position: absolute;
		top: 50%;
		left: 54%;
		margin: -0.65em 0 0 -0.4em;
		border-style: solid;
		border-width: 0.65em 0 0.65em 1.05em;
		border-color: transparent transparent transparent #fff;
	}

.image.video:hover .play,
.image.video:focus .play {
	background: #4acaa8;
	transform: scale(1.08);
}

.image.video:hover .media img,
.image.video:focus .media img {
	opacity: 0.85;
}

/* ---- BibTeX popup ---- */

dialog.bibtex {
	width: 40em;
	max-width: calc(100vw - 2em);
	padding: 0;
	border: 0;
	border-radius: 6px;
	box-shadow: 0 1em 3em rgba(0, 0, 0, 0.3);
	color: #555;
	font-size: 0.8em;
}

	dialog.bibtex::backdrop {
		background: rgba(0, 0, 0, 0.5);
	}

	dialog.bibtex header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0.75em 1em 0.75em 1.5em;
		background: #4acaa8;
		color: #fff;
	}

		dialog.bibtex header h4 {
			color: #fff;
			margin: 0;
		}

	dialog.bibtex .close {
		border: 0;
		background: none;
		color: #fff;
		cursor: pointer;
		font-size: 1.75em;
		line-height: 1em;
		padding: 0 0.25em;
		box-shadow: none;
		height: auto;
	}

	dialog.bibtex pre {
		margin: 0;
		padding: 1.25em 1.5em;
		max-height: 60vh;
		overflow: auto;
		background: #fafafa;
		font-family: Consolas, Menlo, "Courier New", monospace;
		font-size: 0.9em;
		line-height: 1.5em;
		white-space: pre;
		user-select: all;
		-webkit-user-select: all;
	}

	dialog.bibtex footer {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		gap: 1em;
		padding: 0.75em 1.5em;
		border-top: solid 1px #eee;
	}

		dialog.bibtex footer a {
			font-size: 0.9em;
		}

	dialog.bibtex .copy {
		background: #4acaa8;
		border: 0;
		border-radius: 4px;
		color: #fff;
		cursor: pointer;
		font-weight: 700;
		height: auto;
		line-height: 1em;
		padding: 0.8em 1.5em;
	}

		dialog.bibtex .copy:hover {
			background: #5ed0b1;
		}
