/* DrivePress gallery: front end and editor. Grid, masonry, list and slider; colours follow the theme (currentColor).
   Columns follow the width of the gallery itself (container queries), so a gallery in a narrow column gets fewer columns
   too: --dp-cols on wide, --dp-cols-t when the gallery is 640px wide or less, --dp-cols-m at 420px or less. Icons and the lightbox come from
   blocks/file/style.css. */
.dp-gallery {
	--dp-c: var(--dp-cols, 3);
	--dp-g: var(--dp-gap, 12px);
	container-type: inline-size;
	margin: 0 0 1.5em;
	padding: 0;
}
.dp-gallery .dp-gallery__items {
	margin: 0;
	padding: 0;
	list-style: none;
}
@container (max-width: 640px) {
	.dp-gallery .dp-gallery__items {
		--dp-c: var(--dp-cols-t, 2);
	}
}
@container (max-width: 420px) {
	.dp-gallery .dp-gallery__items {
		--dp-c: var(--dp-cols-m, 1);
	}
}
.dp-gallery .dp-gallery__item {
	position: relative;
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}
.dp-gallery .dp-gallery__item::before,
.dp-gallery .dp-gallery__item::marker {
	content: none;
}
.dp-gallery .dp-gallery__open {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: var(--dp-radius, 0);
	color: inherit;
	text-decoration: none !important; /* Themes underline links. */
}
.dp-gallery a.dp-gallery__open {
	cursor: pointer;
}
.dp-gallery.dp-gallery--lightbox a.dp-gallery__open[data-kind="image"] {
	cursor: zoom-in;
}
.dp-gallery img,
.dp-gallery video {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	margin: 0;
	transition: transform 0.35s ease;
}
/* Border and shadow of pictures and videos (--dp-bw / --dp-bs / --dp-bc are set on the gallery; the shadow is a class). */
.dp-gallery .dp-gallery__item--image .dp-gallery__open,
.dp-gallery .dp-gallery__item--video .dp-gallery__open {
	box-sizing: border-box;
	border: var(--dp-bw, 0) var(--dp-bs, solid) var(--dp-bc, currentColor);
}
.dp-gallery--shadow-small .dp-gallery__item--image .dp-gallery__open,
.dp-gallery--shadow-small .dp-gallery__item--video .dp-gallery__open {
	box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);
}
.dp-gallery--shadow-medium .dp-gallery__item--image .dp-gallery__open,
.dp-gallery--shadow-medium .dp-gallery__item--video .dp-gallery__open {
	box-shadow: 0 4px 14px rgb(0 0 0 / 0.22);
}
.dp-gallery--shadow-large .dp-gallery__item--image .dp-gallery__open,
.dp-gallery--shadow-large .dp-gallery__item--video .dp-gallery__open {
	box-shadow: 0 10px 30px rgb(0 0 0 / 0.3);
}
/* Hover effect: zoom (default), lift, dim or none. */
.dp-gallery--hover-zoom a.dp-gallery__open:hover img,
.dp-gallery--hover-zoom a.dp-gallery__open:hover video {
	transform: scale(1.03);
}
.dp-gallery--hover-lift .dp-gallery__item {
	transition: transform 0.2s ease;
}
.dp-gallery--hover-lift .dp-gallery__item:hover {
	transform: translateY(-4px);
}
.dp-gallery--hover-dim a.dp-gallery__open {
	transition: opacity 0.2s ease;
}
.dp-gallery--hover-dim a.dp-gallery__open:hover {
	opacity: 0.8;
}
.dp-gallery a.dp-gallery__open:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}
/* A shape (grid and slider): every picture fills the same box. */
.dp-gallery.dp-gallery--shaped .dp-gallery__open img,
.dp-gallery.dp-gallery--shaped .dp-gallery__open video,
.dp-gallery.dp-gallery--shaped .dp-gallery__tile {
	aspect-ratio: var(--dp-ratio);
	height: 100%;
	object-fit: var(--dp-fit, cover);
}

/* The round play badge on videos that open in the lightbox. */
.dp-gallery .dp-gallery__play {
	position: absolute;
	top: 50%;
	left: 50%;
	display: grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	color: #fff;
	background: rgb(0 0 0 / 0.5);
	transform: translate(-50%, -50%);
	pointer-events: none;
	transition: background 0.15s ease;
}
.dp-gallery .dp-gallery__play .dp-icon {
	width: 1.1rem;
	height: 1.1rem;
	margin-left: 0.15rem;
}
.dp-gallery a.dp-gallery__open:hover .dp-gallery__play {
	background: rgb(0 0 0 / 0.7);
}

/* Files without a picture: a tile with the icon and the name. */
.dp-gallery .dp-gallery__tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	box-sizing: border-box;
	width: 100%;
	min-height: 8rem;
	padding: 1rem;
	border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
	border-radius: var(--dp-radius, 0);
	background: color-mix(in srgb, currentColor 4%, transparent);
	text-align: center;
	transition: border-color 0.15s ease;
}
.dp-gallery a.dp-gallery__open:hover .dp-gallery__tile {
	border-color: color-mix(in srgb, currentColor 30%, transparent);
}
.dp-gallery .dp-gallery__tile .dp-icon {
	width: 2rem;
	height: 2rem;
	opacity: 0.75;
}
.dp-gallery .dp-gallery__tile-name {
	display: -webkit-box;
	max-width: 100%;
	overflow: hidden;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: anywhere;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

/* Name and caption under a picture. */
.dp-gallery .dp-gallery__label {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	padding-top: 0.45rem;
	font-size: 0.85rem;
	line-height: 1.35;
}
.dp-gallery .dp-gallery__label .dp-gallery__name {
	overflow: hidden;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.dp-gallery .dp-gallery__caption {
	opacity: 0.75;
}
.dp-gallery > figcaption {
	margin-top: 0.75em;
	font-size: 0.875em;
	opacity: 0.75;
	text-align: center;
}

/* ---- Grid ---- */
.dp-gallery--grid .dp-gallery__items {
	display: grid;
	grid-template-columns: repeat(var(--dp-c), minmax(0, 1fr));
	gap: var(--dp-g);
}

/* ---- Masonry: columns of pictures at their own height (read top to bottom, then the next column). ---- */
.dp-gallery--masonry .dp-gallery__items {
	column-count: var(--dp-c);
	column-gap: var(--dp-g);
}
.dp-gallery--masonry .dp-gallery__item {
	margin-bottom: var(--dp-g);
	break-inside: avoid;
}

/* ---- List: one row per file, with a small picture, the name, type and size, and a download button. ---- */
.dp-gallery--list .dp-gallery__items {
	display: flex;
	flex-direction: column;
	gap: var(--dp-g);
}
.dp-gallery--list .dp-gallery__item {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	padding: 0.6rem 0.75rem;
	border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
	border-radius: max(var(--dp-radius, 0px), 10px);
	transition: border-color 0.15s ease;
}
.dp-gallery--list .dp-gallery__item:hover {
	border-color: color-mix(in srgb, currentColor 28%, transparent);
}
.dp-gallery--list .dp-gallery__thumb {
	flex: none;
	width: 4rem;
}
.dp-gallery--list .dp-gallery__thumb .dp-gallery__open {
	width: 4rem;
	height: 4rem;
	border-radius: max(calc(var(--dp-radius, 0px) / 2), 6px);
}
.dp-gallery--list .dp-gallery__thumb img,
.dp-gallery--list .dp-gallery__thumb video,
.dp-gallery--list .dp-gallery__thumb .dp-gallery__tile {
	width: 100%;
	height: 100%;
	min-height: 0;
	padding: 0;
	object-fit: cover;
}
.dp-gallery--list .dp-gallery__thumb .dp-gallery__tile .dp-icon {
	width: 1.5rem;
	height: 1.5rem;
}
.dp-gallery--list .dp-gallery__play {
	width: 1.75rem;
	height: 1.75rem;
}
.dp-gallery--list .dp-gallery__play .dp-icon {
	width: 0.75rem;
	height: 0.75rem;
}
.dp-gallery--list .dp-gallery__meta {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
	line-height: 1.35;
}
.dp-gallery--list .dp-gallery__name {
	overflow: hidden;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.dp-gallery--list .dp-gallery__caption {
	font-size: 0.875rem;
}
.dp-gallery--list .dp-gallery__info {
	font-size: 0.8rem;
	opacity: 0.6;
}
.dp-gallery .dp-gallery__download {
	display: inline-grid;
	flex: none;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
	border-radius: 50%;
	color: inherit;
	text-decoration: none !important;
	transition: background 0.15s ease, border-color 0.15s ease;
}
.dp-gallery .dp-gallery__download:hover,
.dp-gallery .dp-gallery__download:focus-visible {
	border-color: currentColor;
	background: color-mix(in srgb, currentColor 10%, transparent);
}

/* ---- Slider: a row that scrolls sideways and snaps to each slide (works by swipe without JavaScript); view.js adds the
   arrows, the dots and autoplay. ---- */
.dp-gallery--slider {
	position: relative;
}
.dp-gallery--slider .dp-gallery__items {
	display: flex;
	gap: var(--dp-g);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}
.dp-gallery--slider .dp-gallery__items::-webkit-scrollbar {
	display: none;
}
.dp-gallery--slider .dp-gallery__item {
	flex: 0 0 calc((100% - (var(--dp-c) - 1) * var(--dp-g)) / var(--dp-c));
	scroll-snap-align: start;
}
html .dp-gallery button.dp-gallery__nav {
	position: absolute;
	top: var(--dp-nav-top, 50%);
	z-index: 2;
	display: grid;
	place-items: center;
	box-sizing: border-box;
	width: 2.5rem;
	min-width: 0;
	height: 2.5rem;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	box-shadow: none;
	line-height: 1;
	text-transform: none;
	color: #fff;
	background: rgb(0 0 0 / 0.45);
	background-image: none;
	cursor: pointer;
	transform: translateY(-50%);
	transition: background 0.15s ease, opacity 0.15s ease;
}
html .dp-gallery button.dp-gallery__nav:hover,
html .dp-gallery button.dp-gallery__nav:focus,
html .dp-gallery button.dp-gallery__nav:focus-visible {
	border: 0;
	box-shadow: none;
	color: #fff;
	background: rgb(0 0 0 / 0.7);
}
.dp-gallery .dp-gallery__nav:disabled {
	opacity: 0;
	pointer-events: none;
}
.dp-gallery .dp-gallery__nav .dp-icon {
	width: 1.25rem;
	height: 1.25rem;
}
.dp-gallery .dp-gallery__nav--prev {
	left: 0.6rem;
}
.dp-gallery .dp-gallery__nav--next {
	right: 0.6rem;
}
.dp-gallery .dp-gallery__dots {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.15rem;
	margin-top: 0.6rem;
}
html .dp-gallery button.dp-gallery__dot,
html .dp-gallery button.dp-gallery__dot:hover,
html .dp-gallery button.dp-gallery__dot:focus {
	display: grid;
	place-items: center;
	box-sizing: border-box;
	width: 1.5rem;
	min-width: 0;
	height: 1.5rem;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: none;
	color: inherit;
	cursor: pointer;
}
.dp-gallery .dp-gallery__dot::before {
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: currentColor;
	content: "";
	opacity: 0.25;
	transition: opacity 0.15s ease, transform 0.15s ease;
}
.dp-gallery .dp-gallery__dot[aria-current="true"]::before {
	opacity: 0.85;
	transform: scale(1.2);
}

/* The lightbox's previous / next buttons and counter (the lightbox itself is in blocks/file/style.css). */
.dp-lightbox__step {
	position: absolute;
	top: 50%;
	z-index: 2;
	transform: translateY(-50%);
}
.dp-lightbox__step--prev {
	left: 0.9em;
}
.dp-lightbox__step--next {
	right: 0.9em;
}
.dp-lightbox__count {
	flex: none;
	font: 500 0.8125rem/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	opacity: 0.8;
	font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
	.dp-lightbox__step {
		top: auto;
		bottom: 1.25em;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dp-gallery img,
	.dp-gallery video,
	.dp-gallery .dp-gallery__tile,
	.dp-gallery--list .dp-gallery__item {
		transition: none;
	}
	.dp-gallery a.dp-gallery__open:hover img,
	.dp-gallery a.dp-gallery__open:hover video,
	.dp-gallery--hover-lift .dp-gallery__item:hover {
		transform: none;
	}
	.dp-gallery--hover-lift .dp-gallery__item,
	.dp-gallery--hover-dim a.dp-gallery__open {
		transition: none;
	}
	.dp-gallery--slider .dp-gallery__items {
		scroll-behavior: auto;
	}
}

/* Size and download icon along the top of a picture or video: on hover or keyboard focus, always on touch screens. */
.dp-gallery .dp-gallery__bar {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.4rem;
	padding: 0.5rem 0.75rem 1.75rem;
	border-radius: var(--dp-radius, 0) var(--dp-radius, 0) 0 0;
	color: #fff;
	background: linear-gradient(to bottom, rgb(0 0 0 / 0.5), transparent);
	font-size: 0.78rem;
	line-height: 1.3;
	opacity: 0;
	transition: opacity 0.18s ease;
	pointer-events: none;
}
.dp-gallery .dp-gallery__item:hover .dp-gallery__bar,
.dp-gallery .dp-gallery__item:focus-within .dp-gallery__bar {
	opacity: 1;
}
@media (hover: none) {
	.dp-gallery .dp-gallery__bar {
		opacity: 1;
	}
}
.dp-gallery .dp-gallery__filesize {
	white-space: nowrap;
	text-shadow: 0 1px 3px rgb(0 0 0 / 0.65);
}
.dp-gallery .dp-gallery__get {
	display: inline-grid;
	place-items: center;
	width: 1.5rem;
	height: 1.5rem;
	margin: -0.25rem -0.35rem;
	color: #fff;
	text-decoration: none !important;
	pointer-events: auto;
	filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.7));
	transition: transform 0.15s ease;
}
.dp-gallery .dp-gallery__get:hover,
.dp-gallery .dp-gallery__get:focus-visible {
	transform: scale(1.12);
}
.dp-gallery .dp-gallery__get .dp-icon {
	width: 0.95rem;
	height: 0.95rem;
}
.dp-gallery .dp-gallery__tile-info {
	font-size: 0.75rem;
	opacity: 0.65;
}
@media (prefers-reduced-motion: reduce) {
	.dp-gallery .dp-gallery__bar,
	.dp-gallery .dp-gallery__get {
		transition: none;
	}
}
