/* ==========================================================================
   Zhyldam — жеңіл жаңалықтар темасы
   ~10KB-тен аз, jQuery жоқ, тек CSS variables
   ========================================================================== */

:root {
	--c-primary: #c1121f;
	--c-primary-dark: #9d0e18;
	--c-ink: #1a1a1a;
	--c-muted: #6b7280;
	--c-line: #e5e7eb;
	--c-bg: #ffffff;
	--c-bg-soft: #f7f7f8;

	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-serif: Georgia, "Times New Roman", serif;

	--container: 1100px;
	--radius: 8px;
	--gap: 1.5rem;
	--shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

/* --- Reset (минимал) --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--font);
	font-size: 1.0625rem;
	line-height: 1.65;
	color: var(--c-ink);
	background: var(--c-bg);
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-dark); text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; margin: 0 0 .5em; }
p { margin: 0 0 1em; }

/* --- Layout --- */
.container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: 1rem;
}
/* Барлық бетте (соның ішінде жеке жазбада) контейнер ені бірдей болуын кепілдейміз.
   Ескі тақырып/плагин CSS-і жеке жазбада контейнерді тарылтып жіберуі мүмкін — соны болдырмайды. */
body .site-header .container,
body .site-content.container {
	max-width: var(--container);
	width: 100%;
	margin-inline: auto;
}
.site-content { padding-block: 2rem; }

.content-area.has-sidebar {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2.5rem;
}
@media (min-width: 900px) {
	.content-area.has-sidebar {
		grid-template-columns: minmax(0, 1fr) 300px;
	}
}

/* --- Header --- */
.site-header {
	border-bottom: 1px solid var(--c-line);
	background: var(--c-bg);
	position: sticky;
	top: 0;
	z-index: 50;
}
.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 64px;
}
.site-branding { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.custom-logo { max-height: 44px; width: auto; }
.site-title { font-size: 1.5rem; margin: 0; font-weight: 800; }
.site-title a { color: var(--c-ink); text-decoration: none; }
.site-description { margin: 0; color: var(--c-muted); font-size: .875rem; }

/* --- Navigation --- */
.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 1.25rem;
}
.main-navigation a {
	color: var(--c-ink);
	font-weight: 600;
	font-size: .95rem;
	padding: .5rem 0;
	display: block;
}
.main-navigation a:hover { color: var(--c-primary); text-decoration: none; }
.main-navigation .current-menu-item > a { color: var(--c-primary); }

.menu-toggle {
	display: none;
	background: none;
	border: 0;
	cursor: pointer;
	padding: .5rem;
	width: 40px;
	height: 40px;
}
.menu-toggle__bar,
.menu-toggle__bar::before,
.menu-toggle__bar::after {
	display: block;
	width: 22px;
	height: 2px;
	background: var(--c-ink);
	position: relative;
	transition: transform .2s ease, opacity .2s ease;
}
.menu-toggle__bar::before,
.menu-toggle__bar::after { content: ""; position: absolute; left: 0; }
.menu-toggle__bar::before { top: -7px; }
.menu-toggle__bar::after { top: 7px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar::before { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
	.menu-toggle { display: block; }
	.main-navigation #primary-menu {
		display: none;
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		flex-direction: column;
		gap: 0;
		background: var(--c-bg);
		border-bottom: 1px solid var(--c-line);
		box-shadow: var(--shadow);
		padding: .5rem 1rem;
	}
	.main-navigation.is-open #primary-menu { display: flex; }
	.main-navigation { position: static; }
	.site-header__inner { position: relative; }
}

/* --- Жаңалық торы (grid) --- */
.posts-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--gap);
}
@media (min-width: 560px) {
	.posts-grid { grid-template-columns: repeat(2, 1fr); }
}
.content-area.has-sidebar .posts-grid { grid-template-columns: 1fr; }
@media (min-width: 560px) {
	.content-area.has-sidebar .posts-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Hero (басты блок) --- */
.hero {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.25rem;
	margin-bottom: 2.5rem;
}
@media (min-width: 900px) {
	.hero { grid-template-columns: 2fr 1fr; }
}
.hero__main {
	position: relative;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--c-bg-soft);
	min-height: 280px;
}
.hero__link { display: block; height: 100%; }
.hero__main img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	aspect-ratio: 16 / 9;
	display: block;
}
.hero__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: .4rem;
	padding: 1.5rem;
	background: linear-gradient(to top, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .25) 55%, transparent 100%);
}
.hero__cat {
	align-self: flex-start;
	background: var(--c-primary);
	color: #fff;
	font-size: .72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	padding: .2rem .6rem;
	border-radius: 4px;
}
.hero__title {
	color: #fff;
	font-size: clamp(1.3rem, 2.6vw, 2rem);
	margin: 0;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.hero__title a, .hero__main:hover .hero__title { color: #fff; text-decoration: none; }
.hero__meta { color: rgba(255, 255, 255, .85); font-size: .82rem; }

.hero__side { display: flex; flex-direction: column; gap: 1rem; }
.hero-item {
	display: grid;
	grid-template-columns: 104px 1fr;
	gap: .85rem;
	align-items: center;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--c-line);
}
.hero__side .hero-item:last-child { border-bottom: 0; padding-bottom: 0; }
.hero-item__thumb { display: block; border-radius: 6px; overflow: hidden; background: var(--c-bg-soft); }
.hero-item__thumb img { width: 104px; height: 78px; object-fit: cover; display: block; }
.hero-item__body { display: flex; flex-direction: column; gap: .25rem; }
.hero-item__cat { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--c-primary); }
.hero-item__title { font-size: .98rem; font-weight: 600; line-height: 1.3; margin: 0; }
.hero-item__title a { color: var(--c-ink); }
.hero-item__title a:hover { color: var(--c-primary); text-decoration: none; }
.hero-item__meta { font-size: .75rem; color: var(--c-muted); }

/* --- Айдар блогы --- */
.cat-section { margin-bottom: 2.5rem; }
.cat-section__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	border-bottom: 2px solid var(--c-primary);
	padding-bottom: .5rem;
	margin-bottom: 1.25rem;
}
.cat-section__title {
	margin: 0;
	font-size: 1.2rem;
	text-transform: uppercase;
	letter-spacing: .03em;
}
.cat-section__title a { color: var(--c-ink); }
.cat-section__title a:hover { color: var(--c-primary); text-decoration: none; }
.cat-section__more { font-size: .85rem; font-weight: 600; white-space: nowrap; }

.posts-grid--4 { grid-template-columns: 1fr; }
@media (min-width: 560px) { .posts-grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .posts-grid--4 { grid-template-columns: repeat(4, 1fr); } }

/* --- Карточка --- */
.post-card {
	background: var(--c-bg);
	border: 1px solid var(--c-line);
	border-radius: var(--radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow .15s ease, transform .15s ease;
}
.post-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.post-card__thumb { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--c-bg-soft); }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; }
.post-card__cat {
	align-self: flex-start;
	font-size: .72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--c-primary);
}
.post-card__title { font-size: 1.15rem; margin: 0; line-height: 1.35; }
.post-card__title a { color: var(--c-ink); }
.post-card__title a:hover { color: var(--c-primary); text-decoration: none; }
.post-card__meta { font-size: .8rem; color: var(--c-muted); }
.post-card__excerpt { font-size: .92rem; color: #444; margin: 0; }

/* --- Жеке жазба --- */
/* Жеке жазба ені басты бетпен бірдей (контейнер ені).
   Оқуға ыңғайлы тар баған қаласаңыз: max-width: 820px; margin-inline: auto; деп қойыңыз. */
.single-post { max-width: 100%; }
.content-area.has-sidebar .single-post { max-width: 100%; }
.entry-header { margin-bottom: 1.25rem; }
.entry-cat {
	display: inline-block;
	font-size: .75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--c-primary);
	margin-bottom: .5rem;
}
.entry-title { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 .5rem; }
.single-post.page .entry-title { margin-bottom: 1rem; }
.entry-meta { font-size: .875rem; color: var(--c-muted); }
.entry-meta a { color: var(--c-muted); }
.entry-meta a:hover { color: var(--c-primary); }
.entry-thumb { margin: 1.5rem 0; border-radius: var(--radius); overflow: hidden; }
.entry-content { font-size: 1.0625rem; line-height: 1.75; }
.entry-content > * { margin-bottom: 1.2em; }
.entry-content h2 { font-size: 1.6rem; margin-top: 1.8em; }
.entry-content h3 { font-size: 1.3rem; margin-top: 1.5em; }
.entry-content img,
.entry-content figure { border-radius: var(--radius); }
.entry-content blockquote {
	margin: 1.5em 0;
	padding: .5em 1.2em;
	border-left: 4px solid var(--c-primary);
	color: #333;
	font-style: italic;
}
.entry-content code {
	background: var(--c-bg-soft);
	padding: .15em .4em;
	border-radius: 4px;
	font-size: .9em;
}
.entry-content pre {
	background: #1a1a1a;
	color: #f7f7f8;
	padding: 1rem;
	border-radius: var(--radius);
	overflow-x: auto;
}
.entry-tags { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 1.5rem 0 0; }
.entry-tags li a {
	font-size: .8rem;
	background: var(--c-bg-soft);
	border: 1px solid var(--c-line);
	border-radius: 999px;
	padding: .25rem .75rem;
	color: var(--c-muted);
}
.entry-tags li a:hover { color: var(--c-primary); text-decoration: none; }

/* --- Post navigation --- */
.post-navigation {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin: 2rem 0;
	padding-top: 1.5rem;
	border-top: 1px solid var(--c-line);
	font-weight: 600;
}
.post-navigation .nav-next { text-align: right; margin-left: auto; }

/* --- Үздіксіз оқу (infinite scroll) --- */
/* Үздіксіз оқу қосылғанда жазбалар арасындағы prev/next навигация артық — жасырамыз. */
.an-infinite-on .post-navigation { display: none; }

.an-next-sep {
	position: relative;
	text-align: center;
	margin: 2.5rem 0 2rem;
	border-top: 1px solid var(--c-line);
}
.an-next-sep span {
	position: relative;
	top: -.75rem;
	display: inline-block;
	background: var(--c-bg);
	padding: 0 1rem;
	font-size: .8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--c-muted);
}
/* Үздіксіз оқуда әр келесі мақаланы бір-бірінен бөлектеу. */
.an-infinite-on .single-post ~ .single-post,
.an-next-sep + .single-post { margin-top: 0; }

.an-infinite-sentinel {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 1px;
	padding: 1.5rem 0;
}
.an-infinite-sentinel .an-infinite-spinner { display: none; }
.an-infinite-sentinel.is-loading { min-height: 60px; }
.an-infinite-sentinel.is-loading .an-infinite-spinner {
	display: block;
	width: 26px;
	height: 26px;
	border: 3px solid var(--c-line);
	border-top-color: var(--c-primary);
	border-radius: 50%;
	animation: an-spin .7s linear infinite;
}
@keyframes an-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
	.an-infinite-sentinel.is-loading .an-infinite-spinner { animation: none; }
}

/* --- Page header / archive --- */
.page-header { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 2px solid var(--c-primary); }
.page-title { font-size: clamp(1.4rem, 3vw, 2rem); margin: 0; }
.archive-description { color: var(--c-muted); margin-top: .5rem; }

/* --- Sidebar --- */
.sidebar .widget { margin-bottom: 2rem; }
.widget-title {
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: .04em;
	margin-bottom: 1rem;
	padding-bottom: .5rem;
	border-bottom: 2px solid var(--c-primary);
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { padding: .4rem 0; border-bottom: 1px solid var(--c-line); }
.sidebar li a { color: var(--c-ink); }
.sidebar li a:hover { color: var(--c-primary); }

/* --- Search form --- */
.search-form { display: flex; gap: .5rem; }
.search-field {
	flex: 1;
	padding: .6rem .8rem;
	border: 1px solid var(--c-line);
	border-radius: var(--radius);
	font-size: 1rem;
	font-family: inherit;
}
.search-field:focus { outline: 2px solid var(--c-primary); outline-offset: 1px; }
.search-submit,
.button {
	background: var(--c-primary);
	color: #fff;
	border: 0;
	border-radius: var(--radius);
	padding: .6rem 1.1rem;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	display: inline-block;
}
.search-submit:hover,
.button:hover { background: var(--c-primary-dark); color: #fff; text-decoration: none; }

/* --- Pagination --- */
.pagination, .comments-pagination { margin: 2.5rem 0; }
.pagination .nav-links,
.comments-pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.pagination a, .pagination .current,
.comments-pagination a, .comments-pagination .current {
	padding: .5rem .85rem;
	border: 1px solid var(--c-line);
	border-radius: var(--radius);
	color: var(--c-ink);
	font-weight: 600;
}
.pagination .current, .comments-pagination .current { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.pagination a:hover, .comments-pagination a:hover { background: var(--c-bg-soft); text-decoration: none; }

/* --- Comments --- */
.comments-area { margin-top: 3rem; }
.comments-title { font-size: 1.4rem; margin-bottom: 1.5rem; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list ol { list-style: none; padding-left: 1.5rem; }
.comment-body { padding: 1rem 0; border-bottom: 1px solid var(--c-line); }
.comment-author { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.comment-author .avatar { border-radius: 50%; }
.comment-meta { font-size: .8rem; color: var(--c-muted); }
.comment-respond { margin-top: 2rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: .6rem .8rem;
	border: 1px solid var(--c-line);
	border-radius: var(--radius);
	font-family: inherit;
	font-size: 1rem;
	margin-bottom: 1rem;
}

/* --- Footer --- */
.site-footer {
	margin-top: 3rem;
	background: var(--c-bg-soft);
	border-top: 1px solid var(--c-line);
	padding-block: 2.5rem 1.5rem;
}
.footer-widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 2rem;
	margin-bottom: 2rem;
}
.footer-menu {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	padding: 0;
	margin: 0 0 1rem;
	justify-content: center;
}
.footer-menu a { color: var(--c-ink); font-weight: 600; font-size: .9rem; }
.site-info { text-align: center; color: var(--c-muted); font-size: .875rem; }

/* --- No results / 404 --- */
.no-results { max-width: 600px; }
.error-404 .page-title { font-size: 4rem; color: var(--c-primary); border: 0; }

/* --- Accessibility --- */
.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--c-primary);
	color: #fff;
	padding: .75rem 1rem;
	z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	word-wrap: normal !important;
}
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
	* { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
