/* ==========================================================================
   STELSM-CLUB.RU — stelsm-blocks.css
   Custom design blocks for the stelsm/theme extension.
   --------------------------------------------------------------------------
   Colours/sizes come EXCLUSIVELY from the child-style design tokens
   (var(--token), see styles/stelsm-{light,dark}/theme/tokens.css).
   No literal hex/rgb here - the blocks re-skin automatically with the
   active light/dark theme.
   ========================================================================== */

/* --- Utilities ---------------------------------------------------------- */
.stelsm-mobile-only { display: none !important; }

/* B8: hide club-nav / footer-social links that have no configured URL.
   The extension supplies the real URL (or an empty value) via config; the
   child-style header/footer still render the <a> tags, so we neutralise the
   fake hrefs here until the child style consumes the S_STELSM_HAS_* flags. */
a.stelsm-clubnav__link[href=""] { display: none; }
a.stelsm-footer__social-link[href=""],
a.stelsm-footer__social-link[href="#"] { display: none; }

/* ==========================================================================
   HERO (§5, §6) — index only
   ========================================================================== */
.stelsm-hero {
	position: relative;
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	height: var(--hero-h);
	overflow: hidden;
	background: var(--bg-surface-muted);
	isolation: isolate;
}

.stelsm-hero__media { position: absolute; inset: 0; z-index: 0; }
.stelsm-hero__media picture { display: block; width: 100%; height: 100%; }
.stelsm-hero__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 58% 50%;
	filter: var(--img-filter);
}

.stelsm-hero__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: var(--hero-overlay);
}

.stelsm-hero__inner {
	position: relative;
	z-index: 2;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-6);
	width: min(var(--container-max), calc(100% - var(--container-gutter) * 2));
	margin-inline: auto;
}

.stelsm-hero__content {
	max-width: 560px;
	padding-block: var(--space-6);
}

.stelsm-hero__eyebrow {
	font-size: var(--text-xs);
	font-weight: var(--weight-semibold);
	letter-spacing: var(--tracking-wider);
	text-transform: uppercase;
	color: var(--text-secondary);
}

.stelsm-hero__title {
	margin-top: var(--space-3);
	margin-left: 0;
	margin-right: 0;
	font-family: var(--font-condensed);
	font-size: var(--text-hero);
	font-weight: var(--weight-heavy);
	line-height: 0.95;
	letter-spacing: var(--tracking-tight);
	text-transform: uppercase;
	color: var(--text-primary);
	text-shadow: var(--hero-text-shadow);
}
.stelsm-hero__accent { color: var(--accent-text); }

.stelsm-hero__text {
	margin-top: var(--space-4);
	max-width: 46ch;
	font-size: var(--text-md);
	line-height: var(--leading-relaxed);
	color: var(--text-secondary);
}

.stelsm-hero__actions {
	display: flex;
	align-items: center;
	gap: var(--space-4);
	margin-top: var(--space-6);
	flex-wrap: wrap;
}

.stelsm-hero__tags {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	letter-spacing: var(--tracking-wide);
	text-transform: uppercase;
	color: var(--text-secondary);
}

.stelsm-hero__hand {
	align-self: flex-end;
	margin-bottom: var(--space-10);
	font-family: var(--font-condensed);
	font-size: var(--text-xl);
	font-weight: var(--weight-bold);
	letter-spacing: var(--tracking-wide);
	text-transform: uppercase;
	color: var(--on-photo);
	background: var(--backdrop);
	padding: var(--space-1) var(--space-3);
	border-radius: var(--radius-pill);
	opacity: 1;
	transform: rotate(-3deg);
	text-shadow: var(--promo-text-shadow);
}

/* ==========================================================================
   BUTTONS (§27)
   ========================================================================== */
.stelsm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	height: 42px;
	padding: 0 18px;
	border: 1px solid transparent;
	border-radius: 10px;
	font-size: var(--text-base);
	font-weight: var(--weight-semibold);
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	text-decoration: none;
	transition: background-color var(--dur-hover) ease, color var(--dur-hover) ease, border-color var(--dur-hover) ease;
}
.stelsm-btn:hover { text-decoration: none; }

.stelsm-btn--primary { background: var(--accent-strong); color: var(--on-accent); }
.stelsm-btn--primary:hover { background: var(--accent-strong-hover); color: var(--on-accent); }
.stelsm-btn--primary:active { background: var(--accent-strong-active); color: var(--on-accent); }

.stelsm-btn--secondary {
	background: var(--bg-surface);
	border-color: var(--border-default);
	color: var(--text-primary);
}
.stelsm-btn--secondary:hover { background: var(--bg-surface-soft); color: var(--text-primary); }

.stelsm-btn--sm { height: 34px; padding: 0 12px; font-size: var(--text-sm); }

/* ==========================================================================
   STATS BAR (§15, §76) — index only
   ========================================================================== */
.stelsm-stats { margin-top: var(--space-4); }
.stelsm-stats__card {
	background: var(--bg-surface);
	border: 1px solid var(--border-soft);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
}
.stelsm-stats__list {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	align-items: center;
	min-height: var(--stats-h);
}
.stelsm-stat {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	padding: var(--space-3) var(--space-4);
	border-left: 1px solid var(--border-soft);
}
.stelsm-stat:first-child { border-left: 0; }
.stelsm-stat__icon {
	display: inline-flex;
	color: var(--accent-text);
	flex-shrink: 0;
}
.stelsm-stat__icon svg { width: 22px; height: 22px; }
.stelsm-stat__body { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.stelsm-stat__num {
	font-family: var(--font-condensed);
	font-size: var(--text-xl);
	font-weight: var(--weight-bold);
	color: var(--text-primary);
}
.stelsm-stat__label {
	font-size: var(--text-xs);
	color: var(--text-tertiary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ==========================================================================
   SIDEBAR (§18) — index only
   ========================================================================== */
.stelsm-sidebar {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
	margin-top: var(--space-4);
}

.stelsm-card {
	background: var(--bg-surface);
	border: 1px solid var(--border-soft);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
}
[data-theme="dark"] .stelsm-card { border-color: var(--border-default); box-shadow: none; }

.stelsm-card__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	padding: var(--space-4) var(--space-4) var(--space-3);
}
.stelsm-card__title { font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--text-primary); margin: 0; }
.stelsm-card__link { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--accent-text); }

/* --- Banner ------------------------------------------------------------- */
.stelsm-banner {
	padding: var(--space-5);
	background: var(--accent-soft);
	border: 1px solid var(--border-soft);
	border-radius: var(--radius-md);
}
.stelsm-banner__title {
	font-family: var(--font-condensed);
	font-size: var(--text-xl);
	font-weight: var(--weight-bold);
	text-transform: uppercase;
	letter-spacing: -0.3px;
	color: var(--text-primary);
	margin: 0;
}
.stelsm-banner__text { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--text-secondary); }
.stelsm-banner__actions { margin-top: var(--space-4); display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* --- Events ------------------------------------------------------------- */
.stelsm-event { display: flex; gap: var(--space-4); padding: var(--space-4); }
.stelsm-event + .stelsm-event { border-top: 1px solid var(--border-soft); }
.stelsm-event__date {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	flex-shrink: 0;
	border-radius: var(--radius-md);
	background: var(--accent-strong);
	color: var(--on-accent);
	line-height: 1;
}
.stelsm-event__day { font-family: var(--font-condensed); font-size: var(--text-xl); font-weight: var(--weight-bold); }
.stelsm-event__month { font-size: 10px; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-wide); text-transform: uppercase; }
.stelsm-event__body { min-width: 0; flex: 1; }
.stelsm-event__title { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--text-primary); margin: 0; }
.stelsm-event__place { display: flex; align-items: center; gap: 4px; margin-top: 3px; font-size: var(--text-xs); color: var(--text-tertiary); }
.stelsm-event__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-3); }
.stelsm-event__people { font-size: var(--text-xs); color: var(--text-secondary); }

/* --- Promo -------------------------------------------------------------- */
.stelsm-promo {
	position: relative;
	min-height: 220px;
	border-radius: var(--radius-md);
	overflow: hidden;
	isolation: isolate;
	background: var(--bg-surface-muted);
}
.stelsm-promo__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 30%;
	z-index: 0;
}
.stelsm-promo__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: var(--promo-overlay);
	/* OBS-2 (a11y): the white promo title sits on the photo and the flat token
	   scrim leaves the brightest photo pixels below 3:1 for large text.  A
	   bottom-heavy gradient lifts the worst case to >= 3:1 while the rider in
	   the upper part of the frame stays legible. */
	background-image: linear-gradient(
		to top,
		rgba(8, 6, 4, .52) 0%,
		rgba(8, 6, 4, .32) 55%,
		rgba(8, 6, 4, .08) 80%,
		rgba(8, 6, 4, 0) 100%
	);
}
.stelsm-promo__content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	height: 100%;
	min-height: 220px;
	padding: var(--space-5);
}
.stelsm-promo__title {
	font-family: var(--font-condensed);
	font-size: var(--text-2xl);
	font-weight: var(--weight-heavy);
	line-height: 0.98;
	text-transform: uppercase;
	color: var(--on-photo);
	text-shadow: var(--promo-text-shadow);
	margin: 0;
}
.stelsm-promo__link {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	margin-top: var(--space-4);
	font-size: var(--text-sm);
	font-weight: var(--weight-semibold);
	color: var(--on-photo);
}
.stelsm-promo__link:hover { color: var(--on-photo); }
.stelsm-promo__link svg { width: 16px; height: 16px; }

/* --- Popular ------------------------------------------------------------ */
.stelsm-popular-list { display: flex; flex-direction: column; }
.stelsm-popular-item { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border-soft); }
.stelsm-popular-item:first-child { border-top: 0; }
.stelsm-popular-item:hover { background: var(--bg-surface-soft); }
.stelsm-popular-item__rank {
	font-family: var(--font-condensed);
	font-size: var(--text-lg);
	font-weight: var(--weight-bold);
	color: var(--accent-text);
	width: 24px;
	flex-shrink: 0;
}
.stelsm-popular-item__body { min-width: 0; }
.stelsm-popular-item__title { font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--text-primary); margin: 0; }
.stelsm-popular-item__title a { color: var(--text-primary); }
.stelsm-popular-item__title a:hover { color: var(--accent-text); }
.stelsm-popular-item__meta { margin-top: 3px; font-size: var(--text-xs); color: var(--text-tertiary); }
.stelsm-popular-empty { padding: var(--space-4); font-size: var(--text-sm); color: var(--text-tertiary); }

/* ==========================================================================
   MOBILE TABS (§22) — index only
   ========================================================================== */
.stelsm-tabs {
	display: flex;
	gap: var(--space-2);
	margin: var(--space-3) 0;
	padding: var(--space-1);
	background: var(--bg-surface-muted);
	border-radius: var(--radius-md);
}
.stelsm-tab {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--touch-target);
	padding: 0 var(--space-3);
	border-radius: var(--radius-sm);
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	color: var(--text-secondary);
	text-decoration: none;
	white-space: nowrap;
}
.stelsm-tab:hover { color: var(--text-primary); background: var(--bg-surface); text-decoration: none; }
.stelsm-tab.is-selected {
	background: var(--accent-strong);
	color: var(--on-accent);
}

/* ==========================================================================
   RECENT TOPICS (§24) — mobile, index only
   ========================================================================== */
.stelsm-recent { margin-top: var(--space-4); }
.stelsm-recent-list { display: flex; flex-direction: column; }
.stelsm-recent-item {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: var(--space-3);
	padding: var(--space-3) var(--space-4);
	border-top: 1px solid var(--border-soft);
	text-decoration: none;
}
.stelsm-recent-item:first-child { border-top: 0; }
.stelsm-recent-item:hover { background: var(--bg-surface-soft); }
.stelsm-recent-item__avatar {
	width: 32px;
	height: 32px;
	flex-shrink: 0;
	border-radius: 50%;
	overflow: hidden;
}
.stelsm-recent-item__avatar img {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}
.stelsm-avatar--fallback {
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--bg-surface-muted);
	color: var(--icon-secondary);
}
.stelsm-avatar--fallback svg { width: 18px; height: 18px; }
.stelsm-recent-item__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stelsm-recent-item__title {
	font-size: var(--text-base);
	font-weight: var(--weight-medium);
	color: var(--text-primary);
}
.stelsm-recent-item__meta { font-size: var(--text-xs); color: var(--text-tertiary); }

/* ==========================================================================
   BURGER (mobile header trigger)
   ========================================================================== */
.stelsm-burger {
	display: none;
	align-items: center;
	justify-content: center;
	width: var(--touch-target);
	height: var(--touch-target);
	padding: 0;
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--icon-primary);
	cursor: pointer;
}
.stelsm-burger svg { width: 22px; height: 22px; }

/* ==========================================================================
   MOBILE BOTTOM NAV + FAB (§21, §56, §57)
   ========================================================================== */
.stelsm-bottom-nav {
	display: none;
	position: fixed;
	left: 0; right: 0; bottom: 0;
	z-index: var(--z-nav);
	height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
	padding-bottom: env(safe-area-inset-bottom);
	background: var(--bg-surface);
	border-top: 1px solid var(--border-soft);
}
.stelsm-bottom-nav__list {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	height: var(--bottom-nav-h);
	align-items: center;
}
.stelsm-bottom-nav__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	height: 100%;
	min-width: var(--touch-target);
	font-size: 10px;
	font-weight: var(--weight-medium);
	color: var(--text-tertiary);
	text-decoration: none;
}
.stelsm-bottom-nav__item:hover { color: var(--text-secondary); text-decoration: none; }
.stelsm-bottom-nav__item svg { width: 22px; height: 22px; }
.stelsm-bottom-nav__item[aria-current="page"] { color: var(--accent-text); }
.stelsm-bottom-nav__item--fab { position: relative; }

.stelsm-fab {
	position: absolute;
	top: -22px;
	left: 50%;
	transform: translateX(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--accent-strong);
	color: var(--on-accent);
	border: 4px solid var(--bg-page);
	box-shadow: var(--shadow-md);
	cursor: pointer;
	transition: background-color var(--dur-hover) ease, transform var(--dur-hover) ease;
}
.stelsm-fab:hover { background: var(--accent-strong-hover); }
.stelsm-fab:active { background: var(--accent-strong-active); }
.stelsm-fab svg { width: 26px; height: 26px; }

/* ==========================================================================
   DRAWER (§20)
   ========================================================================== */
.stelsm-drawer-backdrop {
	position: fixed;
	inset: 0;
	z-index: var(--z-drawer-backdrop);
	background: var(--backdrop);
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--dur-drawer) ease, visibility var(--dur-drawer);
}
.stelsm-drawer-backdrop.is-open { opacity: 1; visibility: visible; }
.stelsm-drawer-backdrop:not(.is-open) { pointer-events: none; }

.stelsm-drawer {
	position: fixed;
	top: 0; left: 0; bottom: 0;
	z-index: var(--z-drawer);
	width: var(--drawer-w);
	max-width: 100%;
	display: flex;
	flex-direction: column;
	background: var(--bg-surface);
	border-right: 1px solid var(--border-soft);
	transform: translateX(-100%);
	visibility: hidden;
	transition: transform var(--dur-drawer) var(--ease-standard), visibility 0s linear var(--dur-drawer);
	padding-top: env(safe-area-inset-top);
	padding-bottom: env(safe-area-inset-bottom);
	overflow-y: auto;
}
.stelsm-drawer.is-open { transform: translateX(0); visibility: visible; transition-delay: 0s; }
.stelsm-drawer:not(.is-open) { pointer-events: none; }

.stelsm-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	padding: var(--space-4);
	border-bottom: 1px solid var(--border-soft);
}
.stelsm-brand__title { font-size: var(--text-lg); font-weight: var(--weight-heavy); letter-spacing: -0.5px; color: var(--text-primary); }
.stelsm-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--touch-target);
	height: var(--touch-target);
	padding: 0;
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--icon-primary);
	cursor: pointer;
}
.stelsm-icon-btn:hover { background: var(--bg-surface-muted); }
.stelsm-icon-btn svg { width: 20px; height: 20px; }

.stelsm-drawer__nav { padding: var(--space-2); }
.stelsm-drawer__link {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	min-height: 50px;
	padding: 0 var(--space-3);
	border-radius: var(--radius-sm);
	font-size: var(--text-md);
	font-weight: var(--weight-medium);
	color: var(--text-primary);
	text-decoration: none;
}
.stelsm-drawer__link svg { width: 20px; height: 20px; color: var(--icon-secondary); flex-shrink: 0; }
.stelsm-drawer__link:hover { background: var(--bg-surface-muted); color: var(--text-primary); text-decoration: none; }
.stelsm-drawer__link[aria-current="page"] { background: var(--accent-soft); color: var(--accent-on-soft); }
.stelsm-drawer__link[aria-current="page"] svg { color: var(--accent-on-soft); }
.stelsm-drawer__divider { height: 1px; margin: var(--space-2) var(--space-3); background: var(--border-soft); }

/* --- Drawer theme switch (§68) ----------------------------------------- */
.stelsm-drawer__theme { padding: var(--space-2) var(--space-3) var(--space-3); }
.stelsm-drawer__theme-label {
	display: block;
	padding: 0 var(--space-3);
	font-size: var(--text-xs);
	font-weight: var(--weight-semibold);
	letter-spacing: var(--tracking-wide);
	text-transform: uppercase;
	color: var(--text-tertiary);
}
.stelsm-drawer__theme-options {
	display: flex;
	gap: var(--space-1);
	margin-top: var(--space-2);
	padding: var(--space-1);
	background: var(--bg-surface-muted);
	border-radius: var(--radius-md);
}
.stelsm-theme-option {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--touch-target);
	padding: 0 var(--space-2);
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--text-secondary);
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	cursor: pointer;
	white-space: nowrap;
}
.stelsm-theme-option:hover { color: var(--text-primary); }
.stelsm-theme-option[aria-pressed="true"] {
	background: var(--accent-strong);
	color: var(--on-accent);
}

/* ==========================================================================
   BOTTOM SHEET (§57)
   ========================================================================== */
.stelsm-sheet-backdrop {
	position: fixed;
	inset: 0;
	z-index: var(--z-modal);
	background: var(--backdrop);
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--dur-sheet) ease, visibility var(--dur-sheet);
}
.stelsm-sheet-backdrop.is-open { opacity: 1; visibility: visible; }
.stelsm-sheet-backdrop:not(.is-open) { pointer-events: none; }

.stelsm-sheet {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	z-index: var(--z-modal);
	padding: var(--space-3) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom));
	background: var(--bg-surface-soft);
	border-radius: var(--radius-xl) var(--radius-xl) 0 0;
	border-top: 1px solid var(--border-default);
	transform: translateY(100%);
	visibility: hidden;
	transition: transform var(--dur-sheet) var(--ease-standard), visibility 0s linear var(--dur-sheet);
}
.stelsm-sheet.is-open { transform: translateY(0); visibility: visible; transition-delay: 0s; }
.stelsm-sheet:not(.is-open) { pointer-events: none; }

.stelsm-sheet__handle {
	width: 36px; height: 4px;
	margin: 0 auto var(--space-4);
	border-radius: var(--radius-pill);
	background: var(--border-default);
}
.stelsm-sheet__item {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	width: 100%;
	min-height: 52px;
	padding: 0 var(--space-3);
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--text-primary);
	font-size: var(--text-md);
	font-weight: var(--weight-medium);
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}
.stelsm-sheet__item:hover { background: var(--bg-surface-muted); color: var(--text-primary); text-decoration: none; }
.stelsm-sheet__item svg { width: 20px; height: 20px; color: var(--accent-text); }

/* ==========================================================================
   POPULAR PAGE (§B7)
   ========================================================================== */
.stelsm-popular-page { margin-top: var(--space-4); }
.stelsm-popular-page__head { padding: var(--space-2) var(--space-4) var(--space-4); }
.stelsm-popular-page__title {
	font-family: var(--font-condensed);
	font-size: var(--text-2xl);
	font-weight: var(--weight-bold);
	text-transform: uppercase;
	letter-spacing: -0.3px;
	color: var(--text-primary);
	margin: 0;
}
.stelsm-popular-page__intro { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--text-secondary); }
.stelsm-popular-page__list {
	list-style: none;
	margin: 0;
	padding: 0;
	background: var(--bg-surface);
	border: 1px solid var(--border-soft);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
}
[data-theme="dark"] .stelsm-popular-page__list { border-color: var(--border-default); box-shadow: none; }
.stelsm-popular-page__item { display: flex; gap: var(--space-3); padding: var(--space-4); border-top: 1px solid var(--border-soft); }
.stelsm-popular-page__item:first-child { border-top: 0; }
.stelsm-popular-page__rank {
	font-family: var(--font-condensed);
	font-size: var(--text-xl);
	font-weight: var(--weight-bold);
	color: var(--accent-text);
	width: 28px;
	flex-shrink: 0;
}
.stelsm-popular-page__body { min-width: 0; }
.stelsm-popular-page__topic { font-size: var(--text-md); font-weight: var(--weight-semibold); margin: 0; }
.stelsm-popular-page__topic a { color: var(--text-primary); }
.stelsm-popular-page__topic a:hover { color: var(--accent-text); }
.stelsm-popular-page__meta { margin-top: 3px; font-size: var(--text-xs); color: var(--text-tertiary); }
.stelsm-popular-page__author { margin-top: 3px; font-size: var(--text-xs); color: var(--text-tertiary); }
.stelsm-popular-page__empty { padding: var(--space-5); font-size: var(--text-sm); color: var(--text-tertiary); }

/* ==========================================================================
   INDEX GRID (§16, §70) — desktop: forum list + sidebar side-by-side
   ========================================================================== */
.stelsm-index-main { min-width: 0; }

@media (min-width: 1024px) {
	.stelsm-index-grid {
		display: grid;
		grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
		gap: var(--space-4);
		align-items: start;
	}
	.stelsm-index-grid .stelsm-sidebar { margin-top: 0; }
}

/* DEF-3 (§16, §18, §55): the child-style token defaults --sidebar-w to 390px
   for every width, but §16 asks for a 320–340px sidebar around ~1200px.  This
   file loads after the child style, so re-scope the variable for the compact
   desktop band (1024–1279) using the design system's own --sidebar-w-compact
   token; >=1280 keeps the full 390px.  Matches the child style's compact forum
   row band, which the frontend has extended to 1279. */
@media (min-width: 1024px) and (max-width: 1279px) {
	:root { --sidebar-w: var(--sidebar-w-compact, 330px); }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
body.is-stelsm-locked { overflow: hidden; }

/* Mobile ≤767: hero shrinks, compact stats, show bottom-nav/burger, hide
   desktop-only sidebar blocks. */
@media (max-width: 767px) {
	.stelsm-desktop-only { display: none !important; }
	.stelsm-mobile-only { display: block !important; }
	.stelsm-mobile-only--inline { display: inline-flex !important; }

	/* Reserve space for the fixed bottom nav so the footer stays readable
	   at maximum scroll (§21, §56). */
	body {
		padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + var(--space-4));
	}

	.stelsm-hero { height: var(--hero-h-mobile); }
	.stelsm-hero__inner { align-items: flex-start; }
	.stelsm-hero__content { max-width: 56%; padding-top: var(--space-6); }
	.stelsm-hero__eyebrow { display: none; }
	.stelsm-hero__title { margin-top: 0; font-size: clamp(30px, 9vw, 40px); line-height: 0.98; }
	.stelsm-hero__text { display: none; }
	.stelsm-hero__actions { margin-top: var(--space-4); }
	.stelsm-hero__tags { display: none; }
	.stelsm-hero__hand { display: none; }
	.stelsm-hero__img { object-position: 59% 55%; }

	.stelsm-stats { margin-top: var(--space-3); }
	.stelsm-stats__list { min-height: 0; }
	.stelsm-stat { flex-direction: column; align-items: flex-start; gap: 2px; padding: var(--space-2) var(--space-3); }
	.stelsm-stat:nth-child(n + 4) { display: none; }
	.stelsm-stat__icon svg { width: 18px; height: 18px; }
	.stelsm-stat__num { font-size: var(--text-lg); }
	.stelsm-stat__label { font-size: 11px; }

	.stelsm-sidebar { flex-direction: column; }
	.stelsm-sidebar__desktop-only { display: none !important; }

	.stelsm-burger { display: inline-flex; }
	.stelsm-bottom-nav { display: block; }

	.stelsm-btn { height: 46px; }
	.stelsm-btn--sm { height: var(--touch-target); }
}

/* Tablet 768–1023: sidebar stacks below content (single column). */
@media (min-width: 768px) and (max-width: 1023px) {
	.stelsm-sidebar { flex-direction: row; flex-wrap: wrap; }
	.stelsm-sidebar > * { flex: 1 1 320px; }
}

@media (max-width: 479px) {
	.stelsm-hero__content { max-width: 62%; }
	.stelsm-stat:nth-child(n + 4) { display: none; }
}

/* Reduced motion (§41) */
@media (prefers-reduced-motion: reduce) {
	.stelsm-hero *,
	.stelsm-drawer,
	.stelsm-drawer-backdrop,
	.stelsm-sheet,
	.stelsm-sheet-backdrop,
	.stelsm-fab,
	.stelsm-btn {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
