:root {
	--fg: #202124;
	--muted: #5f6368;
	--blue: #1a73e8;
	--line: #dadce0;
	--canvas: #f8fafd;
	--panel: #fff;
	--radius: 18px;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
	margin: 0;
	font-family: 'Vazirmatn', system-ui, sans-serif;
	color: var(--fg);
	background: var(--canvas);
	line-height: 1.55;
}
button, input { font: inherit; }

.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.site-header__top {
	display: flex; align-items: center; gap: 24px;
	max-width: 1240px; min-height: 72px; margin: 0 auto; padding: 12px 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; text-decoration: none; color: var(--fg); }
.brand__logo { width: 34px; height: 34px; flex: none; display: block; border-radius: 9px; }
.brand__name { font-size: 20px; font-weight: 700; white-space: nowrap; }
.site-search {
	display: flex; align-items: center; gap: 12px; flex: 1;
	max-width: 720px; min-height: 48px; padding: 0 16px;
	color: var(--muted); background: #f1f3f4; border-radius: 26px;
}
.site-search__icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }
.site-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--fg); background: transparent; }
.site-search input::placeholder { color: #777; }
.site-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.site-action {
	display: grid; place-items: center; width: 40px; height: 40px; padding: 8px;
	border: 0; border-radius: 50%; color: #4b4f52; background: transparent; cursor: pointer;
}
.site-action:hover, .site-action:focus-visible { background: #f1f3f4; outline: none; }
.site-action svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.site-action--signin { width: auto; padding: 0 20px; color: #fff; background: var(--blue); border-radius: 22px; font-size: 14px; font-weight: 600; }
.site-action--signin:hover, .site-action--signin:focus-visible { background: #185abc; }

.site-nav { border-top: 1px solid #f1f3f4; }
.site-nav__list {
	display: flex; gap: 28px; max-width: 1240px; margin: 0 auto; padding: 0 24px;
	overflow-x: auto; list-style: none; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.site-nav__list::-webkit-scrollbar { display: none; }
.site-nav__link {
	position: relative; display: block; white-space: nowrap; padding: 14px 2px 12px;
	color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none;
}
.site-nav__link:hover { color: var(--fg); }
.site-nav__link--active { color: var(--blue); }
.site-nav__link--active::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--blue); }
.site-nav__link--live { display: flex; align-items: center; gap: 7px; color: #c5221f; }
.site-nav__link--live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #c5221f; }

.site-main { max-width: 1240px; margin: 0 auto; padding: 24px; }
.briefing-heading { margin: 0 0 22px; }
.briefing-heading h1 { margin: 0; font-size: clamp(26px, 3vw, 32px); line-height: 1.25; font-weight: 500; }
.briefing-heading p { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.cat-section { max-width: 860px; margin: 0 0 28px; padding: 20px 20px 14px; background: var(--panel); border: 1px solid #eef0f2; border-radius: var(--radius); box-shadow: 0 1px 2px rgba(60,64,67,.06); }
.cat-section__title { display: flex; align-items: center; gap: 8px; margin: 0 0 15px; color: #1267b1; font-size: 21px; font-weight: 500; text-decoration: none; }
.cat-section__title::before { content: "›"; font-size: 28px; line-height: 1; }
.cat-section__title:hover { text-decoration: underline; }

.card-story { position: relative; }
.card-story__link { display: block; color: inherit; text-decoration: none; }
.card-story__media { aspect-ratio: 2.05 / 1; overflow: hidden; background: #e8eaed; border-radius: 13px; }
.card-story__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-story__body { padding: 14px 2px 8px; }
.card-story__title { margin: 0 0 10px; color: var(--fg); font-size: 23px; font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.card-meta { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.card-avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #0ea5e9, #2563eb); font-size: 14px; font-weight: 700; }
.card-avatar__img { display: block; width: 30px; height: 30px; flex: none; object-fit: contain; border-radius: 4px; background: var(--panel); }
.card-avatar__img--sm { width: 20px; height: 20px; }
.card-avatar--sm { width: 20px; height: 20px; font-size: 10px; }
.card-publisher { color: #3c4043; font-weight: 500; }
.card-dot { color: #9aa0a6; }

.cat-section__list { margin-top: 7px; }
.topic-main { grid-column: 1; }
.card { position: relative; padding: 15px 0; border-top: 1px solid #e8eaed; }
.card__link { display: flex; gap: 15px; color: inherit; text-decoration: none; }
.card__media { width: 148px; height: 96px; flex: none; overflow: hidden; background: #e8eaed; border-radius: 10px; }
.card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card__body { display: flex; flex: 1; min-width: 0; flex-direction: column; justify-content: space-between; gap: 8px; }
.card__title { margin: 0; color: var(--fg); font-size: 17px; font-weight: 500; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.more-headlines { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; margin: 8px 0 0; color: #3c4043; background: #f1f3f4; border-radius: 22px; font-size: 13px; text-decoration: none; }
.more-headlines:hover { background: #e8eaed; }
.more-headlines svg { width: 18px; height: 18px; fill: none; stroke: var(--blue); stroke-width: 2; }
.empty { color: var(--muted); }
.site-footer { padding: 20px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* Live feed */
.live { max-width: 760px; margin: 0 auto; padding: 24px 16px; }
.live__title { margin: 0 0 16px; color: #c5221f; font-size: 24px; font-weight: 700; }
#live-feed { display: flex; flex-direction: column; background: var(--panel); border: 1px solid #eef0f2; border-radius: var(--radius); box-shadow: 0 1px 2px rgba(60,64,67,.06); overflow: hidden; }
.live-row {
	display: flex; align-items: baseline; gap: 10px;
	padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.live-row:last-child { border-bottom: 0; }
.live-row__time { flex: 0 0 auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.live-row__cat {
	flex: 0 0 auto; font-size: 11px; font-weight: 600;
	padding: 2px 7px; border-radius: 6px;
	background: #e8f0fe; color: var(--blue);
}
.live-row__title { flex: 1 1 auto; min-width: 0; font-weight: 500; color: var(--fg); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-row__title:hover { color: var(--blue); text-decoration: underline; }
.live-row__source { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.live-poller { display: none; }

@media (min-width: 1000px) {
	.site-main { display: grid; grid-template-columns: minmax(0, 860px) 300px; column-gap: 24px; align-items: start; }
	.briefing-heading { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
	.site-header__top { gap: 12px; min-height: 62px; padding: 10px 16px; }
	.brand { gap: 7px; }
	.brand__logo { width: 30px; height: 30px; }
	.brand__name { max-width: 86px; overflow: hidden; font-size: 17px; text-overflow: ellipsis; }
	.site-search { order: 3; flex-basis: 100%; max-width: none; min-height: 42px; }
	.site-header__top { flex-wrap: wrap; }
	.site-actions { gap: 2px; }
	.site-action { width: 34px; height: 34px; padding: 6px; }
	.site-action--signin { padding: 0 14px; font-size: 13px; }
	.site-nav__list { gap: 22px; padding-inline: 16px; }
	.site-nav__link { padding-top: 11px; padding-bottom: 10px; }
	.site-main { padding: 20px 12px; }
	.briefing-heading { margin-bottom: 17px; padding-inline: 4px; }
	.briefing-heading h1 { font-size: 26px; }
	.cat-section { margin-bottom: 18px; padding: 16px 12px 10px; border-radius: 15px; }
	.cat-section__title { font-size: 19px; }
	.card-story__title { font-size: 20px; }
	.card { gap: 10px; padding: 12px 0; }
	.card__media { width: 92px; height: 68px; border-radius: 8px; }
	.card__title { font-size: 15px; line-height: 1.45; }
	.card-meta { gap: 5px; font-size: 11px; }
	.more-headlines { font-size: 12px; }
}

@media (max-width: 400px) {
	.site-header__top { gap: 8px; }
	.brand__name { max-width: 70px; }
	.site-action:not(.site-action--signin) { display: none; }
	.site-search { order: 4; }
}

/* /most-viewed — ranked click list (mirrors .live density) */
.most-viewed { max-width: 760px; margin: 0 auto; padding: 24px 16px; }
.most-viewed__title { margin: 0 0 16px; color: var(--blue); font-size: 24px; font-weight: 700; }
.most-viewed__empty { color: var(--muted); }
.mv-list { list-style: none; margin: 0; padding: 0; }
.mv-row { display: flex; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mv-row:last-child { border-bottom: 0; }
.mv-row__rank { flex: 0 0 auto; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }
.mv-row--top .mv-row__rank { color: #c5221f; }
.mv-row__cat { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.mv-row__title { flex: 1 1 auto; min-width: 0; font-weight: 500; color: var(--fg); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-row__title:hover { color: var(--blue); text-decoration: underline; }
.mv-row__meta { flex: 0 0 auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Like button (anonymous likes; Phase 1) */
.like { position: absolute; bottom: 8px; inset-inline-end: 8px; z-index: 1; }
.like__btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border: 0; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.like__btn:disabled { cursor: default; }
.like__icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.like.is-liked .like__icon { fill: var(--blue); stroke: var(--blue); }
.like.is-liked .like__btn { color: var(--blue); }

.topic-sentinel { display: flex; align-items: center; justify-content: center; min-height: 48px; color: var(--muted); font-size: 13px; }
