/*
 * Infinite Monkeys Google Reviews - front-end styles.
 *
 * Every selector is wrapped in :where() so it carries zero specificity:
 * any class or style you set in Bricks wins without !important. The
 * custom properties below are the intended knobs - set them on the
 * review card (or :root) to restyle without touching this file.
 */

:root {
	--imgr-photo-size: 150px;
	--imgr-photo-gap: 8px;
	--imgr-photo-radius: 8px;
	--imgr-icon-size: 0.8em;
	--imgr-lightbox-backdrop: rgba(0, 0, 0, 0.88);
}

/* ---------------------------------------------------------------------
 * Linked reviewer name / photo
 * ------------------------------------------------------------------ */

:where(.imgr-review-link) {
	color: inherit;
	text-decoration: none;
}

:where(.imgr-review-name-link) {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
}

:where(.imgr-review-name-link:hover, .imgr-review-name-link:focus-visible, .imgr-review-name-link.is-imgr-hover) :where(.imgr-review-name) {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

/* External-link icon, drawn with a CSS mask so it takes the text color
   and needs no inline SVG (which Bricks/kses could strip). Hidden with
   opacity rather than display so the name never shifts on hover. */
:where(.imgr-external-icon) {
	display: inline-block;
	flex: none;
	width: var(--imgr-icon-size);
	height: var(--imgr-icon-size);
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6'/%3E%3Cpath d='M20 4 10 14'/%3E%3Cpath d='M19 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6'/%3E%3Cpath d='M20 4 10 14'/%3E%3Cpath d='M19 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E") center / contain no-repeat;
	opacity: 0;
	transition: opacity 0.15s ease;
}

:where(.imgr-review-name-link:hover, .imgr-review-name-link:focus-visible, .imgr-review-name-link.is-imgr-hover) :where(.imgr-external-icon) {
	opacity: 0.75;
}

/* Touch screens have no hover, so show the icon permanently there. */
@media (hover: none) {
	:where(.imgr-external-icon) {
		opacity: 0.75;
	}
}

:where(.imgr-review-avatar-link) {
	display: inline-block;
	line-height: 0;
	border-radius: 50%;
}

:where(.imgr-sr-only) {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------------------------------------------------------------------
 * Review photo thumbnails
 * ------------------------------------------------------------------ */

:where(.imgr-review-photos) {
	display: flex;
	flex-wrap: wrap;
	gap: var(--imgr-photo-gap);
}

:where(.imgr-review-photo) {
	position: relative;
	display: block;
	flex: none;
	width: var(--imgr-photo-size);
	height: var(--imgr-photo-size);
	overflow: hidden;
	border-radius: var(--imgr-photo-radius);
	background-color: rgba(0, 0, 0, 0.06);
	cursor: zoom-in;
}

:where(.imgr-review-photo) img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.25s ease;
}

:where(.imgr-review-photo:hover) img {
	transform: scale(1.04);
}

:where(.imgr-review-photo:focus-visible) {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Play badge on video thumbnails. */
:where(.imgr-review-photo--video) {
	cursor: pointer;
}

:where(.imgr-review-photo--video)::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7v10l8-5z' fill='%23fff'/%3E%3C/svg%3E") center / 22px no-repeat;
	pointer-events: none;
}

/* ---------------------------------------------------------------------
 * Lightbox
 * ------------------------------------------------------------------ */

.imgr-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 56px 64px;
	background: var(--imgr-lightbox-backdrop);
	color: #fff;
	opacity: 0;
	transition: opacity 0.2s ease;
	font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

.imgr-lightbox.is-open {
	opacity: 1;
}

.imgr-lightbox__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.imgr-lightbox__media {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.imgr-lightbox__spinner {
	position: absolute;
	width: 36px;
	height: 36px;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: imgr-spin 0.8s linear infinite;
}

.imgr-lightbox__spinner[hidden] {
	display: none;
}

@keyframes imgr-spin {
	to {
		transform: rotate(360deg);
	}
}

.imgr-lightbox__error {
	margin: 0;
	opacity: 0.8;
}

.imgr-lightbox__btn {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.imgr-lightbox__btn:hover,
.imgr-lightbox__btn:focus-visible {
	background: rgba(255, 255, 255, 0.25);
}

.imgr-lightbox__btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.imgr-lightbox__btn[hidden] {
	display: none;
}

.imgr-lightbox__btn::before {
	content: "";
	width: 22px;
	height: 22px;
	background-color: currentColor;
	-webkit-mask: var(--imgr-btn-icon) center / contain no-repeat;
	mask: var(--imgr-btn-icon) center / contain no-repeat;
}

.imgr-lightbox__close {
	top: 8px;
	right: 8px;
	--imgr-btn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E");
}

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

.imgr-lightbox__prev {
	left: 8px;
	--imgr-btn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E");
}

.imgr-lightbox__next {
	right: 8px;
	--imgr-btn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E");
}

.imgr-lightbox__footer {
	position: absolute;
	left: 64px;
	right: 64px;
	bottom: 14px;
	display: flex;
	justify-content: center;
	gap: 1em;
	text-align: center;
	opacity: 0.85;
}

.imgr-lightbox__footer[hidden] {
	display: none;
}

html.imgr-lightbox-open {
	overflow: hidden;
}

@media (max-width: 600px) {
	.imgr-lightbox {
		padding: 56px 8px;
	}

	.imgr-lightbox__prev,
	.imgr-lightbox__next {
		top: auto;
		bottom: 8px;
		transform: none;
	}

	.imgr-lightbox__footer {
		bottom: 22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.imgr-lightbox,
	.imgr-external-icon,
	:where(.imgr-review-photo) img {
		transition: none;
	}
}
