/* ==========================================================================
   Release notes — "engineering changelog" layout
   Built on the site tokens: --bs-base-color (#0c3e51), --bs-ok, --bs-mostly.
   No external fonts, no extra JS libraries, Bootstrap 5 + bootstrap-icons only.
   ========================================================================== */

.rn-shell {
	--rn-base: var(--bs-base-color);
	--rn-line: rgba(12, 62, 81, 0.16);
	--rn-line-soft: rgba(12, 62, 81, 0.08);
	--rn-ink-soft: rgba(12, 62, 81, 0.62);
	--rn-card-bg: #fff;
	--rn-wash: rgba(12, 62, 81, 0.035);
	position: relative;
	padding: 3rem 0 4.5rem;
	background:
		radial-gradient(120% 60% at 50% -10%, var(--rn-wash), transparent 60%),
		var(--bs-body-bg);
}

/* Faint engineering grid behind the timeline; decorative only. */
.rn-shell::before {
	content: '';
	position: absolute;
	inset: 0 0 auto;
	height: 420px;
	background-image:
		linear-gradient(to right, var(--rn-line-soft) 1px, transparent 1px),
		linear-gradient(to bottom, var(--rn-line-soft) 1px, transparent 1px);
	background-size: 64px 64px;
	mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
	-webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
	pointer-events: none;
}

.rn-layout {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2rem;
}

@media (min-width: 992px) {
	.rn-layout {
		grid-template-columns: 250px minmax(0, 1fr);
		gap: 3.25rem;
	}
}

/* ---------- Left rail: search, filters, version index ---------- */

.rn-rail {
	min-width: 0;
}

@media (min-width: 992px) {

	/* The rail never outgrows the viewport: search and filters stay put,
	   the version index scrolls on its own, the CTA stays at the bottom. */
	.rn-rail {
		position: sticky;
		top: 110px;
		align-self: start;
		display: flex;
		flex-direction: column;
		max-height: calc(100vh - 130px);
	}

	.rn-rail > * {
		flex: 0 0 auto;
	}

	.rn-rail > .rn-rail-scroll {
		flex: 1 1 auto;
		min-height: 0;
		margin-bottom: 1.25rem;
		padding-right: .6rem;
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
		scrollbar-color: var(--rn-line) transparent;
		/* Soft edges hint that the list continues. */
		mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 24px), transparent 100%);
		-webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 24px), transparent 100%);
	}

	.rn-rail-scroll::-webkit-scrollbar {
		width: 6px;
	}

	.rn-rail-scroll::-webkit-scrollbar-thumb {
		background: var(--rn-line);
		border-radius: 3px;
	}

	.rn-rail-scroll:hover::-webkit-scrollbar-thumb {
		background: rgba(12, 62, 81, .35);
	}
}

.rn-rail-title {
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--rn-ink-soft);
	margin: 0 0 .75rem;
}

.rn-search {
	position: relative;
	margin-bottom: 1.5rem;
}

.rn-search .bi {
	position: absolute;
	top: 50%;
	left: .8rem;
	transform: translateY(-50%);
	color: var(--rn-ink-soft);
	pointer-events: none;
}

.rn-search input {
	width: 100%;
	padding: .55rem .8rem .55rem 2.25rem;
	font-size: .9rem;
	color: var(--bs-body-color);
	background: var(--rn-card-bg);
	border: 1px solid var(--rn-line);
	border-radius: 2rem;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.rn-search input:focus {
	outline: 0;
	border-color: var(--rn-base);
	box-shadow: 0 0 0 .2rem rgba(12, 62, 81, 0.12);
}

.rn-filters {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem;
	margin-bottom: 1.75rem;
}

.rn-filter {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .3rem .7rem;
	font-size: .78rem;
	font-weight: 600;
	letter-spacing: .01em;
	color: var(--rn-ink-soft);
	background: transparent;
	border: 1px solid var(--rn-line);
	border-radius: 2rem;
	cursor: pointer;
	transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

.rn-filter:hover {
	color: var(--rn-base);
	border-color: var(--rn-base);
}

.rn-filter[aria-pressed="true"] {
	color: #fff;
	background: var(--rn-base);
	border-color: var(--rn-base);
}

.rn-index {
	list-style: none;
	margin: 0 0 1.75rem;
	padding: 0;
	border-left: 1px solid var(--rn-line);
}

.rn-index li + li {
	margin-top: .1rem;
}

.rn-index a {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: .5rem;
	padding: .3rem 0 .3rem .85rem;
	margin-left: -1px;
	font-size: .88rem;
	color: var(--rn-ink-soft);
	text-decoration: none;
	border-left: 2px solid transparent;
	transition: color .18s ease, border-color .18s ease;
}

.rn-index a:hover {
	color: var(--rn-base);
	border-left-color: var(--rn-line);
}

.rn-index a.is-current {
	color: var(--rn-base);
	font-weight: 700;
	border-left-color: var(--rn-base);
}

.rn-index a.is-muted {
	opacity: .35;
	pointer-events: none;
}

.rn-index .rn-index-note {
	font-size: .68rem;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--bs-ok);
}

.rn-rail-cta {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	padding: .6rem 1.1rem;
	font-size: .85rem;
	font-weight: 600;
	color: #fff;
	text-decoration: none;
	background: var(--rn-base);
	border-radius: 2rem;
	transition: transform .18s ease, box-shadow .18s ease;
}

.rn-rail-cta:hover {
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 8px 20px -10px rgba(12, 62, 81, .7);
}

/* Mobile: the index turns into a disclosure, filters scroll horizontally. */
.rn-rail-mobile {
	border: 1px solid var(--rn-line);
	border-radius: .75rem;
	background: var(--rn-card-bg);
	padding: .35rem .9rem;
	margin-bottom: 1.25rem;
}

.rn-rail-mobile > summary {
	cursor: pointer;
	padding: .5rem 0;
	font-size: .85rem;
	font-weight: 600;
	color: var(--rn-base);
}

@media (min-width: 992px) {
	.rn-rail-mobile {
		display: none;
	}
}

@media (max-width: 991.98px) {

	/* Desktop index only; the mobile disclosure keeps its own list. */
	.rn-rail > .rn-rail-scroll,
	.rn-rail .rn-rail-title--index {
		display: none;
	}

	.rn-filters {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-bottom: .35rem;
		scrollbar-width: none;
	}

	.rn-filters::-webkit-scrollbar {
		display: none;
	}

	.rn-filter {
		flex: 0 0 auto;
	}

	/* The theme centres text in this section on small screens. */
	.rn-rail,
	.rn-rail .rn-rail-title {
		text-align: left;
	}

	.rn-rail-title {
		margin-bottom: .5rem;
	}

	.rn-search,
	.rn-filters,
	.rn-rail-mobile {
		margin-bottom: 1rem;
	}

	.rn-rail-cta {
		margin-bottom: .5rem;
	}

	.rn-stream {
		padding-left: 1.4rem;
		text-align: left;
	}

	.rn-card {
		padding: 1.25rem 1.2rem;
	}

	.rn-release::before {
		left: -1.4rem;
	}
}

/* ---------- Timeline ---------- */

.rn-stream {
	position: relative;
	min-width: 0;
	padding-left: 1.85rem;
}

.rn-stream::before {
	content: '';
	position: absolute;
	top: .4rem;
	bottom: 2.5rem;
	left: .32rem;
	width: 2px;
	background: linear-gradient(to bottom, var(--rn-base) 0, var(--rn-line) 55%, transparent 100%);
}

.rn-release {
	position: relative;
	scroll-margin-top: 100px;
}

.rn-release + .rn-release {
	margin-top: 1.5rem;
}

/* Timeline node */
.rn-release::before {
	content: '';
	position: absolute;
	top: 1.75rem;
	left: -1.85rem;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: var(--bs-body-bg);
	border: 2px solid var(--rn-base);
	box-shadow: 0 0 0 4px var(--bs-body-bg);
	transition: background-color .2s ease, transform .2s ease;
}

.rn-release:hover::before {
	background: var(--rn-base);
}

.rn-release--latest::before {
	background: var(--rn-base);
	box-shadow: 0 0 0 4px var(--bs-body-bg), 0 0 0 7px rgba(12, 62, 81, .14);
}

.rn-card {
	position: relative;
	padding: 1.6rem 1.75rem 1.5rem;
	background: var(--rn-card-bg);
	border: 1px solid var(--rn-line);
	border-radius: .85rem;
	box-shadow: 0 1px 2px rgba(12, 62, 81, .04);
	transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}

.rn-card:hover {
	border-color: rgba(12, 62, 81, .3);
	box-shadow: 0 18px 38px -22px rgba(12, 62, 81, .45);
}

.rn-release--latest .rn-card {
	border-color: rgba(12, 62, 81, .35);
	box-shadow: 0 22px 45px -26px rgba(12, 62, 81, .5);
}

/* Thin accent strip on the latest release only. */
.rn-release--latest .rn-card::before {
	content: '';
	position: absolute;
	inset: 0 0 auto;
	height: 3px;
	border-radius: .85rem .85rem 0 0;
	background: linear-gradient(to right, var(--rn-base), rgba(12, 62, 81, .25));
}

.rn-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .5rem .9rem;
	margin-bottom: 1.15rem;
}

.rn-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .18rem .55rem;
	font-size: .66rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--bs-ok);
	background: rgba(33, 163, 102, .1);
	border-radius: 2rem;
}

.rn-version {
	margin: 0;
	font-size: clamp(1.3rem, 1.05rem + .7vw, 1.75rem);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -.015em;
	color: var(--rn-base);
}

.rn-version small {
	display: block;
	font-size: .66rem;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--rn-ink-soft);
}

.rn-anchor {
	margin-left: .35rem;
	font-size: .8rem;
	color: var(--rn-ink-soft);
	text-decoration: none;
	opacity: 0;
	transition: opacity .18s ease, color .18s ease;
}

.rn-card:hover .rn-anchor,
.rn-anchor:focus-visible {
	opacity: 1;
}

.rn-anchor:hover {
	color: var(--rn-base);
}

.rn-count {
	margin-left: auto;
	font-size: .76rem;
	color: var(--rn-ink-soft);
	white-space: nowrap;
}

/* Series groups in the rail */

.rn-series {
	border-bottom: 1px solid var(--rn-line-soft);
}

.rn-series > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .5rem;
	padding: .45rem .1rem;
	font-size: .82rem;
	font-weight: 700;
	letter-spacing: .02em;
	color: var(--rn-base);
	cursor: pointer;
	list-style: none;
}

.rn-series > summary::-webkit-details-marker {
	display: none;
}

.rn-series > summary::after {
	content: '\F282';
	font-family: 'bootstrap-icons';
	font-size: .7rem;
	font-weight: 400;
	color: var(--rn-ink-soft);
	transition: transform .18s ease;
}

.rn-series[open] > summary::after {
	transform: rotate(180deg);
}

.rn-series-count {
	margin-left: auto;
	margin-right: .35rem;
	font-size: .68rem;
	font-weight: 600;
	color: var(--rn-ink-soft);
}

.rn-series .rn-index {
	margin-bottom: .6rem;
}

/* Release date next to the version number */
.rn-date {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	align-self: center;
	font-size: .8rem;
	font-weight: 600;
	color: var(--rn-ink-soft);
	white-space: nowrap;
}

/* Cumulative-update note next to the version number */
.rn-note {
	align-self: center;
	padding: .15rem .5rem;
	font-size: .72rem;
	color: var(--rn-ink-soft);
	background: rgba(12, 62, 81, .05);
	border-radius: 2rem;
}

/* ---------- Items ---------- */

.rn-items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.rn-item + .rn-item {
	margin-top: 1.1rem;
	padding-top: 1.1rem;
	border-top: 1px solid var(--rn-line-soft);
}

.rn-item-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem;
	margin-bottom: .4rem;
}

.rn-tag {
	display: inline-flex;
	align-items: center;
	gap: .3rem;
	flex: 0 0 auto;
	padding: .15rem .55rem;
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	border-radius: .3rem;
}

.rn-tag--new {
	color: rgb(19, 108, 68);
	background: rgba(33, 163, 102, .13);
}

.rn-tag--improved {
	color: var(--rn-base);
	background: rgba(12, 62, 81, .1);
}

.rn-tag--fixed {
	color: rgb(146, 106, 6);
	background: rgba(236, 183, 29, .18);
}

.rn-item-title {
	font-weight: 700;
	color: var(--bs-emphasis-color);
}

.rn-item-body {
	margin: 0;
	color: var(--bs-body-color);
}

.rn-item-body > p:last-child,
.rn-item-body > ol:last-child,
.rn-item-body > ul:last-child {
	margin-bottom: 0;
}

/* URLs and other unbreakable strings in the notes */
.rn-item-body a {
	overflow-wrap: anywhere;
}

/* Nested change lists: teal counters instead of browser numbering. */
.rn-item-body ol {
	list-style: none;
	counter-reset: rn-sub;
	margin: .6rem 0 0;
	padding: 0;
}

.rn-item-body ol > li {
	counter-increment: rn-sub;
	position: relative;
	padding-left: 1.85rem;
}

.rn-item-body ol > li + li {
	margin-top: .45rem;
}

.rn-item-body ol > li::before {
	content: counter(rn-sub);
	position: absolute;
	top: .12rem;
	left: 0;
	display: grid;
	place-items: center;
	width: 1.25rem;
	height: 1.25rem;
	font-size: .7rem;
	font-weight: 700;
	color: var(--rn-base);
	background: rgba(12, 62, 81, .08);
	border-radius: .3rem;
}

/* Function / parameter names */
.rn-fn {
	padding: .08em .35em;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	font-size: .86em;
	color: var(--rn-base);
	background: rgba(12, 62, 81, .07);
	border-radius: .3rem;
	/* Long tokens (installer commands, signatures) must wrap on phones;
	   clone keeps the pill padding on every wrapped line. */
	overflow-wrap: anywhere;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

.rn-example {
	display: block;
	margin-top: .7rem;
	padding: .7rem .9rem;
	font-size: .92rem;
	color: var(--rn-ink-soft);
	background: rgba(12, 62, 81, .04);
	border-left: 2px solid var(--rn-line);
	border-radius: 0 .4rem .4rem 0;
}

/* Screenshots inside a release */
.rn-shot {
	display: block;
	max-width: 100%;
	margin: .9rem auto 0;
	border: 1px solid var(--rn-line);
	border-radius: .5rem;
	cursor: zoom-in;
}

/* ---------- Filtering / empty state ---------- */
/* Changelog source missing (ModelChoice) */
.rn-unavailable {
	padding: 3rem 1rem;
	text-align: center;
	color: var(--rn-ink-soft);
}


.rn-release[hidden],
.rn-item[hidden] {
	display: none;
}

.rn-empty {
	display: none;
	padding: 2.5rem 1rem;
	text-align: center;
	color: var(--rn-ink-soft);
}

.rn-stream.is-empty .rn-empty {
	display: block;
}

/* ---------- Reveal on scroll ---------- */

.rn-js .rn-release {
	opacity: 0;
	transform: translateY(14px);
}

.rn-js .rn-release.is-visible {
	opacity: 1;
	transform: none;
	transition: opacity .5s ease, transform .5s cubic-bezier(.22, .61, .36, 1);
}

@media (prefers-reduced-motion: reduce) {

	.rn-js .rn-release,
	.rn-js .rn-release.is-visible {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.rn-card,
	.rn-release::before,
	.rn-rail-cta {
		transition: none;
	}
}

/* ---------- Dark scheme (site tokens) ---------- */

[data-bs-theme="dark"] .rn-shell {
	--rn-base: #7cc4dd;
	--rn-line: rgba(124, 196, 221, .22);
	--rn-line-soft: rgba(124, 196, 221, .12);
	--rn-ink-soft: rgba(222, 226, 230, .7);
	--rn-card-bg: #262b30;
	--rn-wash: rgba(124, 196, 221, .06);
}

[data-bs-theme="dark"] .rn-fn,
[data-bs-theme="dark"] .rn-item-body ol > li::before {
	background: rgba(124, 196, 221, .12);
}

[data-bs-theme="dark"] .rn-rail-cta {
	color: #0c3e51;
	background: #7cc4dd;
}

/* ---------- Print ---------- */

@media print {

	.rn-rail,
	.rn-shell::before {
		display: none;
	}

	.rn-card {
		border-color: #999;
		box-shadow: none;
	}
}
