/* Taya Gallery — justified rows, hover title, lightbox. */

.taya-gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	margin: 0;
	padding: 0;
}

.taya-gallery__item {
	position: relative;
	display: block;
	flex: 1 1 auto;
	height: var(--taya-row, 120px);
	overflow: hidden;
	margin: 0;
	line-height: 0;
}

.taya-gallery__img {
	display: block;
	height: 100%;
	width: auto;
	min-width: 100%;
	max-width: none;
	object-fit: cover;
}

/* The title on hover: a red bar along the bottom, as the old gallery drew it. */
.taya-gallery__item::after {
	content: attr(data-title);
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 5px;
	background: rgba(255, 28, 28, 0.9);
	color: #3ad6fc;
	font-family: sans-serif;
	font-size: 13px;
	font-weight: 300;
	line-height: 1.3;
	opacity: 0;
	transition: opacity 0.3s;
	pointer-events: none;
}

.taya-gallery__item[data-title=""]::after {
	display: none;
}

.taya-gallery__item:hover::after,
.taya-gallery__item:focus-visible::after {
	opacity: 1;
}

.taya-gallery__item:focus-visible {
	outline: 2px solid #3ad6fc;
	outline-offset: -2px;
}

/* Lightbox */
.taya-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.88);
	touch-action: pan-y;
}

.taya-lightbox[hidden] {
	display: none;
}

.taya-lightbox__figure {
	margin: 0;
	max-width: 90vw;
	max-height: 90vh;
	text-align: center;
}

.taya-lightbox__img {
	display: block;
	max-width: 90vw;
	max-height: calc(90vh - 2.5em);
	margin: 0 auto;
	object-fit: contain;
}

.taya-lightbox__caption {
	margin-top: 0.6em;
	color: #fff;
	font-family: sans-serif;
	font-size: 14px;
	line-height: 1.4;
}

.taya-lightbox__btn {
	position: absolute;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 44px;
	line-height: 1;
	cursor: pointer;
	padding: 12px 16px;
	opacity: 0.8;
}

.taya-lightbox__btn:hover,
.taya-lightbox__btn:focus-visible {
	opacity: 1;
}

.taya-lightbox__close {
	top: 8px;
	right: 8px;
	font-size: 36px;
}

.taya-lightbox__prev {
	left: 8px;
	top: 50%;
	transform: translateY(-50%);
}

.taya-lightbox__next {
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
}

body.taya-lightbox-open {
	overflow: hidden;
}
