/**
 * STW Routes - route page styling.
 *
 * Scoped under .stw-route so it sits inside the Singletrack theme without
 * fighting it, with the palette in custom properties so the house colours can
 * be dropped in from one place.
 *
 * LIGHT AND DARK. The theme follows the reader's system setting: in dark mode
 * the body goes to #121212 with light text. Anything here that hard-codes a
 * colour therefore has to hard-code BOTH, or it breaks in one of them - which
 * is exactly what happened first time round: dark ink was painted on the
 * theme's dark background with no background of its own underneath it, and the
 * ride notes came out near-invisible. So:
 *
 *   - every colour is a token, defined light on .stw-route and redefined in the
 *     dark block below; no colour is declared only once, in only one mode;
 *   - the panels and cards paint --stw-route-surface rather than white, so a
 *     dark reader gets dark cards instead of light rectangles punched into a
 *     dark page;
 *   - colour rules are prefixed with .stw-route. The theme sets a colour on all
 *     headings, and at equal specificity whichever stylesheet loads last wins -
 *     which put the theme's near-white heading colour on the inside of a white
 *     panel. The extra class settles it rather than leaving it to load order.
 */

.stw-route {
	--stw-route-accent: #c8102e;
	--stw-route-accent-hover: #a50d26;
	--stw-route-ink: #1f2933;
	--stw-route-muted: #5b6570;
	--stw-route-rule: #e3e6e8;
	--stw-route-panel: #f7f8f9;
	--stw-route-surface: #ffffff;
	--stw-route-verified-bg: #edf7ee;
	--stw-route-verified-border: #cbe5cf;
	--stw-route-verified-ink: #1a5c2a;
	--stw-route-profile-fill: rgba(200, 16, 46, 0.10);

	color: var(--stw-route-ink);
}

/*
 * THE SHEET. Two problems, one rule, and both of them only appeared on Live.
 *
 * WIDTH. The theme drops a route into a Bootstrap .row, and Bootstrap's
 * `.row > *` sets width:100% and max-width:100% at a specificity a single
 * class cannot beat - so a route ran the full 1,740px of the container, giving
 * ride notes a line length nobody can read. The doubled class is not a typo:
 * it is the smallest thing that wins without reaching for !important.
 *
 * BACKGROUND. Live puts a full-bleed photograph behind the site content. This
 * stylesheet was careful to define both a light and a dark ink colour, but it
 * never painted a ground of its own, so on Live the ride notes landed on a
 * picture of a wet hillside. Every other post type on the site sits on a white
 * card; routes now do the same, in whichever mode the reader is in.
 *
 * Dev has neither the photograph nor that container, which is exactly why this
 * got through: the page it was built against could not show the fault.
 */
.stw-route.stw-route {
	max-width: 1180px;
	margin: 28px auto 56px;
	padding: 32px 32px 40px;
	background: var(--stw-route-surface);
	border: 1px solid var(--stw-route-rule);
	border-radius: 8px;
}

/*
 * The archive is two blocks - the heading and the finder - and they should
 * read as one sheet rather than two cards with a crack between them.
 */
.stw-route.stw-routes-archive-header {
	margin-bottom: 0;
	border-bottom: 0;
	border-radius: 8px 8px 0 0;
	padding-bottom: 4px;
}

.stw-route.stw-routes-finder {
	margin-top: 0;
	border-top: 0;
	border-radius: 0 0 8px 8px;
	padding-top: 12px;
}

/* On a phone the sheet is the page: edge to edge, no rounded corners. */
@media (max-width: 600px) {
	.stw-route.stw-route {
		max-width: none;
		margin: 0 auto 32px;
		padding: 20px 16px 32px;
		border-left: 0;
		border-right: 0;
		border-radius: 0;
	}

	.stw-route.stw-routes-archive-header,
	.stw-route.stw-routes-finder {
		border-radius: 0;
	}
}

@media (prefers-color-scheme: dark) {
	.stw-route {
		--stw-route-accent: #ff4d6a;
		--stw-route-accent-hover: #ff7085;
		--stw-route-ink: #e6e8ea;
		--stw-route-muted: #9aa4b0;
		--stw-route-rule: #2f3742;
		--stw-route-panel: #1b2027;
		--stw-route-surface: #14181d;
		--stw-route-verified-bg: #16301c;
		--stw-route-verified-border: #2c5c37;
		--stw-route-verified-ink: #8fd9a0;
		--stw-route-profile-fill: rgba(255, 77, 106, 0.16);
	}
}

.stw-route,
.stw-route p,
.stw-route li,
.stw-route dd {
	color: var(--stw-route-ink);
}

.stw-route-header {
	padding: 24px 0 8px;
}

.stw-route .stw-route-eyebrow {
	font-size: 0.8125rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--stw-route-muted);
	margin: 0 0 6px;
}

.stw-route .stw-route-title {
	margin: 0 0 8px;
	line-height: 1.15;
	color: var(--stw-route-ink);
}

.stw-route .stw-route-standfirst {
	font-size: 1.125rem;
	line-height: 1.5;
	color: var(--stw-route-muted);
	margin: 0 0 16px;
	max-width: 60ch;
}

/* Verification stamp - the thing crowd-sourced routes cannot claim. */
.stw-route .stw-route-verified {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--stw-route-verified-bg);
	border: 1px solid var(--stw-route-verified-border);
	color: var(--stw-route-verified-ink);
	border-radius: 999px;
	padding: 5px 14px;
	font-size: 0.875rem;
	font-weight: 600;
}

/*
 * Undated: still the endorsement, still green - we do recommend it - but
 * without the "checked in June" half, so the badge never implies a
 * verification that has not happened.
 */
.stw-route .stw-route-verified-detail {
	font-weight: 400;
}

.stw-route .stw-route-facts a,
.stw-route .stw-route-verified a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.stw-route .stw-route-facts a:hover,
.stw-route .stw-route-facts a:focus {
	color: var(--stw-route-accent);
}

/* Stats bar */
.stw-route-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 1px;
	background: var(--stw-route-rule);
	border: 1px solid var(--stw-route-rule);
	border-radius: 6px;
	overflow: hidden;
	margin: 20px 0;
}

.stw-route-stat {
	background: var(--stw-route-surface);
	padding: 14px 16px;
}

.stw-route .stw-route-stat-value {
	display: block;
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--stw-route-ink);
}

.stw-route .stw-route-stat-label {
	display: block;
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--stw-route-muted);
	margin-top: 3px;
}

/* Map */
.stw-route-map-wrap {
	position: relative;
	border: 1px solid var(--stw-route-rule);
	border-radius: 6px;
	overflow: hidden;
}

.stw-route #stw-route-map {
	height: 460px;
	width: 100%;
	/*
	 * Map-paper, not panel: this is what shows through the gaps while tiles
	 * load, and in dark mode a panel-coloured background reads as a hole in the
	 * page for the second before the tiles arrive.
	 */
	background: #e8e4dd;
}

/*
 * The map itself is always light - OSM tiles are a light image whatever the
 * reader's setting - so Leaflet's own furniture keeps light-on-light values
 * rather than inheriting the page's dark text colour.
 */
.stw-route .leaflet-container {
	background: #e8e4dd;
}

.stw-route .leaflet-control-attribution,
.stw-route .leaflet-control-attribution a {
	background: rgba(255, 255, 255, 0.85);
	color: #333;
}

.stw-route .leaflet-tooltip {
	color: #1f2933;
}

@media (max-width: 600px) {
	.stw-route #stw-route-map {
		height: 340px;
	}
}

/*
 * Map style switch: Standard / OS Maps, top right of the map. Light furniture
 * on the map surface whatever the page mode, like Leaflet's own controls, so
 * it reads as part of the map rather than the page.
 */
.stw-route .stw-route-style-switch {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 800; /* above tiles and paths, below Leaflet popups (1000+) */
	display: inline-flex;
	background: rgba(255, 255, 255, 0.95);
	border: 2px solid rgba(0, 0, 0, 0.2);
	border-radius: 4px;
	overflow: hidden;
	font-size: 0.8125rem;
	line-height: 1;
}

.stw-route .stw-route-style-btn {
	appearance: none;
	background: transparent;
	border: 0;
	border-left: 1px solid #ccc;
	color: #1f2933;
	font: inherit;
	font-weight: 600;
	padding: 8px 12px;
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.stw-route .stw-route-style-btn:first-child {
	border-left: 0;
}

.stw-route .stw-route-style-btn:hover,
.stw-route .stw-route-style-btn:focus-visible {
	background: #f4f4f4;
	color: #c8102e;
	outline: none;
}

.stw-route .stw-route-style-btn.is-active {
	background: #1f2933;
	color: #fff;
}

.stw-route .stw-route-style-btn.is-locked {
	color: #5b6570;
	font-weight: 500;
}

.stw-route .stw-route-style-btn.is-locked:hover {
	color: #c8102e;
}

/* A small padlock, drawn rather than fetched. */
.stw-route .stw-route-lock {
	display: inline-block;
	width: 9px;
	height: 7px;
	border: 1.5px solid currentColor;
	border-radius: 1.5px;
	position: relative;
	margin-top: 3px;
}

.stw-route .stw-route-lock::before {
	content: "";
	position: absolute;
	left: 1px;
	top: -6px;
	width: 5px;
	height: 6px;
	border: 1.5px solid currentColor;
	border-bottom: 0;
	border-radius: 4px 4px 0 0;
}

/* Direction chevrons along the track (L.divIcon; the SVG carries its own colours). */
.stw-route .stw-route-arrow {
	background: transparent;
	border: 0;
	line-height: 0;
	pointer-events: none;
}

.stw-route .stw-route-arrow > div,
.stw-route .stw-route-arrow svg {
	display: block;
	width: 10px;
	height: 10px;
}

/* Profile */
.stw-route-profile-wrap {
	margin: 18px 0 28px;
}

.stw-route-profile-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 6px;
}

.stw-route .stw-route-profile-head h2 {
	font-size: 1rem;
	margin: 0;
	color: var(--stw-route-ink);
}

.stw-route #stw-route-profile-readout {
	font-variant-numeric: tabular-nums;
	font-size: 0.875rem;
	color: var(--stw-route-muted);
	min-height: 1.2em;
}

.stw-route #stw-route-profile {
	display: block;
	width: 100%;
	height: 180px;
	border: 1px solid var(--stw-route-rule);
	border-radius: 6px;
	background: var(--stw-route-surface);
	cursor: crosshair;
	touch-action: pan-y;
}

.stw-route-profile-fill {
	fill: var(--stw-route-profile-fill);
}

.stw-route-profile-line {
	fill: none;
	stroke: var(--stw-route-accent);
	stroke-width: 2.5;
	vector-effect: non-scaling-stroke;
}

.stw-route-profile-cursor {
	stroke: var(--stw-route-ink);
	stroke-width: 1;
	vector-effect: non-scaling-stroke;
	pointer-events: none;
}

/*
 * Gallery - a steady grid, every frame the same shape, opening the full-size
 * photo in a lightbox on click.
 *
 * Sits at the foot of the page, below the ride notes and the essentials, with
 * a rule above it so it reads as a closing section rather than something that
 * has drifted loose from the top.
 *
 * An earlier version put the first photo across the full row and left the
 * rest to fall into whatever columns remained - fine with five or six images,
 * but the common case of two or three came out as one big frame over a
 * couple of small thumbnails with a slab of empty grid beside them. A fixed
 * aspect ratio per frame holds up at any count, and nothing here opened when
 * clicked before - this is also the first click-to-enlarge the gallery has
 * had.
 */
.stw-route-gallery-section {
	border-top: 1px solid var(--stw-route-rule);
	margin-top: 36px;
	padding-top: 24px;
}

.stw-route .stw-route-gallery-heading {
	font-size: 1.25rem;
	margin: 0 0 14px;
	color: var(--stw-route-ink);
}

.stw-route-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 14px;
	margin: 0;
}

.stw-route-gallery-item {
	margin: 0;
}

.stw-route-gallery-link {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	border-radius: 8px;
	overflow: hidden;
	background: var(--stw-route-panel);
}

.stw-route-gallery-link:focus-visible {
	outline: 2px solid var(--stw-route-accent);
	outline-offset: 2px;
}

.stw-route-gallery img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0; /* the link now carries the frame's corner radius */
	transition: transform 0.2s ease;
}

.stw-route-gallery-link:hover img,
.stw-route-gallery-link:focus-visible img {
	transform: scale(1.04);
}

/* A quiet magnifying-glass cue on hover/focus - the only sign a frame opens. */
.stw-route .stw-route-gallery-zoom {
	position: absolute;
	right: 8px;
	bottom: 8px;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(20, 24, 29, 0.55);
	color: #fff;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.stw-route-gallery-link:hover .stw-route-gallery-zoom,
.stw-route-gallery-link:focus-visible .stw-route-gallery-zoom {
	opacity: 1;
	transform: translateY(0);
}

.stw-route .stw-route-gallery figcaption {
	font-size: 0.8125rem;
	color: var(--stw-route-muted);
	margin-top: 6px;
	line-height: 1.4;
}

@media (max-width: 600px) {
	.stw-route-gallery {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
		gap: 8px;
	}
}

/*
 * Lightbox (assets/stw-routes.js). A fixed dark stage regardless of the
 * reader's light/dark setting - a photograph reads best against black in
 * either mode, and it is how every other photo lightbox looks - so, unlike
 * the rest of this stylesheet, its colours are not tokenised.
 */
body.stw-route-lightbox-open {
	overflow: hidden;
}

.stw-route-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(10, 12, 15, 0.94);
	padding: 40px 16px;
	box-sizing: border-box;
}

.stw-route-lightbox[hidden] {
	display: none;
}

.stw-route-lightbox-figure {
	position: relative;
	max-width: min(92vw, 1400px);
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.stw-route-lightbox-image {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 140px);
	width: auto;
	height: auto;
	border-radius: 4px;
	background: #14181d;
}

.stw-route-lightbox-caption {
	color: #f2f2f2;
	font-size: 0.875rem;
	margin: 12px 0 0;
	text-align: center;
	max-width: 70ch;
}

.stw-route-lightbox-caption[hidden] {
	display: none;
}

.stw-route-lightbox-count {
	color: rgba(255, 255, 255, 0.6);
	font-size: 0.75rem;
	margin: 4px 0 0;
}

.stw-route-lightbox-close,
.stw-route-lightbox-prev,
.stw-route-lightbox-next {
	position: fixed;
	appearance: none;
	border: 0;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 1.375rem;
	line-height: 1;
}

.stw-route-lightbox-close:hover,
.stw-route-lightbox-prev:hover,
.stw-route-lightbox-next:hover,
.stw-route-lightbox-close:focus-visible,
.stw-route-lightbox-prev:focus-visible,
.stw-route-lightbox-next:focus-visible {
	background: rgba(255, 255, 255, 0.24);
	outline: none;
}

.stw-route-lightbox-close {
	top: 16px;
	right: 16px;
}

.stw-route-lightbox-prev {
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
}

.stw-route-lightbox-next {
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
}

.stw-route-lightbox-prev[hidden],
.stw-route-lightbox-next[hidden] {
	display: none;
}

@media (max-width: 600px) {
	.stw-route-lightbox {
		padding: 24px 8px;
	}

	.stw-route-lightbox-close,
	.stw-route-lightbox-prev,
	.stw-route-lightbox-next {
		width: 38px;
		height: 38px;
		font-size: 1.125rem;
	}
}

/* Body + detail columns */
.stw-route-body {
	display: grid;
	grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
	gap: 36px;
	align-items: start;
}

@media (max-width: 860px) {
	.stw-route-body {
		grid-template-columns: 1fr;
		gap: 24px;
	}
}

.stw-route .stw-route-notes h2 {
	font-size: 1.25rem;
	margin: 28px 0 8px;
	color: var(--stw-route-ink);
}

.stw-route-panel {
	background: var(--stw-route-panel);
	border: 1px solid var(--stw-route-rule);
	border-radius: 6px;
	padding: 18px 20px;
	margin-bottom: 18px;
}

.stw-route .stw-route-panel h2 {
	font-size: 0.8125rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--stw-route-muted);
	margin: 0 0 12px;
}

.stw-route .stw-route-facts {
	margin: 0;
}

.stw-route .stw-route-facts dt {
	font-size: 0.75rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--stw-route-muted);
	margin-top: 12px;
}

.stw-route .stw-route-facts dt:first-child {
	margin-top: 0;
}

.stw-route .stw-route-facts dd {
	margin: 2px 0 0;
	line-height: 1.45;
	color: var(--stw-route-ink);
}

/* Download + gate */
.stw-route a.stw-route-download {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--stw-route-accent);
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	padding: 12px 20px;
	border-radius: 4px;
	width: 100%;
	justify-content: center;
	box-sizing: border-box;
}

.stw-route a.stw-route-download:hover,
.stw-route a.stw-route-download:focus {
	background: var(--stw-route-accent-hover);
	color: #fff;
}

.stw-route-gate {
	border: 1px solid var(--stw-route-rule);
	border-top: 3px solid var(--stw-route-accent);
	border-radius: 6px;
	background: var(--stw-route-panel);
	padding: 22px 24px;
	margin: 24px 0;
}

.stw-route .stw-route-gate h2 {
	margin: 0 0 8px;
	font-size: 1.25rem;
	color: var(--stw-route-ink);
}

.stw-route .stw-route-gate p {
	margin: 0 0 14px;
	color: var(--stw-route-muted);
	max-width: 56ch;
}

.stw-route .stw-route-gate-list {
	margin: 0 0 16px;
	padding-left: 18px;
}

.stw-route .stw-route-gate-list li {
	margin-bottom: 4px;
	color: var(--stw-route-muted);
}

.stw-route .stw-route-byline {
	font-weight: 600;
	margin-top: 24px;
}

.stw-route .stw-route-byline a {
	color: var(--stw-route-accent);
}

.stw-route .stw-route-source {
	font-size: 0.875rem;
	color: var(--stw-route-muted);
	border-top: 1px solid var(--stw-route-rule);
	margin-top: 28px;
	padding-top: 14px;
}

.stw-route .stw-route-source a {
	color: var(--stw-route-accent);
}

.stw-route .stw-route-disclaimer {
	font-size: 0.8125rem;
	color: var(--stw-route-muted);
	margin-top: 10px;
	line-height: 1.5;
}

/*
 * Sponsor (STW_Routes_Sponsor).
 *
 * Two placements, two very different shapes:
 *
 *   INDEX - the sponsor's LOGO on the finder. A transparent PNG at a fixed
 *   height (40px, 32px on phones) with its width following from the file's
 *   own proportions, sitting beneath the "sponsored by" label. It is
 *   deliberately NOT full width: a banner across the top of the map read as
 *   an advert, a logo reads as a sponsorship. The <picture> around it swaps a
 *   light-background logo for a dark-background one via prefers-color-scheme,
 *   the same signal the rest of this stylesheet uses for its dark palette.
 *
 *   SINGLE - the 350x90 BANNER in the route-page column, filling the column
 *   width (width:100% / height:auto), with the label above it.
 *
 * The empty slot (dashed outline) is only ever rendered for users who hold
 * the manage-sponsor capability, so readers never see it.
 */
.stw-route-sponsor {
	margin: 0 0 20px;
}

.stw-route .stw-route-sponsor-label {
	display: block;
	font-size: 0.6875rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--stw-route-muted);
	margin: 0 0 6px;
}

.stw-route .stw-route-sponsor-link {
	display: block;
	line-height: 0;
	text-decoration: none;
	border: 0;
}

/* Finder: label on its own line, logo beneath it at a fixed height. */
.stw-route-sponsor--index {
	margin: 4px 0 22px;
}

.stw-route .stw-route-sponsor--index .stw-route-sponsor-label {
	margin: 0 0 8px;
}

.stw-route .stw-route-sponsor--index .stw-route-sponsor-link {
	display: inline-block;
}

.stw-route-sponsor--index img {
	display: block;
	height: 40px;
	width: auto;
	max-width: 260px;
	object-fit: contain;
}

@media (max-width: 600px) {
	.stw-route-sponsor--index img {
		height: 32px;
		max-width: 200px;
	}
}

/* Route page: the banner fills the column. */
.stw-route-sponsor--single {
	margin: 0 0 18px;
}

.stw-route-sponsor--single img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	border-radius: 4px;
}

/* Editors/sales only: where the sponsor will go once a booking is live. */
.stw-route .stw-route-sponsor-slot {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 90px;
	border: 1px dashed var(--stw-route-rule);
	border-radius: 4px;
	background: var(--stw-route-panel);
	color: var(--stw-route-muted);
	font-size: 0.8125rem;
	text-decoration: none;
	padding: 8px 12px;
	text-align: center;
}

.stw-route .stw-route-sponsor-slot:hover,
.stw-route .stw-route-sponsor-slot:focus {
	color: var(--stw-route-accent);
	border-color: var(--stw-route-accent);
}

.stw-route-sponsor--index .stw-route-sponsor-slot {
	min-height: 40px;
	padding: 6px 16px;
}

/*
 * Member ride reports (STW_Routes_Reports).
 *
 * A panel at the foot of the ride notes: two questions as rows of toggle
 * buttons for members, a padlocked line for everyone else, beneath both the
 * aggregate once enough members have reported, and then the member comments.
 * Buttons are pills; the chosen one goes solid ink, which reads as "recorded"
 * without needing a tick or a colour that means something else (green here
 * would look like a verdict on the route).
 *
 * The comments are WordPress's own; the list is our markup, the form is
 * comment_form() with our classes, so the theme's comments.php is never
 * involved and a theme change cannot restyle it.
 */
.stw-route-reports {
	border-top: 1px solid var(--stw-route-rule);
	margin-top: 28px;
	padding-top: 22px;
}

.stw-route .stw-route-reports-head h2 {
	font-size: 1.25rem;
	margin: 0 0 6px;
	color: var(--stw-route-ink);
}

.stw-route .stw-route-reports-intro {
	color: var(--stw-route-muted);
	margin: 0 0 16px;
	max-width: 60ch;
	line-height: 1.5;
}

.stw-route-report-q {
	margin: 0 0 16px;
}

.stw-route .stw-route-report-label {
	display: block;
	font-weight: 600;
	font-size: 0.9375rem;
	margin: 0 0 8px;
	color: var(--stw-route-ink);
}

.stw-route .stw-route-report-sub {
	font-weight: 400;
	color: var(--stw-route-muted);
	font-size: 0.875rem;
}

.stw-route-report-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.stw-route .stw-route-report-btn {
	appearance: none;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	padding: 9px 14px;
	border-radius: 999px;
	border: 1.5px solid var(--stw-route-rule);
	background: var(--stw-route-surface);
	color: var(--stw-route-ink);
	cursor: pointer;
	transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.stw-route .stw-route-report-btn:hover,
.stw-route .stw-route-report-btn:focus-visible {
	border-color: var(--stw-route-accent);
	color: var(--stw-route-accent);
	outline: none;
}

.stw-route .stw-route-report-btn.is-on {
	background: var(--stw-route-ink);
	border-color: var(--stw-route-ink);
	color: var(--stw-route-surface);
}

.stw-route .stw-route-report-btn.is-on:hover,
.stw-route .stw-route-report-btn.is-on:focus-visible {
	color: var(--stw-route-surface);
	border-color: var(--stw-route-accent);
	background: var(--stw-route-accent);
}

.stw-route-report-form.is-saving .stw-route-report-btn {
	opacity: 0.7;
	cursor: progress;
}

.stw-route .stw-route-report-when {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.875rem;
	color: var(--stw-route-muted);
	margin-left: 6px;
}

.stw-route .stw-route-report-when input,
.stw-route .stw-route-report-note textarea {
	font: inherit;
	font-size: 0.875rem;
	color: var(--stw-route-ink);
	background: var(--stw-route-surface);
	border: 1.5px solid var(--stw-route-rule);
	border-radius: 6px;
	padding: 7px 10px;
}

.stw-route .stw-route-report-when input {
	color-scheme: light dark;
}

.stw-route-report-note {
	margin-top: 10px;
}

.stw-route .stw-route-report-note textarea {
	display: block;
	width: 100%;
	max-width: 56ch;
	box-sizing: border-box;
	resize: vertical;
	line-height: 1.45;
}

.stw-route .stw-route-report-note textarea:focus,
.stw-route .stw-route-report-when input:focus {
	border-color: var(--stw-route-accent);
	outline: none;
}

.stw-route .stw-route-report-note-hint {
	display: block;
	font-size: 0.75rem;
	color: var(--stw-route-muted);
	margin-top: 4px;
}

.stw-route-reports .is-hidden {
	display: none !important;
}

.stw-route .stw-route-report-status {
	min-height: 1.4em;
	font-size: 0.875rem;
	color: var(--stw-route-verified-ink);
	margin: 0 0 8px;
}

.stw-route .stw-route-report-status.is-error {
	color: var(--stw-route-accent);
}

/* Non-members: one padlocked line where the questions would be. */
.stw-route .stw-route-report-locked {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	background: var(--stw-route-panel);
	border: 1px solid var(--stw-route-rule);
	border-radius: 6px;
	padding: 12px 16px;
	margin: 0 0 16px;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--stw-route-muted);
}

.stw-route .stw-route-report-locked .stw-route-lock {
	margin-top: 9px;
	flex: none;
}

.stw-route .stw-route-report-locked a {
	color: var(--stw-route-accent);
	font-weight: 600;
}

/* The aggregate. */
.stw-route .stw-route-report-few {
	font-size: 0.875rem;
	color: var(--stw-route-muted);
	margin: 0 0 12px;
}

.stw-route-report-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1px;
	background: var(--stw-route-rule);
	border: 1px solid var(--stw-route-rule);
	border-radius: 6px;
	overflow: hidden;
	margin: 6px 0 18px;
}

.stw-route .stw-route-report-stat {
	background: var(--stw-route-panel);
	padding: 12px 16px;
	font-size: 0.9375rem;
	line-height: 1.45;
	color: var(--stw-route-ink);
}

.stw-route .stw-route-report-stat strong {
	font-size: 1.125rem;
	color: var(--stw-route-ink);
}

/* Member comments. */
.stw-route-comments {
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid var(--stw-route-rule);
}

.stw-route .stw-route-comments h3 {
	font-size: 1.0625rem;
	margin: 0 0 12px;
	color: var(--stw-route-ink);
}

.stw-route .stw-route-comment-list {
	list-style: none;
	margin: 0 0 18px;
	padding: 0;
}

.stw-route .stw-route-comment {
	display: flex;
	gap: 12px;
	padding: 12px 0;
	border-top: 1px solid var(--stw-route-rule);
	margin: 0;
}

.stw-route .stw-route-comment:first-child {
	border-top: 0;
	padding-top: 0;
}

.stw-route .stw-route-comment.is-pending {
	opacity: 0.75;
}

.stw-route .stw-route-comment-avatar {
	flex: none;
}

.stw-route .stw-route-comment-avatar img {
	display: block;
	width: 40px;
	height: 40px;
	border-radius: 50%;
}

.stw-route .stw-route-comment-body {
	flex: 1 1 auto;
	min-width: 0;
}

.stw-route .stw-route-comment-meta {
	font-size: 0.875rem;
	color: var(--stw-route-muted);
	margin-bottom: 4px;
}

.stw-route .stw-route-comment-meta strong {
	color: var(--stw-route-ink);
	margin-right: 6px;
}

.stw-route .stw-route-comment-pending {
	display: inline-block;
	margin-left: 6px;
	font-size: 0.75rem;
	color: var(--stw-route-accent);
}

.stw-route .stw-route-comment-text,
.stw-route .stw-route-comment-text p {
	font-size: 0.9375rem;
	font-weight: 400;
	line-height: 1.55;
	overflow-wrap: anywhere;
	color: var(--stw-route-ink);
}

.stw-route .stw-route-comment-text p {
	margin: 0 0 8px;
}

.stw-route .stw-route-comment-text p:last-child {
	margin-bottom: 0;
}

.stw-route .stw-route-comment-form-title {
	font-size: 0.9375rem;
	font-weight: 600;
	margin: 0 0 8px;
	color: var(--stw-route-ink);
}

.stw-route .stw-route-comment-form textarea {
	display: block;
	width: 100%;
	max-width: 64ch;
	box-sizing: border-box;
	font: inherit;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--stw-route-ink);
	background: var(--stw-route-surface);
	border: 1.5px solid var(--stw-route-rule);
	border-radius: 6px;
	padding: 9px 12px;
	resize: vertical;
}

.stw-route .stw-route-comment-form textarea:focus {
	border-color: var(--stw-route-accent);
	outline: none;
}

.stw-route .stw-route-comment-form .stw-route-comment-field,
.stw-route .stw-route-comment-form .stw-route-comment-submit {
	margin: 0 0 10px;
}

.stw-route .stw-route-comment-form .stw-route-comment-submit {
	margin-top: 6px;
}

/*
 * The theme dresses #respond as a boxed, orange-edged, white card for its own
 * comment pages. Inside the route sheet the form is part of the panel, so the
 * box goes - in both colour modes, since the white background is what would
 * break dark mode.
 */
.stw-route .stw-route-comments #respond.comment-respond,
.stw-route .stw-route-comments .comment-respond,
.stw-route .stw-route-comments form#commentform,
.stw-route .stw-route-comments form.stw-route-comment-form {
	border: 0;
	padding: 0;
	margin: 0;
	background: transparent;
	box-shadow: none;
	border-radius: 0;
}

.stw-route .stw-route-comments .comment-respond::before,
.stw-route .stw-route-comments .comment-respond::after,
.stw-route .stw-route-comments form.stw-route-comment-form::before,
.stw-route .stw-route-comments form.stw-route-comment-form::after {
	display: none;
}

/* comment_form() also prints a logged-in-as line and the reply title wrapper; we set both empty, so hide the leftovers. */
.stw-route .stw-route-comment-form .logged-in-as,
.stw-route .stw-route-comment-form .comment-notes {
	display: none;
}
