/* ==========================================================================
   TechNews AI — design tokens
   ========================================================================== */
:root {
	--color-violet: #7c3aed;
	--color-fuchsia: #ec4899;
	--color-orange: #fb923c;
	--color-rose: #f43f5e;
	--color-sky: #0ea5e9;
	--color-amber: #f59e0b;
	--color-emerald: #10b981;

	--gradient-brand: linear-gradient(115deg, var(--color-violet) 0%, var(--color-fuchsia) 55%, var(--color-orange) 100%);

	--bg: #fafafc;
	--bg-elevated: #ffffff;
	--bg-muted: #f1f0f7;
	--text: #16161d;
	--text-muted: #62606f;
	--border: #e7e5f0;
	--shadow-color: 250 40% 30%;

	--font-heading: 'Sora', system-ui, sans-serif;
	--font-body: 'Inter', system-ui, sans-serif;

	--radius-lg: 24px;
	--radius-md: 16px;
	--radius-sm: 10px;

	--container-width: 1240px;
}

:root[data-theme='dark'] {
	--bg: #0f0f17;
	--bg-elevated: #1a1a26;
	--bg-muted: #1f1f2e;
	--text: #f5f5fa;
	--text-muted: #a6a4b8;
	--border: #2c2b3d;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme='light']) {
		--bg: #0f0f17;
		--bg-elevated: #1a1a26;
		--bg-muted: #1f1f2e;
		--text: #f5f5fa;
		--text-muted: #a6a4b8;
		--border: #2c2b3d;
	}
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	transition: background-color 0.25s ease, color 0.25s ease;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: inherit;
	text-decoration: none;
}

ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

h1,
h2,
h3,
h4 {
	font-family: var(--font-heading);
	font-weight: 800;
	line-height: 1.2;
	margin: 0 0 0.5em;
}

.container {
	width: 100%;
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 0 24px;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--bg-elevated);
	border-bottom: 1px solid var(--border);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding-top: 16px;
	padding-bottom: 16px;
}

.site-logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	white-space: nowrap;
}

.site-logo__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: var(--gradient-brand);
	box-shadow: 0 4px 14px -4px rgba(124, 58, 237, 0.55);
	flex-shrink: 0;
}

.site-logo__mark svg {
	width: 18px;
	height: 18px;
}

.site-logo__text {
	font-family: var(--font-heading);
	font-size: 24px;
	font-weight: 800;
	letter-spacing: -0.01em;
	background: var(--gradient-brand);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.nav-menu {
	display: flex;
	align-items: center;
	gap: 28px;
	flex-wrap: wrap;
}

.nav-menu a {
	font-weight: 600;
	font-size: 15px;
	padding: 8px 4px;
	position: relative;
}

.nav-menu a::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	border-radius: 3px;
	background: var(--gradient-brand);
	transform: scaleX(0);
	transition: transform 0.2s ease;
}

.nav-menu a:hover::after,
.nav-menu .current-menu-item a::after {
	transform: scaleX(1);
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.header-search {
	display: flex;
	align-items: center;
	background: var(--bg-muted);
	border-radius: 999px;
	padding: 6px 14px;
}

.header-search input[type='search'] {
	border: 0;
	background: transparent;
	outline: none;
	color: var(--text);
	font-family: var(--font-body);
	font-size: 14px;
	width: 140px;
}

.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 999px;
	background: var(--bg-muted);
	border: none;
	cursor: pointer;
	font-size: 18px;
	color: var(--text);
}

.nav-toggle {
	display: none;
	background: none;
	border: none;
	font-size: 24px;
	color: var(--text);
	cursor: pointer;
}

/* ==========================================================================
   Ticker
   ========================================================================== */
.news-ticker {
	background: var(--gradient-brand);
	color: #fff;
	overflow: hidden;
	white-space: nowrap;
}

.news-ticker__inner {
	display: flex;
	align-items: center;
	gap: 48px;
	padding: 10px 0;
	width: max-content;
	animation: ticker-scroll 35s linear infinite;
}

.news-ticker:hover .news-ticker__inner {
	animation-play-state: paused;
}

.news-ticker__label {
	flex-shrink: 0;
	font-weight: 800;
	font-family: var(--font-heading);
	text-transform: uppercase;
	font-size: 13px;
	letter-spacing: 0.06em;
	background: rgba(0, 0, 0, 0.18);
	padding: 4px 14px;
	border-radius: 999px;
}

.news-ticker__item {
	font-weight: 600;
	font-size: 14px;
}

@keyframes ticker-scroll {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-50%);
	}
}

/* ==========================================================================
   Tag badges
   ========================================================================== */
.tag-badge {
	display: inline-flex;
	align-items: center;
	font-family: var(--font-heading);
	font-size: 12px;
	font-weight: 700;
	color: #fff;
	padding: 5px 12px;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.tag-badge--hot {
	background: var(--color-rose);
	box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.18);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
	margin: 32px 0 48px;
}

.hero__card {
	position: relative;
	border-radius: var(--radius-lg);
	overflow: hidden;
	min-height: 420px;
	display: flex;
	align-items: flex-end;
	background: var(--bg-muted);
}

.hero__card img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hero__overlay {
	position: relative;
	z-index: 2;
	padding: 40px;
	width: 100%;
	background: linear-gradient(0deg, rgba(10, 8, 20, 0.92) 0%, rgba(10, 8, 20, 0.55) 55%, rgba(10, 8, 20, 0) 100%);
	color: #fff;
}

.hero__meta {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.hero__title {
	font-size: clamp(28px, 4vw, 46px);
	max-width: 820px;
	margin-bottom: 12px;
}

.hero__excerpt {
	max-width: 640px;
	color: rgba(255, 255, 255, 0.85);
	font-size: 16px;
}

/* ==========================================================================
   Layout: main grid + sidebar
   ========================================================================== */
.content-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 40px;
	align-items: start;
	padding-bottom: 64px;
}

.section-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 22px;
	margin-bottom: 20px;
}

.section-title::before {
	content: '';
	width: 6px;
	height: 24px;
	border-radius: 4px;
	background: var(--gradient-brand);
}

/* ==========================================================================
   News cards
   ========================================================================== */
.news-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px;
	margin-bottom: 48px;
}

.news-card {
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 20px 40px -20px hsl(var(--shadow-color) / 0.45);
}

.news-card__media {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--bg-muted);
}

.news-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.news-card:hover .news-card__media img {
	transform: scale(1.06);
}

.news-card__tag {
	position: absolute;
	top: 12px;
	left: 12px;
}

.news-card__body {
	padding: 18px 20px 22px;
}

.news-card__title {
	font-size: 18px;
	margin-bottom: 8px;
}

.news-card__title a::after {
	content: '';
	position: absolute;
	inset: 0;
}

.news-card {
	position: relative;
}

.news-card__excerpt {
	color: var(--text-muted);
	font-size: 14px;
	margin-bottom: 14px;
}

.news-card__meta {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	color: var(--text-muted);
}

.news-card__meta .dot {
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: var(--text-muted);
}

/* ==========================================================================
   Trend carousel
   ========================================================================== */
.trend-scroll {
	display: flex;
	gap: 20px;
	overflow-x: auto;
	padding-bottom: 12px;
	margin-bottom: 48px;
	scroll-snap-type: x mandatory;
}

.trend-scroll::-webkit-scrollbar {
	height: 6px;
}

.trend-scroll::-webkit-scrollbar-thumb {
	background: var(--border);
	border-radius: 999px;
}

.trend-scroll .news-card {
	flex: 0 0 280px;
	scroll-snap-align: start;
}

/* ==========================================================================
   Sidebar: trending list + newsletter
   ========================================================================== */
.sidebar-block {
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	padding: 24px;
	margin-bottom: 28px;
}

.trending-list {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.trending-item {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}

.trending-item__rank {
	font-family: var(--font-heading);
	font-size: 24px;
	font-weight: 800;
	background: var(--gradient-brand);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	line-height: 1;
	min-width: 28px;
}

.trending-item__title {
	font-size: 14px;
	font-weight: 600;
}

.trending-item__meta {
	font-size: 12px;
	color: var(--text-muted);
	margin-top: 4px;
}

.newsletter-box {
	background: var(--gradient-brand);
	border-radius: var(--radius-md);
	padding: 28px;
	color: #fff;
}

.newsletter-box h3 {
	font-size: 20px;
	margin-bottom: 8px;
}

.newsletter-box p {
	font-size: 14px;
	color: rgba(255, 255, 255, 0.88);
	margin-bottom: 18px;
}

.newsletter-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.newsletter-form input[type='email'] {
	border: none;
	border-radius: var(--radius-sm);
	padding: 12px 16px;
	font-family: var(--font-body);
	font-size: 14px;
	outline: none;
}

.newsletter-form button {
	border: none;
	border-radius: var(--radius-sm);
	padding: 12px 16px;
	background: #16161d;
	color: #fff;
	font-family: var(--font-heading);
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.15s ease;
}

.newsletter-form button:hover {
	transform: scale(1.02);
}

.newsletter-note {
	font-size: 12px;
	margin-top: 10px;
	color: rgba(255, 255, 255, 0.95);
}

/* ==========================================================================
   Single post
   ========================================================================== */
.single-article {
	max-width: 780px;
	margin: 40px auto 64px;
}

.single-article__header {
	margin-bottom: 24px;
}

.single-article__title {
	font-size: clamp(28px, 4vw, 40px);
	margin: 14px 0;
}

.single-article__meta {
	display: flex;
	align-items: center;
	gap: 14px;
	color: var(--text-muted);
	font-size: 14px;
	flex-wrap: wrap;
}

.single-article__thumb {
	border-radius: var(--radius-lg);
	overflow: hidden;
	margin: 24px 0 32px;
}

.single-article__content {
	font-size: 17px;
	line-height: 1.8;
}

.single-article__content p {
	margin: 0 0 1.4em;
}

.single-article__content h2,
.single-article__content h3 {
	margin-top: 1.6em;
}

.single-article__content img {
	border-radius: var(--radius-md);
}

.single-article__content blockquote {
	border-left: 4px solid;
	border-image: var(--gradient-brand) 1;
	padding: 4px 0 4px 20px;
	font-style: italic;
	color: var(--text-muted);
	margin: 1.6em 0;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin: 32px 0 64px;
}

.pagination a,
.pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	border-radius: var(--radius-sm);
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	font-weight: 600;
	font-size: 14px;
}

.pagination .current {
	background: var(--gradient-brand);
	color: #fff;
	border: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
	border-top: 1px solid var(--border);
	padding: 40px 0;
	margin-top: 40px;
}

.site-footer__inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
}

.site-footer__links {
	display: flex;
	gap: 20px;
	font-size: 14px;
	color: var(--text-muted);
}

.site-footer__copy {
	font-size: 14px;
	color: var(--text-muted);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
	.content-layout {
		grid-template-columns: 1fr;
	}

	.news-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 720px) {
	.header-search {
		display: none;
	}

	.nav-menu {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--bg-elevated);
		flex-direction: column;
		align-items: flex-start;
		gap: 0;
		padding: 12px 24px 20px;
		border-bottom: 1px solid var(--border);
	}

	.nav-menu.is-open {
		display: flex;
	}

	.nav-menu li {
		width: 100%;
	}

	.nav-toggle {
		display: inline-flex;
	}

	.news-grid {
		grid-template-columns: 1fr;
	}

	.hero__overlay {
		padding: 24px;
	}
}
