@use "variables";

.mosaic-gallery-wrap {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-template-rows: repeat(2, auto);
	position: relative;

	.mosaic-gallery {
		cursor: zoom-in;
		margin: 0;

		&:first-child {
			grid-column: span 2;
			grid-row: span 2;
		}

		&:nth-child(2) {
			grid-column: span 1;
			grid-row: span 2;
		}

		.image {
			object-fit: cover;
			object-position: center;
			width: 100%;
			height: 100%;

			&.is-circled {
				border-radius: 50%;
			}

			&.is-rounded {
				border-radius: 0.3125rem;
			}

			&.has-shadow {
				box-shadow: variables.$base-shadow;
			}
		}
	}

	.more-images {
		border: 2px solid #fff;
		border-radius: 20px;
		background-color: rgb(0, 0, 0, .10);
		backdrop-filter: blur(8px);
		display: inline-block;
		padding: .5rem .75rem;
		position: absolute;
		z-index: 1;
		right: .75rem;
		bottom: .75rem;
		font-size: .875rem;
		color: #FFF;
		font-weight: 400;
		line-height: 1;
		cursor: pointer;
		transition: all .250s ease-in-out;

		&:hover {
			transform: scale(1.1);
		}
	}

	&.squared {
		>.mosaic-gallery {
			aspect-ratio: 1;

			img {
				width: 100%;
				height: 100%;
				object-fit: cover;
				object-position: center;
			}
		}
	}
}

@media only screen and (max-width: 767px) {
	.mosaic-gallery-wrap {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mosaic-gallery-prettybox {
		padding: 1rem;

		.mosaic-gallery {
			display: block;
			height: fit-content;
			top: 50%;
			transform: translateY(-50%);

			figcaption {
				width: 90%;
				margin: 0 auto;
			}
		}
	}
}
