/**
 * Adaptation Changes — front-end styles.
 *
 * Deliberately built on the same eight tokens the Fan Reviews plugin uses, so
 * the two sit together on a page without arguing. Change --adch-accent and
 * everything else follows: the wash, the rules, the meters and the buttons are
 * all mixed from it.
 */

.adch {
	--adch-accent: #2f5d50;
	--adch-ink: #1c1f1e;
	--adch-muted: #6b7472;
	--adch-paper: #ffffff;
	--adch-wash: color-mix(in srgb, var(--adch-accent) 6%, #ffffff);
	--adch-line: color-mix(in srgb, var(--adch-accent) 18%, #e4e6e5);
	--adch-shadow: rgba(15, 25, 22, 0.05);
	--adch-radius: 14px;

	/* Verdict colours. Positive borrows the accent so the page stays one
	   family; negative is the only hue allowed to disagree with it. */
	--adch-yes: var(--adch-accent);
	--adch-no: #a8443c;

	color: var(--adch-ink);

	/* An explicit stack, not `inherit`. Inheriting sounds tidier but it picks
	   up whatever the surrounding markup happens to carry, and on at least one
	   real page that turned out to be monospace. Override --adch-font to match
	   a theme whose body face is something else. */
	--adch-font: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
		Roboto, Helvetica, Arial, sans-serif;

	font-family: var(--adch-font);
	font-size: 16px;
	line-height: 1.55;
	box-sizing: border-box;
}

.adch input,
.adch select,
.adch textarea,
.adch button,
.adch label,
.adch p,
.adch span,
.adch a,
.adch h2,
.adch h3,
.adch h4,
.adch legend {
	font-family: var(--adch-font);
}

.adch *,
.adch *::before,
.adch *::after {
	box-sizing: inherit;
}

.adch[data-adch-scheme="dark"] {
	--adch-ink: #e6e9e8;
	--adch-muted: #98a29f;
	--adch-paper: color-mix(in srgb, var(--adch-accent) 7%, #151918);
	--adch-wash: color-mix(in srgb, var(--adch-accent) 16%, #151918);
	--adch-line: color-mix(in srgb, var(--adch-accent) 32%, #2b3230);
	--adch-shadow: rgba(0, 0, 0, 0.35);
	--adch-yes: color-mix(in srgb, var(--adch-accent) 55%, #ffffff);
	--adch-no: #d98a83;
}

/* A browser without color-mix gets flat fallbacks rather than transparent
   boxes. Everything below still reads, it just loses the tinting. */
@supports not (color: color-mix(in srgb, #000 50%, #fff)) {
	.adch {
		--adch-wash: #f4f7f6;
		--adch-line: #ccd6d3;
	}

	.adch[data-adch-scheme="dark"] {
		--adch-paper: #1a201e;
		--adch-wash: #212a27;
		--adch-line: #38443f;
		--adch-yes: #7fae9d;
	}
}

/* Links fall through to the theme otherwise, which on a dark background
   usually means an unreadable default blue. */
.adch a {
	color: var(--adch-yes);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.adch a:hover,
.adch a:focus-visible {
	color: var(--adch-ink);
}

/* Anything that is a link but reads as a control keeps its own colour: the
   rule above is `.adch a`, which outranks a bare component class. */
.adch a.adch-button {
	color: #fff;
	text-decoration: none;
}

.adch a.adch-button--quiet {
	color: var(--adch-ink);
}

.adch a.adch-toolbar__item,
.adch .adch-entry__title a,
.adch .adch-pagination a.page-numbers {
	color: var(--adch-ink);
	text-decoration: none;
}

.adch .adch-pagination a.page-numbers:hover,
.adch a.adch-toolbar__item:hover {
	color: var(--adch-ink);
}

.adch .adch-entry__title a:hover {
	color: var(--adch-ink);
	text-decoration: underline;
}

/* ---------- Panels ---------- */

.adch-panel {
	background: var(--adch-paper);
	border: 1px solid var(--adch-line);
	border-radius: var(--adch-radius);
	box-shadow: 0 1px 2px 0 var(--adch-shadow);
	padding: 28px;
	margin: 0 0 20px;
}

@media (max-width: 600px) {
	.adch-panel {
		padding: 20px 18px;
	}
}

.adch-heading {
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.25;
	margin: 0 0 8px;
	color: var(--adch-ink);
}

.adch-label {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--adch-muted);
	margin: 0 0 14px;
}

.adch-section {
	border-top: 1px solid var(--adch-line);
	margin-top: 24px;
	padding-top: 20px;
}

/* ---------- Toolbar ---------- */

.adch-toolbar {
	display: flex;
	border: 1px solid var(--adch-line);
	border-radius: var(--adch-radius);
	background: var(--adch-paper);
	overflow: hidden;
	margin: 0 0 16px;
}

.adch-toolbar__item {
	flex: 1 1 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 14px;
	background: none;
	border: 0;
	border-right: 1px solid var(--adch-line);
	font: inherit;
	font-size: 0.94rem;
	font-weight: 600;
	color: var(--adch-ink);
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease;
}

.adch-toolbar__item:last-child {
	border-right: 0;
}

.adch-toolbar__item:hover,
.adch-toolbar__item:focus-visible {
	background: var(--adch-wash);
}

@media (max-width: 560px) {
	.adch-toolbar {
		flex-direction: column;
	}

	.adch-toolbar__item {
		border-right: 0;
		border-bottom: 1px solid var(--adch-line);
	}

	.adch-toolbar__item:last-child {
		border-bottom: 0;
	}
}

/* ---------- Hero ---------- */

.adch-hero__top {
	display: flex;
	gap: 24px;
	align-items: flex-start;
	flex-wrap: wrap;
}

.adch-hero__badge {
	background: var(--adch-accent);
	color: #fff;
	border-radius: var(--adch-radius);
	padding: 12px 18px;
	text-align: center;
	flex: 0 0 auto;
	line-height: 1.1;
}

.adch-hero__percent {
	font-size: 1.9rem;
	font-weight: 800;
	display: block;
}

.adch-hero__percent-label {
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.85;
}

.adch-hero__body {
	flex: 1 1 16rem;
	min-width: 0;
}

.adch-hero__sub {
	color: var(--adch-muted);
	font-size: 0.92rem;
	margin: 0 0 14px;
}

.adch-hero__split {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
	gap: 14px;
	margin-top: 20px;
}

.adch-stat {
	border-top: 1px solid var(--adch-line);
	padding-top: 10px;
}

.adch-stat__value {
	font-size: 1.3rem;
	font-weight: 800;
	display: block;
	line-height: 1.2;
}

.adch-stat__label {
	font-size: 0.78rem;
	color: var(--adch-muted);
}

/* ---------- Buttons ---------- */

.adch-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 26px;
	border: 0;
	border-radius: 99px;
	background: var(--adch-accent);
	color: #fff;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.adch-button:hover,
.adch-button:focus-visible {
	opacity: 0.9;
	color: #fff;
}

.adch-button--quiet {
	background: none;
	color: var(--adch-ink);
	border: 1px solid var(--adch-line);
}

.adch-button--quiet:hover,
.adch-button--quiet:focus-visible {
	background: var(--adch-wash);
	color: var(--adch-ink);
	opacity: 1;
}

.adch-button[disabled] {
	opacity: 0.5;
	cursor: default;
}

/* ---------- Meters ---------- */

.adch-meter {
	height: 8px;
	border-radius: 99px;
	background: color-mix(in srgb, var(--adch-accent) 5%, #f2f4f3);
	overflow: hidden;
}

.adch[data-adch-scheme="dark"] .adch-meter {
	background: color-mix(in srgb, var(--adch-accent) 22%, #101413);
}

.adch-meter__fill {
	display: block;
	height: 100%;
	border-radius: 99px;
	background: linear-gradient(
		90deg,
		color-mix(in srgb, var(--adch-yes) 70%, #ffffff) 0%,
		var(--adch-yes) 100%
	);
	transition: width 0.3s ease;
}

.adch-meter--negative .adch-meter__fill {
	background: linear-gradient(
		90deg,
		color-mix(in srgb, var(--adch-no) 70%, #ffffff) 0%,
		var(--adch-no) 100%
	);
}

.adch-meter--empty .adch-meter__fill {
	background: var(--adch-line);
}

/* ---------- Entry ---------- */

.adch-entry {
	background: var(--adch-paper);
	border: 1px solid var(--adch-line);
	border-radius: var(--adch-radius);
	box-shadow: 0 1px 2px 0 var(--adch-shadow);
	padding: 24px 26px;
	margin: 0 0 14px;
}

.adch-entry--single {
	border: 0;
	box-shadow: none;
	padding: 0;
	background: none;
}

.adch-entry__head {
	display: flex;
	gap: 16px;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
}

.adch-entry__title {
	font-size: 1.12rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.3;
	margin: 0;
	flex: 1 1 14rem;
}

.adch-entry__title a {
	color: inherit;
	text-decoration: none;
}

.adch-entry__title a:hover {
	text-decoration: underline;
}

.adch-entry__verdict {
	font-size: 1.05rem;
	font-weight: 800;
	white-space: nowrap;
	color: var(--adch-yes);
}

.adch-entry__verdict--negative,
.adch-vote__percent.is-negative {
	color: var(--adch-no);
}

.adch-entry__verdict--none {
	color: var(--adch-muted);
	font-weight: 600;
	font-size: 0.85rem;
}

.adch-entry__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 10px 0 0;
	list-style: none;
	padding: 0;
}

.adch-tag {
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	padding: 3px 9px;
	border-radius: 99px;
	background: var(--adch-wash);
	border: 1px solid var(--adch-line);
	color: var(--adch-muted);
}

.adch-entry__image {
	margin: 18px 0 0;
}

.adch-entry__image img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: 10px;
}

/* ---------- Book vs screen ---------- */

.adch-versions {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: 0;
	margin-top: 18px;
	border-top: 1px solid var(--adch-line);
}

.adch-version {
	padding: 16px 0 4px;
}

.adch-version + .adch-version {
	border-top: 1px solid var(--adch-line);
}

@media (min-width: 40rem) {
	.adch-versions {
		gap: 26px;
	}

	.adch-version + .adch-version {
		border-top: 0;
		border-left: 1px solid var(--adch-line);
		padding-left: 26px;
	}
}

.adch-version__label {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--adch-muted);
	margin: 0 0 6px;
}

.adch-version__body > :first-child {
	margin-top: 0;
}

.adch-version__body > :last-child {
	margin-bottom: 0;
}

/* ---------- The case for and against ---------- */

.adch-case {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: 14px;
	margin-top: 20px;
}

.adch-case__side {
	border-radius: 10px;
	padding: 14px 16px;
}

.adch-case__side--pro {
	background: var(--adch-wash);
}

.adch-case__side--con {
	background: color-mix(in srgb, var(--adch-no) 7%, transparent);
}

@supports not (color: color-mix(in srgb, #000 50%, #fff)) {
	.adch-case__side--con {
		background: var(--adch-wash);
	}
}

.adch-case__label {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	margin: 0 0 6px;
}

.adch-case__side--pro .adch-case__label {
	color: var(--adch-yes);
}

.adch-case__side--con .adch-case__label {
	color: var(--adch-no);
}

.adch-case__body > :first-child {
	margin-top: 0;
}

.adch-case__body > :last-child {
	margin-bottom: 0;
}

.adch-entry__source {
	font-size: 0.82rem;
	color: var(--adch-muted);
	margin: 16px 0 0;
	word-break: break-word;
}

/* ---------- Voting ---------- */

.adch-vote {
	margin-top: 20px;
	border-top: 1px solid var(--adch-line);
	padding-top: 16px;
}

.adch-vote__readout {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	font-size: 0.82rem;
	color: var(--adch-muted);
	margin: 0 0 6px;
}

.adch-vote__readout strong {
	color: var(--adch-ink);
	font-weight: 700;
}

.adch-vote__actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 14px;
}

.adch-vote__ask {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--adch-muted);
	margin-right: 4px;
}

.adch-vote__btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 15px;
	border: 1px solid var(--adch-line);
	border-radius: 99px;
	background: var(--adch-paper);
	color: var(--adch-ink);
	font: inherit;
	font-size: 0.88rem;
	font-weight: 600;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.adch-vote__btn:hover:not([disabled]) {
	border-color: var(--adch-muted);
}

.adch-vote__btn--up.is-active {
	background: var(--adch-yes);
	border-color: var(--adch-yes);
	color: #fff;
}

.adch-vote__btn--down.is-active {
	background: var(--adch-no);
	border-color: var(--adch-no);
	color: #fff;
}

.adch-vote__btn[disabled] {
	opacity: 0.5;
	cursor: default;
}

.adch-vote__btn-count {
	font-variant-numeric: tabular-nums;
	opacity: 0.75;
	font-weight: 600;
}

.adch-vote__reason[hidden],
.adch-vote__identity[hidden],
.adch-submit__identity[hidden],
.adch-more[hidden] {
	display: none;
}

.adch-vote__reason {
	margin-top: 14px;
	display: grid;
	gap: 8px;
	max-width: 38rem;
}

.adch-vote__message {
	margin: 10px 0 0;
	font-size: 0.85rem;
	color: var(--adch-muted);
	min-height: 1.2em;
}

.adch-vote__message.is-error {
	color: var(--adch-no);
}

/* ---------- Reader comments ---------- */

.adch-reasons__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 2px;
}

.adch-reason {
	padding: 14px 0;
	border-top: 1px solid var(--adch-line);
}

.adch-reason:first-child {
	border-top: 0;
}

.adch-reason__body {
	margin: 0 0 6px;
}

.adch-reason__byline {
	margin: 0;
	font-size: 0.78rem;
	color: var(--adch-muted);
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.adch-reason__author {
	font-weight: 700;
	color: var(--adch-ink);
}

.adch-reason__verdict {
	font-weight: 600;
}

.adch-reason--up .adch-reason__verdict {
	color: var(--adch-yes);
}

.adch-reason--down .adch-reason__verdict {
	color: var(--adch-no);
}

/* ---------- Forms ---------- */

.adch-field {
	display: grid;
	gap: 5px;
	margin: 0 0 16px;
}

.adch-field > label,
.adch-fieldset > legend {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--adch-ink);
}

.adch-field__help {
	font-size: 0.8rem;
	color: var(--adch-muted);
}

.adch input[type="text"],
.adch input[type="email"],
.adch input[type="url"],
.adch input[type="search"],
.adch select,
.adch textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--adch-line);
	border-radius: 8px;
	background: var(--adch-paper);
	color: var(--adch-ink);
	font: inherit;
	font-size: 1rem;
}

.adch textarea {
	resize: vertical;
	min-height: 5.5em;
}

.adch input:focus-visible,
.adch select:focus-visible,
.adch textarea:focus-visible,
.adch button:focus-visible,
.adch a:focus-visible {
	outline: 2px solid var(--adch-accent);
	outline-offset: 2px;
}

.adch-fieldset {
	border: 1px solid var(--adch-line);
	border-radius: 10px;
	padding: 14px 16px 4px;
	margin: 0 0 16px;
}

.adch-fieldset > legend {
	padding: 0 6px;
}

.adch-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
	gap: 14px;
}

.adch-required {
	color: var(--adch-no);
}

.adch-checks {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}

/* Checkboxes styled as selectable pills — quicker to scan and to tap than a
   column of boxes, and it keeps the tag vocabulary visible while choosing. */
.adch-check {
	position: relative;
}

.adch-check input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.adch-check span {
	display: inline-block;
	padding: 6px 13px;
	border: 1px solid var(--adch-line);
	border-radius: 99px;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--adch-muted);
	background: var(--adch-paper);
	transition: all 0.15s ease;
}

.adch-check input:checked + span {
	background: var(--adch-accent);
	border-color: var(--adch-accent);
	color: #fff;
}

.adch-check input:focus-visible + span {
	outline: 2px solid var(--adch-accent);
	outline-offset: 2px;
}

.adch-more__toggle {
	background: none;
	border: 0;
	padding: 0 0 16px;
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--adch-accent);
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.adch[data-adch-scheme="dark"] .adch-more__toggle {
	color: var(--adch-yes);
}

/* The honeypot must be reachable by bots and invisible to people. */
.adch-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

/* ---------- Repeatable change blocks ---------- */

.adch-change + .adch-change {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid var(--adch-line);
}

.adch-change__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.adch-change__count {
	margin-bottom: 10px;
}

.adch-change__remove {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--adch-no);
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.adch-change__remove[hidden],
.adch-change__count[hidden] {
	display: none;
}

.adch-changes__add {
	margin: 4px 0 20px;
}

.adch-changes__add button[hidden] {
	display: none;
}

/* ---------- Terms ---------- */

.adch-terms {
	margin: 4px 0 18px;
	padding: 14px 16px;
	border: 1px solid var(--adch-line);
	border-radius: 10px;
	background: var(--adch-wash);
}

.adch-terms__label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 0.92rem;
	font-weight: 500;
	cursor: pointer;
}

.adch-terms__label input {
	margin: 0.2em 0 0;
	flex: 0 0 auto;
	width: 1.05em;
	height: 1.05em;
	accent-color: var(--adch-accent);
}

.adch-submit__actions {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin: 8px 0 0;
}

.adch-submit__status {
	font-size: 0.88rem;
	color: var(--adch-muted);
}

.adch-submit__status.is-error {
	color: var(--adch-no);
}

/* ---------- Filters ---------- */

.adch-filters {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
	gap: 12px;
	align-items: end;
}

.adch-filters .adch-field {
	margin: 0;
}

.adch-filters__submit {
	align-self: end;
}

.adch-count {
	font-size: 0.85rem;
	color: var(--adch-muted);
	margin: 0 0 14px;
}

/* ---------- Notices, empty state, pagination ---------- */

.adch-notice {
	padding: 12px 16px;
	border-radius: 10px;
	margin: 0 0 18px;
	font-size: 0.94rem;
	border: 1px solid;
}

.adch-notice--success {
	background: var(--adch-wash);
	border-color: var(--adch-yes);
	color: var(--adch-ink);
}

.adch-notice--error {
	background: color-mix(in srgb, var(--adch-no) 8%, transparent);
	border-color: var(--adch-no);
	color: var(--adch-ink);
}

.adch-empty {
	padding: 40px 24px;
	text-align: center;
	color: var(--adch-muted);
	border: 1px dashed var(--adch-line);
	border-radius: var(--adch-radius);
	margin-bottom: 20px;
}

.adch-pagination {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin: 20px 0;
	flex-wrap: wrap;
}

.adch-pagination .page-numbers {
	padding: 7px 13px;
	border: 1px solid var(--adch-line);
	border-radius: 99px;
	text-decoration: none;
	color: var(--adch-ink);
	font-size: 0.88rem;
	font-weight: 600;
}

.adch-pagination .page-numbers:hover {
	background: var(--adch-wash);
}

.adch-pagination .page-numbers.current {
	background: var(--adch-accent);
	border-color: var(--adch-accent);
	color: #fff;
}

@media (prefers-reduced-motion: reduce) {
	.adch *,
	.adch *::before,
	.adch *::after {
		transition: none !important;
	}
}
