/* ============================================================
   Freebuff — основной CSS. Mobile-first.
   Цвета и ширина контейнера задаются через CSS-переменные.
   ============================================================ */

/* ---------- Сброс и переменные ---------- */

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

:root {
	--fb-primary: #2563eb;
	--fb-link: #2563eb;
	--fb-text: #1f2937;
	--fb-bg: #ffffff;
	--fb-header-bg: #ffffff;
	--fb-header-text: #111827;
	--fb-container: 1200px;
	--fb-radius: 12px;
	--fb-radius-sm: 8px;
	--fb-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
	--fb-shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);
	--fb-border: #e5e7eb;
	--fb-muted: #6b7280;
	--fb-bg-soft: #f3f4f6;
}

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

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	font-size: 17px;
	line-height: 1.65;
	color: var(--fb-text);
	background: var(--fb-bg);
	overflow-wrap: break-word;
}

img {
	max-width: 100%;
	height: auto;
	display: inline-block;
	vertical-align: middle;
}

a {
	color: var(--fb-link);
	text-decoration: none;
	transition: color 0.15s ease;
}

a:hover {
	color: var(--fb-primary);
	text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
	line-height: 1.25;
	margin: 1.4em 0 0.5em;
	font-weight: 700;
	color: inherit;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.12rem; }

p {
	margin: 0 0 1.2em;
}

/* ---------- Утилиты ---------- */

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	padding: 10px 16px;
	background: var(--fb-primary);
	color: #fff;
	border-radius: 0 0 8px 0;
}

.skip-link:focus {
	left: 0;
	color: #fff;
	text-decoration: none;
}

.fb-container {
	max-width: var(--fb-container);
	margin: 0 auto;
	padding: 0 16px;
}

.fb-icon {
	width: 1em;
	height: 1em;
	flex: none;
	vertical-align: -0.125em;
}

/* ---------- Шапка ---------- */

.fb-header {
	background: var(--fb-header-bg);
	color: var(--fb-header-text);
	border-bottom: 1px solid var(--fb-border);
}

.fb-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 64px;
	flex-wrap: wrap;
}

.fb-logo {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 800;
	letter-spacing: -0.02em;
}

.fb-logo a {
	color: var(--fb-header-text);
	text-decoration: none;
}

.custom-logo {
	max-height: 56px;
	width: auto;
}

.fb-header__tagline {
	margin: 2px 0 0;
	font-size: 0.85rem;
	color: var(--fb-muted);
}

/* Кнопка-бургер */
.fb-nav-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--fb-border);
	border-radius: var(--fb-radius-sm);
	background: transparent;
	cursor: pointer;
	color: var(--fb-header-text);
}

.fb-nav-toggle__icon,
.fb-nav-toggle__icon::before,
.fb-nav-toggle__icon::after {
	display: block;
	width: 20px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.fb-nav-toggle__icon {
	position: relative;
}

.fb-nav-toggle__icon::before,
.fb-nav-toggle__icon::after {
	content: "";
	position: absolute;
	left: 0;
}

.fb-nav-toggle__icon::before { top: -6px; }
.fb-nav-toggle__icon::after  { top: 6px; }

.fb-nav-toggle.is-active .fb-nav-toggle__icon {
	background: transparent;
}

.fb-nav-toggle.is-active .fb-nav-toggle__icon::before {
	transform: translateY(6px) rotate(45deg);
}

.fb-nav-toggle.is-active .fb-nav-toggle__icon::after {
	transform: translateY(-6px) rotate(-45deg);
}

/* Навигация (мобильная: выпадающая панель) */
.fb-nav {
	display: none;
	width: 100%;
	order: 3;
	border-top: 1px solid var(--fb-border);
}

.fb-nav.is-open {
	display: block;
}

.fb-nav__list {
	list-style: none;
	margin: 0;
	padding: 8px 0 16px;
}

.fb-nav__list > li > a,
.fb-nav__list > li > span {
	display: block;
	padding: 10px 0;
	font-weight: 600;
	color: var(--fb-header-text);
	text-decoration: none;
}

.fb-nav__list li {
	position: relative;
}

.fb-nav__list .sub-menu {
	list-style: none;
	margin: 0 0 6px;
	padding: 0 0 0 16px;
	font-size: 0.95rem;
}

.fb-nav__list .sub-menu a {
	display: block;
	padding: 6px 0;
	color: var(--fb-muted);
	text-decoration: none;
}

.fb-nav__list .sub-menu a:hover {
	color: var(--fb-primary);
}

.fb-nav__list .current-menu-item > a,
.fb-nav__list .current-menu-item > span {
	color: var(--fb-primary);
}

/* ---------- Герой-блок главной ---------- */

.fb-hero {
	background: var(--fb-primary); /* fallback */
	background: linear-gradient(135deg, var(--fb-primary), color-mix(in srgb, var(--fb-primary) 60%, #1e40af));
	color: #fff;
	padding: 44px 0;
}

.fb-hero__inner {
	text-align: center;
}

.fb-hero__title {
	margin: 0 0 10px;
	font-size: 2rem;
	color: #fff;
}

.fb-hero__text {
	margin: 0 auto;
	max-width: 640px;
	font-size: 1.05rem;
	opacity: 0.92;
}

/* ---------- Раскладка ---------- */

.fb-layout {
	display: block;
	padding: 24px 0 48px;
}

.fb-main {
	min-width: 0;
}

.fb-sidebar {
	min-width: 0;
	margin-top: 40px;
}

/* ---------- Карточки постов ---------- */

.fb-cards {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

.fb-card {
	display: flex;
	flex-direction: column;
	background: var(--fb-bg);
	border: 1px solid var(--fb-border);
	border-radius: var(--fb-radius);
	overflow: hidden;
	box-shadow: var(--fb-shadow);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.fb-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--fb-shadow-lg);
}

.fb-card__media {
	display: block;
	aspect-ratio: 16 / 9;
	background: var(--fb-bg-soft);
	overflow: hidden;
}

.fb-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.fb-card:hover .fb-card__media img {
	transform: scale(1.04);
}

.fb-card__body {
	padding: 18px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.fb-card__title {
	margin: 0 0 10px;
	font-size: 1.2rem;
}

.fb-card__title a {
	color: inherit;
	text-decoration: none;
}

.fb-card__title a:hover {
	color: var(--fb-primary);
}

.fb-card__excerpt {
	color: var(--fb-muted);
	font-size: 0.95rem;
	margin: 0 0 14px;
}

.fb-card__more {
	margin-top: auto;
	align-self: flex-start;
	font-weight: 600;
	font-size: 0.95rem;
}

/* Пресет «overlay» — картинка на весь фон */
.fb-cards-overlay .fb-card {
	position: relative;
	border: 0;
}

.fb-cards-overlay .fb-card__media {
	position: absolute;
	inset: 0;
}

.fb-cards-overlay .fb-card__media img {
	width: 100%;
	height: 100%;
}

.fb-cards-overlay .fb-card__body {
	position: relative;
	min-height: 260px;
	justify-content: flex-end;
	color: #fff;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.05));
}

.fb-cards-overlay .fb-card__title a,
.fb-cards-overlay .fb-card__more {
	color: #fff;
}

.fb-cards-overlay .fb-card__excerpt {
	color: rgba(255, 255, 255, 0.85);
}

.fb-cards-overlay .fb-meta {
	color: rgba(255, 255, 255, 0.9);
}

.fb-cards-overlay .fb-meta a {
	color: #fff;
}

/* Пресет «horizontal» */
.fb-cards-horizontal .fb-card {
	flex-direction: row;
}

.fb-cards-horizontal .fb-card__media {
	width: 42%;
	aspect-ratio: auto;
	flex: none;
}

.fb-cards-horizontal .fb-card__body {
	padding: 16px 18px;
}

/* Пресет «minimal» — без картинок */
.fb-cards-minimal .fb-card {
	box-shadow: none;
	border-radius: var(--fb-radius-sm);
}

/* ---------- Мета-информация поста ---------- */

.fb-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	font-size: 0.85rem;
	color: var(--fb-muted);
	margin-bottom: 14px;
}

.fb-meta__item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.fb-meta__item a {
	color: var(--fb-muted);
	text-decoration: none;
}

.fb-meta__item a:hover {
	color: var(--fb-primary);
}

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

.fb-article {
	background: var(--fb-bg);
	border: 1px solid var(--fb-border);
	border-radius: var(--fb-radius);
	padding: 24px 18px;
	box-shadow: var(--fb-shadow);
}

.fb-article__header {
	margin-bottom: 18px;
}

.fb-article__title {
	margin: 0 0 12px;
	font-size: 2rem;
}

.fb-article__thumb {
	margin: 0 0 20px;
	border-radius: var(--fb-radius);
	overflow: hidden;
}

.fb-article__content {
	font-size: 1.05rem;
}

/* Типографика контента */
.fb-article__content h2,
.fb-article__content h3,
.fb-article__content h4 {
	scroll-margin-top: 90px;
}

.fb-article__content img {
	border-radius: var(--fb-radius-sm);
}

.fb-article__content ul,
.fb-article__content ol {
	padding-left: 1.4em;
}

.fb-article__content li {
	margin-bottom: 0.4em;
}

.fb-article__content blockquote {
	margin: 1.6em 0;
	padding: 12px 20px;
	border-left: 4px solid var(--fb-primary);
	background: var(--fb-bg-soft);
	border-radius: 0 var(--fb-radius-sm) var(--fb-radius-sm) 0;
	font-style: italic;
	color: #374151;
}

.fb-article__content blockquote p:last-child {
	margin-bottom: 0;
}

.fb-article__content pre {
	padding: 16px;
	background: #0f172a;
	color: #e2e8f0;
	border-radius: var(--fb-radius-sm);
	overflow-x: auto;
	font-size: 0.9rem;
}

.fb-article__content code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.9em;
	background: var(--fb-bg-soft);
	padding: 2px 6px;
	border-radius: 4px;
}

.fb-article__content pre code {
	background: transparent;
	padding: 0;
}

.fb-article__content table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.4em 0;
	font-size: 0.95rem;
	display: block;
	overflow-x: auto;
}

.fb-article__content th,
.fb-article__content td {
	border: 1px solid var(--fb-border);
	padding: 10px 12px;
	text-align: left;
}

.fb-article__content th {
	background: var(--fb-bg-soft);
	font-weight: 700;
}

.fb-article__content tr:nth-child(even) td {
	background: #fafafa;
}

.fb-article__content .wp-caption {
	max-width: 100%;
}

.fb-article__content .wp-caption-text {
	font-size: 0.85rem;
	color: var(--fb-muted);
	text-align: center;
	margin-top: 6px;
}

.fb-article__content .alignleft { float: left; margin: 0 20px 16px 0; }
.fb-article__content .alignright { float: right; margin: 0 0 16px 20px; }
.fb-article__content .aligncenter { margin: 20px auto; display: block; }

.fb-page-links {
	margin: 20px 0;
	font-weight: 600;
}

/* ---------- Источник, теги, кнопки в конце записи ---------- */

.fb-entry-footer {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--fb-border);
}

.fb-source {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	background: var(--fb-bg-soft);
	padding: 12px 16px;
	border-radius: var(--fb-radius-sm);
	margin-bottom: 16px;
	font-size: 0.95rem;
}

.fb-source span {
	color: var(--fb-muted);
}

.fb-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 0.9rem;
	color: var(--fb-muted);
}

.fb-tags__item {
	background: var(--fb-bg-soft);
	color: #374151;
	padding: 4px 12px;
	border-radius: 999px;
	text-decoration: none;
}

.fb-tags__item:hover {
	background: var(--fb-primary);
	color: #fff;
	text-decoration: none;
}

/* ---------- Кнопки «Поделиться» ---------- */

.fb-share {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 20px;
}

.fb-share__label {
	font-weight: 600;
	font-size: 0.95rem;
}

.fb-share__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.fb-share__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 1px solid var(--fb-border);
	border-radius: 50%;
	background: var(--fb-bg);
	color: #374151;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.fb-share__btn:hover {
	background: var(--fb-primary);
	border-color: var(--fb-primary);
	color: #fff;
}

.fb-share__btn.is-copied {
	background: #16a34a;
	border-color: #16a34a;
	color: #fff;
}

.fb-share__btn .fb-icon {
	width: 17px;
	height: 17px;
}

/* Кнопки приложений — только на мобильных */
.fb-share__mobile {
	display: none;
}

/* ---------- Комментарии ---------- */

.fb-comments {
	margin-top: 32px;
}

.fb-comments__title {
	font-size: 1.4rem;
}

.fb-comments__count {
	color: var(--fb-muted);
	font-weight: 400;
}

.comment-list {
	list-style: none;
	margin: 0 0 28px;
	padding: 0;
}

.comment-list .children {
	list-style: none;
	padding-left: 20px;
	margin: 0;
}

.comment-body {
	background: var(--fb-bg);
	border: 1px solid var(--fb-border);
	border-radius: var(--fb-radius-sm);
	padding: 16px;
	margin-bottom: 16px;
}

.comment-meta {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 0.9rem;
	margin-bottom: 10px;
}

.comment-meta .avatar {
	border-radius: 50%;
}

.comment-author {
	font-weight: 600;
}

.comment-author .fb-comment-author {
	cursor: pointer;
}

.comment-author .fb-comment-author:hover {
	color: var(--fb-primary);
}

.comment-metadata {
	font-size: 0.82rem;
	color: var(--fb-muted);
}

.comment-metadata a {
	color: var(--fb-muted);
	text-decoration: none;
}

.comment-content p:last-child {
	margin-bottom: 0;
}

/* Кнопка «Ответить» вместо ссылки */
.comment-reply-link,
.comment-edit-link {
	display: inline-block;
	margin-top: 8px;
	padding: 4px 12px;
	font-size: 0.85rem;
	border: 1px solid var(--fb-border);
	border-radius: 999px;
	background: var(--fb-bg);
	color: #374151;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.comment-reply-link:hover,
.comment-edit-link:hover {
	background: var(--fb-primary);
	border-color: var(--fb-primary);
	color: #fff;
	text-decoration: none;
}

.fb-comments__closed {
	color: var(--fb-muted);
}

/* ---------- Виджеты ---------- */

.fb-widget {
	margin-bottom: 28px;
}

.fb-widget__title {
	font-size: 1.1rem;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--fb-border);
	position: relative;
	margin-bottom: 16px;
}

.fb-widget__title::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -2px;
	width: 48px;
	height: 2px;
	background: var(--fb-primary);
}

.fb-widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fb-widget ul li {
	padding: 8px 0;
	border-bottom: 1px solid var(--fb-border);
}

.fb-widget ul li:last-child {
	border-bottom: 0;
}

.fb-widget ul a {
	text-decoration: none;
}

/* Виджет постов */
.fb-widget-posts__item {
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

.fb-widget-posts__thumb {
	flex: none;
	width: 64px;
	height: 64px;
	border-radius: var(--fb-radius-sm);
	overflow: hidden;
	background: var(--fb-bg-soft);
}

.fb-widget-posts__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.fb-widget-posts__title {
	display: block;
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.35;
}

.fb-widget-posts__meta {
	display: block;
	font-size: 0.8rem;
	color: var(--fb-muted);
	margin-top: 4px;
}

/* Соцсети */
.fb-social {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.fb-social__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 1px solid var(--fb-border);
	border-radius: 50%;
	color: #374151;
	transition: background 0.15s ease, color 0.15s ease;
}

.fb-social__link:hover {
	background: var(--fb-primary);
	border-color: var(--fb-primary);
	color: #fff;
	text-decoration: none;
}

.fb-social__link .fb-icon {
	width: 17px;
	height: 17px;
}

/* ---------- Хлебные крошки ---------- */

.fb-breadcrumbs {
	margin-bottom: 20px;
	font-size: 0.88rem;
}

.fb-breadcrumbs__list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
	color: var(--fb-muted);
}

.fb-breadcrumbs__item {
	display: flex;
	align-items: center;
	gap: 6px;
}

.fb-breadcrumbs__item + .fb-breadcrumbs__item::before {
	content: "›";
	color: var(--fb-border);
}

.fb-breadcrumbs__item a {
	color: var(--fb-muted);
	text-decoration: none;
}

.fb-breadcrumbs__item a:hover {
	color: var(--fb-primary);
}

.fb-breadcrumbs__item [aria-current="page"] {
	color: var(--fb-text);
}

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

.fb-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 32px;
}

.fb-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--fb-border);
	border-radius: var(--fb-radius-sm);
	color: #374151;
	text-decoration: none;
	font-weight: 600;
}

.fb-pagination .page-numbers.current {
	background: var(--fb-primary);
	border-color: var(--fb-primary);
	color: #fff;
}

.fb-pagination .page-numbers:hover {
	border-color: var(--fb-primary);
	color: var(--fb-primary);
}

/* ---------- Формы ---------- */

.fb-search {
	display: flex;
	gap: 8px;
	max-width: 460px;
}

.fb-search__input {
	flex: 1;
	min-width: 0;
	padding: 10px 14px;
	border: 1px solid var(--fb-border);
	border-radius: var(--fb-radius-sm);
	font-size: 1rem;
	background: var(--fb-bg);
	color: var(--fb-text);
}

.fb-search__input:focus {
	outline: none;
	border-color: var(--fb-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--fb-primary) 18%, transparent);
}

.fb-search__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--fb-primary);
	border-radius: var(--fb-radius-sm);
	background: var(--fb-primary);
	color: #fff;
	cursor: pointer;
}

.fb-search__btn:hover {
	filter: brightness(1.1);
}

.fb-form .fb-form__row {
	display: grid;
	gap: 16px;
}

.fb-form__field {
	margin-bottom: 16px;
}

.fb-form__field label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 0.95rem;
}

.fb-form__field input[type="text"],
.fb-form__field input[type="email"],
.fb-form__field input[type="url"],
.fb-form__field input[type="search"],
.fb-form__field textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--fb-border);
	border-radius: var(--fb-radius-sm);
	font: inherit;
	background: var(--fb-bg);
	color: var(--fb-text);
}

.fb-form__field input:focus,
.fb-form__field textarea:focus,
.comment-form input:focus,
.comment-form textarea:focus {
	outline: none;
	border-color: var(--fb-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--fb-primary) 18%, transparent);
}

.fb-form__hp {
	position: absolute !important;
	left: -9999px !important;
	opacity: 0;
	height: 0;
	overflow: hidden;
}

.fb-form__notice {
	padding: 12px 16px;
	border-radius: var(--fb-radius-sm);
	margin-bottom: 16px;
	font-weight: 600;
}

.fb-form__notice--ok {
	background: #dcfce7;
	color: #166534;
}

.fb-form__notice--error {
	background: #fee2e2;
	color: #991b1b;
}

.fb-btn {
	display: inline-block;
	padding: 11px 22px;
	border: 1px solid var(--fb-primary);
	border-radius: var(--fb-radius-sm);
	background: var(--fb-primary);
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: filter 0.15s ease;
}

.fb-btn:hover {
	filter: brightness(1.1);
	color: #fff;
	text-decoration: none;
}

/* ---------- Блоки внимания (8 видов) ---------- */

.fb-alert {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 16px 18px;
	border-radius: var(--fb-radius-sm);
	margin: 1.4em 0;
	border: 1px solid;
	font-size: 0.98rem;
}

.fb-alert .fb-icon {
	width: 22px;
	height: 22px;
	flex: none;
	margin-top: 3px;
}

.fb-alert__body {
	min-width: 0;
}

.fb-alert__body p:last-child {
	margin-bottom: 0;
}

.fb-alert__title {
	display: block;
	margin-bottom: 4px;
}

.fb-alert--info     { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.fb-alert--success  { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.fb-alert--warning  { background: #fffbeb; border-color: #fde68a; color: #713f12; }
.fb-alert--error    { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.fb-alert--tip      { background: #f5f3ff; border-color: #ddd6fe; color: #4c1d95; }
.fb-alert--note     { background: #f8fafc; border-color: #e2e8f0; color: #1e293b; }
.fb-alert--question { background: #fdf4ff; border-color: #f5d0fe; color: #701a75; }
.fb-alert--download { background: #ecfeff; border-color: #a5f3fc; color: #164e63; }

/* ---------- Спойлер ---------- */

.fb-spoiler {
	border: 1px solid var(--fb-border);
	border-radius: var(--fb-radius-sm);
	margin: 1.4em 0;
	background: var(--fb-bg);
}

.fb-spoiler summary {
	cursor: pointer;
	padding: 12px 16px;
	font-weight: 600;
	list-style: none;
	display: flex;
	align-items: center;
	gap: 8px;
}

.fb-spoiler summary::-webkit-details-marker {
	display: none;
}

.fb-spoiler summary::before {
	content: "+";
	font-weight: 700;
	color: var(--fb-primary);
	transition: transform 0.2s ease;
}

.fb-spoiler[open] summary::before {
	content: "−";
}

.fb-spoiler__body {
	padding: 0 16px 16px;
}

/* ---------- Содержание ---------- */

.fb-toc {
	background: var(--fb-bg-soft);
	border: 1px solid var(--fb-border);
	border-radius: var(--fb-radius-sm);
	padding: 14px 18px;
	margin: 1.6em 0;
	font-size: 0.95rem;
}

.fb-toc summary {
	cursor: pointer;
	font-weight: 700;
}

.fb-toc__list {
	margin: 10px 0 0;
	padding-left: 20px;
}

.fb-toc__list li {
	margin-bottom: 6px;
}

.fb-toc__list a {
	text-decoration: none;
	color: #374151;
}

.fb-toc__list a:hover,
.fb-toc__list a.is-active {
	color: var(--fb-primary);
}

.fb-toc__sub {
	list-style-type: circle;
}

/* ---------- Карта сайта ---------- */

.fb-sitemap__list {
	padding-left: 20px;
}

.fb-sitemap__count {
	color: var(--fb-muted);
}

/* ---------- Слайдер ---------- */

.fb-slider {
	position: relative;
	margin: 1.6em 0;
	border-radius: var(--fb-radius);
	overflow: hidden;
	background: var(--fb-bg-soft);
}

.fb-slider__viewport {
	overflow: hidden;
}

.fb-slider__track {
	display: flex;
	transition: transform 0.35s ease;
}

.fb-slider__slide {
	flex: 0 0 100%;
	min-width: 0;
	margin: 0;
}

.fb-slider__slide img {
	width: 100%;
	display: block;
}

.fb-slider__slide figcaption {
	padding: 10px 16px;
	font-size: 0.9rem;
	color: var(--fb-muted);
	text-align: center;
}

.fb-slider__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: #111827;
	font-size: 1.4rem;
	cursor: pointer;
	box-shadow: var(--fb-shadow);
}

.fb-slider__prev { left: 12px; }
.fb-slider__next { right: 12px; }

.fb-slider__nav:hover {
	background: #fff;
}

.fb-slider__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	padding: 10px;
}

.fb-slider__dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #d1d5db;
	cursor: pointer;
}

.fb-slider__dot.is-active {
	background: var(--fb-primary);
}

.fb-slider--single .fb-slider__dots {
	display: none;
}

/* ---------- Лайтбокс ---------- */

.fb-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.9);
	padding: 24px;
}

.fb-lightbox[hidden] {
	display: none;
}

.fb-lightbox__img {
	max-width: 100%;
	max-height: 90vh;
	border-radius: 4px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.fb-lightbox__close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 1.6rem;
	cursor: pointer;
	line-height: 1;
}

.fb-lightbox__close:hover {
	background: rgba(255, 255, 255, 0.3);
}

body.fb-lightbox-open {
	overflow: hidden;
}

/* ---------- Похожие записи, навигация по записям ---------- */

.fb-related {
	margin-top: 36px;
}

.fb-related__title {
	font-size: 1.35rem;
}

.fb-postnav {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
	margin-top: 32px;
}

.fb-postnav a {
	display: block;
	padding: 14px 16px;
	border: 1px solid var(--fb-border);
	border-radius: var(--fb-radius-sm);
	text-decoration: none;
	color: inherit;
	font-weight: 600;
}

.fb-postnav a:hover {
	border-color: var(--fb-primary);
	color: var(--fb-primary);
}

.fb-postnav__next {
	text-align: right;
}

/* ---------- Блок автора ---------- */

.fb-authorbox {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	background: var(--fb-bg-soft);
	border-radius: var(--fb-radius);
	padding: 18px;
	margin-top: 28px;
}

.fb-authorbox img {
	border-radius: 50%;
}

.fb-authorbox__role {
	display: block;
	font-size: 0.82rem;
	color: var(--fb-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.fb-authorbox__name {
	font-size: 1.1rem;
	font-weight: 700;
}

.fb-authorbox__desc {
	margin: 6px 0 0;
	color: var(--fb-muted);
	font-size: 0.95rem;
}

/* ---------- Архив, 404, пусто ---------- */

.fb-archive-header {
	margin-bottom: 24px;
}

.fb-archive-header__title {
	font-size: 1.7rem;
	margin: 0 0 10px;
}

.fb-archive-header__desc {
	color: var(--fb-muted);
}

.fb-search-query {
	color: var(--fb-primary);
}

.fb-404 {
	text-align: center;
	padding: 40px 0;
}

.fb-404__code {
	font-size: 5rem;
	font-weight: 800;
	margin: 0;
	color: var(--fb-primary);
	line-height: 1;
}

.fb-404 .fb-search {
	margin: 24px auto;
}

.fb-none {
	text-align: center;
	padding: 32px 0;
}

.fb-none .fb-search {
	margin: 20px auto;
}

/* ---------- Реклама ---------- */

.fb-ad {
	text-align: center;
	margin: 20px auto;
	overflow: hidden;
}

.fb-ad--header {
	margin-top: 0;
	padding: 16px 0;
	border-bottom: 1px solid var(--fb-border);
}

.fb-ad--footer {
	padding: 16px 0;
	border-bottom: 1px solid var(--fb-border);
}

/* ---------- Подвал ---------- */

.fb-footer {
	background: var(--fb-bg-soft);
	border-top: 1px solid var(--fb-border);
	margin-top: 48px;
	padding: 40px 0 24px;
}

.fb-footer__widgets {
	display: grid;
	grid-template-columns: 1fr;
	gap: 28px;
	margin-bottom: 28px;
}

.fb-footer__widgets .fb-widget__title {
	border-color: #d1d5db;
}

.fb-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	justify-content: space-between;
	border-top: 1px solid var(--fb-border);
	padding-top: 20px;
	font-size: 0.9rem;
	color: var(--fb-muted);
}

.fb-footer__menu {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.fb-footer__menu a {
	color: var(--fb-muted);
	text-decoration: none;
}

.fb-footer__menu a:hover {
	color: var(--fb-primary);
}

/* ---------- Кнопка «Наверх» ---------- */

.fb-to-top {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 900;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border: 0;
	border-radius: 50%;
	background: var(--fb-primary);
	color: #fff;
	cursor: pointer;
	box-shadow: var(--fb-shadow-lg);
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.fb-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.fb-to-top:hover {
	filter: brightness(1.1);
}

/* ============================================================
   Адаптив
   ============================================================ */

@media (min-width: 640px) {
	.fb-container {
		padding: 0 24px;
	}

	.fb-cards {
		grid-template-columns: repeat(2, 1fr);
	}

	.fb-article {
		padding: 32px 28px;
	}

	.fb-article__title {
		font-size: 2.2rem;
	}

	.fb-hero {
		padding: 56px 0;
	}

	.fb-hero__title {
		font-size: 2.4rem;
	}

	.fb-form .fb-form__row {
		grid-template-columns: 1fr 1fr;
	}

	.fb-postnav {
		grid-template-columns: 1fr 1fr;
	}

	.fb-footer__widgets {
		grid-template-columns: repeat(3, 1fr);
	}

	/* Кнопки Telegram/Viber/WhatsApp видны только с мобильных */
	.fb-share__mobile {
		display: none;
	}
}

@media (min-width: 900px) {
	.fb-nav-toggle {
		display: none;
	}

	.fb-nav {
		display: block;
		width: auto;
		order: 0;
		border-top: 0;
	}

	.fb-nav__list {
		display: flex;
		align-items: center;
		gap: 4px;
		padding: 0;
	}

	.fb-nav__list > li > a,
	.fb-nav__list > li > span {
		padding: 8px 14px;
		border-radius: var(--fb-radius-sm);
	}

	.fb-nav__list > li > a:hover {
		background: var(--fb-bg-soft);
		text-decoration: none;
	}

	/* Выпадающее подменю */
	.fb-nav__list li.menu-item-has-children {
		position: relative;
	}

	.fb-nav__list .sub-menu {
		position: absolute;
		top: 100%;
		left: 0;
		min-width: 220px;
		background: var(--fb-bg);
		border: 1px solid var(--fb-border);
		border-radius: var(--fb-radius-sm);
		box-shadow: var(--fb-shadow-lg);
		padding: 8px;
		opacity: 0;
		visibility: hidden;
		transform: translateY(6px);
		transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
		z-index: 50;
	}

	.fb-nav__list li:hover > .sub-menu,
	.fb-nav__list li:focus-within > .sub-menu {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}

	.fb-nav__list .sub-menu a {
		padding: 8px 10px;
		border-radius: 6px;
		color: #374151;
	}

	.fb-nav__list .sub-menu a:hover {
		background: var(--fb-bg-soft);
		color: var(--fb-primary);
	}

	.fb-layout--sidebar {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 320px;
		gap: 36px;
		align-items: start;
	}

	.fb-sidebar {
		margin-top: 0;
	}

	body.fb-sidebar-left .fb-layout--sidebar {
		grid-template-columns: 320px minmax(0, 1fr);
	}

	body.fb-sidebar-left .fb-layout--sidebar .fb-main {
		order: 2;
	}

	body.fb-sidebar-left .fb-layout--sidebar .fb-sidebar {
		order: 1;
	}

	.fb-cards--3 {
		grid-template-columns: repeat(3, 1fr);
	}

	.fb-hero__title {
		font-size: 2.8rem;
	}
}

@media (min-width: 1024px) {
	.fb-container {
		padding: 0 32px;
	}

	.fb-layout {
		padding: 32px 0 56px;
	}

	.fb-cards--2 {
		grid-template-columns: repeat(2, 1fr);
	}

	.fb-article__title {
		font-size: 2.4rem;
	}
}

/* Мобильные кнопки шаринга для приложений */
@media (hover: none) and (pointer: coarse) {
	.fb-share__mobile {
		display: inline-flex;
	}
}

/* Уважение к настройке «уменьшить движение» */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
