/**
 * Ralify shared page shell and right-rail modules.
 *
 * Owns the two-column shell (.ralify-page) that the Worlds universe, the
 * Stories index and the single Story template all wrap their content in, plus
 * every module that sits in the rail.
 *
 * Scoped under .ralify-page and .ralify-rail-* only. Every token carries a
 * literal fallback so the rail still renders correctly if tokens.css fails.
 *
 * @package Ralify
 */

/* Page shell
   ------------------------------------------------------------------------ */

.ralify-page {
	--rr-bg: var(--ralify-color-midnight, #0b0f17);
	--rr-surface: var(--ralify-color-surface, #111827);
	--rr-raised: var(--ralify-color-surface-raised, #182233);
	--rr-text: var(--ralify-color-text, #f8fafc);
	--rr-muted: var(--ralify-color-text-muted, #94a3b8);
	--rr-border: var(--ralify-color-border, #273142);
	--rr-cyan: var(--ralify-color-cyan, #00e5ff);
	--rr-violet: var(--ralify-color-purple, #885cf6);
	--rr-blue: var(--ralify-color-blue, #2563eb);
	--rr-breaking: var(--ralify-color-breaking, #ff4d67);
	--rr-radius: var(--ralify-radius-lg, 16px);
	--rr-gap: var(--ralify-space-5, 24px);
	--rr-sticky-top: 24px;

	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
	align-items: start;
	gap: var(--rr-gap);
	color: var(--rr-text);
	font-family: var(--ralify-font, "Sora", sans-serif);
}

.ralify-page__breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--ralify-space-2, 8px);
	grid-column: 1 / -1;
	margin: 0 0 var(--ralify-space-1, 4px);
	color: var(--rr-muted);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.4;
}

.ralify-page__breadcrumb a {
	color: inherit;
	text-decoration: none;
	transition: color var(--ralify-transition, 180ms ease);
}

.ralify-page__breadcrumb a:hover {
	color: var(--rr-cyan);
}

.ralify-page__breadcrumb a:focus-visible {
	outline: 2px solid var(--rr-cyan);
	outline-offset: 3px;
	border-radius: var(--ralify-radius-sm, 8px);
}

.ralify-page__breadcrumb [aria-current="page"] {
	color: var(--rr-text);
}

/*
 * Grid children default to min-width:auto, so any child whose content is wider
 * than the column (a horizontal scroller, a long unbroken string) pushes the
 * column out and paints under the sticky rail. These two guards keep every
 * child inside its own column on every template.
 */
.ralify-page > *,
.ralify-page__main > *,
.ralify-page__rail > * {
	min-width: 0;
	max-width: 100%;
}

.ralify-page__main {
	display: grid;
	min-width: 0;
	align-content: start;
	gap: clamp(20px, 3vw, 36px);
}

/*
 * Templates that render no rail (Universes archive, single Story since the
 * rails moved below the article) still sit inside the two-column .ralify-page
 * grid, so without this the content is pinned to column one and column two is
 * dead space.
 */
.ralify-page__main--full {
	grid-column: 1 / -1;
}

/*
 * Post-article modules on a single Story.
 *
 * These four cards (Story Info, Related, Trending, newsletter signup) are peers,
 * so they are laid out as a fixed 4-up grid that steps down to 2-up and then
 * 1-up, rather than auto-fit. auto-fit sizes columns from available space and
 * left the last row half-empty at some widths; a fixed track count keeps the
 * rows whole at every breakpoint.
 *
 * `align-items: stretch` plus a full-height rule on the children is what makes
 * them read as one component set: without it each card is only as tall as its
 * own content, so Related (4 items) and Trending (6 items) rendered at visibly
 * different heights side by side.
 */
.ralify-story__after {
	display: grid;
	grid-column: 1 / -1;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	align-items: stretch;
	gap: var(--ralify-space-5, 24px);
	margin-block-start: clamp(32px, 5vw, 56px);
	padding-block-start: clamp(28px, 4vw, 44px);
	border-top: 1px solid var(--rr-border);
}

@media (max-width: 1200px) {
	.ralify-story__after {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/*
 * Index-page variant (News / Stories listing). That page renders three rail
 * cards, not four, so the base 4-up track list left a permanently empty
 * column on the right and squeezed Trending into a quarter-width box that
 * truncated every headline. Here Trending is the lead card and takes double
 * width, with the newsletter signup beside it and Rally+ closing the row.
 */
.ralify-story__after--lead {
	grid-template-columns: 2fr minmax(0, 1fr) minmax(0, 1fr);
}

@media (max-width: 1200px) {
	.ralify-story__after--lead {
		grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
	}
}

@media (max-width: 680px) {
	.ralify-story__after--lead {
		grid-template-columns: minmax(0, 1fr);
	}
}

/*
 * Solo variant. The News index now ends on a single Morning Brief capture,
 * so the grid collapses to one full-width track at every breakpoint. The
 * newsletter card was authored for a narrow sidebar cell, so its inner
 * layout is widened here: intro copy on the left, form on the right, rather
 * than a stacked column stranded in the middle of a wide row.
 */
.ralify-story__after--solo {
	grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 861px) {
	.ralify-story__after--solo .ralify-rail-newsletter {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
		align-items: center;
		gap: clamp(24px, 4vw, 48px);
	}

	.ralify-story__after--solo .ralify-rail-newsletter__intro {
		margin-block-end: 0;
	}

	.ralify-story__after--solo .ralify-rail-newsletter__form {
		margin-block-start: 0;
	}
}

@media (max-width: 680px) {
	.ralify-story__after {
		grid-template-columns: minmax(0, 1fr);
	}
}

/*
 * Equal height. The rail cards were built for a stacked sidebar where height
 * was free, so each sets its own. In a row they need to fill the cell.
 */
.ralify-story__after > .ralify-rail-card,
.ralify-story__after > section,
.ralify-story__after > div {
	display: flex;
	height: 100%;
	flex-direction: column;
}

/*
 * Scroll the long lists rather than letting one card set the row height. Six
 * trending items next to a four-line signup form otherwise stretches every
 * sibling to match the tallest.
 */
.ralify-story__after .ralify-rail-card__list,
.ralify-story__after .ralify-rail-list {
	min-height: 0;
	flex: 1 1 auto;
}

.ralify-story__after > * {
	min-width: 0;
	max-width: 100%;
}

.ralify-page__rail {
	position: sticky;
	top: var(--rr-sticky-top);
	display: grid;
	min-width: 0;
	align-content: start;
	gap: var(--ralify-space-4, 16px);
}

/* Rail card base
   ------------------------------------------------------------------------ */

.ralify-rail-card {
	display: grid;
	gap: var(--ralify-space-3, 12px);
	padding: var(--ralify-space-4, 16px);
	border: 1px solid var(--ralify-color-border, #273142);
	border-radius: var(--ralify-radius-lg, 16px);
	background: var(--ralify-color-surface, #111827);
	color: var(--ralify-color-text, #f8fafc);
	font-family: var(--ralify-font, "Sora", sans-serif);
}

.ralify-rail-card__header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--ralify-space-3, 12px);
}

.ralify-rail-card__title {
	margin: 0;
	color: var(--ralify-color-text, #f8fafc);
	font-size: 0.6875rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	line-height: 1.3;
	text-transform: uppercase;
}

.ralify-rail-card__link {
	flex: 0 0 auto;
	color: var(--ralify-color-cyan, #00e5ff);
	font-size: 0.6875rem;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
	white-space: nowrap;
	transition: color var(--ralify-transition, 180ms ease);
}

.ralify-rail-card__link:hover {
	color: #72f1ff;
	text-decoration: underline;
}

.ralify-rail-card__link:focus-visible {
	outline: 2px solid var(--ralify-color-cyan, #00e5ff);
	outline-offset: 3px;
	border-radius: var(--ralify-radius-sm, 8px);
}

.ralify-rail-card__empty {
	margin: 0;
	color: var(--ralify-color-text-muted, #94a3b8);
	font-size: 0.8125rem;
	line-height: 1.5;
	text-wrap: pretty;
}

.ralify-rail-card__footer {
	margin-top: var(--ralify-space-1, 4px);
}

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

/* Shared thumbnails
   ------------------------------------------------------------------------ */

.ralify-rail-thumb {
	display: block;
	overflow: hidden;
	flex: 0 0 auto;
	border: 1px solid var(--ralify-color-border, #273142);
	border-radius: var(--ralify-radius-md, 12px);
	background: var(--ralify-color-surface-raised, #182233);
}

.ralify-rail-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ralify-rail-thumb--empty {
	background:
		radial-gradient(circle at 30% 25%, rgba(136, 92, 246, 0.35), transparent 60%),
		linear-gradient(140deg, #17233d, #0b0f17);
}

.ralify-rail-thumb--xs {
	width: 44px;
	height: 44px;
	border-radius: var(--ralify-radius-sm, 8px);
}

.ralify-rail-thumb--sm {
	width: 56px;
	height: 56px;
}

.ralify-rail-thumb--wide {
	width: 72px;
	height: 56px;
}

/* Shared pills
   ------------------------------------------------------------------------ */

.ralify-rail-pill {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	padding: 3px 8px;
	border: 1px solid rgba(148, 163, 184, 0.34);
	border-radius: var(--ralify-radius-pill, 999px);
	background: rgba(148, 163, 184, 0.12);
	color: var(--ralify-color-text-muted, #94a3b8);
	font-size: 0.5625rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	line-height: 1;
	text-transform: uppercase;
	white-space: nowrap;
}

.ralify-rail-pill--new {
	border-color: rgba(0, 229, 255, 0.44);
	background: rgba(0, 229, 255, 0.13);
	color: #8beeff;
}

.ralify-rail-pill--live,
.ralify-rail-pill--released {
	border-color: rgba(48, 209, 88, 0.45);
	background: rgba(48, 209, 88, 0.14);
	color: #73e88d;
}

.ralify-rail-pill--upcoming {
	border-color: rgba(255, 176, 32, 0.46);
	background: rgba(255, 176, 32, 0.14);
	color: #ffd080;
}

.ralify-rail-pill--early-access {
	border-color: rgba(136, 92, 246, 0.52);
	background: rgba(136, 92, 246, 0.16);
	color: #c4b5fd;
}

/* Shared list rows (New Worlds, Categories, Related Stories)
   ------------------------------------------------------------------------ */

.ralify-rail-list {
	display: grid;
	gap: var(--ralify-space-1, 4px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.ralify-rail-list__item {
	margin: 0;
}

.ralify-rail-list__link {
	display: flex;
	align-items: center;
	gap: var(--ralify-space-3, 12px);
	min-height: 44px;
	padding: 6px;
	border: 1px solid transparent;
	border-radius: var(--ralify-radius-md, 12px);
	color: inherit;
	text-decoration: none;
	transition:
		background-color var(--ralify-transition, 180ms ease),
		border-color var(--ralify-transition, 180ms ease);
}

a.ralify-rail-list__link:hover {
	border-color: rgba(136, 92, 246, 0.28);
	background: rgba(136, 92, 246, 0.08);
}

a.ralify-rail-list__link:focus-visible {
	outline: 2px solid var(--ralify-color-cyan, #00e5ff);
	outline-offset: 2px;
}

.ralify-rail-list__body {
	display: grid;
	min-width: 0;
	flex: 1 1 auto;
	gap: 3px;
}

.ralify-rail-list__title {
	overflow: hidden;
	color: var(--ralify-color-text, #f8fafc);
	font-size: 0.8125rem;
	font-weight: 700;
	line-height: 1.35;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ralify-rail-list__title--clamp {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	white-space: normal;
}

.ralify-rail-list__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 5px;
	color: var(--ralify-color-text-muted, #94a3b8);
	font-size: 0.6875rem;
	font-weight: 600;
	line-height: 1.3;
}

.ralify-rail-list__dot {
	opacity: 0.6;
}

/* Trending Stories
   ------------------------------------------------------------------------ */

.ralify-rail-trending {
	display: grid;
	gap: var(--ralify-space-2, 8px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.ralify-rail-trending__item {
	display: flex;
	align-items: center;
	gap: var(--ralify-space-3, 12px);
	min-height: 56px;
}

.ralify-rail-trending__rank {
	display: grid;
	width: 26px;
	height: 26px;
	flex: 0 0 26px;
	place-items: center;
	border: 1px solid rgba(0, 229, 255, 0.4);
	border-radius: 50%;
	background: rgba(0, 229, 255, 0.1);
	color: var(--ralify-color-cyan, #00e5ff);
	font-size: 0.6875rem;
	font-variant-numeric: tabular-nums;
	font-weight: 800;
	line-height: 1;
}

.ralify-rail-trending__body {
	display: grid;
	min-width: 0;
	flex: 1 1 auto;
	gap: 4px;
}

.ralify-rail-trending__title {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	color: var(--ralify-color-text, #f8fafc);
	font-size: 0.8125rem;
	font-weight: 700;
	line-height: 1.35;
	text-decoration: none;
	transition: color var(--ralify-transition, 180ms ease);
}

.ralify-rail-trending__title:hover {
	color: var(--ralify-color-cyan, #00e5ff);
}

.ralify-rail-trending__title:focus-visible {
	outline: 2px solid var(--ralify-color-cyan, #00e5ff);
	outline-offset: 3px;
	border-radius: var(--ralify-radius-sm, 8px);
}

.ralify-rail-trending__meta {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--ralify-color-text-muted, #94a3b8);
	font-size: 0.6875rem;
	font-weight: 600;
	line-height: 1.3;
}

.ralify-rail-trend {
	display: inline-flex;
	align-items: center;
}

.ralify-rail-trend svg {
	width: 12px;
	height: 12px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2.2;
}

/*
 * The trend arrow is a fixed-size glyph, not a scalable graphic. Astra and the
 * Gutenberg addons both ship broad `svg { width: 100% }`-style rules that beat
 * the single-class selector above and blew the arrow up to fill the meta row.
 * Higher specificity plus flex-basis pins it at icon size wherever it renders.
 */
.ralify-rail-trending__meta .ralify-rail-trend svg,
.ralify-rail-trend svg[width] {
	width: 12px !important;
	height: 12px !important;
	flex: 0 0 12px;
	max-width: 12px;
	max-height: 12px;
}

/* The wrapper itself must not stretch either: as a flex child with no basis it
   absorbed the free space in the meta row and dragged the glyph with it. */
.ralify-rail-trend {
	flex: 0 0 auto;
}

.ralify-rail-trending__meta {
	flex-wrap: nowrap;
}

.ralify-rail-trending__time {
	white-space: nowrap;
}

.ralify-rail-trend--up {
	color: var(--ralify-color-official, #30d158);
}

.ralify-rail-trend--down {
	color: var(--ralify-color-breaking, #ff4d67);
}

/* World Categories
   ------------------------------------------------------------------------ */

.ralify-rail-categories__tile {
	display: grid;
	width: 32px;
	height: 32px;
	flex: 0 0 32px;
	place-items: center;
	border: 1px solid hsl(var(--ralify-rail-hue, 210) 85% 62% / 0.4);
	border-radius: var(--ralify-radius-sm, 8px);
	background: hsl(var(--ralify-rail-hue, 210) 85% 60% / 0.16);
	color: hsl(var(--ralify-rail-hue, 210) 90% 75%);
}

.ralify-rail-categories__tile svg {
	width: 17px;
	height: 17px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.6;
}

.ralify-rail-categories__count {
	flex: 0 0 auto;
	color: var(--ralify-color-text-muted, #94a3b8);
	font-size: 0.6875rem;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	white-space: nowrap;
}

/* Rally+
   ------------------------------------------------------------------------ */

.ralify-rail-rally {
	position: relative;
	overflow: hidden;
	border-color: rgba(136, 92, 246, 0.38);
	background:
		radial-gradient(circle at 82% -10%, rgba(136, 92, 246, 0.28), transparent 58%),
		linear-gradient(160deg, rgba(37, 99, 235, 0.14), transparent 62%),
		var(--ralify-color-surface, #111827);
	text-align: center;
	justify-items: center;
}

.ralify-rail-rally__glyph {
	display: grid;
	width: 42px;
	height: 42px;
	place-items: center;
	border-radius: var(--ralify-radius-md, 12px);
	background: rgba(255, 176, 32, 0.14);
	color: var(--ralify-color-deal, #ffb020);
}

.ralify-rail-rally__glyph svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.7;
}

.ralify-rail-rally__title {
	margin: 0;
	color: var(--ralify-color-text, #f8fafc);
	font-size: 0.9375rem;
	font-weight: 800;
	letter-spacing: -0.01em;
	line-height: 1.3;
	text-wrap: balance;
}

.ralify-rail-rally__benefits {
	display: grid;
	gap: var(--ralify-space-2, 8px);
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	text-align: left;
}

.ralify-rail-rally__benefit {
	display: flex;
	align-items: center;
	gap: var(--ralify-space-2, 8px);
	margin: 0;
	color: var(--ralify-color-text-muted, #94a3b8);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.4;
}

.ralify-rail-rally__check {
	display: grid;
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	place-items: center;
	border-radius: 50%;
	background: rgba(48, 209, 88, 0.16);
	color: var(--ralify-color-official, #30d158);
}

.ralify-rail-rally__check svg {
	width: 11px;
	height: 11px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2.4;
}

.ralify-rail-rally__cta {
	display: flex;
	width: 100%;
	min-height: 44px;
	align-items: center;
	justify-content: center;
	padding: 0 18px;
	border: 1px solid rgba(136, 92, 246, 0.7);
	border-radius: var(--ralify-radius-sm, 8px);
	background: var(--ralify-gradient-brand, linear-gradient(135deg, #2563eb, #885cf6));
	color: #fff;
	font-size: 0.8125rem;
	font-weight: 800;
	line-height: 1;
	text-decoration: none;
	box-shadow: 0 10px 28px rgba(37, 99, 235, 0.22);
	transition:
		transform var(--ralify-transition, 180ms ease),
		box-shadow var(--ralify-transition, 180ms ease);
}

.ralify-rail-rally__cta:hover {
	transform: translateY(-1px);
	color: #fff;
	box-shadow: 0 14px 34px rgba(136, 92, 246, 0.3);
}

.ralify-rail-rally__cta:focus-visible {
	outline: 2px solid var(--ralify-color-cyan, #00e5ff);
	outline-offset: 3px;
}

/* Newsletter
   ------------------------------------------------------------------------ */

.ralify-rail-newsletter__intro {
	display: flex;
	align-items: flex-start;
	gap: var(--ralify-space-3, 12px);
}

.ralify-rail-newsletter__glyph {
	display: grid;
	width: 36px;
	height: 36px;
	flex: 0 0 36px;
	place-items: center;
	border-radius: var(--ralify-radius-sm, 8px);
	background: rgba(0, 229, 255, 0.12);
	color: var(--ralify-color-cyan, #00e5ff);
}

.ralify-rail-newsletter__glyph svg {
	width: 19px;
	height: 19px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.7;
}

.ralify-rail-newsletter__copy {
	min-width: 0;
}

.ralify-rail-newsletter__title {
	margin: 0 0 4px;
	color: var(--ralify-color-text, #f8fafc);
	font-size: 0.875rem;
	font-weight: 800;
	letter-spacing: -0.01em;
	line-height: 1.3;
}

.ralify-rail-newsletter__body {
	margin: 0;
	color: var(--ralify-color-text-muted, #94a3b8);
	font-size: 0.75rem;
	line-height: 1.5;
	text-wrap: pretty;
}

.ralify-rail-newsletter__form {
	display: grid;
	gap: var(--ralify-space-2, 8px);
}

.ralify-rail-newsletter__input {
	width: 100%;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--ralify-color-border, #273142);
	border-radius: var(--ralify-radius-sm, 8px);
	background: rgba(11, 15, 23, 0.72);
	color: var(--ralify-color-text, #f8fafc);
	font-family: inherit;
	font-size: 0.8125rem;
	transition: border-color var(--ralify-transition, 180ms ease);
}

.ralify-rail-newsletter__input::placeholder {
	color: var(--ralify-color-text-muted, #94a3b8);
}

.ralify-rail-newsletter__input:focus {
	border-color: var(--ralify-color-cyan, #00e5ff);
	outline: none;
}

.ralify-rail-newsletter__input:focus-visible {
	outline: 2px solid var(--ralify-color-cyan, #00e5ff);
	outline-offset: 2px;
}

.ralify-rail-newsletter__submit {
	min-height: 44px;
	padding: 0 18px;
	border: 0;
	border-radius: var(--ralify-radius-sm, 8px);
	background: var(--ralify-gradient-brand, linear-gradient(135deg, #2563eb, #885cf6));
	color: #fff;
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
	transition: transform var(--ralify-transition, 180ms ease);
}

.ralify-rail-newsletter__submit:hover {
	transform: translateY(-1px);
}

.ralify-rail-newsletter__submit:focus-visible {
	outline: 2px solid var(--ralify-color-cyan, #00e5ff);
	outline-offset: 3px;
}

.ralify-rail-newsletter__note {
	margin: 0;
	color: var(--ralify-color-text-muted, #94a3b8);
	font-size: 0.625rem;
	font-weight: 600;
	line-height: 1.4;
}

.ralify-rail-newsletter--banner {
	grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
	align-items: center;
	padding: var(--ralify-space-5, 24px);
	column-gap: var(--ralify-space-5, 24px);
}

.ralify-rail-newsletter--banner .ralify-rail-newsletter__intro {
	grid-row: 1 / span 2;
	align-items: center;
}

.ralify-rail-newsletter--banner .ralify-rail-newsletter__title {
	font-size: 1.0625rem;
}

.ralify-rail-newsletter--banner .ralify-rail-newsletter__body {
	font-size: 0.8125rem;
}

.ralify-rail-newsletter--banner .ralify-rail-newsletter__form {
	grid-template-columns: minmax(0, 1fr) auto;
	align-self: end;
}

.ralify-rail-newsletter--banner .ralify-rail-newsletter__note {
	align-self: start;
}

/* Sponsored
   ------------------------------------------------------------------------ */

.ralify-rail-sponsored {
	position: relative;
	padding-bottom: 30px;
	border-style: dashed;
	border-color: rgba(148, 163, 184, 0.34);
}

.ralify-rail-sponsored__media {
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: var(--ralify-radius-md, 12px);
	background: var(--ralify-color-surface-raised, #182233);
}

.ralify-rail-sponsored__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ralify-rail-sponsored__media--empty {
	background:
		repeating-linear-gradient(
			135deg,
			rgba(148, 163, 184, 0.07),
			rgba(148, 163, 184, 0.07) 8px,
			transparent 8px,
			transparent 16px
		),
		var(--ralify-color-surface-raised, #182233);
}

.ralify-rail-sponsored__headline {
	margin: 0;
	color: var(--ralify-color-text, #f8fafc);
	font-size: 0.8125rem;
	font-weight: 700;
	line-height: 1.4;
	text-wrap: pretty;
}

.ralify-rail-sponsored__body {
	margin: 0;
	color: var(--ralify-color-text-muted, #94a3b8);
	font-size: 0.75rem;
	line-height: 1.5;
	text-wrap: pretty;
}

.ralify-rail-sponsored__label {
	position: absolute;
	right: var(--ralify-space-4, 16px);
	bottom: 10px;
	margin: 0;
	color: var(--ralify-color-text-muted, #94a3b8);
	font-size: 0.5625rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	line-height: 1;
	text-transform: uppercase;
}

/* Story Info
   ------------------------------------------------------------------------ */

.ralify-rail-info {
	display: grid;
	gap: var(--ralify-space-2, 8px);
	margin: 0;
}

.ralify-rail-info__row {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr);
	align-items: baseline;
	gap: var(--ralify-space-3, 12px);
	padding-bottom: var(--ralify-space-2, 8px);
	border-bottom: 1px solid rgba(39, 49, 66, 0.7);
}

.ralify-rail-info__row:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.ralify-rail-info__term {
	margin: 0;
	color: var(--ralify-color-text-muted, #94a3b8);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.4;
}

.ralify-rail-info__value {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--ralify-space-2, 8px);
	margin: 0;
	min-width: 0;
	color: var(--ralify-color-text, #f8fafc);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.4;
}

.ralify-rail-info__value a {
	color: inherit;
	text-decoration: none;
	transition: color var(--ralify-transition, 180ms ease);
}

.ralify-rail-info__value a:hover {
	color: var(--ralify-color-cyan, #00e5ff);
}

.ralify-rail-info__value a:focus-visible {
	outline: 2px solid var(--ralify-color-cyan, #00e5ff);
	outline-offset: 3px;
	border-radius: var(--ralify-radius-sm, 8px);
}

.ralify-rail-info__world,
.ralify-rail-info__source {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

.ralify-rail-info__world-name,
.ralify-rail-info__source-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ralify-rail-info__source-logo {
	display: grid;
	overflow: hidden;
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	place-items: center;
	border-radius: 4px;
	background: var(--ralify-color-surface-raised, #182233);
}

.ralify-rail-info__source-logo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ralify-rail-info__verified {
	display: inline-flex;
	flex: 0 0 auto;
	color: var(--ralify-color-cyan, #00e5ff);
}

.ralify-rail-info__verified svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.6;
}

/* Story filters
   ------------------------------------------------------------------------ */

.ralify-rail-filters__form {
	display: grid;
	gap: var(--ralify-space-4, 16px);
}

.ralify-rail-filters__group {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.ralify-rail-filters__legend {
	padding: 0;
	margin-bottom: var(--ralify-space-2, 8px);
	color: var(--ralify-color-text-muted, #94a3b8);
	font-size: 0.625rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	line-height: 1.3;
	text-transform: uppercase;
}

.ralify-rail-filters__checks {
	display: grid;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
	max-height: 268px;
	overflow-y: auto;
}

.ralify-rail-filters__check {
	display: flex;
	align-items: center;
	gap: var(--ralify-space-2, 8px);
	min-height: 44px;
	padding: 0 8px;
	border: 1px solid transparent;
	border-radius: var(--ralify-radius-sm, 8px);
	color: var(--ralify-color-text, #f8fafc);
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	transition: background-color var(--ralify-transition, 180ms ease);
}

.ralify-rail-filters__check:hover {
	background: rgba(136, 92, 246, 0.08);
}

.ralify-rail-filters__check input {
	width: 17px;
	height: 17px;
	flex: 0 0 17px;
	accent-color: var(--ralify-color-purple, #885cf6);
	cursor: pointer;
}

.ralify-rail-filters__check input:focus-visible {
	outline: 2px solid var(--ralify-color-cyan, #00e5ff);
	outline-offset: 2px;
}

.ralify-rail-filters__field {
	display: grid;
	gap: var(--ralify-space-1, 4px);
	margin: 0;
}

.ralify-rail-filters__label {
	color: var(--ralify-color-text-muted, #94a3b8);
	font-size: 0.625rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	line-height: 1.3;
	text-transform: uppercase;
}

.ralify-rail-filters__select {
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	padding: 0 32px 0 12px;
	border: 1px solid var(--ralify-color-border, #273142);
	border-radius: var(--ralify-radius-sm, 8px);
	background-color: rgba(11, 15, 23, 0.72);
	background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%);
	background-position: right 15px center, right 10px center;
	background-repeat: no-repeat;
	background-size: 5px 5px, 5px 5px;
	color: var(--ralify-color-text, #f8fafc);
	font-family: inherit;
	font-size: 0.8125rem;
	cursor: pointer;
	appearance: none;
}

.ralify-rail-filters__select:focus-visible {
	border-color: var(--ralify-color-cyan, #00e5ff);
	outline: 2px solid var(--ralify-color-cyan, #00e5ff);
	outline-offset: 2px;
}

.ralify-rail-filters__select option {
	background: var(--ralify-color-surface, #111827);
	color: var(--ralify-color-text, #f8fafc);
}

.ralify-rail-filters__submit {
	margin-top: var(--ralify-space-1, 4px);
}

/* Responsive
   ------------------------------------------------------------------------ */

@media (max-width: 1080px) {
	.ralify-page {
		grid-template-columns: minmax(0, 1fr);
	}

	.ralify-page__rail {
		position: static;
		top: auto;
		grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
		align-items: start;
	}
}

@media (max-width: 700px) {
	.ralify-page {
		--rr-gap: var(--ralify-space-4, 16px);

		grid-template-columns: minmax(0, 1fr);
	}

	.ralify-page__rail {
		grid-template-columns: minmax(0, 1fr);
	}

	.ralify-rail-card {
		padding: var(--ralify-space-4, 16px) var(--ralify-space-3, 12px);
		border-right: 0;
		border-left: 0;
		border-radius: 0;
	}

	.ralify-rail-sponsored {
		border-right: 1px dashed rgba(148, 163, 184, 0.34);
		border-left: 1px dashed rgba(148, 163, 184, 0.34);
		border-radius: var(--ralify-radius-lg, 16px);
	}

	.ralify-rail-newsletter--banner {
		grid-template-columns: minmax(0, 1fr);
	}

	.ralify-rail-newsletter--banner .ralify-rail-newsletter__intro {
		grid-row: auto;
	}

	.ralify-rail-newsletter--banner .ralify-rail-newsletter__form {
		grid-template-columns: minmax(0, 1fr);
	}

	.ralify-rail-info__row {
		grid-template-columns: minmax(0, 1fr);
		gap: 2px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ralify-page__breadcrumb a,
	.ralify-rail-card__link,
	.ralify-rail-list__link,
	.ralify-rail-trending__title,
	.ralify-rail-rally__cta,
	.ralify-rail-newsletter__input,
	.ralify-rail-newsletter__submit,
	.ralify-rail-filters__check,
	.ralify-rail-info__value a {
		transition: none;
	}

	.ralify-rail-rally__cta:hover,
	.ralify-rail-newsletter__submit:hover {
		transform: none;
	}
}
