/* Nested Albums: front end. Override the custom properties in your theme to restyle. */

.nested-albums-gallery,
.nested-albums-grid {
	--nested-albums-gap: 0.75rem;
	--nested-albums-radius: 4px;
	display: grid;
	grid-template-columns: repeat(var(--nested-albums-columns, 3), minmax(0, 1fr));
	gap: var(--nested-albums-gap);
	margin: 0 0 1.5em;
	padding: 0;
	list-style: none;
}

@media (max-width: 600px) {
	.nested-albums-gallery,
	.nested-albums-grid {
		grid-template-columns: repeat(var(--nested-albums-columns-small, 2), minmax(0, 1fr));
	}
}

.nested-albums-gallery__item {
	margin: 0;
	overflow: hidden;
	border-radius: var(--nested-albums-radius);
}

.nested-albums-gallery__link {
	display: block;
	cursor: zoom-in;
}

.nested-albums-gallery__item img,
.nested-albums-grid__cover img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--nested-albums-aspect-ratio, 1);
	object-fit: cover;
	transition: transform 0.3s ease;
}

.nested-albums-gallery__link:hover img,
.nested-albums-gallery__link:focus-visible img,
.nested-albums-grid__link:hover img,
.nested-albums-grid__link:focus-visible img {
	transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
	.nested-albums-gallery__item img,
	.nested-albums-grid__cover img {
		transition: none;
	}
}

.nested-albums-gallery__caption {
	padding: 0.4em 0;
	font-size: 0.875em;
}

/* Album grid cards */

.nested-albums-grid__item {
	margin: 0;
}

.nested-albums-grid__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.nested-albums-grid__cover {
	display: block;
	overflow: hidden;
	border-radius: var(--nested-albums-radius);
	aspect-ratio: var(--nested-albums-aspect-ratio, 1);
	background: rgba(127, 127, 127, 0.15);
}

.nested-albums-grid__title {
	display: block;
	margin-top: 0.5em;
	font-weight: 600;
}

.nested-albums-grid__count {
	display: block;
	font-size: 0.875em;
	opacity: 0.75;
}

/* Breadcrumbs */

.nested-albums-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25em 0.5em;
	margin: 0 0 1em;
	padding: 0;
	list-style: none;
	font-size: 0.875em;
}

.nested-albums-breadcrumbs li + li::before {
	content: "/";
	margin-right: 0.5em;
	opacity: 0.5;
}

/* Lightbox */

html.nested-albums-lightbox-open {
	overflow: hidden;
}

.nested-albums-lightbox {
	width: 100vw;
	max-width: none;
	height: 100vh;
	max-height: none;
	margin: 0;
	padding: 3.5rem 4rem;
	border: 0;
	background: rgba(0, 0, 0, 0.92);
	color: #fff;
	box-sizing: border-box;
}

.nested-albums-lightbox[open] {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.nested-albums-lightbox::backdrop {
	background: rgba(0, 0, 0, 0.6);
}

.nested-albums-lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 0;
	margin: 0;
	pointer-events: none;
}

.nested-albums-lightbox__image {
	max-width: 100%;
	max-height: calc(100vh - 9rem);
	object-fit: contain;
	pointer-events: auto;
}

.nested-albums-lightbox__caption {
	margin-top: 0.75rem;
	text-align: center;
	pointer-events: auto;
}

.nested-albums-lightbox__counter {
	position: absolute;
	top: 1rem;
	left: 1rem;
	margin: 0;
	font-size: 0.875rem;
	opacity: 0.8;
}

.nested-albums-lightbox__button {
	position: absolute;
	width: 3rem;
	height: 3rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
}

.nested-albums-lightbox__button:hover,
.nested-albums-lightbox__button:focus-visible {
	background: rgba(255, 255, 255, 0.28);
}

.nested-albums-lightbox__close {
	top: 0.75rem;
	right: 0.75rem;
}

.nested-albums-lightbox__prev,
.nested-albums-lightbox__next {
	top: 50%;
	transform: translateY(-50%);
}

.nested-albums-lightbox__prev {
	left: 0.75rem;
}

.nested-albums-lightbox__next {
	right: 0.75rem;
}

.nested-albums-lightbox.is-single .nested-albums-lightbox__prev,
.nested-albums-lightbox.is-single .nested-albums-lightbox__next,
.nested-albums-lightbox.is-single .nested-albums-lightbox__counter {
	display: none;
}

@media (max-width: 600px) {
	.nested-albums-lightbox {
		padding: 3.5rem 0.5rem;
	}

	.nested-albums-lightbox__prev,
	.nested-albums-lightbox__next {
		top: auto;
		bottom: 0.75rem;
		transform: none;
	}
}
