/* Review photos (inc/review-photos.php): picker in the review form,
   thumbnails under reviews and the photo viewer. */
.rd-rp-field,
.rd-rp-gallery,
.rd-rp-viewer {
	--rd-ink: #16181d;
	--rd-muted: #5a6170;
	--rd-line: #e4e7ec;
	--rd-soft: #f4f6f9;
	--rd-accent: #1e4fd8;
	--rd-accent-soft: #eef3ff;
}

/* ---------- Picker ---------- */
.rd-rp-field {
	margin: 4px 0 18px;
}

/* Visually hidden but focusable, so the label works as the button. */
.rd-rp-input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	border: 0;
}

.rd-rp-drop {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 14px 16px;
	border: 1.5px dashed #c5ccd8;
	border-radius: 12px;
	background: var(--rd-soft);
	color: var(--rd-ink);
	font-weight: 400;
	cursor: pointer;
	transition: border-color .15s, background-color .15s;
}

.rd-rp-drop:hover,
.rd-rp-input:focus-visible + .rd-rp-drop {
	border-color: var(--rd-accent);
	background: var(--rd-accent-soft);
}

.rd-rp-input:focus-visible + .rd-rp-drop {
	outline: 2px solid var(--rd-accent);
	outline-offset: 2px;
}

.rd-rp-drop__icon {
	flex: 0 0 auto;
	color: var(--rd-accent);
}

.rd-rp-drop__text {
	display: flex;
	flex-direction: column;
	line-height: 1.35;
}

.rd-rp-drop__text strong {
	font-size: 15px;
}

.rd-rp-drop__text small {
	font-size: 13px;
	color: var(--rd-muted);
}

.rd-rp-field.is-full .rd-rp-drop {
	opacity: .55;
	pointer-events: none;
}

.rd-rp-previews {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.rd-rp-previews li {
	position: relative;
	width: 72px;
	height: 72px;
	margin: 0;
}

.rd-rp-previews img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 1px solid var(--rd-line);
	border-radius: 10px;
}

/* Upload states: dimmed with a bar while uploading, a tick when done,
   red when it failed. */
.rd-rp-previews li.is-uploading img { opacity: .55; }
.rd-rp-previews li.is-error img { opacity: .4; border-color: #b42318; }

.rd-rp-progress {
	position: absolute;
	left: 8px;
	right: 8px;
	bottom: 8px;
	height: 5px;
	overflow: hidden;
	border-radius: 3px;
	background: rgba(255, 255, 255, .85);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
}

.rd-rp-progress span {
	display: block;
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: var(--rd-accent);
	transition: width .2s;
}

.rd-rp-previews li.is-done .rd-rp-progress {
	left: auto;
	right: 6px;
	bottom: 6px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #12b76a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
	box-shadow: 0 0 0 2px #fff;
}

.rd-rp-previews li.is-done .rd-rp-progress span { display: none; }

.rd-rp-previews li.is-error .rd-rp-progress span {
	width: 100% !important;
	background: #b42318;
}

.rd-rp-remove {
	position: absolute;
	top: -7px;
	right: -7px;
	width: 24px;
	min-height: 0;
	height: 24px;
	margin: 0;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--rd-ink);
	color: #fff;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

.rd-rp-error {
	margin: 8px 0 0;
	font-size: 13px;
	color: #b42318;
}

.rd-rp-note {
	margin: 8px 0 0;
	font-size: 12px;
	color: var(--rd-muted);
}

/* ---------- Thumbnails under a review ---------- */
.rd-rp-gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 10px 0 4px;
}

.rd-rp-thumb {
	display: block;
	width: 72px;
	height: 72px;
	overflow: hidden;
	border: 1px solid var(--rd-line);
	border-radius: 10px;
	cursor: zoom-in;
}

.rd-rp-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .2s;
}

.rd-rp-thumb:hover img {
	transform: scale(1.05);
}

/* ---------- Viewer ---------- */
.rd-rp-viewer {
	max-width: 100vw;
	max-height: 100vh;
	margin: auto;
	padding: 0;
	border: 0;
	background: transparent;
	overflow: visible;
}

.rd-rp-viewer::backdrop {
	background: rgba(10, 12, 16, .88);
}

.rd-rp-viewer img {
	display: block;
	max-width: min(92vw, 1100px);
	max-height: 86vh;
	border-radius: 8px;
}

.rd-rp-viewer button {
	position: fixed;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	line-height: 1;
	cursor: pointer;
}

.rd-rp-viewer button:hover {
	background: rgba(255, 255, 255, .26);
}

.rd-rp-viewer__close {
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	font-size: 28px;
}

.rd-rp-viewer__nav {
	top: 50%;
	width: 48px;
	height: 48px;
	font-size: 34px;
	transform: translateY(-50%);
}

.rd-rp-viewer__nav.is-prev { left: 16px; }
.rd-rp-viewer__nav.is-next { right: 16px; }
.rd-rp-viewer.is-single .rd-rp-viewer__nav { display: none; }

@media (max-width: 549px) {
	.rd-rp-drop { padding: 12px 14px; }
	.rd-rp-viewer img { max-width: 100vw; border-radius: 0; }
	.rd-rp-viewer__nav { top: auto; bottom: 20px; transform: none; }
	.rd-rp-viewer__nav.is-prev { left: calc(50% - 60px); }
	.rd-rp-viewer__nav.is-next { right: calc(50% - 60px); }
}
