/*
 * Two palettes on purpose (D17):
 *  --hwh-*  blog content tokens (from the blog layout, orange accent);
 *  --lp-*   header/footer tokens copied from the landing page, so the chrome
 *           looks identical to the main site (dark primary button, not orange).
 */
@font-face {
	font-family: Inter;
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/inter-latin-var.woff2") format("woff2");
}

:root {
	--hwh-accent: #E95E2A;
	--hwh-accent-hover: #c74d1f;
	--hwh-ink: #1a1a1a;
	--hwh-text: #444;
	--hwh-muted: #666;
	--hwh-meta: #999;
	--hwh-faint: #bbb;
	--hwh-border: #f0f0f0;
	--hwh-border-strong: #eee;
	--hwh-chip: #f5f5f5;
	--hwh-panel: #fafafa;
	--hwh-bg: #fff;
	--hwh-radius-card: 12px;
	--hwh-radius-btn: 8px;
	--hwh-radius-chip: 100px;
	/* Контейнер совпадает с лендингом (1120/24), а не с макетом (1280/64):
	   шапка общая для сайта, и при переходе с / на /blog/ логотип и меню
	   не должны прыгать. Содержимое держим в той же ширине, иначе оно было бы
	   шире собственной шапки. */
	--hwh-container: 1120px;
	--hwh-gutter: 24px;

	--lp-ink: #171717;
	--lp-muted: #5b5b66;
	--lp-line: #e7e7ec;
	--lp-soft: #f6f6f9;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--hwh-bg);
	color: var(--hwh-text);
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 17px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

.wrap {
	max-width: var(--hwh-container);
	margin: 0 auto;
	padding: 0 var(--hwh-gutter);
}

.content { padding-top: 48px; padding-bottom: 64px; }
.content h1 { color: var(--hwh-ink); letter-spacing: -0.02em; }
.content a { color: var(--hwh-accent); }
.content a:hover { color: var(--hwh-accent-hover); }

:focus-visible { outline: 3px solid var(--hwh-accent); outline-offset: 3px; border-radius: 6px; }

/* Header (landing port) */
.site-header {
	position: sticky;
	top: env(safe-area-inset-top, 0px);
	z-index: 20;
	background: rgba(255, 255, 255, 0.94);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--lp-line);
}

.site-header .bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 64px;
	gap: 16px;
}

.site-header .brand {
	font-weight: 800;
	font-size: 19px;
	letter-spacing: -0.02em;
	text-decoration: none;
	display: flex;
	align-items: center;
	gap: 10px;
}

.site-header nav { display: flex; gap: 28px; }

.site-header nav a {
	text-decoration: none;
	color: var(--lp-muted);
	font-size: 15px;
	font-weight: 500;
}

.site-header nav a:hover { color: var(--lp-ink); }

.site-header nav a[aria-current="page"],
.site-header nav a[aria-current="page"]:hover { color: var(--hwh-accent); }

.bar-actions { display: flex; gap: 10px; align-items: center; }

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0 22px;
	border-radius: 10px;
	font: 600 15px/1 Inter, sans-serif;
	text-decoration: none;
	border: 1.5px solid var(--lp-ink);
	cursor: pointer;
	background: transparent;
}

.btn-dark, .content a.btn-dark { background: var(--lp-ink); color: #fff; }
.btn-dark:hover, .content a.btn-dark:hover { background: #000; color: #fff; }
.btn-line { background: #fff; color: var(--lp-ink); }
.btn-line:hover { background: var(--lp-soft); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; }

.link-quiet {
	font-size: 15px;
	font-weight: 500;
	color: var(--lp-muted);
	text-decoration: none;
	padding: 8px 6px;
}

.link-quiet:hover { color: var(--lp-ink); }

/* Footer (landing port) */
.site-footer {
	padding: 36px 0 48px;
	font-size: 14px;
	color: var(--lp-muted);
}

.site-footer .row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 16px;
}

.site-footer a { text-decoration: none; color: inherit; }
.site-footer a:hover { color: var(--lp-ink); text-decoration: underline; }

@media (max-width: 960px) {
	.site-header nav { display: none; }
}

@media (max-width: 620px) {
	.wrap { padding: 0 18px; }
}

/* Category chips and cover placeholders (inc/categories.php, inc/cover.php).
   Colours come from inline --cat-* variables; fallbacks are the neutral palette. */
.hwh-chip-cat {
	display: inline-block;
	padding: 4px 12px;
	border-radius: var(--hwh-radius-chip);
	background: var(--cat-soft, #f5f5f5);
	color: var(--cat-accent, #666);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	text-decoration: none;
}

.hwh-cover {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	overflow: hidden;
}
.hwh-cover--hwh-card { aspect-ratio: 16 / 9; }
.hwh-cover--hwh-wide { aspect-ratio: 20 / 9; }
.hwh-cover--hwh-og { aspect-ratio: 1200 / 630; }

.hwh-cover__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hwh-cover--ph {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--cat-grad, linear-gradient(135deg, #f5f5f5, #e7e7e7));
}
.hwh-cover__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--cat-accent, #666);
	color: #fff;
}
.hwh-cover__icon svg { width: 26px; height: 26px; }

/* --- Authors (inc/authors.php, template-parts/author-*.php) ----------------- */
.hwh-avatar {
	display: block;
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
}
.hwh-author-inline {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 0;
	margin: 0 0 24px;
	border-top: 1px solid var(--hwh-border);
	border-bottom: 1px solid var(--hwh-border);
}
.hwh-author-inline__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1 1 auto;
}
.hwh-author-inline__name {
	font-size: 15px;
	font-weight: 600;
	color: var(--hwh-ink);
	line-height: 1.3;
}
.hwh-author-inline__position {
	font-size: 13px;
	color: var(--hwh-muted);
	line-height: 1.4;
}
.hwh-author-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--hwh-muted);
	text-decoration: none;
	flex: 0 0 auto;
}
.hwh-author-link:hover,
.hwh-author-link:focus-visible {
	color: var(--hwh-accent);
}
.hwh-author-link svg {
	width: 20px;
	height: 20px;
}
.hwh-author-card {
	display: flex;
	align-items: flex-start;
	gap: 20px;
	margin: 48px 0 0;
	padding: 28px;
	background: var(--hwh-panel);
	border-radius: var(--hwh-radius-card);
}
.hwh-author-card .hwh-avatar {
	width: 64px;
	height: 64px;
}
.hwh-author-card__body {
	min-width: 0;
}
.hwh-author-card__label {
	margin: 0 0 4px;
	font-size: 13px;
	font-weight: 600;
	color: var(--hwh-accent);
}
.hwh-author-card__name {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--hwh-ink);
	line-height: 1.3;
}
.hwh-author-card__bio {
	margin: 8px 0 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--hwh-muted);
}
.hwh-author-card__link {
	margin-top: 12px;
	font-size: 14px;
}
.hwh-author-card__link span {
	font-weight: 600;
}
@media (max-width: 620px) {
	.hwh-author-card {
		flex-direction: column;
		padding: 20px;
	}
}

/* --- Catalog (home.php, category.php, template-parts/*) ---------------------- */
.hwh-catalog { padding-bottom: 64px; }

.hwh-breadcrumbs { padding: 20px 0 0; font-size: 14px; }
.hwh-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; color: var(--hwh-meta); }
.hwh-breadcrumbs li + li::before { content: ">"; margin-right: 8px; color: var(--hwh-faint); }
.hwh-breadcrumbs a { color: var(--hwh-muted); text-decoration: none; font-weight: 500; }
.hwh-breadcrumbs a:hover { color: var(--hwh-accent); }
.hwh-breadcrumbs [aria-current="page"] { color: var(--hwh-accent); font-weight: 600; }

.hwh-hero { padding: 40px 0 32px; text-align: center; }
.hwh-hero__eyebrow { margin: 0; font-size: 14px; font-weight: 600; color: var(--hwh-accent); text-transform: uppercase; letter-spacing: 1px; }
.hwh-hero__title { margin: 12px 0 16px; font-size: 44px; font-weight: 700; line-height: 1.2; color: var(--hwh-ink); letter-spacing: -0.02em; }
.hwh-hero__lead { margin: 0 auto; max-width: 560px; font-size: 16px; line-height: 1.6; color: var(--hwh-muted); }

.hwh-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 40px; }
.hwh-filter { padding: 8px 20px; border-radius: 100px; background: #f5f5f5; color: #444; font-size: 14px; font-weight: 500; text-decoration: none; }
.hwh-filter:hover { background: #ececec; }
.hwh-filter.is-active, .hwh-filter.is-active:hover { background: var(--cat-accent, #E95E2A); color: #fff; font-weight: 600; }

.hwh-section-title { display: flex; align-items: center; gap: 8px; margin: 0 0 24px; font-size: 20px; font-weight: 700; color: var(--hwh-ink); line-height: 1.3; }
.hwh-section-title svg { color: var(--hwh-accent); }
.hwh-popular { margin-bottom: 48px; }

.hwh-popular__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.hwh-popular__grid--single { grid-template-columns: minmax(0, 1fr); }
.hwh-popular__stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.hwh-popular__stack .hwh-card--wide { flex: 1 1 auto; }

.hwh-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

/* Card. Cover heights are set HERE: .hwh-cover has no height of its own. */
.hwh-card { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--hwh-border); border-radius: var(--hwh-radius-card); background: #fff; }
.hwh-card__cover { position: relative; flex: 0 0 auto; height: 160px; }
.hwh-card__cover .hwh-cover { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.hwh-card--large .hwh-card__cover { height: 260px; }
.hwh-card__cover .hwh-cover__icon { width: 48px; height: 48px; }
.hwh-card--large .hwh-card__cover .hwh-cover__icon { width: 64px; height: 64px; }
.hwh-card__body { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; padding: 20px; }
.hwh-card--large .hwh-card__body { padding: 24px; }
.hwh-card__top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.hwh-card .hwh-chip-cat { position: relative; z-index: 1; padding: 3px 8px; }
.hwh-card__read { margin-left: auto; font-size: 12px; color: var(--hwh-meta); }
.hwh-card__title { margin: 0 0 8px; font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--hwh-ink); }
.hwh-card--large .hwh-card__title { font-size: 22px; font-weight: 700; line-height: 1.3; }
.hwh-card__link { color: inherit; text-decoration: none; }
.hwh-card__link::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.hwh-card:hover .hwh-card__link { color: var(--hwh-accent); }
.hwh-card__link:focus-visible { outline: none; }
.hwh-card:has(.hwh-card__link:focus-visible) { outline: 3px solid var(--hwh-accent); outline-offset: 2px; }
.hwh-card__excerpt { margin: 0 0 14px; font-size: 13px; line-height: 1.5; color: #888; }
.hwh-card--large .hwh-card__excerpt { margin-bottom: 20px; font-size: 14px; line-height: 1.6; color: var(--hwh-muted); flex: 1 1 auto; }
.hwh-card__foot { display: flex; align-items: center; gap: 8px; margin-top: auto; font-size: 12px; color: var(--hwh-meta); }
.hwh-card .hwh-avatar { width: 24px; height: 24px; }
.hwh-card__author { color: var(--hwh-muted); }
.hwh-card__date { margin-left: auto; }

.hwh-card--wide { flex-direction: row; min-height: 140px; }
.hwh-card--wide .hwh-card__cover { width: 200px; height: auto; min-height: 140px; }
.hwh-card--wide .hwh-card__body { justify-content: center; }
.hwh-card--wide .hwh-card__foot { margin-top: 0; }
.hwh-card--wide .hwh-card__date { margin-left: 0; }

.hwh-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 40px; }
.hwh-pagination .page-numbers { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--hwh-radius-btn); background: #f5f5f5; color: var(--hwh-muted); font-size: 14px; font-weight: 500; text-decoration: none; }
.hwh-pagination a.page-numbers:hover { background: #ececec; }
.hwh-pagination .page-numbers.current { background: var(--hwh-accent); color: #fff; font-weight: 600; }
.hwh-pagination .page-numbers.dots { background: none; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.hwh-empty { margin: 0; padding: 48px 0; text-align: center; color: var(--hwh-muted); }
.hwh-empty a { color: var(--hwh-accent); }

@media (max-width: 960px) {
	.hwh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.hwh-popular__grid { grid-template-columns: minmax(0, 1fr); }
	.hwh-hero__title { font-size: 36px; }
}

@media (max-width: 620px) {
	.hwh-grid { grid-template-columns: minmax(0, 1fr); }
	.hwh-hero { padding: 28px 0 24px; }
	.hwh-hero__title { font-size: 30px; }
	.hwh-card--wide { flex-direction: column; }
	.hwh-card--wide .hwh-card__cover { width: 100%; height: 160px; min-height: 0; }
}

/* --- Article (single.php, template-parts/article-meta|share|related|cta) ----- */
.hwh-article { max-width: 800px; margin: 0 auto; padding: 32px 0 0; }
.hwh-article__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 20px; font-size: 13px; color: var(--hwh-meta); }
.hwh-article__meta .hwh-chip-cat { padding: 4px 12px; }
.hwh-article__title { margin: 0 0 24px; font-size: 40px; font-weight: 700; line-height: 1.2; color: var(--hwh-ink); letter-spacing: -0.02em; }
.hwh-article__subtitle { margin: 0 0 32px; font-size: 18px; line-height: 1.6; color: var(--hwh-muted); }
.hwh-article .hwh-author-inline { margin-bottom: 40px; }
.hwh-article__cover { position: relative; height: 360px; margin-bottom: 40px; border-radius: var(--hwh-radius-card); overflow: hidden; }
.hwh-article__cover .hwh-cover { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.hwh-article__cover .hwh-cover__icon { width: 64px; height: 64px; }
.hwh-article__cover .hwh-cover__icon svg { width: 30px; height: 30px; }

.hwh-article__content { margin-bottom: 40px; overflow-wrap: break-word; }
.hwh-article__content h2 { margin: 32px 0 16px; font-size: 24px; font-weight: 700; line-height: 1.3; color: var(--hwh-ink); }
.hwh-article__content h3 { margin: 24px 0 12px; font-size: 20px; font-weight: 700; color: var(--hwh-ink); }
.hwh-article__content > :first-child { margin-top: 0; }
.hwh-article__content p { margin: 0 0 16px; font-size: 16px; line-height: 1.8; color: var(--hwh-text); }
.hwh-article__content ul, .hwh-article__content ol { margin: 0 0 16px; padding-left: 24px; font-size: 16px; line-height: 1.8; color: var(--hwh-text); }
.hwh-article__content a { color: var(--hwh-accent); }
.hwh-article__content img { height: auto; border-radius: var(--hwh-radius-card); }
.hwh-article__content figure { margin: 24px 0; }
.hwh-article__content figcaption { margin-top: 8px; font-size: 13px; color: var(--hwh-meta); text-align: center; }
.hwh-article__content blockquote { margin: 24px 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--hwh-accent); color: var(--hwh-muted); }

.hwh-share { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 24px 0; margin-bottom: 40px; border-top: 1px solid var(--hwh-border); }
.hwh-share__label { font-size: 13px; font-weight: 500; color: var(--hwh-meta); }
.hwh-share__icon, .hwh-share__copy summary { display: inline-flex; align-items: center; justify-content: center; height: 32px; border-radius: var(--hwh-radius-btn); background: #f5f5f5; color: var(--hwh-muted); text-decoration: none; cursor: pointer; }
.hwh-share__icon { width: 32px; }
.hwh-share__icon svg { width: 16px; height: 16px; }
.hwh-share__icon:hover, .hwh-share__copy summary:hover { background: #ececec; color: var(--hwh-accent); }
.hwh-share__copy { position: relative; }
.hwh-share__copy summary { padding: 0 12px; font-size: 13px; font-weight: 500; list-style: none; }
.hwh-share__copy summary::-webkit-details-marker { display: none; }
.hwh-share__panel { position: absolute; right: 0; top: 40px; z-index: 2; display: flex; gap: 8px; align-items: center; padding: 8px; background: #fff; border: 1px solid var(--hwh-border-strong); border-radius: var(--hwh-radius-btn); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); }
.hwh-share__panel input { width: 280px; max-width: 60vw; height: 32px; padding: 0 10px; border: 1px solid var(--hwh-border-strong); border-radius: 6px; font: 13px Inter, sans-serif; color: var(--hwh-text); }
.hwh-share__btn { height: 32px; padding: 0 14px; border: 0; border-radius: 6px; background: var(--hwh-accent); color: #fff; font: 600 13px Inter, sans-serif; cursor: pointer; }
.hwh-share__btn:hover { background: var(--hwh-accent-hover); }

.hwh-article .hwh-author-card { margin: 0 0 48px; }

.hwh-related { margin-bottom: 48px; }
.hwh-related__title { margin: 0 0 24px; font-size: 20px; font-weight: 700; color: var(--hwh-ink); }
.hwh-related__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.hwh-card--related { flex-direction: row; }
.hwh-card--related .hwh-card__cover { width: 160px; height: auto; min-height: 120px; }
.hwh-card--related .hwh-card__body { justify-content: center; padding: 16px; }
.hwh-card--related .hwh-card__title { margin: 0 0 6px; font-size: 15px; line-height: 1.4; }
.hwh-card--related .hwh-card__cover .hwh-cover__icon { width: 36px; height: 36px; }
.hwh-card--related .hwh-card__cover .hwh-cover__icon svg { width: 18px; height: 18px; }
.hwh-related__cat { margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--cat-accent, var(--hwh-muted)); }
.hwh-related__sub { font-size: 12px; color: var(--hwh-meta); }

.hwh-cta { margin-bottom: 48px; padding: 40px; border-radius: var(--hwh-radius-card); background: linear-gradient(135deg, #E95E2A 0%, #D4501E 100%); text-align: center; }
.hwh-cta h2 { margin: 0 0 12px; font-size: 24px; font-weight: 700; color: #fff; }
.hwh-cta p { margin: 0 0 24px; font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, 0.85); }
.content a.hwh-cta__btn, .hwh-cta__btn { display: inline-block; padding: 12px 32px; border-radius: var(--hwh-radius-btn); background: #fff; color: var(--hwh-accent); font-size: 15px; font-weight: 700; text-decoration: none; }
.hwh-cta__btn:hover { background: #fff5f0; color: var(--hwh-accent-hover); }

@media (max-width: 960px) {
	.hwh-article { max-width: none; }
	.hwh-article__title { font-size: 34px; }
}
@media (max-width: 620px) {
	.hwh-article__title { font-size: 28px; }
	.hwh-article__subtitle { font-size: 16px; }
	.hwh-article__cover { height: 220px; }
	.hwh-related__grid { grid-template-columns: minmax(0, 1fr); }
	.hwh-cta { padding: 28px 20px; }
	.hwh-share__panel { right: auto; left: auto; }
}

/* Editor patterns (inc/patterns). Selectors carry the .hwh-article__content prefix so they
   beat the generic content rules (p, h3, ul) of the article body. */
.hwh-article__content .hwh-pro-tip { margin: 24px 0; padding: 20px 24px; background: var(--cat-soft, #f5f5f5); border-left: 4px solid var(--cat-accent, #666666); border-radius: 0 8px 8px 0; }
.hwh-article__content .hwh-pro-tip__label { margin: 0 0 8px; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--cat-accent, #666666); }
.hwh-article__content .hwh-pro-tip__text { margin: 0; font-size: 15px; line-height: 1.6; color: var(--hwh-text); }

.hwh-article__content .hwh-takeaways { margin: 24px 0; padding: 24px; background: #fafafa; border-radius: 12px; }
.hwh-article__content .hwh-takeaways h3 { margin: 0 0 12px; }
.hwh-article__content .hwh-takeaways ul { margin: 0; padding-left: 20px; }

.hwh-article__content .hwh-figure { margin: 24px 0; }
.hwh-article__content .hwh-figure img { border: 1px solid #eee; border-radius: 12px; }
.hwh-article__content .hwh-figure figcaption { margin-top: 8px; font-size: 13px; color: #999; text-align: center; }

.hwh-article__content .hwh-cta-register { margin: 32px 0; padding: 20px 24px; background: #fff; border: 1px solid var(--hwh-border-strong); border-radius: var(--hwh-radius-card); }
.hwh-article__content .hwh-cta-register__title { margin: 0 0 6px; font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--hwh-ink); }
.hwh-article__content .hwh-cta-register__text { margin: 0 0 14px; font-size: 15px; line-height: 1.5; color: var(--hwh-muted); }
.hwh-article__content .hwh-cta-register .wp-block-buttons { margin: 0; }
.hwh-article__content .hwh-cta-register .wp-block-button__link { padding: 8px 18px; border-radius: var(--hwh-radius-btn); background: var(--hwh-accent); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; }
.hwh-article__content .hwh-cta-register .wp-block-button__link:hover { background: var(--hwh-accent-hover); }
