/*
Theme Name: Raisovich Journal
Theme URI: https://blog.raisovich.ru/
Author: Студия Раисыча
Description: Блог на дизайне n8n Automation Blog: светлый фон, тёмный hero со статистикой, каталог с фильтрами и нумерованные карточки.
Version: 2.2.1
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: MIT
Text Domain: raisovich-journal
*/

/* Служебные классы WordPress. */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.n8n-pagination .screen-reader-text {
	position: absolute !important;
}

/* Обложка статьи. */
.n8n-cover {
	margin: 22px 0 0;
	overflow: hidden;
	border: 1px solid #dbeafe;
	border-radius: 22px;
	background: #fff;
	box-shadow: 0 18px 40px rgba(16, 24, 40, 0.08);
}

.n8n-cover img {
	display: block;
	width: 100%;
	height: auto;
}

/* Картинки внутри текста. */
.n8n-prose img {
	height: auto;
	margin: 22px 0;
	border-radius: 14px;
}

.n8n-prose figure {
	margin: 22px 0;
}

.n8n-prose figcaption {
	margin-top: 8px;
	color: #667085;
	font-size: 12px;
	text-align: center;
}

/* Ссылки-чипсы в сайдбаре. */
a.n8n-chip {
	text-decoration: none;
}

a.n8n-chip:hover {
	background: #e8f2ff;
}

/* Список свежих статей в сайдбаре. */
.n8n-facts-list dt a {
	color: #101828;
	font-weight: 600;
	text-decoration: none;
}

.n8n-facts-list dt a:hover {
	color: #135e96;
}

.n8n-facts-list div {
	align-items: flex-start;
}

/* Карточки тегов. */
.n8n-card-compact .n8n-read {
	display: inline-block;
	margin-top: 10px;
}

/* Админ-бар. */
body.admin-bar .n8n-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .n8n-header {
		top: 46px;
	}
}

/* Выравнивание заголовков секций. */
.n8n-catalog-head h2 {
	color: #101828;
}

.n8n-main > .n8n-cta:last-child {
	margin-bottom: 8px;
}

/* Пагинация: WP оборачивает номера в .nav-links — выстраиваем в строку. */
.n8n-pagination .nav-links,
.n8n-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.n8n-pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
}

/* Карточка с обложкой: фото + затемнение, чтобы номер и бейдж читались. */
.n8n-card-visual.has-cover {
	min-height: 156px;
	background-color: #0b1220;
	background-position: center;
	background-size: cover;
}

.n8n-card-visual.has-cover::after {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: linear-gradient(180deg, rgba(11, 18, 32, 0.18) 0%, rgba(11, 18, 32, 0.55) 52%, rgba(11, 18, 32, 0.92) 100%);
	content: "";
}

.n8n-card-visual.has-cover .n8n-card-glow {
	display: none;
}

.n8n-card-visual.has-cover .n8n-card-number,
.n8n-card-visual.has-cover .n8n-card-nodes {
	z-index: 1;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* Одинаковая высота визуальной части у всех карточек в ряду. */
.n8n-card-visual {
	min-height: 156px;
}

/* Мини-обложка в компактных карточках «Похожие статьи». */
.n8n-card-visual-sm {
	min-height: 112px;
}

.n8n-card-visual-sm.has-cover::after {
	background: linear-gradient(180deg, rgba(11, 18, 32, 0.05), rgba(11, 18, 32, 0.35));
}

/* Обложка карточки — img с ленивой загрузкой, поверх неё затемнение. */
.n8n-card-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
}

.n8n-card-visual.has-cover::after {
	z-index: 1;
}

.n8n-card-visual.has-cover .n8n-card-number,
.n8n-card-visual.has-cover .n8n-card-nodes {
	z-index: 2;
}

/* Карточки с обложками: пропорция 16:9, как у обычных превью-карточек. */
.n8n-card-visual {
	min-height: 0;
	aspect-ratio: 16 / 9;
}

.n8n-card-visual-sm {
	min-height: 0;
	aspect-ratio: 16 / 6;
}

/* -------------------------------------------------------------------------
 * Кластеры, TOC, автор и финальный CTA
 * ---------------------------------------------------------------------- */

.n8n-cluster-chips {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 6px;
}

.n8n-cluster-hero {
	padding-top: 18px;
}

.n8n-toc {
	margin: 26px 0 30px;
	padding: 18px 22px;
	border: 1px solid #dbeafe;
	border-radius: 16px;
	background: #f8fbff;
}

.n8n-toc-head {
	margin-bottom: 8px;
	color: #667085;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.n8n-toc ol {
	display: grid;
	gap: 6px;
	margin: 0;
	padding-left: 20px;
}

.n8n-toc a {
	color: #135e96;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.n8n-toc a:hover {
	text-decoration: underline;
}

.n8n-author {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	max-width: 1000px;
	margin: 30px auto 0;
	padding: 20px 24px;
	border: 1px solid #e4e7ec;
	border-radius: 18px;
	background: #fff;
}

.n8n-author-avatar {
	display: grid;
	flex: 0 0 52px;
	place-items: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: #101828;
	color: #fff;
	font-size: 20px;
	font-weight: 800;
}

.n8n-author strong {
	display: block;
	font-size: 16px;
}

.n8n-author p {
	margin: 4px 0 8px;
	color: #475467;
	font-size: 14px;
}

.n8n-side-card .n8n-text-link {
	display: inline-block;
	margin-top: 10px;
}

.n8n-inline-cta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	max-width: 1200px;
	margin: 28px auto 0;
	padding: 28px 32px;
	border-radius: 22px;
	background: linear-gradient(135deg, #101828, #123b5d);
	color: #fff;
}

.n8n-inline-cta h2 {
	margin: 4px 0 8px;
	color: #fff;
	font-size: clamp(22px, 2.4vw, 30px);
	letter-spacing: -0.03em;
}

.n8n-inline-cta p {
	max-width: 720px;
	margin: 0;
	color: #cbd5e1;
	font-size: 14px;
}

.n8n-inline-cta .n8n-kicker {
	color: #7dd3fc;
}

.n8n-inline-cta .n8n-button-primary {
	border-color: #fff;
	background: #fff;
	color: #101828 !important;
	white-space: nowrap;
}

.n8n-inline-cta .n8n-button-primary:hover {
	background: #e8f2ff;
}

@media screen and (max-width: 860px) {
	.n8n-cluster-chips {
		justify-content: flex-start;
	}

	.n8n-inline-cta {
		align-items: flex-start;
		flex-direction: column;
		padding: 24px;
	}

	.n8n-author {
		margin: 24px 16px 0;
	}
}

/* Полоса кластеров на главной */
.n8n-cluster-strip {
	max-width: 1200px;
	margin: 30px auto 0;
	padding: 0 24px;
}

.n8n-cluster-strip-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 16px;
}

.n8n-cluster-strip-head h2 {
	margin: 4px 0 0;
	font-size: clamp(22px, 2.4vw, 30px);
	letter-spacing: -0.03em;
}

.n8n-cluster-strip-head p {
	max-width: 420px;
	margin: 0;
	color: #667085;
	font-size: 13px;
}

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

.n8n-cluster-card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px;
	border: 1px solid #e4e7ec;
	border-radius: 14px;
	background: #fff;
	color: #101828 !important;
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.n8n-cluster-card:hover {
	border-color: #b9d9f5;
	box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
	transform: translateY(-1px);
}

.n8n-cluster-card-kicker {
	color: #2271b1;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.n8n-cluster-card strong {
	font-size: 15px;
	line-height: 1.25;
}

.n8n-cluster-card-count {
	margin-top: 2px;
	color: #667085;
	font-size: 12px;
}

@media screen and (max-width: 860px) {
	.n8n-cluster-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.n8n-cluster-strip {
		padding: 0 16px;
	}

	.n8n-cluster-strip-head {
		align-items: flex-start;
		flex-direction: column;
	}
}

@media screen and (max-width: 520px) {
	.n8n-cluster-grid {
		grid-template-columns: 1fr;
	}
}

/* -------------------------------------------------------------------------
 * 2.2.0 — экосистемное меню, поиск, карточки и воронка
 * ---------------------------------------------------------------------- */

/* Skip link */
.skip-link:focus {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 200;
	width: auto;
	height: auto;
	padding: 10px 14px;
	clip: auto;
	clip-path: none;
	border-radius: 8px;
	background: #fff;
	color: #135e96;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 8px 24px rgba(16, 24, 40, 0.18);
}

/* Шапка: экосистема + контекст блога */
.n8n-header-inner {
	gap: 16px;
}

.n8n-nav {
	gap: 2px;
}

.n8n-nav a.n8n-nav-global {
	color: #344054 !important;
}

.n8n-nav a.n8n-nav-global.is-active {
	background: #eff6ff;
	color: #135e96 !important;
}

.n8n-nav-divider {
	width: 1px;
	height: 18px;
	margin: 0 4px;
	background: #e4e7ec;
}

.n8n-header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}

.n8n-header-cta {
	border-color: #2271b1;
	background: #2271b1;
	color: #fff !important;
	box-shadow: 0 4px 12px rgba(34, 113, 177, 0.2);
}

.n8n-header-cta:hover {
	background: #135e96;
}

/* Поиск в шапке */
.n8n-search {
	display: flex;
	align-items: center;
	gap: 2px;
	height: 36px;
	padding: 0 6px 0 10px;
	border: 1px solid #e4e7ec;
	border-radius: 8px;
	background: #fff;
}

.n8n-search input {
	width: 104px;
	border: 0;
	outline: 0;
	background: transparent;
	color: #101828;
	font: inherit;
	font-size: 12px;
}

.n8n-search input::placeholder {
	color: #98a2b3;
}

.n8n-search button {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #667085;
	cursor: pointer;
}

.n8n-search button:hover {
	background: #f3f9ff;
	color: #135e96;
}

.n8n-search svg,
.n8n-search-toggle svg {
	width: 15px;
	height: 15px;
}

/* Выпадающие меню */
.n8n-dropdown {
	position: relative;
}

.n8n-dropdown summary {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 8px 11px;
	border-radius: 8px;
	color: #344054;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	list-style: none;
}

.n8n-dropdown summary::-webkit-details-marker {
	display: none;
}

.n8n-dropdown summary::after {
	color: #98a2b3;
	content: "▾";
	font-size: 9px;
}

.n8n-dropdown summary:hover,
.n8n-dropdown summary.is-active,
.n8n-dropdown[open] summary {
	background: #eff6ff;
	color: #135e96;
}

.n8n-dropdown-panel {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 80;
	width: 282px;
	padding: 8px;
	border: 1px solid #e4e7ec;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 18px 40px rgba(16, 24, 40, 0.14);
}

.n8n-dropdown-panel a {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 9px 10px;
	border-radius: 8px;
	color: #344054 !important;
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
}

.n8n-dropdown-panel a:hover {
	background: #f3f9ff;
	color: #135e96 !important;
}

.n8n-dropdown-num {
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
	font-size: 10px;
	color: #98a2b3;
}

/* Кнопки-иконки для мобильного */
.n8n-menu-toggle,
.n8n-search-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid #e4e7ec;
	border-radius: 8px;
	background: #fff;
	color: #344054;
	cursor: pointer;
}

.n8n-menu-toggle {
	flex-direction: column;
	gap: 4px;
}

.n8n-menu-toggle span {
	display: block;
	width: 16px;
	height: 1px;
	background: #344054;
}

.n8n-menu-toggle[aria-expanded="true"] {
	border-color: #b9d9f5;
	background: #eff6ff;
}

/* Мобильное меню */
.n8n-mobile-menu {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	max-height: calc(100vh - 70px);
	overflow-y: auto;
	border-top: 1px solid #e4e7ec;
	border-bottom: 1px solid #e4e7ec;
	background: #fff;
	box-shadow: 0 18px 34px rgba(16, 24, 40, 0.14);
}

.n8n-mobile-menu[hidden] {
	display: none;
}

.n8n-mobile-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 16px 24px 24px;
}

.n8n-mobile-search {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 16px;
	padding: 4px 4px 4px 12px;
	border: 1px solid #e4e7ec;
	border-radius: 10px;
	background: #f8fafc;
}

.n8n-mobile-search input {
	flex: 1 1 auto;
	min-width: 0;
	height: 34px;
	border: 0;
	outline: 0;
	background: transparent;
	color: #101828;
	font: inherit;
	font-size: 13px;
}

.n8n-mobile-search button {
	height: 34px;
	padding: 0 12px;
	border: 0;
	border-radius: 7px;
	background: #2271b1;
	color: #fff;
	cursor: pointer;
	font-size: 11px;
	font-weight: 700;
}

.n8n-mobile-section {
	padding: 14px 0;
	border-top: 1px solid #f0f0f1;
}

.n8n-mobile-label {
	display: block;
	margin-bottom: 9px;
	color: #667085;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.n8n-mobile-eco {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
}

.n8n-mobile-eco a {
	padding: 10px 8px;
	border: 1px solid #e4e7ec;
	border-radius: 8px;
	color: #344054 !important;
	font-size: 12px;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
}

.n8n-mobile-eco a.is-active {
	border-color: #b9d9f5;
	background: #eff6ff;
	color: #135e96 !important;
}

.n8n-mobile-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid #f0f0f1;
	color: #101828 !important;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.n8n-mobile-link:last-child {
	border-bottom: 0;
}

.n8n-mobile-link span:last-child {
	color: #667085;
	font-size: 11px;
	font-weight: 500;
}

.n8n-mobile-num {
	margin-right: 5px;
	color: #98a2b3;
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
	font-size: 10px;
}

.n8n-mobile-actions {
	display: grid;
	gap: 8px;
	margin-top: 14px;
}

.n8n-mobile-actions .n8n-button {
	width: 100%;
}

/* Карточки: кластер, заглушка, ровные заголовки */
.n8n-card h3 {
	display: -webkit-box;
	overflow: hidden;
	min-height: calc(3 * 1.28em);
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.n8n-card-fallback {
	position: absolute;
	inset: 0;
	z-index: 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 18px;
	background:
		radial-gradient(circle at 86% 18%, rgba(83, 166, 255, 0.38), transparent 38%),
		linear-gradient(135deg, #0b1220, #123b5d 62%, #1b4d78);
}

.n8n-card-fallback-kicker {
	color: #9fd0ff;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.n8n-card-fallback-title {
	max-width: calc(100% - 66px);
	margin-top: auto;
	color: #fff;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.n8n-card-visual.is-fallback .n8n-card-number {
	position: absolute;
	top: 12px;
	right: 16px;
	bottom: auto;
	left: auto;
	z-index: 2;
	color: #fff;
	font-size: 34px;
	opacity: 0.55;
}

.n8n-card-visual.is-fallback .n8n-card-nodes {
	position: absolute;
	right: 16px;
	bottom: 16px;
	z-index: 2;
}

.n8n-card-visual.is-fallback .n8n-card-glow {
	z-index: 0;
}

/* Обложка статьи: не занимает весь экран */
.n8n-cover img {
	max-height: 420px;
	object-fit: cover;
}

/* Компактный CTA внутри статьи */
.n8n-inline-offer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin: 30px 0;
	padding: 20px 22px;
	border: 1px solid #dbeafe;
	border-radius: 16px;
	background: linear-gradient(135deg, #f8fbff, #eef6ff);
}

.n8n-inline-offer-copy {
	min-width: 0;
}

.n8n-inline-offer .n8n-side-kicker {
	display: block;
	margin-bottom: 5px;
	color: #135e96;
	font-size: 9px;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.n8n-inline-offer strong {
	display: block;
	color: #101828;
	font-size: 19px;
	line-height: 1.25;
	letter-spacing: -0.02em;
}

.n8n-inline-offer p {
	margin: 5px 0 0;
	color: #475467;
	font-size: 13px;
	line-height: 1.5;
}

.n8n-inline-offer .n8n-button {
	flex: 0 0 auto;
}

.n8n-facts-list dd {
	white-space: nowrap;
}

.n8n-table-wrap {
	overflow-x: auto;
	margin: 22px 0;
	border: 1px solid #e4e7ec;
	border-radius: 12px;
}

.n8n-table-wrap table {
	margin: 0;
	min-width: 620px;
}

.n8n-table-wrap th:first-child,
.n8n-table-wrap td:first-child {
	position: sticky;
	left: 0;
	background: #fff;
}

.n8n-inline-cta-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.n8n-inline-cta-actions .n8n-button-ghost {
	border-color: rgba(255, 255, 255, 0.3);
	background: transparent;
	color: #fff !important;
}

.n8n-inline-cta-actions .n8n-button-ghost:hover {
	border-color: rgba(255, 255, 255, 0.55);
	background: rgba(255, 255, 255, 0.08);
}

/* Липкая кнопка на мобильном */
.n8n-sticky-cta {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 45;
	display: none;
	padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
	border-top: 1px solid #e4e7ec;
	background: rgba(255, 255, 255, 0.97);
	box-shadow: 0 -8px 24px rgba(16, 24, 40, 0.12);
}

body.n8n-menu-open {
	overflow: hidden;
}

.n8n-sticky-cta.is-visible {
	display: block;
}

@media (min-width: 783px) {
	.n8n-sticky-cta.is-visible {
		display: none;
	}
}

.n8n-sticky-cta .n8n-button {
	width: 100%;
}

/* Подвал: экосистема */
.n8n-footer-eco {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 12px;
}

.n8n-footer-eco a {
	padding: 4px 9px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 999px;
	color: #d6e8ff !important;
	font-size: 10px;
	font-weight: 700;
	text-decoration: none;
}

.n8n-footer-eco a.is-active {
	border-color: #2271b1;
	background: #2271b1;
	color: #fff !important;
}

/* Планшеты и мобильные */
@media (max-width: 1080px) {
	.n8n-nav,
	.n8n-search,
	.n8n-header-cta {
		display: none;
	}

	.n8n-menu-toggle,
	.n8n-search-toggle {
		display: flex;
	}

	.n8n-header-actions {
		margin-left: auto;
	}
}

@media (max-width: 782px) {
	.n8n-header-inner {
		flex-wrap: nowrap;
		padding: 10px 16px;
	}

	.n8n-mobile-inner {
		padding: 14px 16px 22px;
	}

	.n8n-cover img {
		max-height: 220px;
	}

	.n8n-fact-card {
		display: none;
	}

	.n8n-article-hero-copy h1 {
		font-size: 27px;
		line-height: 1.1;
	}

	.n8n-inline-offer {
		display: block;
		padding: 18px;
	}

	.n8n-inline-offer .n8n-button {
		width: 100%;
		margin-top: 14px;
	}

	.n8n-inline-cta-actions {
		width: 100%;
	}

	.n8n-inline-cta-actions .n8n-button {
		width: 100%;
	}

	.single-post {
		padding-bottom: 72px;
	}

	.n8n-card h3 {
		min-height: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.n8n-card,
	.n8n-button,
	.n8n-cluster-card {
		transition: none !important;
	}
}

/* Источники статьи */
.n8n-sources {
	margin-top: 40px;
	padding-top: 24px;
	border-top: 1px solid #e4e7ec;
}

.n8n-sources h2 {
	margin: 0 0 14px;
	font-size: clamp(1.3rem, 2.2vw, 1.55rem);
}

.n8n-sources ul {
	margin: 0;
	padding-left: 1.2rem;
}

.n8n-sources li {
	margin: 8px 0;
	line-height: 1.55;
}

.n8n-sources a {
	color: #175cd3;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.n8n-sources-publisher {
	color: #667085;
	font-size: 0.9em;
}

.n8n-sources-note {
	margin: 14px 0 0;
	color: #667085;
	font-size: 0.85rem;
}

