/* ==========================================================================
   China Blog — main.css
   Быстрая адаптивная тема без фреймворков. Палитра: красный акцент (Китай) + нейтральный текст.
   ========================================================================== */

:root {
	--color-accent: #c8102e;       /* китайский красный */
	--color-accent-dark: #9e0c24;
	--color-text: #1a1a1a;
	--color-muted: #5c6773;
	--color-bg: #ffffff;
	--color-bg-soft: #f7f8fa;
	--color-border: #e6e8eb;
	--color-gold: #f2b705;

	--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
	--maxw: 1180px;
	--radius: 12px;
	--shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
	--space: 20px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--font-sans);
	font-size: 17px;
	line-height: 1.65;
	color: var(--color-text);
	background: var(--color-bg);
}

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

a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-dark); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; color: var(--color-text); }
h1 { font-size: 2rem; margin: 0 0 0.6em; }
h2 { font-size: 1.5rem; margin: 1.6em 0 0.5em; }
h3 { font-size: 1.2rem; margin: 1.4em 0 0.4em; }

p { margin: 0 0 1em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--space); }

/* Доступность */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px; overflow: hidden;
	clip: rect(0, 0, 0, 0); border: 0;
}
.skip-link {
	position: absolute; left: -9999px; top: 0;
	background: #fff; padding: 10px 16px; z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Шапка ---------- */
.site-header {
	border-bottom: 1px solid var(--color-border);
	background: var(--color-bg);
	position: sticky; top: 0; z-index: 100;
}
.site-header__inner {
	display: flex; align-items: center; justify-content: space-between;
	gap: 16px; min-height: 66px;
}
.site-title { font-size: 1.3rem; font-weight: 800; color: var(--color-text); text-decoration: none; }
.site-title:hover { color: var(--color-accent); text-decoration: none; }

.site-nav .nav-menu {
	list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; flex-wrap: wrap;
}
.site-nav .nav-menu a { color: var(--color-text); font-weight: 500; }
.site-nav .nav-menu a:hover { color: var(--color-accent); text-decoration: none; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 10px; }
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
	display: block; width: 24px; height: 2px; background: var(--color-text); position: relative;
}
.nav-toggle__bar::before, .nav-toggle__bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bar::before { top: -7px; }
.nav-toggle__bar::after { top: 7px; }

/* ---------- Hero (главная) ---------- */
.hero {
	background: linear-gradient(135deg, #fff 0%, var(--color-bg-soft) 100%);
	padding: 64px 0;
	border-bottom: 1px solid var(--color-border);
}
.hero__title { font-size: 2.6rem; margin-bottom: 0.3em; }
.hero__subtitle { font-size: 1.2rem; color: var(--color-muted); max-width: 620px; }
.hero__actions { margin-top: 28px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
	display: inline-block; padding: 12px 22px; border-radius: var(--radius);
	font-weight: 600; text-decoration: none; transition: all 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--color-accent); color: #fff; }
.btn--primary:hover { background: var(--color-accent-dark); color: #fff; }
.btn--ghost { background: #fff; color: var(--color-accent); border: 1.5px solid var(--color-accent); }
.btn--ghost:hover { background: var(--color-accent); color: #fff; }

/* ---------- Хабы (сетка разделов) ---------- */
.hubs, .latest { padding: 52px 0; }
.section-title { font-size: 1.7rem; margin: 0 0 1em; }
.hubs__grid {
	display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
}
.hub-card {
	display: flex; flex-direction: column; gap: 6px;
	padding: 22px; background: var(--color-bg-soft);
	border: 1px solid var(--color-border); border-radius: var(--radius);
	text-decoration: none; transition: all 0.15s ease;
}
.hub-card:hover { border-color: var(--color-accent); box-shadow: var(--shadow); text-decoration: none; transform: translateY(-2px); }
.hub-card__title { font-weight: 700; font-size: 1.1rem; color: var(--color-text); }
.hub-card__desc { color: var(--color-muted); font-size: 0.92rem; }

/* ---------- Лента статей ---------- */
.layout-with-sidebar {
	display: grid; grid-template-columns: 1fr 300px; gap: 40px;
	padding: 40px var(--space);
}
.content-area { min-width: 0; }

.post-list { display: flex; flex-direction: column; gap: 28px; }
.post-list--grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.post-card {
	display: flex; gap: 18px; background: #fff;
	border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden;
}
.post-list--grid .post-card { flex-direction: column; gap: 0; }
.post-card__thumb { flex: 0 0 220px; }
.post-list--grid .post-card__thumb { flex: none; }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: 18px 20px; }
.post-card__title { font-size: 1.2rem; margin: 0 0 0.4em; }
.post-card__title a { color: var(--color-text); }
.post-card__title a:hover { color: var(--color-accent); text-decoration: none; }
.post-card__meta { font-size: 0.85rem; color: var(--color-muted); margin-bottom: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.post-card__excerpt { color: var(--color-muted); }
.read-more { display: inline-block; margin-top: 10px; font-weight: 600; }

/* ---------- Одиночная запись ---------- */
.breadcrumbs { font-size: 0.88rem; color: var(--color-muted); margin-bottom: 18px; }
.breadcrumbs a { color: var(--color-muted); }
.single-post__title, .single-page__title { font-size: 2.1rem; }
.single-post__meta { font-size: 0.9rem; color: var(--color-muted); margin-bottom: 20px; display: flex; gap: 14px; flex-wrap: wrap; }
.single-post__thumb, .single-page__thumb { margin: 0 0 24px; border-radius: var(--radius); overflow: hidden; }

.entry-content { font-size: 1.05rem; }
.entry-content h2 { border-bottom: 2px solid var(--color-bg-soft); padding-bottom: 0.3em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin-bottom: 0.4em; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.2em 0; }
.entry-content th, .entry-content td { border: 1px solid var(--color-border); padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--color-bg-soft); }
.entry-content blockquote {
	border-left: 4px solid var(--color-accent); margin: 1.2em 0; padding: 0.4em 1.2em;
	background: var(--color-bg-soft); color: var(--color-muted);
}
.entry-content img { border-radius: var(--radius); margin: 1em 0; }

/* Читайте также + CTA */
.related-posts { margin: 40px 0; padding: 24px; background: var(--color-bg-soft); border-radius: var(--radius); }
.related-posts__title { margin-top: 0; }
.related-posts__list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }

.cta-box {
	margin: 40px 0; padding: 28px; text-align: center;
	background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
	border-radius: var(--radius); color: #fff;
}
.cta-box__text { font-size: 1.15rem; font-weight: 600; margin-bottom: 14px; }
.cta-box__btn { display: inline-block; background: #fff; color: var(--color-accent); padding: 12px 26px; border-radius: var(--radius); font-weight: 700; }
.cta-box__btn:hover { background: var(--color-gold); color: var(--color-text); text-decoration: none; }

.single-post__tags { margin: 24px 0; font-size: 0.9rem; }

/* ---------- Сайдбар ---------- */
.sidebar .widget { margin-bottom: 32px; }
.widget-title { font-size: 1.1rem; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--color-accent); }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { padding: 6px 0; border-bottom: 1px solid var(--color-border); }

/* ---------- Пагинация ---------- */
.pagination { margin: 40px 0; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers {
	padding: 8px 14px; border: 1px solid var(--color-border); border-radius: 8px; color: var(--color-text);
}
.pagination .current { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.pagination a:hover { border-color: var(--color-accent); text-decoration: none; }

/* ---------- Подвал ---------- */
.site-footer {
	margin-top: 60px; padding: 40px 0; background: var(--color-bg-soft);
	border-top: 1px solid var(--color-border);
}
.footer-menu { list-style: none; display: flex; gap: 22px; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
.footer-menu a { color: var(--color-text); }
.site-footer__copy { color: var(--color-muted); font-size: 0.9rem; margin: 0; }

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
	.hubs__grid { grid-template-columns: repeat(2, 1fr); }
	.layout-with-sidebar { grid-template-columns: 1fr; }
	.post-list--grid { grid-template-columns: repeat(2, 1fr); }
	.related-posts__list { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
	body { font-size: 16px; }
	.hero { padding: 44px 0; }
	.hero__title { font-size: 2rem; }
	.site-nav { display: none; }
	.site-nav.is-open {
		display: block; position: absolute; top: 66px; left: 0; right: 0;
		background: #fff; border-bottom: 1px solid var(--color-border); padding: 16px var(--space);
	}
	.site-nav.is-open .nav-menu { flex-direction: column; gap: 0; }
	.site-nav.is-open .nav-menu li { padding: 10px 0; border-bottom: 1px solid var(--color-border); }
	.nav-toggle { display: block; }
	.hubs__grid { grid-template-columns: 1fr; }
	.post-list--grid { grid-template-columns: 1fr; }
	.post-card { flex-direction: column; }
	.post-card__thumb { flex: none; }
}
