/* Puntit community forms + reviews.
 *
 * Theme-adaptive: colours derive from the theme's own `currentColor` via
 * color-mix(), so the controls read correctly on a dark Kadence theme (light
 * text → light translucent surfaces) AND on a light theme, without hard-coding
 * a background that fights the theme. Buttons use a solid accent so the CTA
 * stands out regardless.
 */

.puntit-correction,
.puntit-reviews {
	margin: 1.75rem 0;
	color: inherit;
}

/* ── Disclosure toggles as real buttons ──────────────────────────────── */
.puntit-correction > summary,
.puntit-review-form-wrap > summary {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	list-style: none;
	cursor: pointer;
	padding: 0.7rem 1.25rem;
	margin: 0.25rem 0;
	border-radius: 8px;
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.2;
	background: #15803d;
	color: #fff;
	border: 0;
	transition: background 0.15s ease;
}
.puntit-correction > summary:hover,
.puntit-review-form-wrap > summary:hover {
	background: #166534;
}
.puntit-correction > summary::-webkit-details-marker,
.puntit-review-form-wrap > summary::-webkit-details-marker {
	display: none;
}
.puntit-correction > summary::before,
.puntit-review-form-wrap > summary::before {
	content: "✎";
	font-size: 1.05em;
}

/* ── Form fields ─────────────────────────────────────────────────────── */
.puntit-correction__form,
.puntit-review__form {
	margin-top: 1rem;
	padding: 1.25rem;
	border-radius: 10px;
	border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	background: color-mix(in srgb, currentColor 4%, transparent);
}
.puntit-correction__form p,
.puntit-review__form p {
	margin: 0 0 1rem;
}
.puntit-correction__form label,
.puntit-review__form label {
	display: block;
	font-size: 0.95rem;
	font-weight: 600;
	margin-bottom: 0.3rem;
	color: inherit;
}
.puntit-correction__form input[type="text"],
.puntit-correction__form input[type="email"],
.puntit-correction__form select,
.puntit-correction__form textarea,
.puntit-review__form input[type="text"],
.puntit-review__form input[type="email"],
.puntit-review__form select,
.puntit-review__form textarea {
	width: 100%;
	max-width: 36rem;
	padding: 0.6rem 0.75rem;
	font-size: 1rem;
	color: inherit;
	background: color-mix(in srgb, currentColor 7%, transparent);
	border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
	border-radius: 8px;
	box-sizing: border-box;
}
.puntit-correction__form textarea,
.puntit-review__form textarea {
	min-height: 6.5rem;
	resize: vertical;
}
.puntit-correction__form input:focus,
.puntit-correction__form select:focus,
.puntit-correction__form textarea:focus,
.puntit-review__form input:focus,
.puntit-review__form select:focus,
.puntit-review__form textarea:focus {
	outline: 2px solid color-mix(in srgb, currentColor 55%, transparent);
	outline-offset: 1px;
	border-color: transparent;
}
/* Dropdown options need an explicit dark background on some browsers. */
.puntit-correction__form select option,
.puntit-review__form select option {
	color: #111;
	background: #fff;
}

.puntit-correction__form button[type="submit"],
.puntit-review__form button[type="submit"] {
	padding: 0.7rem 1.4rem;
	border: 0;
	border-radius: 8px;
	background: #15803d;
	color: #fff;
	font-weight: 700;
	font-size: 1rem;
	cursor: pointer;
	transition: background 0.15s ease;
}
.puntit-correction__form button[type="submit"]:hover,
.puntit-review__form button[type="submit"]:hover {
	background: #166534;
}
.puntit-correction__form button:disabled,
.puntit-review__form button:disabled {
	opacity: 0.6;
	cursor: default;
}

.puntit-correction__result {
	min-height: 1.2em;
	margin-top: 0.5rem;
	font-size: 0.95rem;
	font-weight: 600;
}
.puntit-correction__result.is-success {
	color: #22c55e;
}
.puntit-correction__result.is-error {
	color: #f87171;
}

/* ── Reviews ─────────────────────────────────────────────────────────── */
.puntit-reviews__heading {
	margin: 0 0 0.75rem;
}
.puntit-reviews__agg {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 1.1rem;
	margin: 0 0 1.25rem;
}
.puntit-stars {
	color: #f59e0b;
	letter-spacing: 2px;
	font-size: 1.05em;
}
.puntit-reviews__list {
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
	display: grid;
	gap: 1rem;
}
.puntit-review {
	padding: 1rem 1.1rem;
	border-radius: 10px;
	border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
	background: color-mix(in srgb, currentColor 3%, transparent);
}
.puntit-review__head {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.35rem;
}
.puntit-review__title {
	font-size: 1.05rem;
}
.puntit-review__body {
	margin: 0.35rem 0 0.5rem;
	line-height: 1.55;
}
.puntit-review__meta {
	font-size: 0.85rem;
	opacity: 0.7;
	margin: 0;
}
.puntit-reviews__empty {
	opacity: 0.75;
}

.puntit-rating-summary {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}
.puntit-rating-summary__num {
	font-weight: 700;
}
.puntit-rating-summary__count {
	opacity: 0.7;
}
.puntit-rating-summary--empty {
	opacity: 0.7;
	font-size: 0.95rem;
}
