/* DD Coin Box — user star ratings in comments.
 * Interactive input widget + read-only summary/per-comment stars.
 * RTL-first, gold-on-brand, works on light & dark backgrounds. */

.dd-rate-field,
.dd-rate-summary,
.dd-cmt-rating { direction: rtl; }

/* sr-only helper (theme may not provide one) */
.dd-rate .screen-reader-text,
.dd-rstars .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap; border: 0;
}

/* ---------------- Interactive 5-star input ---------------- */
.dd-rate-field {
	margin: 0 0 16px;
	padding: 12px 14px;
	border: 1px solid rgba(246, 177, 0, .28);
	border-radius: 14px;
	background: linear-gradient(180deg, rgba(246, 177, 0, .06), rgba(246, 177, 0, .02));
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}
.dd-rate-field__label {
	font-size: 14px;
	font-weight: 700;
	opacity: .9;
}
.dd-rate-field__opt {
	font-weight: 400;
	opacity: .6;
	font-size: 12px;
}
.dd-rate {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}
.dd-rate__stars {
	display: inline-flex;
	flex-direction: row-reverse;
	direction: ltr;          /* keep the sibling-fill geometry predictable */
	gap: 4px;
	justify-content: flex-start;
}
.dd-rate__stars input {
	-webkit-appearance: none;
	appearance: none;
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}
.dd-rate__stars label {
	cursor: pointer;
	font-size: 30px;
	line-height: 1;
	color: rgba(140, 140, 140, .38);
	transition: color .12s ease, transform .12s ease;
}
.dd-rate__stars label span[aria-hidden] { display: block; }
/* hover + checked fill (works because DOM is 5→1) */
.dd-rate__stars input:checked ~ label,
.dd-rate__stars label:hover,
.dd-rate__stars label:hover ~ label {
	color: #f6b100;
}
.dd-rate__stars label:hover { transform: scale(1.14); }
.dd-rate__stars input:focus-visible + label,
.dd-rate__stars input:focus + label {
	outline: 2px solid #f6b100;
	outline-offset: 3px;
	border-radius: 6px;
}

/* ---------------- Read-only star rows ---------------- */
.dd-rstars { display: inline-flex; gap: 2px; line-height: 1; vertical-align: middle; }
.dd-rstar { color: rgba(140, 140, 140, .35); font-size: 15px; }
.dd-rstar.is-on { color: #f6b100; }

/* ---------------- Aggregate summary box ---------------- */
.dd-rate-summary {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin: 0 0 18px;
	padding: 10px 16px;
	border: 1px solid rgba(246, 177, 0, .3);
	border-radius: 14px;
	background: linear-gradient(180deg, rgba(246, 177, 0, .08), rgba(246, 177, 0, .02));
}
.dd-rate-summary__avg {
	font-size: 26px;
	font-weight: 800;
	color: #d99400;
	line-height: 1;
}
.dd-rate-summary__of { font-size: 13px; opacity: .6; }
.dd-rate-summary .dd-rstars .dd-rstar { font-size: 20px; }
.dd-rate-summary__count { font-size: 13px; opacity: .75; margin-inline-start: auto; }

/* ---------------- Per-comment rating ---------------- */
.dd-cmt-rating {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 8px;
	padding: 3px 9px;
	border-radius: 999px;
	background: rgba(246, 177, 0, .1);
}
.dd-cmt-rating__num { font-size: 12px; font-weight: 700; color: #d99400; }

/* ---------------- Dark mode ---------------- */
@media (prefers-color-scheme: dark) {
	.dd-rstar,
	.dd-rate__stars label { color: rgba(200, 200, 200, .3); }
	.dd-rate-summary__avg,
	.dd-cmt-rating__num { color: #ffca28; }
}
.dark-mode .dd-rate__stars label,
body.dracula .dd-rate__stars label,
.dark .dd-rstar { color: rgba(200, 200, 200, .3); }
.dark-mode .dd-rate-summary__avg,
.dark-mode .dd-cmt-rating__num,
body.dracula .dd-rate-summary__avg,
body.dracula .dd-cmt-rating__num { color: #ffca28; }
