/**
 * Buyers' photos from Etsy reviews: the strip under the gallery, the
 * viewer, and the thumbnail on a review card. Loaded only on product pages
 * that have photos (inc/review-photos.php).
 */

/* ---- Strip, under the product gallery ---- */
/* The strip's row of thumbnails scrolls inside the column. width: 0 keeps
   the row's full length out of the column's own width (on phones the layout
   is a wrapping flex column, whose lines grow to their widest content);
   min-width: 100% fills the column. */
.soluturn-customer-photos {
	margin-top: 32px;
	min-width: 100%;
	width: 0;
}

.soluturn-customer-photos__title {
	align-items: baseline;
	color: var(--soluturn-neutral-80, #262626);
	display: flex;
	font: var(--type-title-small-semibold, 600 18px/1.3 "Bricolage Grotesque", Arial, sans-serif);
	gap: 8px;
	margin: 0 0 12px;
}

.soluturn-customer-photos__count {
	color: var(--soluturn-neutral-60, #525252);
	font-size: var(--type-body-small-size);
	font-weight: 400;
}

.soluturn-customer-photos__list {
	display: flex;
	gap: 8px;
	list-style: none;
	margin: 0;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	padding: 2px 2px 8px;
	scroll-snap-type: x proximity;
	scrollbar-width: thin;
}

.soluturn-customer-photos__item {
	flex: none;
	margin: 0;
	scroll-snap-align: start;
}

.soluturn-customer-photos__thumb,
.soluturn-bubble__photo {
	background: var(--soluturn-neutral-10, #f5f5f5);
	border: 0;
	border-radius: 8px;
	cursor: zoom-in;
	display: block;
	overflow: hidden;
	padding: 0;
}

.soluturn-customer-photos__thumb {
	height: 120px;
	width: 120px;
}

.soluturn-customer-photos__thumb img,
.soluturn-bubble__photo img {
	display: block;
	height: 100%;
	object-fit: cover;
	transition: transform 0.2s ease;
	width: 100%;
}

.soluturn-customer-photos__thumb:hover img,
.soluturn-bubble__photo:hover img {
	transform: scale(1.04);
}

.soluturn-customer-photos__thumb:focus-visible,
.soluturn-bubble__photo:focus-visible {
	outline: 2px solid var(--soluturn-purple-60, #6b21a8);
	outline-offset: 2px;
}

@media (max-width: 781px) {
	/* The gallery column runs edge to edge on phones (the photo slider);
	   the strip keeps the page's side gutter, and its row scrolls to the edge. */
	.soluturn-customer-photos {
		margin-top: 24px;
	}

	.soluturn-customer-photos__title {
		padding: 0 var(--wp--preset--spacing--50, 28px);
	}

	.soluturn-customer-photos__list {
		padding-left: var(--wp--preset--spacing--50, 28px);
		padding-right: var(--wp--preset--spacing--50, 28px);
		scroll-padding-left: var(--wp--preset--spacing--50, 28px);
	}

	.soluturn-customer-photos__thumb {
		height: 96px;
		width: 96px;
	}
}

/* ---- Thumbnail on a review card ---- */
.soluturn-bubble__photo {
	height: 72px;
	margin: 0 0 12px;
	width: 72px;
}

/* ---- Viewer ---- */
html.soluturn-photo-viewer-open {
	overflow: hidden;
}

.soluturn-photo-viewer {
	background: var(--soluturn-neutral-00, #fff);
	border: 0;
	border-radius: 16px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
	color: var(--soluturn-neutral-80, #262626);
	height: min(760px, 88vh);
	max-height: none;
	max-width: none;
	overflow: hidden;
	padding: 0;
	width: min(1120px, 92vw);
}

.soluturn-photo-viewer::backdrop {
	background: rgba(0, 0, 0, 0.72);
}

.soluturn-photo-viewer__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	height: 100%;
	position: relative;
}

.soluturn-photo-viewer__media {
	align-items: center;
	background: var(--soluturn-neutral-10, #f5f5f5);
	display: flex;
	justify-content: center;
	min-height: 0;
	position: relative;
}

/* The whole photo, never cropped. */
.soluturn-photo-viewer__img {
	display: block;
	height: auto;
	max-height: 100%;
	max-width: 100%;
	object-fit: contain;
	width: auto;
}

.soluturn-photo-viewer__btn {
	align-items: center;
	background: var(--soluturn-neutral-00, #fff);
	border: 0;
	border-radius: 999px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
	color: var(--soluturn-neutral-80, #262626);
	cursor: pointer;
	display: flex;
	height: 44px;
	justify-content: center;
	padding: 0;
	position: absolute;
	width: 44px;
	z-index: 2;
}

.soluturn-photo-viewer__btn[hidden] {
	display: none;
}

.soluturn-photo-viewer__btn:hover {
	color: var(--soluturn-purple-60, #6b21a8);
}

.soluturn-photo-viewer__btn:focus-visible,
.soluturn-photo-viewer__link:focus-visible {
	outline: 2px solid var(--soluturn-purple-60, #6b21a8);
	outline-offset: 2px;
}

.soluturn-photo-viewer__prev {
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
}

.soluturn-photo-viewer__next {
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
}

.soluturn-photo-viewer__close {
	right: 16px;
	top: 16px;
}

.soluturn-photo-viewer__counter {
	background: rgba(0, 0, 0, 0.6);
	border-radius: 999px;
	bottom: 16px;
	color: #fff;
	font-size: var(--type-micro-large-size, 12px);
	font-variant-numeric: tabular-nums;
	left: 50%;
	margin: 0;
	padding: 4px 10px;
	position: absolute;
	transform: translateX(-50%);
}

.soluturn-photo-viewer__counter[hidden] {
	display: none;
}

.soluturn-photo-viewer__panel {
	display: flex;
	flex-direction: column;
	font-family: "Bricolage Grotesque", Arial, sans-serif;
	gap: 0;
	overflow-y: auto;
	padding: 72px 28px 24px;
}

.soluturn-photo-viewer__stars {
	display: flex;
	gap: 2px;
	margin-bottom: 14px;
}

.soluturn-photo-viewer__words {
	font-size: var(--type-body-medium-size, 16px);
	line-height: 1.55;
	margin: 0 0 16px;
	white-space: pre-line;
}

.soluturn-photo-viewer__words[hidden] {
	display: none;
}

.soluturn-photo-viewer__who {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0 0 16px;
}

.soluturn-photo-viewer__author {
	font-size: var(--type-body-small-size, 14px);
	font-weight: 600;
}

.soluturn-photo-viewer__date {
	color: var(--soluturn-neutral-60, #525252);
	font-size: var(--type-micro-large-size, 12px);
}

.soluturn-photo-viewer__label {
	align-self: flex-start;
	background: var(--soluturn-neutral-10, #f5f5f5);
	border-radius: 999px;
	color: var(--soluturn-neutral-70, #404040);
	font-size: var(--type-micro-large-size, 12px);
	font-weight: 600;
	margin: 0 0 12px;
	padding: 4px 10px;
}

.soluturn-photo-viewer__link {
	align-self: flex-start;
	color: var(--soluturn-purple-60, #6b21a8);
	font-size: var(--type-body-small-size, 14px);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}


/* Phones: full screen, the photo on top and the review under it. */
@media (max-width: 781px) {
	.soluturn-photo-viewer {
		border-radius: 0;
		height: 100dvh;
		width: 100vw;
	}

	.soluturn-photo-viewer__inner {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: minmax(0, 62%) minmax(0, 1fr);
	}

	.soluturn-photo-viewer__panel {
		padding: 20px 16px 24px;
	}

	.soluturn-photo-viewer__close {
		right: 12px;
		top: 12px;
	}

	.soluturn-photo-viewer__prev {
		left: 8px;
	}

	.soluturn-photo-viewer__next {
		right: 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.soluturn-customer-photos__thumb img,
	.soluturn-bubble__photo img {
		transition: none;
	}
}
