/* CC Astrophotos — slideshow for projections (/diaporama/). */

html,
body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #000;
	color: #fff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cc-slideshow {
	position: fixed;
	inset: 0;
	background: #000;
	overflow: hidden;
	-webkit-user-select: none;
	user-select: none;
}

/* The cursor goes after a few seconds without a move. */
.cc-slideshow:not(.is-awake) {
	cursor: none;
}

.cc-slideshow__layer {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	opacity: 0;
	transition: opacity 1s ease;
	-webkit-user-drag: none;
}

.cc-slideshow__layer.is-visible {
	opacity: 1;
}

.cc-slideshow__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 1.2em 4vw 1.4em;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.55) 60%, rgba(0, 0, 0, 0));
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
	pointer-events: none;
}

.cc-slideshow__title {
	margin: 0;
	font-size: clamp(18px, 2.6vw, 40px);
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
}

.cc-slideshow__meta {
	margin: 0.3em 0 0;
	font-size: clamp(14px, 1.5vw, 24px);
	line-height: 1.3;
	color: rgba(255, 255, 255, 0.85);
}

.cc-slideshow__meta:empty {
	display: none;
}

.cc-slideshow__pause {
	position: absolute;
	top: 16px;
	right: 16px;
	padding: 6px 12px;
	font-size: 14px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.8);
	background: rgba(0, 0, 0, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 999px;
	pointer-events: none;
}

.cc-slideshow__pause::before {
	content: "❚❚ ";
}

.cc-slideshow__loading,
.cc-slideshow__empty {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: min(80vw, 640px);
	margin: 0;
	text-align: center;
	font-size: clamp(16px, 2vw, 24px);
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.85);
}

.cc-slideshow__loading {
	color: rgba(255, 255, 255, 0.5);
}

.cc-slideshow__empty p {
	margin: 0 0 0.8em;
}

.cc-slideshow__empty a {
	color: #fff;
	text-decoration: underline;
}

/* Buttons: shown while the pointer moves or after a touch, hidden otherwise. */
.cc-slideshow__controls {
	position: absolute;
	right: 16px;
	bottom: 16px;
	display: flex;
	align-items: center;
	gap: 8px;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.cc-slideshow.is-awake .cc-slideshow__controls,
.cc-slideshow__controls:hover,
.cc-slideshow__controls:focus-within {
	opacity: 1;
	cursor: default;
}

.cc-slideshow__button {
	width: 48px;
	height: 48px;
	padding: 0;
	font-size: 22px;
	line-height: 1;
	color: #fff;
	background: rgba(0, 0, 0, 0.6);
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 50%;
	cursor: pointer;
	touch-action: manipulation;
}

.cc-slideshow__button:hover,
.cc-slideshow__button:focus-visible {
	background: rgba(255, 255, 255, 0.2);
	outline: none;
}

.cc-slideshow__wake {
	max-width: 40vw;
	margin-right: 8px;
	font-size: 12px;
	line-height: 1.3;
	text-align: right;
	color: rgba(255, 255, 255, 0.7);
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.cc-slideshow__wake.is-active {
	color: rgba(160, 230, 160, 0.9);
}

@media (max-width: 600px) {
	.cc-slideshow__caption {
		padding: 1em 16px 1.1em;
	}

	.cc-slideshow__pause {
		top: 10px;
		right: 10px;
		font-size: 12px;
	}

	.cc-slideshow__controls {
		right: 10px;
		bottom: 10px;
		gap: 6px;
	}

	.cc-slideshow__button {
		width: 42px;
		height: 42px;
		font-size: 18px;
	}

	.cc-slideshow__wake {
		display: none;
	}
}

/* When the caption would cover the controls on a narrow screen, the controls sit above it. */
@media (max-width: 600px) and (orientation: portrait) {
	.cc-slideshow__controls {
		bottom: auto;
		top: 10px;
		left: 10px;
		right: auto;
	}
}
