/*
 * Nodus Draw's pages (#319): the example drawings on the front page (gallery.js). Made from
 * docs/website/site/nodus.css in Nodus Draw's repository by scripts/prepare-website.py.
 */

.nodus-gallery {
	position: relative;
	margin: 0 0 2em 0;
}

.nodus-gallery-track {
	display: flex;
	gap: 1.5em;
	margin: 0;
	padding: 0.5em 0 1em 0;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
}

.nodus-gallery-item {
	flex: 0 0 auto;
	width: min(80%, 22em);
	margin: 0;
	padding: 0;
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
}

.nodus-gallery-view {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 16em;
	padding: 0.75em;
	background: #ffffff;
	border: solid 1px rgba(210, 215, 217, 0.75);
	border-radius: 0.375em;
	border-bottom: solid 1px rgba(210, 215, 217, 0.75);
}

.nodus-gallery-view:hover,
.nodus-gallery-view:focus-visible {
	border-color: #f56a6a;
}

.nodus-gallery-view img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.nodus-gallery-caption {
	margin: 0.5em 0 0 0;
	text-align: center;
	font-size: 0.9em;
}

.nodus-gallery-download {
	margin-left: 0.5em;
	white-space: nowrap;
}

/* Buttons to move the strip (added by the script) */
.nodus-gallery-move {
	position: absolute;
	top: calc(0.5em + 8em);
	transform: translateY(-50%);
	width: 2.25em;
	height: 2.25em;
	padding: 0;
	line-height: 2.1em;
	font-size: 1.4em;
	text-align: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 0 0 1px rgba(210, 215, 217, 0.9);
	color: #3d4449 !important;
	cursor: pointer;
	z-index: 1;
}

.nodus-gallery-move:hover,
.nodus-gallery-move:focus-visible {
	box-shadow: 0 0 0 2px #f56a6a;
	color: #f56a6a !important;
}

.nodus-gallery-back {
	left: -0.5em;
}

.nodus-gallery-on {
	right: -0.5em;
}

/* A drawing shown big */
.nodus-gallery-big {
	width: min(95vw, 1400px);
	height: min(92vh, 1000px);
	max-width: none;
	max-height: none;
	padding: 1em 3.5em;
	border: none;
	border-radius: 0.5em;
	background: #ffffff;
	box-shadow: 0 0.5em 2em rgba(0, 0, 0, 0.35);
	overflow: hidden;
}

.nodus-gallery-big::backdrop {
	background: rgba(30, 34, 37, 0.7);
}

.nodus-gallery-big figure {
	display: flex;
	flex-direction: column;
	height: 100%;
	margin: 0;
}

.nodus-gallery-big img {
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
	object-fit: contain;
}

.nodus-gallery-big figcaption {
	flex: 0 0 auto;
	padding-top: 0.75em;
	text-align: center;
}

.nodus-gallery-big button {
	position: absolute;
	width: 2em;
	height: 2em;
	padding: 0;
	line-height: 1.9em;
	font-size: 1.5em;
	text-align: center;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: #3d4449 !important;
	cursor: pointer;
}

.nodus-gallery-big button:hover,
.nodus-gallery-big button:focus-visible {
	box-shadow: 0 0 0 2px #f56a6a;
	color: #f56a6a !important;
}

.nodus-gallery-close {
	top: 0.4em;
	right: 0.4em;
}

.nodus-gallery-big-back,
.nodus-gallery-big-on {
	top: 50%;
	transform: translateY(-50%);
}

.nodus-gallery-big-back {
	left: 0.4em;
}

.nodus-gallery-big-on {
	right: 0.4em;
}

@media (prefers-reduced-motion: reduce) {
	.nodus-gallery-track {
		scroll-behavior: auto;
	}
}
