/*!
 * Hramada 2026 v5 — content.css (U3).
 * Унутраныя шаблоны: крошкі, артыкул і старонка, проза (core blocks, стары HTML, табліцы,
 * галерэі, embeds), тэгі, папярэдняя/наступная, звязаныя, спісы запісаў, пагінацыя, пошук,
 * пусты стан, 404, каментары. Токены, reset, шапка і футэр — base.css (U1).
 * Mobile-first; брэйкпойнты 600 / 768 (як у base.css). Старонка ніколі не ідзе ўбок:
 * доўгія радкі і URL ломяцца (overflow-wrap:anywhere), табліцы пракручваюцца ў сваім кантэйнеры.
 * Колеры — толькі з токенаў; без прымусовага uppercase.
 */

/* =========================================================================
   1. МАКЕТ ЎНУТРАНЫХ СТАРОНАК
   ========================================================================= */
.hg-column {
	min-width: 0;
	max-width: var(--hg-prose-measure);
	margin-inline: auto;
}

/* Спісы (архіў, пошук) крыху шырэйшыя за радок тэксту, але не на ўсю шырыню. */
.hg-column--list {
	max-width: 820px;
}

.hg-title {
	margin: 0 0 .4em;
	overflow-wrap: anywhere;
}

/* Падзагаловак секцыі (h2 побач з h1: «Разьдзелы», «Чытайце таксама», «Каментары»). */
.hg-heading {
	margin: 0 0 .6em;
	font-size: 22px;
	font-weight: 500;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

@media (min-width: 768px) {
	.hg-heading {
		font-size: 24px;
	}
}

/* =========================================================================
   2. ХЛЕБНЫЯ КРОШКІ
   ========================================================================= */
.hg-breadcrumb {
	margin: 0 0 12px;
	color: var(--hg-muted);
	font-size: 15px;
	line-height: 1.4;
}

.hg-breadcrumb__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hg-breadcrumb__item {
	display: flex;
	align-items: center;
	min-width: 0;
	min-height: var(--hg-target-min);
}

/* Падзельнік дэкаратыўны (з alt-тэкстам "", калі браўзер умее, AT яго не агучвае);
   стаіць у канцы пункта, каб пры пераносе радок не пачынаўся з «/». */
.hg-breadcrumb__item:not(:last-child)::after {
	content: "/";
	content: "/" / "";
	margin-inline: .6em;
	color: var(--hg-muted);
}

.hg-breadcrumb__link {
	display: inline-flex;
	align-items: center;
	min-height: var(--hg-target-min);
	color: var(--hg-muted);
	overflow-wrap: anywhere;
}

.hg-breadcrumb__link:hover {
	color: var(--hg-red-hover);
}

.hg-breadcrumb__current {
	color: var(--hg-ink);
	overflow-wrap: anywhere;
}

/* =========================================================================
   3. АРТЫКУЛ І СТАРОНКА
   ========================================================================= */
.hg-article__header {
	margin-bottom: 24px;
}

.hg-article__header .hg-title {
	margin-bottom: .3em;
}

.hg-article__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0;
	color: var(--hg-muted);
	font-size: 15px;
	line-height: 1.4;
}

.hg-article__label {
	display: inline-flex;
	align-items: center;
	min-height: var(--hg-target-min);
	color: var(--hg-red);
	font-weight: 500;
	overflow-wrap: anywhere;
}

.hg-article__label:hover {
	color: var(--hg-red-hover);
}

.hg-article__label + .hg-article__date::before {
	content: "·";
	content: "·" / "";
	margin-inline: .6em;
}

/* Галоўная выява запісу: на ўсю шырыню калонкі, прапорцыі зыходнай выявы. */
.hg-article__figure {
	margin: 0 0 28px;
}

.hg-article__figure img {
	display: block;
	width: 100%;
	height: auto;
}

.hg-article__caption {
	margin-top: 8px;
	color: var(--hg-muted);
	font-size: 15px;
	line-height: 1.45;
}

.hg-article__footer {
	margin-top: 32px;
	padding-top: 20px;
	border-top: 1px solid var(--hg-divider);
}

/* Старонкі аднаго запісу (<!--nextpage-->). */
.hg-page-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	margin-top: 28px;
}

.hg-page-links__label {
	color: var(--hg-muted);
}

.hg-page-links .post-page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--hg-target-min);
	min-height: var(--hg-target-min);
	padding: 0 10px;
	border-radius: var(--hg-radius);
	color: var(--hg-ink);
	text-decoration: none;
}

.hg-page-links a.post-page-numbers:hover {
	background: var(--hg-surface);
	color: var(--hg-ink);
}

.hg-page-links .post-page-numbers.current {
	background: var(--hg-surface);
	font-weight: 600;
}

/* =========================================================================
   4. ПРОЗА (the_content): ≤72ch, 17–18px, line-height 1.65
   ========================================================================= */
.hg-prose {
	display: flow-root;
	font-size: 17px;
	line-height: 1.65;
	overflow-wrap: anywhere;
}

@media (min-width: 768px) {
	.hg-prose {
		font-size: 18px;
	}
}

.hg-prose > * {
	max-width: 100%;
}

.hg-prose > :first-child {
	margin-top: 0;
}

.hg-prose > :last-child {
	margin-bottom: 0;
}

.hg-prose :is(p, ul, ol, dl, blockquote, figure, pre, details) {
	margin-block: 0 1.1em;
}

.hg-prose :is(h2, h3, h4, h5, h6) {
	margin: 1.6em 0 .5em;
	line-height: 1.3;
}

.hg-prose h2 {
	font-size: 1.45em;
}

/* H1 з кантэнту, панізжаны фільтрам hg_content_demote_h1() да h2 (адзіны h1 — загаловак шаблона):
   выглядае як звычайны h2 прозы, а не як h1 шаблона. */
.hg-prose h2.hg-content-h1 {
	margin: 1.6em 0 .5em;
	font-size: 1.45em;
	font-weight: 500;
	line-height: 1.3;
}

.hg-prose h3 {
	font-size: 1.25em;
}

.hg-prose h4 {
	font-size: 1.1em;
	font-weight: 600;
}

.hg-prose :is(h5, h6) {
	font-size: 1em;
	font-weight: 600;
}

/* Спасылкі ў прозе: чырвоныя, з падкрэсліваннем. Кнопкі і іншыя блокі ядра (wp-block-*)
   маюць свае колеры — іх не чапаем. */
.hg-prose a:not([class*="wp-block-"]):not(.wp-element-button) {
	color: var(--hg-red);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .18em;
}

.hg-prose a:not([class*="wp-block-"]):not(.wp-element-button):hover {
	color: var(--hg-red-hover);
	text-decoration-thickness: 2px;
}

.hg-prose :is(.has-background, .wp-block-cover) a:not([class*="wp-block-"]):not(.wp-element-button) {
	color: inherit;
}

.hg-prose a:has(> img) {
	text-decoration: none;
}

.hg-prose .wp-block-button__link {
	border-radius: var(--hg-radius);
	text-decoration: none;
}

.hg-prose :is(ul, ol) {
	padding-left: 1.4em;
}

.hg-prose li + li {
	margin-top: .35em;
}

.hg-prose li > :is(ul, ol) {
	margin: .35em 0 0;
}

.hg-prose dt {
	font-weight: 600;
}

.hg-prose dd {
	margin: 0 0 .6em 1.4em;
}

.hg-prose blockquote {
	margin-block: 1.5em;
	margin-inline: 0;
	padding: .2em 0 .2em 1.1em;
	border-left: 3px solid var(--hg-divider);
}

.hg-prose blockquote > :last-child {
	margin-bottom: 0;
}

.hg-prose :is(blockquote, .wp-block-quote, .wp-block-pullquote) cite {
	display: block;
	margin-top: .5em;
	color: var(--hg-muted);
	font-size: .875em;
	font-style: normal;
}

.hg-prose :is(code, kbd, samp) {
	padding: .1em .3em;
	border-radius: 2px;
	background: var(--hg-surface);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	font-size: .9em;
}

/* pre без гарызантальнага скролу: радкі пераносяцца. */
.hg-prose pre {
	padding: 12px 14px;
	border-radius: var(--hg-radius);
	background: var(--hg-surface);
	font-size: .9em;
	line-height: 1.5;
	white-space: pre-wrap;
}

.hg-prose pre code {
	padding: 0;
	background: none;
	font-size: 1em;
}

.hg-prose hr {
	margin-block: 2em;
}

/* ---- выявы, подпісы, выраўноўванне ---- */
.hg-prose :is(img, video, canvas, iframe, embed, object) {
	max-width: 100%;
}

.hg-prose :is(img, video) {
	height: auto;
}

.hg-prose figure {
	max-width: 100%;
	margin-inline: 0;
}

.hg-prose :is(figcaption, .wp-caption-text, .wp-element-caption) {
	margin-top: .5em;
	color: var(--hg-muted);
	font-size: 15px;
	line-height: 1.45;
	text-align: left;
}

/* Класічны [caption]: inline width=… не павінен выпіраць за калонку. */
.hg-prose .wp-caption {
	max-width: 100%;
}

.hg-prose .wp-caption img {
	display: block;
}

.hg-prose .aligncenter {
	display: block;
	margin-inline: auto;
}

/* Вузкі экран: float-выраўноўванне адключана, выява на ўсю шырыню радка. */
.hg-prose :is(.alignleft, .alignright) {
	float: none;
	display: block;
	margin: 0 0 1em;
}

@media (min-width: 600px) {
	.hg-prose .alignleft {
		float: left;
		margin: .3em 1.4em .8em 0;
		max-width: 50%;
	}

	.hg-prose .alignright {
		float: right;
		margin: .3em 0 .8em 1.4em;
		max-width: 50%;
	}
}

/* Галерэі: макет ядра (core gallery / [gallery]) не перавызначаем — толькі выявы не выходзяць за межы. */
.hg-prose :is(.gallery, .wp-block-gallery) img {
	max-width: 100%;
	height: auto;
}

/* ---- embeds: блок ядра рэзінавы праз wp-embed-responsive; класічны <iframe> з відэа — 16:9 ---- */
.hg-prose iframe:is([src*="youtube"], [src*="youtu.be"], [src*="vimeo"], [src*="rutube"]):not(.wp-has-aspect-ratio *) {
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
}

.hg-prose .wp-block-embed {
	margin-inline: 0;
}

/* ---- табліцы: лакальны кантэйнер пракруткі (ствараецца фільтрам the_content, inc/content.php) ---- */
.hg-table-scroll {
	max-width: 100%;
	margin: 0 0 1.4em;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.hg-prose table {
	width: 100%;
	border-collapse: collapse;
	font-size: .9em;
	line-height: 1.45;
}

.hg-prose :is(th, td) {
	padding: 8px 12px;
	border: 1px solid var(--hg-divider);
	text-align: left;
	vertical-align: top;
	overflow-wrap: normal;
}

.hg-prose th {
	background: var(--hg-surface);
	font-weight: 600;
}

.hg-prose caption {
	padding: 8px 0;
	caption-side: bottom;
	color: var(--hg-muted);
	text-align: left;
}

.hg-prose .wp-block-table {
	margin-block: 0 1.4em;
}

.hg-prose .wp-block-table .hg-table-scroll {
	margin-bottom: 0;
}

/* =========================================================================
   5. ТЭГІ
   ========================================================================= */
.hg-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 12px;
}

.hg-tags__label {
	color: var(--hg-muted);
	font-size: 15px;
}

.hg-tags__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hg-tags__item {
	min-width: 0;
}

.hg-tags__link {
	display: inline-flex;
	align-items: center;
	min-height: var(--hg-target-min);
	padding: 0 14px;
	border-radius: var(--hg-radius);
	background: var(--hg-surface);
	color: var(--hg-ink);
	font-size: 15px;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.hg-tags__link:hover {
	color: var(--hg-red-hover);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .18em;
}

/* =========================================================================
   6. ПАПЯРЭДНЯЯ / НАСТУПНАЯ ПУБЛІКАЦЫЯ
   ========================================================================= */
.hg-postnav {
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid var(--hg-divider);
}

.hg-postnav .nav-links {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 8px 32px;
}

.hg-postnav a {
	display: block;
	padding-block: 10px;
	color: var(--hg-ink);
	text-decoration: none;
}

.hg-postnav__label {
	display: block;
	color: var(--hg-muted);
	font-size: 15px;
}

.hg-postnav__title {
	display: block;
	font-weight: 500;
	overflow-wrap: anywhere;
}

.hg-postnav a:hover .hg-postnav__title {
	color: var(--hg-red-hover);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .18em;
}

@media (min-width: 600px) {
	.hg-postnav .nav-links {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.hg-postnav .nav-previous {
		grid-column: 1;
	}

	.hg-postnav .nav-next {
		grid-column: 2;
		text-align: right;
	}
}

/* =========================================================================
   7. ЗВЯЗАНЫЯ ПУБЛІКАЦЫІ І «РАЗДЗЕЛЫ» (простыя тэкставыя спісы)
   ========================================================================= */
.hg-related,
.hg-subsections {
	margin-top: 40px;
}

@media (min-width: 768px) {
	.hg-related,
	.hg-subsections {
		margin-top: 48px;
	}
}

.hg-related__list,
.hg-subsections__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hg-related__item {
	display: flex;
	flex-direction: column;
	padding-block: 4px 10px;
	border-top: 1px solid var(--hg-divider);
}

.hg-related__link {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	min-height: var(--hg-target-min);
	color: var(--hg-ink);
	font-weight: 500;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.hg-related__link:hover {
	color: var(--hg-red-hover);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .18em;
}

.hg-related__date {
	color: var(--hg-muted);
	font-size: 15px;
}

.hg-subsections__item {
	border-top: 1px solid var(--hg-divider);
}

.hg-subsections__link {
	display: flex;
	align-items: center;
	min-height: var(--hg-target-min);
	padding-block: 6px;
	color: var(--hg-ink);
	font-weight: 500;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.hg-subsections__link::after {
	content: "→";
	content: "→" / "";
	flex: none;
	margin-left: .5em;
	color: var(--hg-red);
}

.hg-subsections__link:hover {
	color: var(--hg-red-hover);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .18em;
}

/* Архіў: «Разьдзелы» і ніжэй спіс запісаў. */
.hg-subsections + .hg-list {
	margin-top: 32px;
}

@media (min-width: 640px) {
	.hg-subsections__list {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 32px;
	}
}

/* =========================================================================
   8. ГАЛАВА АРХІВА / ПОШУКУ І СПІС ЗАПІСАЎ
   ========================================================================= */
.hg-archive-head {
	margin-bottom: 24px;
}

.hg-archive-head__description {
	max-width: var(--hg-prose-measure);
	margin-top: 8px;
	overflow-wrap: anywhere;
}

.hg-archive-head__description > :last-child {
	margin-bottom: 0;
}

.hg-archive-head__description a {
	color: var(--hg-red);
}

.hg-archive-head__search {
	margin-top: 16px;
}

.hg-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hg-list__item {
	padding-block: 20px;
	border-top: 1px solid var(--hg-divider);
}

.hg-list__item:first-child {
	padding-top: 0;
	border-top: 0;
}

.hg-entry {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
}

.hg-entry--thumb {
	grid-template-columns: 96px minmax(0, 1fr);
	column-gap: 16px;
	align-items: start;
}

.hg-entry__thumb {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--hg-radius);
	background: var(--hg-surface);
}

.hg-entry__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hg-entry__body {
	min-width: 0;
}

.hg-entry__meta {
	display: flex;
	flex-wrap: wrap;
	margin: 0 0 2px;
	color: var(--hg-muted);
	font-size: 15px;
	line-height: 1.4;
}

.hg-entry__label {
	font-weight: 500;
}

.hg-entry__label + .hg-entry__date::before {
	content: "·";
	content: "·" / "";
	margin-inline: .6em;
}

.hg-entry__title {
	margin: 0;
	font-size: 20px;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.hg-entry--thumb .hg-entry__title {
	font-size: 18px;
}

.hg-entry__title a {
	display: flex;
	align-items: center;
	min-height: var(--hg-target-min);
	color: var(--hg-ink);
	text-decoration: none;
}

.hg-entry__title a:hover {
	color: var(--hg-red-hover);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .18em;
}

.hg-entry__excerpt {
	margin: 2px 0 0;
	color: var(--hg-muted);
	line-height: 1.55;
	overflow-wrap: anywhere;
}

@media (min-width: 600px) {
	.hg-entry--thumb {
		grid-template-columns: 160px minmax(0, 1fr);
		column-gap: 24px;
	}

	.hg-entry--thumb .hg-entry__title {
		font-size: 20px;
	}
}

@media (min-width: 768px) {
	.hg-entry__title,
	.hg-entry--thumb .hg-entry__title {
		font-size: 22px;
	}
}

/* =========================================================================
   9. ПАГІНАЦЫЯ (the_posts_pagination, клас nav = hg-pagination)
   ========================================================================= */
.hg-pagination {
	margin-top: 32px;
}

.hg-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.hg-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--hg-target-min);
	min-height: var(--hg-target-min);
	padding: 0 12px;
	border-radius: var(--hg-radius);
	color: var(--hg-ink);
	text-decoration: none;
}

.hg-pagination a.page-numbers:hover {
	background: var(--hg-surface);
	color: var(--hg-ink);
}

.hg-pagination .page-numbers.current {
	background: var(--hg-surface);
	font-weight: 600;
}

.hg-pagination .page-numbers.dots {
	min-width: 0;
	padding-inline: 4px;
}

.hg-pagination :is(.prev, .next) {
	border: 1px solid var(--hg-divider);
}

/* =========================================================================
   10. ПУСТЫ СТАН І 404
   ========================================================================= */
.hg-empty {
	margin: 0;
	padding-block: 20px;
	border-top: 1px solid var(--hg-divider);
	font-size: 18px;
	line-height: 1.5;
}

.hg-empty__text {
	margin: 0;
}

.hg-empty__search {
	margin-top: 16px;
}

.hg-notfound__text {
	margin: 0;
	color: var(--hg-muted);
	font-size: 18px;
	line-height: 1.5;
}

.hg-notfound__search {
	margin-block: 24px;
}

.hg-notfound__home {
	margin: 0;
}

/* =========================================================================
   11. КАМЕНТАРЫ (штатны wp_list_comments / comment_form, без аватараў)
   ========================================================================= */
.hg-comments {
	margin-top: 40px;
	padding-top: 24px;
	border-top: 1px solid var(--hg-divider);
}

.hg-comments__list,
.hg-comments__list .children {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hg-comments__list .children {
	margin-left: 12px;
	padding-left: 12px;
	border-left: 1px solid var(--hg-divider);
}

.hg-comments .comment-body {
	padding-block: 16px;
	border-top: 1px solid var(--hg-divider);
}

.hg-comments .comment-meta {
	margin-bottom: 6px;
	color: var(--hg-muted);
	font-size: 15px;
}

.hg-comments .comment-author {
	display: block;
}

.hg-comments .comment-author .fn {
	color: var(--hg-ink);
	font-style: normal;
	font-weight: 500;
	overflow-wrap: anywhere;
}

.hg-comments .comment-author .says {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.hg-comments .comment-metadata a {
	color: var(--hg-muted);
}

.hg-comments .comment-content {
	overflow-wrap: anywhere;
}

.hg-comments .comment-content > :last-child {
	margin-bottom: 0;
}

.hg-comments .reply a {
	display: inline-flex;
	align-items: center;
	min-height: var(--hg-target-min);
	font-size: 15px;
}

.hg-comments__closed {
	margin-top: 16px;
	color: var(--hg-muted);
}

.hg-commentnav {
	margin-top: 16px;
}

.hg-commentnav .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 16px;
}

.hg-commentnav a {
	display: inline-flex;
	align-items: center;
	min-height: var(--hg-target-min);
}

.hg-comments .comment-respond {
	margin-top: 32px;
}

.hg-comments .comment-reply-title {
	margin: 0 0 .6em;
	font-size: 22px;
	font-weight: 500;
	line-height: 1.3;
}

.hg-comments .comment-reply-title small {
	margin-left: .75em;
	font-size: 15px;
	font-weight: 400;
}

.hg-comments .comment-form p {
	margin: 0 0 16px;
}

.hg-comments .comment-form label {
	display: block;
	margin-bottom: 4px;
	font-weight: 500;
}

.hg-comments .comment-form .required {
	color: var(--hg-red);
}

.hg-comments .comment-notes {
	color: var(--hg-muted);
	font-size: 15px;
}

.hg-comments .comment-form-cookies-consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.hg-comments .comment-form-cookies-consent input {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 2px 0 0;
}

.hg-comments .comment-form-cookies-consent label {
	margin: 0;
	font-weight: 400;
}
