/**
 * Press Gallery block styles.
 * Loaded only on the front end and inside the block editor iframe (never in wp-admin chrome).
 */

.press-gallery-edit__grid {
	display: grid;
	gap: 16px;
	margin-bottom: 16px;
}

.press-gallery-edit__item {
	position: relative;
	aspect-ratio: 3 / 2;
	overflow: hidden;
}

.press-gallery-edit__item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.press-gallery-edit__remove {
	position: absolute;
	top: 6px;
	right: 6px;
	min-width: 24px;
	height: 24px;
	padding: 0 !important;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6) !important;
	color: #fff !important;
}

.press-gallery-edit__remove:hover {
	background: rgba(180, 30, 58, 0.85) !important;
}

.press-gallery-block {
	padding: 50px 0;
	--press-gallery-columns: 4;
}

.press-gallery-block__grid {
	display: grid;
	grid-template-columns: repeat(var(--press-gallery-columns), 1fr);
	gap: 24px;
}

@media (max-width: 995px) {
	.press-gallery-block__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 420px) {
	.press-gallery-block__grid {
		grid-template-columns: 1fr;
	}
}

.press-gallery-block__item {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	margin: 0;
	border: 0;
	background: none;
	cursor: pointer;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	border: 2px solid transparent;
}

.press-gallery-block__item:hover {
	border: 2px solid #aaa;	
}

.press-gallery-block__item::before {
	content: '+';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 10;
	display: block;
	width: 30px;
	height: 30px;
	background-color: #b41e3a;
	border-radius: 50%;
	color: #fff;
	font-size: 20px;
	text-align: center;
	line-height: 27px;
	opacity: 0;
	transition: all .3s ease;
}

.press-gallery-block__item::after {
		content: '';
		display: block;
		width: 100%;
		height: 100%;
		background-color: #fff;
		opacity: .3;
		transition: all .3s ease;
		transform: scale(0);
		position: absolute;
		top: 0;
		left: 0;
}

.press-gallery-block__item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
	margin: 0 !important;
}

.press-gallery-block__item:hover img,
.press-gallery-block__item:focus-visible img {
	transform: scale(1.04);
}

.press-gallery-block__item:hover::before {
	opacity: 1;
}

.press-gallery-block__item:hover::after {
	transform: scale(1);
}

/* Press Gallery Lightbox
-------------------------------------------------------------- */
.press-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: rgba(0, 0, 0, 0.85);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
	padding: 60px 80px;
}

.press-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.press-lightbox__figure {
	margin: 0;
	max-width: 100%;
	max-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.press-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: 78vh;
	width: auto;
	height: auto;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.press-lightbox__caption {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 24px;
	width: 100%;
	margin-top: 16px;
	color: #fff;
	font-size: 0.9rem;
}

.press-lightbox__close,
.press-lightbox__prev,
.press-lightbox__next {
	position: absolute;
	background: none;
	border: 0;
	color: #fff;
	cursor: pointer;
	line-height: 1;
	padding: 8px;
}

.press-lightbox__close {
	top: 24px;
	right: 24px;
	font-size: 2.2rem;
}

.press-lightbox__prev,
.press-lightbox__next {
	top: 50%;
	transform: translateY(-50%);
	font-size: 3rem;
}

.press-lightbox__prev {
	left: 20px;
}

.press-lightbox__next {
	right: 20px;
}

@media (max-width: 767px) {
	.press-lightbox {
		padding: 40px 20px;
	}

	.press-lightbox__prev,
	.press-lightbox__next {
		font-size: 2rem;
	}
}

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