/*
 * عابرين — pages/blog.css
 * Blog templates: magazine posts page (home.php), category.php, the
 * "جميع المقالات" page template, single.php, page.php and full-width.php.
 * Blocks: cover story, numbered headlines, CSS-only categories ticker,
 * editorial rows, article rows/cards, post cards, single article header/
 * content/footer, TOC, author box, related posts, comments, sidebar widgets,
 * filter rail and author hero. Handle: stv-page-blog.
 */

/* ===== Shared meta line ===== */
.stv-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--stv-space-1) var(--stv-space-3);
	font-size: var(--stv-font-size-xs);
	color: var(--stv-color-text-muted);
}

.stv-meta__item { display: inline-flex; align-items: center; gap: var(--stv-space-1); color: inherit; text-decoration: none; }
.stv-meta__item .stv-icon { font-size: 16px; color: var(--stv-color-text-faint); }
.stv-meta__item a { color: inherit; text-decoration: none; }

@media (hover: hover) {
	.stv-meta__item a:hover,
	a.stv-meta__item:hover {
		color: var(--stv-color-primary);
	}
}

/* ===== Magazine cover (posts page) ===== */
.stv-magazine { --stv-page-space-start: var(--stv-space-5); padding-block-end: var(--stv-space-8); } /* the header offset itself comes from .stv-main (layout.css) */
.stv-magazine__top { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--stv-space-5); align-items: start; margin-block-end: var(--stv-space-6); }
.stv-cover { overflow: hidden; border: 1px solid var(--stv-color-border); border-radius: var(--stv-radius-lg); background: var(--stv-color-surface); }
.stv-cover__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--stv-color-surface-2); }
.stv-cover__img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease-out; }
.stv-cover__img--empty { display: block; background: var(--stv-gradient-dark); }

@media (hover: hover) {
	.stv-cover:hover .stv-cover__img { transform: scale(1.03); }
}

.stv-cover__body { display: flex; flex-direction: column; gap: var(--stv-space-3); padding: var(--stv-space-5); }

.stv-cover__kicker {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--stv-space-2);
	font-size: var(--stv-font-size-xs);
	font-weight: var(--stv-weight-ui);
	color: var(--stv-color-primary);
	letter-spacing: .04em;
}

.stv-cover__title { font-size: var(--stv-font-size-2xl); font-weight: var(--stv-weight-heading); line-height: var(--stv-lh-heading); }
.stv-cover__link { color: inherit; text-decoration: none; }

@media (hover: hover) {
	.stv-cover__link:hover { color: var(--stv-color-primary); }
}

.stv-cover__excerpt { color: var(--stv-color-text-muted); }
.stv-cover__action { margin-block-start: var(--stv-space-2); }

/* Numbered headlines */
.stv-headlines {
	padding: var(--stv-space-5);
	border: 1px solid var(--stv-color-border);
	border-radius: var(--stv-radius-lg);
	background: var(--stv-color-surface);
}

.stv-headlines__title { margin-block-end: var(--stv-space-3); font-size: var(--stv-font-size-lg); font-weight: var(--stv-weight-heading); }
.stv-headlines__list { list-style: none; }

.stv-headlines__item {
	display: grid;
	grid-template-columns: 40px minmax(0, 1fr);
	gap: var(--stv-space-3);
	padding-block: var(--stv-space-3);
	border-block-end: 1px solid var(--stv-color-border);
}

.stv-headlines__item:last-child { border-block-end: 0; padding-block-end: 0; }

.stv-headlines__num {
	font-size: var(--stv-font-size-2xl);
	font-weight: var(--stv-weight-heading);
	line-height: 1.2;
	color: var(--stv-color-primary);
	opacity: .6;
}

.stv-headlines__body { display: flex; flex-direction: column; gap: var(--stv-space-1); min-width: 0; }
.stv-headlines__link { font-weight: var(--stv-weight-ui); color: var(--stv-color-text); text-decoration: none; line-height: 1.5; }

@media (hover: hover) {
	.stv-headlines__link:hover { color: var(--stv-color-primary); }
}

.stv-headlines__date { font-size: var(--stv-font-size-xs); color: var(--stv-color-text-muted); }

/* CSS-only categories ticker (track printed twice; rtl.css reverses direction) */
.stv-ticker {
	display: flex;
	align-items: center;
	gap: var(--stv-space-3);
	margin-block-end: var(--stv-space-6);
	padding-block: var(--stv-space-2);
	border-block: 1px solid var(--stv-color-border);
	overflow: hidden;
}

.stv-ticker__label {
	display: inline-flex;
	align-items: center;
	gap: var(--stv-space-1);
	flex: 0 0 auto;
	padding-inline-end: var(--stv-space-3);
	border-inline-end: 1px solid var(--stv-color-border);
	font-size: var(--stv-font-size-xs);
	font-weight: var(--stv-weight-ui);
	color: var(--stv-color-text-muted);
	white-space: nowrap;
}

.stv-ticker__viewport {
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	mask-image: linear-gradient(to right, transparent, #000000 8%, #000000 92%, transparent);
	-webkit-mask-image: linear-gradient(to right, transparent, #000000 8%, #000000 92%, transparent);
}

.stv-ticker__track {
	display: flex;
	flex: 0 0 auto;
	gap: var(--stv-space-3);
	width: max-content;
	padding-inline-end: var(--stv-space-3);
	list-style: none;
	animation: stv-ticker 40s linear infinite;
}

@keyframes stv-ticker {
	to { transform: translateX(-100%); }
}

@media (hover: hover) {
	.stv-ticker:hover .stv-ticker__track { animation-play-state: paused; }
}

.stv-ticker:focus-within .stv-ticker__track { animation-play-state: paused; }
.stv-ticker__item { flex: 0 0 auto; }
.stv-ticker__count { color: var(--stv-color-text-muted); }

/* Editorial rows */
.stv-editorial__head { margin-block-end: var(--stv-space-4); }
.stv-editorial__rows { gap: 0; }

/* ===== Article rows (date ledger) ===== */
.stv-article-row {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr);
	gap: var(--stv-space-4);
	padding-block: var(--stv-space-5);
	border-block-end: 1px solid var(--stv-color-border);
}

.stv-articles--list > .stv-article-row:first-child,
.stv-editorial__rows > .stv-article-row:first-child {
	padding-block-start: 0;
}

.stv-article-row__date { display: flex; flex-direction: column; align-items: center; text-align: center; }
.stv-article-row__time { display: flex; flex-direction: column; align-items: center; }
.stv-article-row__day { font-size: var(--stv-font-size-3xl); font-weight: var(--stv-weight-heading); line-height: 1; color: var(--stv-color-text); }

.stv-article-row__month {
	margin-block-start: var(--stv-space-1);
	font-size: var(--stv-font-size-xs);
	color: var(--stv-color-text-muted);
	text-transform: uppercase;
	letter-spacing: .06em;
}

.stv-article-row__thumb { display: none; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--stv-radius-md); background: var(--stv-color-surface-2); }
.stv-article-row__img { width: 100%; height: 100%; object-fit: cover; }
.stv-article-row__img--empty { display: block; background: var(--stv-gradient-dark); }
.stv-article-row__body { display: flex; flex-direction: column; gap: var(--stv-space-2); min-width: 0; }
.stv-article-row__cat { align-self: flex-start; }
.stv-article-row__title { font-size: var(--stv-font-size-xl); font-weight: var(--stv-weight-heading); line-height: var(--stv-lh-heading); }
.stv-article-row__link { color: inherit; text-decoration: none; }

@media (hover: hover) {
	.stv-article-row__link:hover { color: var(--stv-color-primary); }
}

.stv-article-row__excerpt {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	font-size: var(--stv-font-size-sm);
	color: var(--stv-color-text-muted);
}

/* ===== Article cards (index/archive/category grids) ===== */
.stv-article-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--stv-color-border);
	border-radius: var(--stv-radius-lg);
	background: var(--stv-color-surface);
	transition: transform var(--stv-transition), box-shadow var(--stv-transition), border-color var(--stv-transition);
}

@media (hover: hover) {
	.stv-article-card:hover { transform: var(--stv-lift); box-shadow: var(--stv-shadow-glow); border-color: transparent; }
}

.stv-article-card__media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--stv-color-surface-2); }
.stv-article-card__thumb { display: block; height: 100%; }
.stv-article-card__media img { width: 100%; height: 100%; object-fit: cover; }
.stv-article-card__body { display: flex; flex-direction: column; flex: 1 1 auto; gap: var(--stv-space-2); padding: var(--stv-space-4); }
.stv-article-card__category { align-self: flex-start; }
.stv-article-card__title { font-size: var(--stv-font-size-lg); font-weight: var(--stv-weight-heading); line-height: var(--stv-lh-heading); }
.stv-article-card__title a { color: inherit; text-decoration: none; }

@media (hover: hover) {
	.stv-article-card__title a:hover { color: var(--stv-color-primary); }
}

.stv-article-card__title--featured { font-size: var(--stv-font-size-2xl); }

.stv-article-card__excerpt {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	font-size: var(--stv-font-size-sm);
	color: var(--stv-color-text-muted);
}

.stv-article-card__more { align-self: flex-start; margin-block-start: auto; padding-inline: 0; }
.stv-article-card--row { flex-direction: row; }
.stv-article-card--row .stv-article-card__media { flex: 0 0 120px; aspect-ratio: 1 / 1; }
.stv-article-card--featured .stv-article-card__body { padding: var(--stv-space-5); }

/* ===== Post cards (related posts, category grid) ===== */
.stv-post-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border: 1px solid var(--stv-color-border);
	border-radius: var(--stv-radius-lg);
	background: var(--stv-color-surface);
	transition: transform var(--stv-transition), box-shadow var(--stv-transition), border-color var(--stv-transition);
}

@media (hover: hover) {
	.stv-post-card:hover { transform: var(--stv-lift); box-shadow: var(--stv-shadow-glow); border-color: transparent; }
}

.stv-post-card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--stv-color-surface-2); }
.stv-post-card__img { width: 100%; height: 100%; object-fit: cover; }
.stv-post-card__img--empty { display: block; background: var(--stv-gradient-dark); }
.stv-post-card__body { display: flex; flex-direction: column; flex: 1 1 auto; gap: var(--stv-space-2); padding: var(--stv-space-4); }
.stv-post-card__cat { align-self: flex-start; }

.stv-post-card__title {
	font-size: var(--stv-font-size-lg);
	font-weight: var(--stv-weight-heading);
	line-height: var(--stv-lh-heading);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.stv-post-card__link { color: inherit; text-decoration: none; }

@media (hover: hover) {
	.stv-post-card__link:hover { color: var(--stv-color-primary); }
}

.stv-post-card__excerpt {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	font-size: var(--stv-font-size-sm);
	color: var(--stv-color-text-muted);
}

.stv-post-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--stv-space-1) var(--stv-space-3);
	margin-block-start: auto;
	font-size: var(--stv-font-size-xs);
	color: var(--stv-color-text-muted);
}

/* ===== Single article ===== */
.stv-single { padding-block-end: var(--stv-space-8); }
.stv-single .stv-single__layout { padding-block-start: var(--stv-space-4); }
.stv-article__header { display: flex; flex-direction: column; gap: var(--stv-space-3); margin-block-end: var(--stv-space-5); }
.stv-article__categories { display: flex; flex-wrap: wrap; gap: var(--stv-space-2); }
.stv-article__title { font-size: clamp(30px, 4vw, var(--stv-blog-title-size, 38px)); font-weight: var(--stv-weight-heading); line-height: var(--stv-lh-heading); }
.stv-article__meta { gap: var(--stv-space-2) var(--stv-space-4); }
.stv-article__cover { margin-block: var(--stv-space-5); overflow: hidden; border-radius: var(--stv-radius-xl); background: var(--stv-color-surface-2); }
.stv-article__cover-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.stv-article__cover-caption {
	padding: var(--stv-space-2) var(--stv-space-3);
	font-size: var(--stv-font-size-xs);
	color: var(--stv-color-text-muted);
	text-align: center;
}

.stv-article__content { font-size: var(--stv-blog-body-size, 18px); }

.stv-article__footer {
	display: flex;
	flex-direction: column;
	gap: var(--stv-space-5);
	margin-block-start: var(--stv-space-6);
	padding-block-start: var(--stv-space-5);
	border-block-start: 1px solid var(--stv-color-border);
}

.stv-article__tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--stv-space-2); }
.stv-article__tags-label { font-size: var(--stv-font-size-sm); color: var(--stv-color-text-muted); }
.stv-article__edit { font-size: var(--stv-font-size-sm); }

.stv-link-pages {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--stv-space-2);
	margin-block-start: var(--stv-space-5);
	font-size: var(--stv-font-size-sm);
}

.stv-link-pages__label { color: var(--stv-color-text-muted); }

.stv-link-pages__item,
.stv-link-pages a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding-inline: var(--stv-space-2);
	border: 1px solid var(--stv-color-border);
	border-radius: var(--stv-radius-pill);
	text-decoration: none;
}

.stv-link-pages__item {
	background: var(--stv-color-primary);
	border-color: transparent;
	color: var(--stv-color-on-primary);
	font-weight: var(--stv-weight-ui);
}

.stv-article--page .stv-article__title { font-size: var(--stv-font-size-3xl); }
.stv-article--wide .stv-article__content { max-width: none; }
.stv-page--full .stv-article__header { max-width: var(--stv-container-content); }

/* ===== Table of contents ===== */
.stv-toc {
	margin-block: var(--stv-space-5);
	padding: var(--stv-space-4);
	border: 1px solid var(--stv-color-border);
	border-radius: var(--stv-radius-lg);
	background: var(--stv-color-surface-2);
}

.stv-toc__summary {
	display: flex;
	align-items: center;
	gap: var(--stv-space-2);
	cursor: pointer;
	font-weight: var(--stv-weight-ui);
	list-style: none;
}

.stv-toc__summary::-webkit-details-marker { display: none; }
.stv-toc__title { display: inline-flex; align-items: center; gap: var(--stv-space-2); }
.stv-toc__icon { color: var(--stv-color-primary); }

.stv-toc__count {
	padding: 2px 8px;
	border-radius: var(--stv-radius-pill);
	background: var(--stv-color-surface-3);
	font-size: var(--stv-font-size-xs);
	color: var(--stv-color-text-muted);
}

.stv-toc__chevron { margin-inline-start: auto; transition: transform var(--stv-transition); }
.stv-toc__details[open] .stv-toc__chevron { transform: rotate(180deg); }

.stv-toc__list {
	display: flex;
	flex-direction: column;
	gap: var(--stv-space-1);
	margin-block-start: var(--stv-space-3);
	padding-inline-start: var(--stv-space-5);
	font-size: var(--stv-font-size-sm);
	counter-reset: stv-toc;
	list-style: none;
}

.stv-toc__item { position: relative; counter-increment: stv-toc; }

.stv-toc__item::before {
	content: counter(stv-toc) ".";
	position: absolute;
	inset-inline-start: calc(-1 * var(--stv-space-5));
	color: var(--stv-color-text-muted);
	font-weight: var(--stv-weight-ui);
}

.stv-toc__item--h3 { padding-inline-start: var(--stv-space-4); }

.stv-toc__item--h4,
.stv-toc__item--h5,
.stv-toc__item--h6 {
	padding-inline-start: var(--stv-space-6);
}

.stv-toc__link {
	display: inline-block;
	padding-block: 2px;
	color: var(--stv-color-text-muted);
	text-decoration: none;
	transition: color var(--stv-transition);
}

@media (hover: hover) {
	.stv-toc__link:hover { color: var(--stv-color-text); }
}

.stv-toc__item.is-active > .stv-toc__link,
.stv-toc__link.is-active,
.stv-toc__link[aria-current] {
	color: var(--stv-color-primary);
	font-weight: var(--stv-weight-ui);
}

/* ===== Author box ===== */
.stv-author-box {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr);
	gap: var(--stv-space-4);
	padding: var(--stv-space-5);
	border: 1px solid var(--stv-color-border);
	border-radius: var(--stv-radius-lg);
	background: var(--stv-color-surface);
}

.stv-author-box__avatar {
	display: block;
	width: 72px;
	height: 72px;
	overflow: hidden;
	border-radius: 50%;
	background: var(--stv-color-surface-2);
}

.stv-author-box__img { width: 100%; height: 100%; object-fit: cover; }
.stv-author-box__body { display: flex; flex-direction: column; gap: var(--stv-space-2); min-width: 0; }
.stv-author-box__label { font-size: var(--stv-font-size-xs); color: var(--stv-color-text-muted); text-transform: uppercase; letter-spacing: .06em; }
.stv-author-box__name { font-size: var(--stv-font-size-xl); font-weight: var(--stv-weight-heading); }
.stv-author-box__name a { color: inherit; text-decoration: none; }
.stv-author-box__bio { font-size: var(--stv-font-size-sm); color: var(--stv-color-text-muted); }
.stv-author-box__links { display: flex; flex-wrap: wrap; gap: var(--stv-space-3); font-size: var(--stv-font-size-sm); }
.stv-author-box__link { display: inline-flex; align-items: center; gap: var(--stv-space-1); color: var(--stv-color-primary); text-decoration: none; }

/* ===== Related posts ===== */
.stv-related__head { display: flex; align-items: center; justify-content: space-between; gap: var(--stv-space-3); margin-block-end: var(--stv-space-4); }
.stv-related__title { font-size: var(--stv-font-size-xl); font-weight: var(--stv-weight-heading); }

/* ===== Comments ===== */
.stv-comments { margin-block-start: var(--stv-space-7); }
.stv-comments__title { margin-block-end: var(--stv-space-5); font-size: var(--stv-font-size-2xl); font-weight: var(--stv-weight-heading); }

.stv-comments__list,
.stv-comments__list .children {
	list-style: none;
}

.stv-comments__list > li + li { margin-block-start: var(--stv-space-3); }

.stv-comments__list .children {
	margin-block-start: var(--stv-space-3);
	margin-inline-start: var(--stv-space-4);
	padding-inline-start: var(--stv-space-3);
	border-inline-start: 2px solid var(--stv-color-border);
}

.stv-comments__list .children > li + li { margin-block-start: var(--stv-space-3); }

.stv-comment__body {
	padding: var(--stv-space-4);
	border: 1px solid var(--stv-color-border);
	border-radius: var(--stv-radius-lg);
	background: var(--stv-color-surface);
}

.stv-comment__meta { display: flex; align-items: center; gap: var(--stv-space-3); margin-block-end: var(--stv-space-3); }
.stv-comment__avatar { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; }
.stv-comment__meta-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stv-comment__author { font-weight: var(--stv-weight-ui); }
.stv-comment__author a { color: inherit; text-decoration: none; }
.stv-comment__type { margin-inline-start: var(--stv-space-2); font-size: var(--stv-font-size-xs); color: var(--stv-color-text-muted); }
.stv-comment__time { font-size: var(--stv-font-size-xs); color: var(--stv-color-text-muted); text-decoration: none; }

.stv-comment__pending {
	display: inline-block;
	margin-block-start: 2px;
	padding: 2px 8px;
	border-radius: var(--stv-radius-pill);
	background: var(--stv-color-warning-soft);
	color: var(--stv-color-warning);
	font-size: var(--stv-font-size-xs);
}

.bypostauthor > .stv-comment__body .stv-comment__author::after { content: "\2726"; margin-inline-start: var(--stv-space-1); color: var(--stv-color-primary); }
.bypostauthor > .stv-comment__body { border-color: var(--stv-color-primary-soft); box-shadow: inset 0 0 0 1px var(--stv-color-primary-soft); }
.stv-comment__content { font-size: var(--stv-font-size-sm); }
.stv-comment__content > * + * { margin-block-start: var(--stv-space-2); }

.stv-comment__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--stv-space-3);
	margin-block-start: var(--stv-space-3);
	font-size: var(--stv-font-size-sm);
}

/* Text-link look (no inline padding), but a 44 × 40 hit area: «رد» alone is 15px wide (WCAG 2.5.8) */
.stv-comment__reply { justify-content: flex-start; min-inline-size: 44px; padding-inline: 0; }

.stv-comments__nav {
	display: flex;
	justify-content: space-between;
	gap: var(--stv-space-3);
	margin-block: var(--stv-space-5);
	font-size: var(--stv-font-size-sm);
}

.stv-comments__closed { margin-block-start: var(--stv-space-5); color: var(--stv-color-text-muted); }

/* Comment form (core markup with theme field classes) */
.stv-comment-form,
.comment-respond {
	margin-block-start: var(--stv-space-6);
	padding: var(--stv-space-5);
	border: 1px solid var(--stv-color-border);
	border-radius: var(--stv-radius-lg);
	background: var(--stv-color-surface);
}

.comment-reply-title {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--stv-space-3);
	margin-block-end: var(--stv-space-4);
	font-size: var(--stv-font-size-xl);
	font-weight: var(--stv-weight-heading);
}

.comment-reply-title small { font-size: var(--stv-font-size-sm); font-weight: var(--stv-weight-body); }
.comment-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--stv-space-4); }
.comment-form > p { margin: 0; }

.comment-form .comment-notes,
.comment-form .logged-in-as {
	font-size: var(--stv-font-size-sm);
	color: var(--stv-color-text-muted);
}

.comment-form .comment-form-comment textarea { width: 100%; min-height: 140px; }
.comment-form .form-submit { display: flex; align-items: center; gap: var(--stv-space-3); }

.comment-form .form-submit .submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--stv-control-height);
	padding-inline: 20px;
	border: 0;
	border-radius: var(--stv-radius-md);
	background: var(--stv-color-cta);
	color: var(--stv-color-on-cta);
	font-weight: var(--stv-weight-ui);
	cursor: pointer;
}

/* ===== Sidebar widgets ===== */
.stv-widget--recent .stv-widget__title { margin-block-end: var(--stv-space-3); }
.stv-recent { display: flex; flex-direction: column; list-style: none; }
.stv-widget .stv-recent__item + .stv-recent__item { margin-block-start: var(--stv-space-3); padding-block-start: var(--stv-space-3); border-block-start: 1px solid var(--stv-color-border); }
.stv-recent__item { display: flex; gap: var(--stv-space-3); }

.stv-recent__thumb {
	display: block;
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	overflow: hidden;
	border-radius: var(--stv-radius-sm);
	background: var(--stv-color-surface-2);
}

.stv-recent__img { width: 100%; height: 100%; object-fit: cover; }
.stv-recent__img--empty { display: block; background: var(--stv-gradient-dark); }
.stv-recent__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.stv-recent__title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	font-size: var(--stv-font-size-sm);
	font-weight: var(--stv-weight-ui);
	color: var(--stv-color-text);
	text-decoration: none;
	line-height: 1.5;
}

@media (hover: hover) {
	.stv-recent__title:hover { color: var(--stv-color-primary); }
}

.stv-recent__date { font-size: var(--stv-font-size-xs); color: var(--stv-color-text-muted); }

/* ===== Blog page template: filter rail ===== */
.stv-blog { --stv-page-space-start: var(--stv-space-5); padding-block-end: var(--stv-space-8); }

.stv-filter-rail {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: var(--stv-space-3);
	margin-block-end: var(--stv-space-5);
	padding: var(--stv-space-4);
	border: 1px solid var(--stv-color-border);
	border-radius: var(--stv-radius-lg);
	background: var(--stv-color-surface);
	z-index: 2;
}

.stv-filter-rail__group { display: flex; flex-direction: column; gap: var(--stv-space-1); flex: 1 1 180px; min-width: 0; }
.stv-filter-rail__label { font-size: var(--stv-font-size-xs); font-weight: var(--stv-weight-ui); color: var(--stv-color-text-muted); }
.stv-filter-rail__search { position: relative; }
.stv-filter-rail__search .stv-filter-rail__input { width: 100%; padding-inline-end: 44px; }

.stv-filter-rail__search-icon {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-end: var(--stv-space-3);
	transform: translateY(-50%);
	display: inline-flex;
	color: var(--stv-color-text-faint);
	pointer-events: none;
}

.stv-filter-rail__select { width: 100%; }
.stv-filter-rail__actions { display: flex; align-items: center; gap: var(--stv-space-2); }
.stv-filter-rail__reset { font-size: var(--stv-font-size-sm); color: var(--stv-color-text-muted); }
.stv-filter-rail__view { margin-inline-start: auto; }

/* View toggle (shared with shop.css, scoped here for blog pages) */
.stv-view-toggle {
	display: inline-flex;
	padding: 3px;
	border: 1px solid var(--stv-color-border);
	border-radius: var(--stv-radius-md);
	background: var(--stv-color-surface-2);
}

.stv-view-toggle__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 32px;
	border-radius: var(--stv-radius-sm);
	color: var(--stv-color-text-muted);
	text-decoration: none;
	transition: background-color var(--stv-transition), color var(--stv-transition);
}

.stv-view-toggle__btn.is-active,
.stv-view-toggle__btn[aria-current="true"] {
	background: var(--stv-color-surface-3);
	color: var(--stv-color-primary);
}

.stv-view-toggle__btn:focus-visible { outline: none; box-shadow: var(--stv-focus-ring); }
.stv-blog__count { margin-block-end: var(--stv-space-4); font-size: var(--stv-font-size-xs); color: var(--stv-color-text-muted); }
.stv-blog__results { margin-block-start: 0; }

.stv-articles--grid .stv-article-row {
	grid-template-columns: minmax(0, 1fr);
	padding: 0;
	border: 1px solid var(--stv-color-border);
	border-radius: var(--stv-radius-lg);
	background: var(--stv-color-surface);
	overflow: hidden;
}

.stv-articles--grid .stv-article-row__date { display: none; }
.stv-articles--grid .stv-article-row__thumb { display: block; aspect-ratio: 16 / 9; border-radius: 0; }
.stv-articles--grid .stv-article-row__body { padding: var(--stv-space-4); }

/* ===== Category + author ===== */
.stv-category,
.stv-author,
.stv-page {
	--stv-page-space-start: var(--stv-space-5);
	padding-block-end: var(--stv-space-8);
}

.stv-category__featured { margin-block-end: var(--stv-space-6); }

.stv-category__grid,
.stv-author__grid {
	margin-block-end: var(--stv-space-6);
}

.stv-author-hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--stv-space-4);
	margin-block-end: var(--stv-space-6);
	padding: var(--stv-space-6) var(--stv-space-5);
	border: 1px solid var(--stv-color-border);
	border-radius: var(--stv-radius-xl);
	background: var(--stv-gradient-dark);
	text-align: center;
}

.stv-author-hero__avatar {
	width: 96px;
	height: 96px;
	overflow: hidden;
	border: 3px solid var(--stv-color-primary-soft);
	border-radius: 50%;
	background: var(--stv-color-surface-2);
}

.stv-author-hero__avatar img { width: 100%; height: 100%; object-fit: cover; }
.stv-author-hero__text { display: flex; flex-direction: column; gap: var(--stv-space-2); min-width: 0; }
.stv-author-hero__name { font-size: var(--stv-font-size-3xl); font-weight: var(--stv-weight-heading); }
.stv-author-hero__bio { max-width: 60ch; color: var(--stv-color-text-muted); }
.stv-author-hero__count { font-size: var(--stv-font-size-sm); color: var(--stv-color-text-muted); }

/* ===== Breakpoints ===== */
@media (min-width: 600px) {
	.stv-article-row { grid-template-columns: 64px 160px minmax(0, 1fr); }
	.stv-article-row__thumb { display: block; }
	.stv-cover__title { font-size: var(--stv-font-size-3xl); }
	.comment-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }

	.comment-form > p,
	.comment-form .comment-form-comment,
	.comment-form .comment-form-cookies-consent,
	.comment-form .form-submit,
	.comment-form .comment-notes,
	.comment-form .logged-in-as {
		grid-column: 1 / -1;
	}

	.comment-form .comment-form-author,
	.comment-form .comment-form-email {
		grid-column: auto;
	}

	.stv-author-box { grid-template-columns: 96px minmax(0, 1fr); }
	.stv-author-box__avatar { width: 96px; height: 96px; }
	.stv-author-hero { flex-direction: row; text-align: start; }
	.stv-articles--grid .stv-article-row { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 900px) {
	.stv-magazine__top { grid-template-columns: 2fr 1fr; gap: var(--stv-space-6); }
	.stv-cover__body { padding: var(--stv-space-6); }
	.stv-filter-rail { position: sticky; top: calc(var(--stv-adminbar-height, 0px) + var(--stv-header-height) + var(--stv-header-offset) + var(--stv-topbar-height, 0px) + var(--stv-store-notice-height, 0px) + var(--stv-space-3)); }
	.stv-comments__list .children { margin-inline-start: var(--stv-space-6); padding-inline-start: var(--stv-space-4); }
	.stv-article__header { margin-block-end: var(--stv-space-6); }
}

/* ===== Print ===== */
@media print {
	.stv-toc,
	.stv-filter-rail,
	.stv-comments,
	.stv-related,
	.stv-ticker {
		display: none;
	}
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
	.stv-ticker__track { animation: none; }

	.stv-cover__img,
	.stv-article-card,
	.stv-post-card,
	.stv-toc__chevron,
	.stv-toc__link,
	.stv-view-toggle__btn {
		transition: none;
	}

	.stv-cover:hover .stv-cover__img,
	.stv-article-card:hover,
	.stv-post-card:hover {
		transform: none;
	}
}
