/*
Theme Name: TechPulse
Theme URI: https://cardmunch.com
Author: Cardmunch
Author URI: https://cardmunch.com
Description: A dark-header, card-driven news theme for TechPulse — built for fast-moving tech news, reviews, and gadget coverage with a homepage hero, trending sidebar, and category badge system.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: techpulse
Tags: news, blog, two-columns, right-sidebar, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   0. Design tokens
   ========================================================================== */
:root {
	--color-bg: #F4F6FA;
	--color-surface: #FFFFFF;
	--color-header: #0B1220;
	--color-header-border: #1B2436;
	--color-text: #101828;
	--color-text-muted: #667085;
	--color-text-inverse: #F8FAFC;
	--color-accent: #2563EB;
	--color-accent-dark: #1D4ED8;
	--color-accent-soft: #EFF4FF;
	--color-border: #E5E9F0;

	--badge-gaming: #2563EB;
	--badge-apps: #7C3AED;
	--badge-tech-news: #2563EB;
	--badge-how-to: #F97316;
	--badge-reviews: #DC2626;
	--badge-best-of: #059669;
	--badge-deals: #DB2777;
	--badge-default: #2563EB;

	--radius-sm: 6px;
	--radius-md: 10px;
	--radius-lg: 18px;
	--shadow-card: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
	--shadow-card-hover: 0 4px 10px rgba(16,24,40,.10), 0 2px 4px rgba(16,24,40,.06);

	--font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

	--container: 1320px;
}

[data-theme="dark"] {
	--color-bg: #0B1220;
	--color-surface: #121B2E;
	--color-text: #F1F5F9;
	--color-text-muted: #94A3B8;
	--color-border: #223049;
	--color-accent-soft: #16233D;
}

/* ==========================================================================
   1. Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--font-sans);
	background: var(--color-bg);
	color: var(--color-text);
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	transition: background-color .2s ease, color .2s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.container {
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 24px;
}
.screen-reader-text {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px,1px,1px,1px); white-space: nowrap;
}
:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   2. Site header
   ========================================================================== */
.site-header {
	background: var(--color-header);
	border-bottom: 1px solid var(--color-header-border);
	position: sticky;
	top: 0;
	z-index: 100;
}
.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 72px;
	gap: 24px;
}
.site-logo {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 22px;
	font-weight: 800;
	color: #fff;
	flex-shrink: 0;
}
.site-logo .accent { color: var(--color-accent); }
.site-logo svg { flex-shrink: 0; }
.site-logo img { max-height: 32px; }

.primary-nav { flex: 1; display: flex; justify-content: center; }
.primary-nav ul { display: flex; gap: 32px; }
.primary-nav a {
	color: #CBD5E1;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
	padding: 8px 0;
	position: relative;
	transition: color .15s ease;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a {
	color: #fff;
}
.primary-nav .current-menu-item > a::after,
.primary-nav .current_page_item > a::after {
	content: '';
	position: absolute;
	left: 0; right: 0; bottom: -1px;
	height: 2px;
	background: var(--color-accent);
	border-radius: 2px;
}

.header-actions { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.header-icon-btn {
	background: none; border: none; color: #CBD5E1;
	display: flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; border-radius: 50%;
	transition: background .15s ease, color .15s ease;
}
.header-icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.btn-subscribe {
	background: var(--color-accent);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .03em;
	padding: 10px 20px;
	border-radius: var(--radius-sm);
	border: none;
	white-space: nowrap;
	transition: background .15s ease, transform .1s ease;
}
.btn-subscribe:hover { background: var(--color-accent-dark); }
.btn-subscribe:active { transform: scale(.98); }

.menu-toggle {
	display: none;
	background: none; border: none; color: #fff;
	width: 40px; height: 40px;
}
.search-panel {
	display: none;
	background: var(--color-header-border);
	border-top: 1px solid var(--color-header-border);
}
.search-panel.is-open { display: block; }
.search-panel form { display: flex; padding: 14px 0; gap: 8px; }
.search-panel input[type="search"] {
	flex: 1;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	padding: 10px 14px;
	color: var(--color-text);
	font-size: 14px;
}
.search-panel button {
	background: var(--color-accent);
	color: #fff;
	border: none;
	border-radius: var(--radius-sm);
	padding: 10px 18px;
	font-weight: 700;
	font-size: 14px;
}

/* ==========================================================================
   3. Category badges
   ========================================================================== */
.badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: #fff;
	padding: 5px 10px;
	border-radius: var(--radius-sm);
	background: var(--badge-default);
}
.badge--gaming { background: var(--badge-gaming); }
.badge--apps { background: var(--badge-apps); }
.badge--tech-news { background: var(--badge-tech-news); }
.badge--how-to { background: var(--badge-how-to); }
.badge--reviews { background: var(--badge-reviews); }
.badge--best-of { background: var(--badge-best-of); }
.badge--deals { background: var(--badge-deals); }

/* ==========================================================================
   4. Homepage hero
   ========================================================================== */
.hero-section {
	padding: 32px 0 0;
	display: grid;
	grid-template-columns: 1.7fr 1fr 340px;
	gap: 20px;
	align-items: start;
}
.hero-main {
	position: relative;
	border-radius: var(--radius-lg);
	overflow: hidden;
	min-height: 420px;
	display: flex;
	align-items: flex-end;
	background-color: #0B1220;
	background-size: cover;
	background-position: center;
	box-shadow: var(--shadow-card);
}
.hero-main::after {
	content: '';
	position: absolute; inset: 0;
	background: linear-gradient(0deg, rgba(6,10,20,.92) 0%, rgba(6,10,20,.55) 45%, rgba(6,10,20,.15) 100%);
}
.hero-main__content { position: relative; z-index: 1; padding: 28px 32px; color: #fff; }
.hero-main .badge { margin-bottom: 14px; }
.hero-main__date { font-size: 13px; color: #CBD5E1; margin-bottom: 10px; }
.hero-main h1 {
	font-size: 32px;
	line-height: 1.18;
	margin-bottom: 12px;
	max-width: 90%;
}
.hero-main__excerpt { color: #D8DEE9; font-size: 15px; max-width: 640px; }

.hero-secondary { display: flex; flex-direction: column; gap: 20px; }
.hero-secondary__card {
	position: relative;
	border-radius: var(--radius-lg);
	overflow: hidden;
	min-height: 200px;
	display: flex;
	align-items: flex-end;
	background-color: #0B1220;
	background-size: cover;
	background-position: center;
	box-shadow: var(--shadow-card);
}
.hero-secondary__card::after {
	content: '';
	position: absolute; inset: 0;
	background: linear-gradient(0deg, rgba(6,10,20,.90) 10%, rgba(6,10,20,.25) 100%);
}
.hero-secondary__content { position: relative; z-index: 1; padding: 18px; color: #fff; }
.hero-secondary .badge { margin-bottom: 8px; font-size: 10px; }
.hero-secondary__date { font-size: 12px; color: #CBD5E1; margin-bottom: 6px; }
.hero-secondary h2 { font-size: 17px; line-height: 1.3; }

/* ==========================================================================
   5. Sidebar widgets (Top Categories / Trending Now)
   ========================================================================== */
.widget {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	padding: 22px;
	box-shadow: var(--shadow-card);
}
.widget + .widget { margin-top: 20px; }
.widget-title {
	font-size: 16px;
	font-weight: 800;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--color-accent);
	display: inline-block;
}
.category-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 11px 0;
	border-bottom: 1px solid var(--color-border);
}
.category-list li:last-child { border-bottom: none; padding-bottom: 0; }
.category-list li:first-child { padding-top: 0; }
.category-list a {
	display: flex; align-items: center; gap: 12px;
	font-weight: 700; font-size: 14.5px;
}
.category-list .cat-icon {
	width: 20px; height: 20px; flex-shrink: 0;
	color: var(--color-text);
}
.category-list .cat-count {
	font-size: 13px; color: var(--color-text-muted); font-weight: 500;
}
.widget-link {
	display: inline-flex; align-items: center; gap: 6px;
	color: var(--color-accent); font-weight: 700; font-size: 14px;
	margin-top: 16px;
}
.widget-link:hover { text-decoration: underline; }

.trending-list li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.trending-list li:last-child { border-bottom: none; padding-bottom: 0; }
.trending-list li:first-child { padding-top: 0; }
.trending-num {
	flex-shrink: 0;
	width: 24px; height: 24px;
	border-radius: 50%;
	background: var(--color-accent);
	color: #fff;
	font-size: 12px; font-weight: 800;
	display: flex; align-items: center; justify-content: center;
	margin-top: 2px;
}
.trending-thumb {
	flex-shrink: 0;
	width: 64px; height: 64px;
	border-radius: var(--radius-sm);
	overflow: hidden;
	background: var(--color-accent-soft);
}
.trending-thumb img { width: 100%; height: 100%; object-fit: cover; }
.trending-body h3 { font-size: 14px; line-height: 1.35; margin-bottom: 4px; font-weight: 700; }
.trending-body h3 a:hover { color: var(--color-accent); }
.trending-date { font-size: 12px; color: var(--color-text-muted); }

/* ==========================================================================
   6. Latest articles grid
   ========================================================================== */
.section {
	padding: 44px 0;
}
.section-header {
	display: flex; align-items: baseline; justify-content: space-between;
	margin-bottom: 22px;
}
.section-header h2 {
	font-size: 22px;
	position: relative;
	padding-bottom: 12px;
}
.section-header h2::after {
	content: '';
	position: absolute; left: 0; bottom: 0;
	width: 40px; height: 3px;
	background: var(--color-accent);
	border-radius: 2px;
}
.section-header .widget-link { margin-top: 0; }

.content-layout {
	display: grid;
	grid-template-columns: 1fr 340px;
	gap: 32px;
	align-items: start;
}
.article-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 22px;
}
.article-grid.article-grid--wide { grid-template-columns: repeat(3, 1fr); }

.article-card {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-card);
	transition: box-shadow .2s ease, transform .2s ease;
	display: flex;
	flex-direction: column;
}
.article-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.article-card__thumb { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--color-accent-soft); }
.article-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-card__thumb .badge { position: absolute; top: 12px; left: 12px; }
.article-card__body { padding: 16px 18px 20px; flex: 1; display: flex; flex-direction: column; }
.article-card__meta { font-size: 12.5px; color: var(--color-text-muted); margin-bottom: 8px; }
.article-card h3 { font-size: 16px; line-height: 1.35; margin-bottom: 8px; }
.article-card h3 a:hover { color: var(--color-accent); }
.article-card__excerpt { font-size: 13.5px; color: var(--color-text-muted); flex: 1; }

/* ==========================================================================
   7. Newsletter CTA
   ========================================================================== */
.newsletter {
	background: linear-gradient(120deg, #E9EEFC 0%, #E4E9FB 55%, #ECE7FB 100%);
	border-radius: var(--radius-lg);
	padding: 32px 36px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 28px;
	flex-wrap: wrap;
}
[data-theme="dark"] .newsletter { background: linear-gradient(120deg, #16233D 0%, #1B2440 100%); }
.newsletter__copy { display: flex; align-items: center; gap: 18px; }
.newsletter__icon {
	width: 52px; height: 52px; border-radius: 14px;
	background: var(--color-accent);
	display: flex; align-items: center; justify-content: center;
	color: #fff; flex-shrink: 0;
}
.newsletter h2 { font-size: 20px; margin-bottom: 4px; }
.newsletter p { margin: 0; color: var(--color-text-muted); font-size: 14px; }
.newsletter-form { display: flex; gap: 10px; flex: 1; max-width: 440px; min-width: 280px; }
.newsletter-form input[type="email"] {
	flex: 1;
	padding: 13px 16px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--color-border);
	font-size: 14px;
	background: var(--color-surface);
	color: var(--color-text);
}
.newsletter-form button {
	background: var(--color-accent);
	color: #fff; border: none;
	padding: 13px 22px;
	border-radius: var(--radius-sm);
	font-weight: 700; font-size: 14px;
	white-space: nowrap;
}
.newsletter-form button:hover { background: var(--color-accent-dark); }
.newsletter-note { width: 100%; font-size: 13px; margin-top: 10px; color: var(--color-text-muted); }

/* ==========================================================================
   8. Single post / page / archive / search
   ========================================================================== */
.page-header-bar { padding: 36px 0 8px; }
.page-header-bar h1 { font-size: 28px; }
.page-header-bar .archive-desc { color: var(--color-text-muted); margin-top: 8px; }

.single-post { padding: 36px 0 60px; }
.single-post__meta { color: var(--color-text-muted); font-size: 13.5px; margin-bottom: 14px; }
.single-post h1 { font-size: 34px; line-height: 1.2; margin-bottom: 14px; max-width: 900px; }
.single-post__thumb { border-radius: var(--radius-lg); overflow: hidden; margin: 20px 0 30px; box-shadow: var(--shadow-card); }
.single-post__excerpt { font-size: 18px; color: var(--color-text-muted); margin-bottom: 24px; max-width: 760px; }
.entry-content { max-width: 760px; font-size: 17px; line-height: 1.75; }
.entry-content h2 { font-size: 24px; margin: 1.6em 0 .6em; }
.entry-content h3 { font-size: 20px; margin: 1.4em 0 .5em; }
.entry-content p { margin-bottom: 1.2em; }
.entry-content img { border-radius: var(--radius-md); margin: 1.4em 0; }
.entry-content a { color: var(--color-accent); text-decoration: underline; }
.entry-content ul, .entry-content ol { margin: 0 0 1.2em 1.4em; }
.entry-content blockquote {
	border-left: 3px solid var(--color-accent);
	margin: 1.6em 0; padding: .2em 0 .2em 20px;
	color: var(--color-text-muted); font-style: italic;
}
.entry-tags { margin: 30px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.entry-tags a {
	font-size: 12.5px; padding: 6px 12px; border-radius: 999px;
	background: var(--color-accent-soft); color: var(--color-accent); font-weight: 600;
}
.source-attribution {
	margin: 24px 0; padding: 14px 18px;
	background: var(--color-accent-soft);
	border-radius: var(--radius-md);
	font-size: 13.5px; color: var(--color-text-muted);
}

.comments-area { max-width: 760px; margin-top: 40px; }
.comment-list { margin-top: 20px; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--color-border); }
.comment-author { font-weight: 700; font-size: 14px; }
.comment-metadata { font-size: 12px; color: var(--color-text-muted); margin-bottom: 8px; }
.comment-form input, .comment-form textarea {
	width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
	border: 1px solid var(--color-border); font-family: inherit; font-size: 14px;
	background: var(--color-surface); color: var(--color-text); margin-bottom: 12px;
}
.comment-form textarea { min-height: 120px; }
.comment-form input[type="submit"] {
	background: var(--color-accent); color: #fff; border: none; font-weight: 700; width: auto; padding: 12px 26px;
}

.pagination { display: flex; gap: 8px; margin-top: 30px; }
.pagination a, .pagination span {
	padding: 9px 15px; border-radius: var(--radius-sm);
	border: 1px solid var(--color-border); font-size: 14px; font-weight: 600;
}
.pagination .current { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }

/* ==========================================================================
   9. Footer
   ========================================================================== */
.site-footer {
	background: var(--color-header);
	color: #94A3B8;
	margin-top: 40px;
	padding: 48px 0 24px;
}
.footer-grid {
	display: grid;
	grid-template-columns: 1.4fr repeat(3, 1fr);
	gap: 32px;
	padding-bottom: 32px;
	border-bottom: 1px solid var(--color-header-border);
}
.footer-brand .site-logo { margin-bottom: 12px; }
.footer-brand p { font-size: 14px; max-width: 320px; }
.footer-col h4 { color: #fff; font-size: 14px; margin-bottom: 14px; letter-spacing: .04em; text-transform: uppercase; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a { font-size: 14px; color: #94A3B8; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
	display: flex; justify-content: space-between; align-items: center;
	padding-top: 20px; font-size: 13px; flex-wrap: wrap; gap: 10px;
}
.footer-social { display: flex; gap: 12px; }
.footer-social a {
	width: 34px; height: 34px; border-radius: 50%;
	background: rgba(255,255,255,.06);
	display: flex; align-items: center; justify-content: center;
}
.footer-social a:hover { background: var(--color-accent); }

/* ==========================================================================
   10. Responsive
   ========================================================================== */
@media (max-width: 1080px) {
	.hero-section { grid-template-columns: 1fr 1fr; }
	.hero-section > .widget-area { grid-column: 1 / -1; }
	.content-layout { grid-template-columns: 1fr; }
	.article-grid, .article-grid--wide { grid-template-columns: repeat(2, 1fr); }
	.footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
	.primary-nav { display: none; }
	.menu-toggle { display: flex; align-items: center; justify-content: center; }
	.hero-section { grid-template-columns: 1fr; }
	.hero-secondary { flex-direction: row; }
	.hero-secondary__card { flex: 1; min-height: 160px; }
}
@media (max-width: 860px) {
	.primary-nav.is-open {
		display: flex; position: absolute; top: 72px; left: 0; right: 0;
		background: var(--color-header); flex-direction: column; padding: 10px 24px 20px;
		border-top: 1px solid var(--color-header-border);
	}
	.primary-nav.is-open ul { flex-direction: column; gap: 4px; }
	.primary-nav.is-open a { display: block; padding: 12px 0; }
}
@media (max-width: 640px) {
	.article-grid, .article-grid--wide, .hero-secondary { grid-template-columns: 1fr; flex-direction: column; }
	.newsletter { flex-direction: column; align-items: flex-start; }
	.newsletter-form { width: 100%; max-width: none; }
	.footer-grid { grid-template-columns: 1fr; }
	.hero-main h1 { font-size: 24px; }
	.single-post h1 { font-size: 26px; }
	.site-header__inner { height: 64px; }
}
