/* ==========================================================================
   IGA RECIPE RATINGS STAR SYSTEM STYLES
   ========================================================================== */

/* FIXED: the block below used to open with an unterminated comment, which
   swallowed everything down to the "Main Container Card" marker and silently
   disabled ~20 lines of styling. The rules that are still needed are live
   again; the ones that fought the card layout stay commented, deliberately. */

.recipe-average-rating { font-size: 1.1em; margin: 15px 0; }
.recipe-average-rating .filled-star { color: #e4291b; }
.recipe-average-rating .empty-star { color: #e0e0e0; }
.recipe-average-rating .rating-text { font-size: 0.9em; color: #666; margin-left: 8px; }

.recipe-rating-container .rating-subtext { font-size: 18px; color: #555; }
.rating-summary-stats { font-size: 18px; line-height: 28px; font-weight: 500; }

/* Superseded by the card rules further down - kept for reference only:
.recipe-rating-container { margin-bottom: 25px; max-width: 450px; }
.recipe-rating-container h3 .rating-prompt { font-size: 31px !important; font-weight: 900 !important; margin: 0 0 10px 0; color: #333; }
*/

/* Main Container Card */
.recipe-rating-container {
	padding: 30px;
	margin: 35px 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	background-color: #F9F9F9;
	font-family: inherit;
	max-width: 100%;
}

/* Header Title */
.recipe-rating-container .review-section-title {
	font-size: 20px;
	font-weight: 800;
	text-transform: uppercase;
	color: #222222;
	margin: 0 0 25px 0;
	letter-spacing: 0.5px;
}

/* Summary Grid (2 Columns) */
.iga-review-summary-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 30px;
	align-items: center;
}

/* Left Column: Average & Button */
.iga-review-summary-left {
	flex: 1;
	min-width: 220px;
	text-align: center;
	padding-right: 20px;
	border-right: 1px solid #eeeeee;
}

.iga-big-rating-number {
	font-size: 50px;
	font-weight: 800;
	line-height: 1;
	color: #111111;
	margin-bottom: 8px;
}

.iga-stars-display {
	color: #e4291b;
	font-size: 22px;
	margin-bottom: 6px;
	letter-spacing: 2px;
}

.iga-review-count-sub {
	font-size: 13px;
	color: #666666;
	margin-bottom: 20px;
}

.iga-add-review-btn {
	background-color: #e4291b;
	color: #ffffff !important;
	border: none;
	padding: 12px 28px;
	border-radius: 4px;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	transition: background-color 0.2s ease;
	display: inline-block;
	text-decoration: none;
}

.iga-add-review-btn:hover {
	background-color: #c4122c;
}

.iga-add-review-btn:focus-visible {
	outline: 2px solid #111111;
	outline-offset: 2px;
}

/* Right Column: Breakdown Bars */
.iga-review-summary-right {
	flex: 1.5;
	min-width: 260px;
}

.iga-bar-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
	font-size: 13px;
	color: #444444;
}

.iga-bar-row.iga-bar-empty {
	color: #666666;
	font-style: italic;
	line-height: 1.5;
}

.iga-bar-label {
	width: 45px;
	text-align: right;
	font-weight: 500;
	white-space: nowrap;
}

.iga-bar-track {
	flex: 1;
	background-color: #eef0f2;
	height: 18px;
	border-radius: 2px;
	overflow: hidden;
}

.iga-bar-fill {
	background-color: #e4291b;
	height: 100%;
	border-radius: 2px;
	transition: width 0.4s ease-in-out;
}

.iga-bar-percent {
	width: 40px;
	text-align: right;
	font-weight: 500;
	color: #555555;
}

.iga-bar-row.iga-legacy-meter .iga-bar-percent {
	width: auto;
	min-width: 40px;
	font-weight: 700;
	color: #222222;
}

/* Interactive Voting Area.
   This sits in the same slot as the "Add a review" button: the button hides and
   the star row takes its place, instead of the panel opening on a new line. */
.iga-review-cta {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.iga-vote-form-wrapper {
	width: 100%;
	margin: 0;
	padding: 0;
	border-top: none;
}

.iga-vote-form-wrapper .rating-subtext {
	font-weight: 600;
	margin: 0 0 4px;
}

.star-rating-input {
	position: relative;
	display: flex;
	flex-direction: row-reverse;
	justify-content: center;
	gap: 6px;
	margin: 6px 0 0;
}

/* FIXED: these radios used to be display:none, which removed them from the tab
   order entirely - the rating control could not be operated by keyboard or by
   a screen reader. They are now visually hidden but still focusable. */
.star-rating-input input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	border: 0;
	opacity: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.star-rating-input label {
	font-size: 32px;
	color: #e0e0e0;
	cursor: pointer;
	transition: color 0.15s;
	line-height: 1;
}

.star-rating-input .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.star-rating-input input:checked ~ label,
.star-rating-input label:hover,
.star-rating-input label:hover ~ label {
	color: #e4291b;
}

.star-rating-input input:focus-visible + label {
	outline: 2px solid #111111;
	outline-offset: 2px;
	border-radius: 2px;
}

.recipe-rating-container.voted .star-rating-input {
	pointer-events: none;
	opacity: 0.65;
}

.rating-thanks-msg {
	margin-top: 10px;
	font-weight: bold;
	color: #333;
	font-size: 15px;
}

.iga-rating-error {
	margin-top: 10px;
	font-size: 14px;
	color: #b32d2e;
}

/* Responsive adjustments */
@media (max-width: 600px) {
	.iga-review-summary-left {
		border-right: none;
		border-bottom: 1px solid #eeeeee;
		padding-right: 0;
		padding-bottom: 20px;
	}
}
