/* ================================================================
   Cheat Starter — Main Stylesheet
   Light theme by default, dark via [data-theme="dark"]
   CSS custom properties управляются через Customizer
   ================================================================ */

/* ── Reset & Base ───────────────────────────────────── */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* ── Light Theme (default) ──────────────────────────── */
:root {
	--cs-green: #00c96a;
	--cs-blue: #0099cc;
	--cs-purple: #8b5cf6;
	--cs-bg1: #ffffff;
	--cs-bg2: #f4f5f7;
	--cs-text: #1a1a2e;
	--cs-text-muted: #6b7280;
	--cs-heading: #111827;
	--cs-border: #e5e7eb;
	--cs-header-bg: rgb(255, 255, 255);
	--cs-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
	--cs-radius: 12px;
	--cs-radius-sm: 8px;
	--cs-transition: 0.25s ease;
	--cs-max-w: 1200px;
	--cs-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Dark Theme ─────────────────────────────────────── */
[data-theme="dark"] {
	--cs-green: #00ff88;
	--cs-blue: #00d4ff;
	--cs-purple: #a855f7;
	--cs-bg1: #0a0a0f;
	--cs-bg2: #12121a;
	--cs-text: #e4e4e7;
	--cs-text-muted: #9ca3af;
	--cs-heading: #ffffff;
	--cs-border: #1e1e2a;
	--cs-header-bg: rgb(10, 10, 15);
	--cs-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	font-family: var(--cs-font);
	font-size: 16px;
	line-height: 1.7;
	color: var(--cs-text);
	background: var(--cs-bg1);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
	transition: background var(--cs-transition), color var(--cs-transition);
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--cs-green);
	text-decoration: none;
	transition: color var(--cs-transition);
}
a:hover {
	color: var(--cs-blue);
}

/* ── Accessibility ──────────────────────────────────── */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.screen-reader-text:focus {
	position: fixed;
	top: 5px;
	left: 5px;
	z-index: 100000;
	width: auto;
	height: auto;
	padding: 12px 24px;
	clip: auto;
	background: var(--cs-bg2);
	color: var(--cs-green);
	font-size: 14px;
	font-weight: 600;
	border-radius: var(--cs-radius-sm);
}

/* ── Container ──────────────────────────────────────── */
.container {
	width: 100%;
	max-width: var(--cs-max-w);
	margin: 0 auto;
	padding: 0 20px;
}

/* ── Header ─────────────────────────────────────────── */
.site-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: var(--cs-header-bg);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border-bottom: 1px solid var(--cs-border);
	transition: background var(--cs-transition), border-color var(--cs-transition);
}
.site-header__inner {
	display: flex;
	align-items: center;
	gap: 24px;
	height: 64px;
}
.site-brand {
	flex-shrink: 0;
}
.site-brand__name {
	font-size: 20px;
	font-weight: 900;
	color: var(--cs-heading);
	text-transform: uppercase;
	letter-spacing: 1px;
}
.site-brand img {
	max-height: 40px;
	width: auto;
}

/* Navigation */
.main-nav {
	margin-left: auto;
}
.nav-list {
	list-style: none;
	display: flex;
	gap: 4px;
}
.nav-list li a {
	display: block;
	padding: 8px 16px;
	color: var(--cs-text-muted);
	font-size: 14px;
	font-weight: 600;
	border-radius: var(--cs-radius-sm);
	transition: all var(--cs-transition);
}
.nav-list li a:hover,
.nav-list li.current-menu-item > a {
	color: var(--cs-text);
	background: rgba(128, 128, 128, 0.08);
}

/* Mobile toggle */
.menu-toggle {
	display: none;
	flex-direction: column;
	gap: 5px;
	background: none;
	border: none;
	padding: 8px;
	cursor: pointer;
	margin-left: auto;
}
.menu-toggle__bar {
	display: block;
	width: 24px;
	height: 2px;
	background: var(--cs-text);
	border-radius: 2px;
	transition: all var(--cs-transition);
}

/* ── Theme Toggle ───────────────────────────────────── */
.theme-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	padding: 0;
	background: var(--cs-bg2);
	border: 1px solid var(--cs-border);
	border-radius: 50%;
	cursor: pointer;
	color: var(--cs-text-muted);
	transition: all var(--cs-transition);
}
.theme-toggle:hover {
	color: var(--cs-text);
	border-color: var(--cs-text-muted);
}
/* Light mode: show moon icon, hide sun */
.theme-toggle__icon--light {
	display: none;
}
.theme-toggle__icon--dark {
	display: block;
}
/* Dark mode: show sun icon, hide moon */
[data-theme="dark"] .theme-toggle__icon--light {
	display: block;
}
[data-theme="dark"] .theme-toggle__icon--dark {
	display: none;
}

/* ── Front Page ─────────────────────────────────────── */
.front-page {
	padding: 48px 0 80px;
}
.front-page__title {
	font-size: clamp(1.75rem, 4vw, 2.75rem);
	font-weight: 900;
	line-height: 1.2;
	color: var(--cs-heading);
	margin-bottom: 32px;
}
.front-page__image {
	margin-bottom: 32px;
	border-radius: var(--cs-radius);
	overflow: hidden;
}
.front-page__image img {
	width: 100%;
	height: auto;
}

/* ── Section Common ─────────────────────────────────── */
.section {
	padding: 80px 0;
}
.section:nth-child(even) {
	background: var(--cs-bg2);
}
.section__title {
	font-size: clamp(1.5rem, 3vw, 2.25rem);
	font-weight: 800;
	text-align: center;
	margin-bottom: 12px;
	color: var(--cs-heading);
}
.section__subtitle {
	text-align: center;
	color: var(--cs-text-muted);
	max-width: 560px;
	margin: 0 auto 48px;
	font-size: 1.05rem;
}

/* ── Card Grid ──────────────────────────────────────── */
.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 24px;
}
.card-grid--3 {
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ── Post Card ──────────────────────────────────────── */
.post-card {
	background: var(--cs-bg2);
	border: 1px solid var(--cs-border);
	border-radius: var(--cs-radius);
	overflow: hidden;
	transition: all var(--cs-transition);
	box-shadow: var(--cs-card-shadow);
}
.post-card:hover {
	border-color: var(--cs-green);
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .post-card:hover {
	box-shadow: 0 0 30px rgba(0, 255, 136, 0.06);
}
.post-card__thumb img {
	width: 100%;
	height: 200px;
	object-fit: cover;
}
.post-card__body {
	padding: 20px 24px 24px;
}
.post-card__cat {
	display: inline-block;
	padding: 3px 10px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--cs-green);
	background: rgba(0, 201, 106, 0.08);
	border-radius: 100px;
	margin-bottom: 10px;
}
[data-theme="dark"] .post-card__cat {
	background: rgba(0, 255, 136, 0.08);
}
.post-card__cat:hover {
	color: #fff;
	background: var(--cs-green);
}
.post-card__title {
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.4;
	margin-bottom: 8px;
}
.post-card__title a {
	color: var(--cs-heading);
}
.post-card__title a:hover {
	color: var(--cs-green);
}
.post-card__excerpt {
	color: var(--cs-text-muted);
	font-size: 0.9rem;
	line-height: 1.6;
	margin-bottom: 12px;
}
.post-card__date {
	font-size: 0.8rem;
	color: var(--cs-text-muted);
}

/* ── Archive Layout ─────────────────────────────────── */
.archive-layout {
	display: grid;
	grid-template-columns: 1fr 280px;
	gap: 40px;
	padding-top: 40px;
	padding-bottom: 60px;
}
.archive-layout__main {
	min-width: 0;
}

/* ── Archive Header ─────────────────────────────────── */
.archive-header {
	margin-bottom: 32px;
}
.archive-header__title {
	font-size: 1.75rem;
	font-weight: 800;
	color: var(--cs-heading);
}
.archive-header__desc {
	color: var(--cs-text-muted);
	margin-top: 8px;
}

/* ── Single Post ────────────────────────────────────── */
.single-layout {
	display: grid;
	grid-template-columns: 1fr 280px;
	gap: 40px;
	padding-top: 40px;
	padding-bottom: 60px;
}
.single-layout__main {
	min-width: 0;
}

.post-full__header {
	margin-bottom: 32px;
}
.post-full__cats {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
}
.post-full__title {
	font-size: clamp(1.5rem, 3vw, 2.25rem);
	font-weight: 900;
	line-height: 1.2;
	color: var(--cs-heading);
	margin-bottom: 12px;
}
.post-full__meta {
	display: flex;
	gap: 16px;
	font-size: 0.85rem;
	color: var(--cs-text-muted);
}
.post-full__thumb {
	margin-bottom: 32px;
	border-radius: var(--cs-radius);
	overflow: hidden;
}
.post-full__thumb img {
	width: 100%;
	height: auto;
}

/* Entry Content (article body) */
.entry-content {
	font-size: 1.05rem;
	line-height: 1.8;
	color: var(--cs-text);
}
.entry-content h2 {
	font-size: 1.5rem;
	font-weight: 800;
	color: var(--cs-heading);
	margin: 40px 0 16px;
}
.entry-content h3 {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--cs-heading);
	margin: 32px 0 12px;
}
.entry-content h4 {
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--cs-heading);
	margin: 24px 0 8px;
}
.entry-content p {
	margin-bottom: 16px;
}
.entry-content ul,
.entry-content ol {
	margin: 0 0 16px 24px;
}
.entry-content li {
	margin-bottom: 6px;
}
.entry-content blockquote {
	margin: 24px 0;
	padding: 20px 24px;
	border-left: 4px solid var(--cs-green);
	background: var(--cs-bg2);
	border-radius: 0 var(--cs-radius-sm) var(--cs-radius-sm) 0;
	font-style: italic;
	color: var(--cs-text-muted);
}
.entry-content pre {
	background: var(--cs-bg2);
	border: 1px solid var(--cs-border);
	border-radius: var(--cs-radius-sm);
	padding: 20px;
	overflow-x: auto;
	font-size: 0.9rem;
	margin-bottom: 16px;
}
.entry-content code {
	background: var(--cs-bg2);
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 0.9em;
}
.entry-content table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 16px;
}
.entry-content th,
.entry-content td {
	padding: 10px 14px;
	border: 1px solid var(--cs-border);
	text-align: left;
}
.entry-content th {
	background: var(--cs-bg2);
	font-weight: 700;
	color: var(--cs-heading);
}
.entry-content img {
	border-radius: var(--cs-radius-sm);
	margin: 16px 0;
}
.entry-content .wp-block-image {
	margin: 24px 0;
}

/* Tags */
.post-full__footer {
	margin-top: 40px;
	padding-top: 24px;
	border-top: 1px solid var(--cs-border);
}
.post-full__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.tag-link {
	display: inline-block;
	padding: 4px 12px;
	font-size: 0.85rem;
	color: var(--cs-text-muted);
	background: var(--cs-bg2);
	border: 1px solid var(--cs-border);
	border-radius: 100px;
	transition: all var(--cs-transition);
}
.tag-link:hover {
	color: var(--cs-purple);
	border-color: var(--cs-purple);
}

/* Post Nav */
.post-nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin: 48px 0;
}
.post-nav__link {
	display: block;
	padding: 20px;
	background: var(--cs-bg2);
	border: 1px solid var(--cs-border);
	border-radius: var(--cs-radius-sm);
	transition: all var(--cs-transition);
}
.post-nav__link:hover {
	border-color: var(--cs-green);
}
.post-nav__link--next {
	text-align: right;
}
.post-nav__label {
	display: block;
	font-size: 0.8rem;
	color: var(--cs-text-muted);
	margin-bottom: 4px;
}
.post-nav__title {
	display: block;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--cs-heading);
}

/* Related Posts */
.related-posts {
	margin-bottom: 48px;
}
.related-posts .section__title {
	text-align: left;
	margin-bottom: 24px;
}

/* ── Page Content ───────────────────────────────────── */
.page-layout {
	padding: 40px 20px 80px;
	max-width: 800px;
}
.page-content__title {
	font-size: clamp(1.5rem, 3vw, 2.25rem);
	font-weight: 900;
	color: var(--cs-heading);
	margin-bottom: 32px;
}

/* ── 404 ────────────────────────────────────────────── */
.error-404 {
	text-align: center;
	padding: 100px 0;
}
.error-404__code {
	font-size: 8rem;
	font-weight: 900;
	line-height: 1;
	background: linear-gradient(135deg, var(--cs-green), var(--cs-purple));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}
.error-404__title {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--cs-heading);
	margin: 16px 0;
}
.error-404__desc {
	color: var(--cs-text-muted);
	margin-bottom: 32px;
}

/* ── Sidebar ────────────────────────────────────────── */
.sidebar {
	position: sticky;
	top: 84px;
	align-self: start;
}
.widget {
	background: var(--cs-bg2);
	border: 1px solid var(--cs-border);
	border-radius: var(--cs-radius);
	padding: 24px;
	margin-bottom: 20px;
	box-shadow: var(--cs-card-shadow);
	transition: background var(--cs-transition), border-color var(--cs-transition);
}
.widget-title {
	font-size: 1rem;
	font-weight: 700;
	color: var(--cs-heading);
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--cs-border);
}
.widget ul {
	list-style: none;
}
.widget li {
	padding: 6px 0;
	border-bottom: 1px solid var(--cs-border);
}
.widget li:last-child {
	border-bottom: none;
}
.widget li a {
	color: var(--cs-text-muted);
	font-size: 0.9rem;
}
.widget li a:hover {
	color: var(--cs-green);
}
.widget .search-field {
	width: 100%;
}

/* ── Comments ───────────────────────────────────────── */
.comments-area {
	margin-top: 48px;
	padding-top: 32px;
	border-top: 1px solid var(--cs-border);
}
.comments-area__title {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--cs-heading);
	margin-bottom: 24px;
}
.comment-list {
	list-style: none;
	margin-bottom: 32px;
}
.comment-list .comment {
	padding: 20px;
	margin-bottom: 16px;
	background: var(--cs-bg2);
	border: 1px solid var(--cs-border);
	border-radius: var(--cs-radius-sm);
}
.comment-list .comment .children {
	list-style: none;
	margin-top: 16px;
	padding-left: 24px;
}
.comment-author {
	font-weight: 700;
	color: var(--cs-heading);
	margin-bottom: 4px;
}
.comment-meta {
	font-size: 0.8rem;
	color: var(--cs-text-muted);
	margin-bottom: 8px;
}
.comment-content {
	color: var(--cs-text);
	font-size: 0.95rem;
}

/* Comment Form */
.comment-form label {
	display: block;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--cs-text);
	margin-bottom: 6px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 10px 14px;
	background: var(--cs-bg1);
	border: 1px solid var(--cs-border);
	border-radius: var(--cs-radius-sm);
	color: var(--cs-text);
	font-family: var(--cs-font);
	font-size: 0.95rem;
	margin-bottom: 16px;
	transition: border-color var(--cs-transition);
}
.comment-form input:focus,
.comment-form textarea:focus {
	outline: none;
	border-color: var(--cs-green);
	box-shadow: 0 0 0 2px rgba(0, 201, 106, 0.15);
}
[data-theme="dark"] .comment-form input:focus,
[data-theme="dark"] .comment-form textarea:focus {
	box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.1);
}
.comment-form textarea {
	min-height: 120px;
	resize: vertical;
}
.comment-form .form-submit .submit {
	display: inline-block;
	padding: 10px 24px;
	background: var(--cs-green);
	color: #fff;
	border: none;
	border-radius: var(--cs-radius-sm);
	font-family: var(--cs-font);
	font-weight: 700;
	font-size: 0.95rem;
	cursor: pointer;
	transition: all var(--cs-transition);
}
.comment-form .form-submit .submit:hover {
	opacity: 0.9;
}

/* Search Form */
.search-form {
	display: flex;
	gap: 8px;
}
.search-field {
	flex: 1;
	padding: 10px 14px;
	background: var(--cs-bg2);
	border: 1px solid var(--cs-border);
	border-radius: var(--cs-radius-sm);
	color: var(--cs-text);
	font-family: var(--cs-font);
	font-size: 0.95rem;
}
.search-field:focus {
	outline: none;
	border-color: var(--cs-green);
}
.search-submit {
	padding: 10px 20px;
	background: var(--cs-green);
	color: #fff;
	border: none;
	border-radius: var(--cs-radius-sm);
	font-weight: 700;
	cursor: pointer;
	transition: all var(--cs-transition);
}
.search-submit:hover {
	opacity: 0.9;
}

/* ── Footer ─────────────────────────────────────────── */
.site-footer {
	background: var(--cs-bg2);
	border-top: 1px solid var(--cs-border);
	padding: 40px 0 32px;
	transition: background var(--cs-transition), border-color var(--cs-transition);
}
.footer-nav {
	margin-bottom: 24px;
}
.footer-nav__list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}
.footer-nav__list li a {
	display: block;
	padding: 6px 14px;
	font-size: 0.9rem;
	color: var(--cs-text-muted);
	border-radius: var(--cs-radius-sm);
	transition: color var(--cs-transition);
}
.footer-nav__list li a:hover {
	color: var(--cs-green);
}
.footer-bottom {
	text-align: center;
	font-size: 0.85rem;
	color: var(--cs-text-muted);
}

/* ── Pagination ─────────────────────────────────────── */
.navigation.pagination {
	margin-top: 40px;
}
.nav-links {
	display: flex;
	justify-content: center;
	gap: 6px;
	flex-wrap: wrap;
}
.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--cs-text-muted);
	background: var(--cs-bg2);
	border: 1px solid var(--cs-border);
	border-radius: var(--cs-radius-sm);
	transition: all var(--cs-transition);
}
.page-numbers:hover,
.page-numbers.current {
	color: #fff;
	background: var(--cs-green);
	border-color: var(--cs-green);
}

/* Page Links (multi-page posts) */
.page-links {
	margin-top: 24px;
	font-weight: 600;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1024px) {
	.archive-layout,
	.single-layout {
		grid-template-columns: 1fr;
	}
	.sidebar {
		position: static;
	}
}

@media (max-width: 768px) {
	.site-header__inner {
		flex-wrap: wrap;
	}
	.menu-toggle {
		display: flex;
		order: 2;
	}
	.main-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		margin: 0;
		padding: 16px 20px;
		background: var(--cs-header-bg);
		backdrop-filter: blur(16px);
		-webkit-backdrop-filter: blur(16px);
		border-top: 1px solid var(--cs-border);
		border-bottom: 1px solid var(--cs-border);
		box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
	}
	.main-nav.is-active {
		display: block;
	}
	.nav-list {
		flex-direction: column;
	}
	.nav-list li a {
		padding: 10px 0;
	}
	.theme-toggle {
		order: 3;
	}

	.section {
		padding: 50px 0;
	}
	.card-grid {
		grid-template-columns: 1fr;
	}

	.post-nav {
		grid-template-columns: 1fr;
	}

	.front-page {
		padding: 32px 0 60px;
	}
}

@media (max-width: 480px) {
	.front-page__title {
		font-size: 1.5rem;
	}
}

/* ── WordPress Core Overrides ───────────────────────── */
.wp-block-separator {
	border-color: var(--cs-border);
}
.alignwide {
	max-width: calc(var(--cs-max-w) + 40px);
}
.alignfull {
	max-width: 100vw;
	margin-left: calc(-50vw + 50%);
	margin-right: calc(-50vw + 50%);
}

/* ── Animations (respects prefers-reduced-motion) ──── */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
