/* ==========================================================================
   Зошит — content.css
   Блог, статті, звичайні сторінки, пошук, 404.
   Текст статті пишуть у редакторі блоків, тому тут оформлено саме блоки WP.
   ========================================================================== */

.page-wrap {
	padding-top: clamp(24px, 4vw, 44px);
	padding-bottom: clamp(40px, 6vw, 72px);
}

.page-head {
	max-width: 760px;
	margin-bottom: clamp(24px, 3vw, 36px);
}

.page-head .z-sub {
	margin-top: 12px;
}

.page-head .search-form {
	margin-top: 20px;
}

/* Хлібні крихти ------------------------------------------------------------ */

.breadcrumbs {
	margin-bottom: 20px;
	font-size: 0.84375rem;
	color: var(--ink-3);
}

.breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.breadcrumbs li + li::before {
	content: "/";
	margin-right: 8px;
	color: var(--line-strong);
}

.breadcrumbs a {
	color: var(--ink-2);
}

.breadcrumbs a:hover {
	color: var(--ochre-link);
}

/* Картки статей -------------------------------------------------------------- */

.post-grid {
	display: grid;
	gap: clamp(16px, 2vw, 24px);
}

@media (min-width: 640px) {
	.post-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1020px) {
	.post-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.post-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 18px;
	background: var(--card);
	transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
	border-color: var(--line-strong);
	transform: translateY(-3px);
	box-shadow: var(--shadow-card);
}

.post-card__media {
	display: block;
	aspect-ratio: 16 / 10;
	background: var(--paper-2);
	overflow: hidden;
}

.post-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.post-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	padding: 22px 24px 24px;
}

.post-card__title {
	margin-top: 12px;
	font-size: 1.1875rem;
	font-weight: 600;
	line-height: 1.32;
}

.post-card__body > .post-card__title:first-child {
	margin-top: 0;
}

.post-card__title a {
	color: var(--ink);
}

.post-card__title a:hover {
	color: var(--ochre-link);
}

.post-card__excerpt {
	margin-top: 9px;
	font-size: 0.9375rem;
	color: var(--ink-2);
}

.post-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: auto;
	padding-top: 16px;
	font-size: 0.8125rem;
	color: var(--ink-3);
}

/* Пагінація -------------------------------------------------------------------- */

.pager {
	margin-top: clamp(28px, 4vw, 44px);
}

.pager .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.pager .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-width: 44px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--card);
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--ink);
}

.pager a.page-numbers:hover {
	border-color: var(--ink);
}

.pager .page-numbers.current {
	border-color: var(--ink);
	background: var(--ink);
	color: #ffffff;
}

.pager .page-numbers.dots {
	border-color: transparent;
	background: none;
}

/* Форма пошуку -------------------------------------------------------------------- */

.search-form {
	display: flex;
	gap: 10px;
	width: 100%;
	max-width: 520px;
}

.search-form .z-search {
	flex: 1;
}

/* Порожній стан і 404 ---------------------------------------------------------------- */

.empty-state,
.not-found {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	max-width: 640px;
	padding: clamp(24px, 4vw, 40px);
}

.empty-state p {
	color: var(--ink-2);
}

.not-found {
	position: relative;
	overflow: hidden;
	margin-block: clamp(16px, 4vw, 48px);
	border: 1px solid var(--line);
	border-radius: var(--r-2xl);
	background-color: var(--card);
}

/* Червоне поле зошита. Лінійок тут немає: текст різного кеглю
   на них не лягає, і вони його перекреслювали б. */
.not-found::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: clamp(11px, 2vw, 19px);
	width: 2px;
	background: var(--margin-line);
}

.not-found__code {
	font-size: clamp(3.5rem, 2rem + 6vw, 6rem);
	line-height: 1;
	color: var(--ochre);
}

.not-found__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-block: 6px;
}

/* Стаття ------------------------------------------------------------------------------ */

/* Шапка статті тримає ту саму ліву межу, що й колонка тексту (760 px). */
.article__head {
	max-width: calc(760px + var(--gutter) * 2);
	padding-top: clamp(24px, 4vw, 44px);
}

.article__title {
	margin-top: 16px;
	font-size: clamp(1.875rem, 1.2rem + 2.6vw, 3rem);
	line-height: 1.1;
	text-wrap: balance;
}

.article--page .article__title {
	margin-top: 0;
}

/* У статті після тексту йдуть позначки й заклик; у сторінки — одразу підвал. */
.article--page .entry-content {
	padding-bottom: clamp(32px, 5vw, 56px);
}

.article__head .post-meta {
	margin-top: 18px;
	padding-top: 0;
	font-size: 0.90625rem;
}

.article__cover {
	max-width: calc(1100px + var(--gutter) * 2);
	margin-top: clamp(24px, 3vw, 36px);
}

.article__cover img {
	width: 100%;
	border-radius: var(--r-xl);
}

.entry-content {
	padding: clamp(24px, 3.4vw, 40px) var(--gutter) 0;
	font-size: clamp(1.0625rem, 1.02rem + 0.2vw, 1.125rem);
	line-height: 1.7;
}

/* Колонка тексту 760 px; «широкі» блоки — 1100 px; «на всю ширину» — до країв. */
.entry-content > * {
	max-width: 760px;
	margin-inline: auto;
}

.entry-content > .alignwide {
	max-width: 1100px;
}

.entry-content > .alignfull {
	max-width: none;
	margin-inline: calc(var(--gutter) * -1);
}

.entry-content > * + * {
	margin-top: 1.25em;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	line-height: 1.22;
	scroll-margin-top: calc(var(--header-h) + 16px);
}

.entry-content h2 {
	margin-top: 1.9em;
	font-family: var(--font-display);
	font-size: clamp(1.4375rem, 1.2rem + 0.9vw, 1.8125rem);
	font-weight: 600;
	letter-spacing: -0.025em;
}

.entry-content h3 {
	margin-top: 1.7em;
	font-size: 1.3125rem;
	font-weight: 600;
}

.entry-content h4 {
	margin-top: 1.5em;
	font-size: 1.125rem;
	font-weight: 600;
}

.entry-content a {
	text-decoration: underline;
	text-decoration-thickness: 1.5px;
	text-underline-offset: 3px;
}

/* Скидання в main.css прибирає маркери в списків із класом, а редактор
   додає клас кожному списку (wp-block-list) — у тексті статті повертаємо.
   Лише звичайним спискам: «Останні записи», галереї тощо теж <ul>,
   і маркери їм не потрібні. */
.entry-content :is(ul, ol):is(:not([class]), .wp-block-list) {
	padding-left: 1.35em;
}

.entry-content ul:is(:not([class]), .wp-block-list) {
	list-style: disc;
}

.entry-content ol:is(:not([class]), .wp-block-list) {
	list-style: decimal;
}

.entry-content ul:is(:not([class]), .wp-block-list) ul {
	list-style: circle;
}

.entry-content li > ul,
.entry-content li > ol {
	margin-top: 0.45em;
}

.entry-content li + li {
	margin-top: 0.45em;
}

.entry-content li::marker {
	color: var(--ochre);
	font-weight: 600;
}

/* Цитата — як нотатка на полях зошита. */
.entry-content blockquote,
.entry-content .wp-block-quote {
	padding: 4px 0 4px 22px;
	border-left: 3px solid var(--margin-line);
	font-size: 1.125em;
	line-height: 1.55;
	color: var(--ink-soft);
}

.entry-content blockquote cite,
.entry-content .wp-block-quote cite {
	display: block;
	margin-top: 10px;
	font-size: 0.8125rem;
	font-style: normal;
	color: var(--ink-3);
}

.entry-content img {
	border-radius: var(--r-lg);
}

.entry-content figcaption,
.entry-content .wp-element-caption {
	margin-top: 10px;
	font-size: 0.84375rem;
	color: var(--ink-3);
	text-align: center;
}

.entry-content hr,
.entry-content .wp-block-separator {
	height: 1px;
	margin-block: 2.2em;
	border: 0;
	background: var(--line);
}

.entry-content code,
.entry-content kbd {
	padding: 2px 6px;
	border-radius: 6px;
	background: var(--paper-2);
	font-size: 0.9em;
}

.entry-content pre {
	overflow-x: auto;
	padding: 18px 20px;
	border-radius: var(--r-lg);
	background: var(--night);
	color: #e6eaf0;
	font-size: 0.9375rem;
	line-height: 1.6;
}

.entry-content pre code {
	padding: 0;
	background: none;
}

/* Таблиці: на телефоні гортаються вбік, а не ламають сторінку. */
.entry-content .wp-block-table {
	overflow-x: auto;
}

.entry-content table {
	width: 100%;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.entry-content th,
.entry-content td {
	padding: 11px 14px;
	border: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

.entry-content thead th {
	background: var(--paper-2);
	font-weight: 600;
}

.entry-content tbody tr:nth-child(even) td {
	background: var(--paper-3);
}

/* Кнопки-блоки беруть вигляд головної кнопки сайту. */
.entry-content .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	min-height: 50px;
	padding: 0 26px;
	border-radius: var(--r-md);
	background: var(--ochre);
	color: #ffffff;
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.16s ease;
}

.entry-content .wp-block-button__link:hover {
	background: var(--ochre-hover);
	color: #ffffff;
}

.entry-content .is-style-outline .wp-block-button__link {
	border: 1px solid var(--line-strong);
	background: var(--card);
	color: var(--ink);
}

/* Патерни з inc/patterns.php ------------------------------------------------------------- */

.entry-content .zoshyt-cta {
	padding: clamp(22px, 3vw, 32px);
	border-radius: var(--r-xl);
	background: var(--ochre);
	color: #ffffff;
}

.entry-content .zoshyt-cta > * {
	max-width: none;
	margin-inline: 0;
}

.entry-content .zoshyt-cta h3 {
	margin-top: 0;
	font-family: var(--font-display);
	font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
	letter-spacing: -0.025em;
	color: #ffffff;
}

.entry-content .zoshyt-cta .wp-block-button__link,
.entry-content .zoshyt-cta .wp-block-button__link:hover {
	background: #ffffff;
	color: var(--ink);
}

.entry-content .zoshyt-note {
	padding: 18px 22px;
	border: 1px solid var(--blue-tint-line);
	border-radius: var(--r-lg);
	background: var(--blue-tint);
	color: var(--blue-ink);
	font-size: 0.96875em;
}

.entry-content .zoshyt-note > * {
	max-width: none;
	margin-inline: 0;
}

/* Низ статті ----------------------------------------------------------------------------- */

.article__foot {
	max-width: calc(760px + var(--gutter) * 2);
	margin-inline: auto;
	padding: clamp(28px, 4vw, 44px) var(--gutter) 0;
}

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

.article__tags a {
	display: inline-flex;
	padding: 6px 13px;
	border-radius: var(--r-pill);
	background: var(--paper-2);
	font-size: 0.84375rem;
	font-weight: 500;
	color: var(--ink-2);
}

.article__tags a:hover {
	background: var(--ochre-tint);
	color: var(--ochre-tint-ink);
}

.article-cta {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 20px 32px;
	overflow: hidden;
	padding: clamp(24px, 3.4vw, 36px);
	border-radius: var(--r-2xl);
	background: var(--ochre);
	color: #ffffff;
}

.article-cta::before {
	content: "";
	position: absolute;
	top: -70px;
	right: -50px;
	width: 220px;
	height: 220px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.07);
	pointer-events: none;
}

.article-cta__text {
	position: relative;
	flex: 1 1 320px;
}

.article-cta__title {
	font-family: var(--font-display);
	font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.625rem);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.03em;
	text-wrap: balance;
}

.article-cta__text p {
	margin-top: 10px;
	font-size: 1rem;
}

.article-cta .z-btn {
	position: relative;
}

.related {
	padding-top: clamp(44px, 6vw, 72px);
	padding-bottom: clamp(24px, 4vw, 48px);
}

.related .z-h2 {
	margin-bottom: clamp(20px, 3vw, 30px);
	font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
}

.page-links {
	display: flex;
	gap: 8px;
	font-weight: 600;
}

@media (max-width: 560px) {
	.search-form {
		flex-direction: column;
	}

	.article-cta .z-btn,
	.not-found__actions .z-btn {
		width: 100%;
	}
}
