/**
 * Стили раздела категорий (архивов): рубрики, главная блога, поиск.
 * Тёмная графитовая тема в стиле сайта (глоссарий, главная).
 * Сайдбар на этих страницах не выводится — контент на всю ширину.
 */

/* Раскладка без сайдбара — перебиваем style.css */
body.archive .site-content,
body.blog .site-content,
body.home:not(.front-page-hub) .site-content,
body.search .site-content {
	display: block !important;
	grid-template-columns: none !important;
}

body.archive .content-area,
body.archive #primary,
body.blog .content-area,
body.blog #primary,
body.home:not(.front-page-hub) .content-area,
body.home:not(.front-page-hub) #primary,
body.search .content-area,
body.search #primary {
	width: 100% !important;
	max-width: 100% !important;
	grid-column: unset !important;
}

/* Скрыть сайдбар на случай если где-то ещё выводится */
body.archive #secondary,
body.archive .sidebar,
body.blog #secondary,
body.blog .sidebar,
body.home:not(.front-page-hub) #secondary,
body.home:not(.front-page-hub) .sidebar,
body.search #secondary,
body.search .sidebar {
	display: none !important;
}

/* Переменные — в тон существующему сайту */
body.archive,
body.blog,
body.home:not(.front-page-hub),
body.search {
	--fp-bg: #161618;
	--fp-bg-soft: #1e1e21;
	--fp-bg-card: #252529;
	--fp-border: rgba(255, 255, 255, 0.06);
	--fp-text: #e4e4e7;
	--fp-text-muted: #a1a1aa;
	--fp-text-dim: #71717a;
	--fp-accent: #818cf8;
	--fp-accent-soft: rgba(129, 140, 248, 0.15);
	--fp-btn: #2d2d32;
	--fp-btn-hover: #3f3f46;
	--fp-radius: 10px;
	--fp-radius-sm: 6px;
}

/* Фон страницы и контентной области */
body.archive,
body.blog,
body.home:not(.front-page-hub),
body.search {
	background: var(--fp-bg) !important;
	color: var(--fp-text);
}

body.archive #content,
body.archive .site-content,
body.blog #content,
body.blog .site-content,
body.home:not(.front-page-hub) #content,
body.home:not(.front-page-hub) .site-content,
body.search #content,
body.search .site-content {
	background: var(--fp-bg) !important;
	color: var(--fp-text) !important;
}

body.archive a,
body.blog a,
body.home:not(.front-page-hub) a,
body.search a {
	color: var(--fp-accent);
}

body.archive a:hover,
body.blog a:hover,
body.home:not(.front-page-hub) a:hover,
body.search a:hover {
	color: #a5b4fc;
}

/* Заголовок архива (Рубрика: Знания) — перебиваем style.css */
body.archive .archive-header,
body.blog .archive-header,
body.search .archive-header {
	margin-bottom: 2rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--fp-border);
	background: transparent !important;
	color: var(--fp-text) !important;
}

body.archive .archive-title,
body.blog .archive-title,
body.search .archive-title {
	margin: 0 0 0.25em;
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--fp-text) !important;
	background: transparent !important;
}

body.archive .archive-description,
body.blog .archive-description,
body.search .archive-description {
	margin: 0;
	font-size: 0.95rem;
	color: var(--fp-text-muted);
}

/* Основная колонка с карточками записей */
body.archive .content-archive,
body.blog .content-archive,
body.search .content-archive {
	background: transparent !important;
	color: var(--fp-text);
	padding: 1.5rem 1rem 2rem;
	max-width: 960px;
	margin-left: auto;
	margin-right: auto;
}

body.archive .post-wrapper,
body.blog .post-wrapper,
body.search .post-wrapper {
	display: grid;
	gap: 1.5rem;
}

@media (min-width: 600px) {
	body.archive .post-wrapper,
	body.blog .post-wrapper,
	body.search .post-wrapper {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 900px) {
	body.archive .post-wrapper,
	body.blog .post-wrapper,
	body.search .post-wrapper {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Карточка записи */
body.archive .content-archive .type-post,
body.blog .content-archive .type-post,
body.search .content-archive .type-post {
	background: var(--fp-bg-card) !important;
	border: 1px solid var(--fp-border);
	border-radius: var(--fp-radius);
	overflow: hidden;
	padding: 1.25rem;
}

body.archive .content-archive .type-post .entry-title,
body.blog .content-archive .type-post .entry-title,
body.search .content-archive .type-post .entry-title {
	margin: 0 0 0.5em;
	font-size: 1.1rem;
	line-height: 1.3;
}

body.archive .content-archive .type-post .entry-title a,
body.blog .content-archive .type-post .entry-title a,
body.search .content-archive .type-post .entry-title a {
	color: var(--fp-text) !important;
	text-decoration: none;
}

body.archive .content-archive .type-post .entry-title a:hover,
body.blog .content-archive .type-post .entry-title a:hover,
body.search .content-archive .type-post .entry-title a:hover {
	color: var(--fp-accent) !important;
}

body.archive .content-archive .entry-meta,
body.blog .content-archive .entry-meta,
body.search .content-archive .entry-meta {
	font-size: 0.85em;
	color: #e4e4e7 !important;
	margin-bottom: 0;
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	padding: 0.25rem 0.7rem;
	border-radius: 999px;
	background: var(--fp-bg-soft);
	border: 1px solid var(--fp-border);
	line-height: 1.2;
}

/* Отдельные баблики: дата и автор */
body.archive .content-archive .entry-header .entry-meta .posted-on,
body.archive .content-archive .entry-header .entry-meta .posted-by,
body.blog .content-archive .entry-header .entry-meta .posted-on,
body.blog .content-archive .entry-header .entry-meta .posted-by,
body.search .content-archive .entry-header .entry-meta .posted-on,
body.search .content-archive .entry-header .entry-meta .posted-by {
	display: inline-flex;
	align-items: center;
	padding: 0;
	border-radius: 0;
	background: none;
	border: none;
	gap: 0.2em;
}

body.archive .content-archive .entry-header .entry-meta,
body.blog .content-archive .entry-header .entry-meta,
body.search .content-archive .entry-header .entry-meta {
	font-size: 0.8rem;
	font-weight: 400;
	color: #e4e4e7;
}

body.archive .content-archive .entry-header__meta-row,
body.blog .content-archive .entry-header__meta-row,
body.search .content-archive .entry-header__meta-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	margin-bottom: 0.5em;
}

/* Баблик «Раздел» рядом с датой и автором */
body.archive .content-archive .entry-header .entry-categories,
body.blog .content-archive .entry-header .entry-categories,
body.search .content-archive .entry-header .entry-categories {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.25rem 0.7rem;
	border-radius: 999px;
	background: var(--fp-bg-soft);
	border: 1px solid var(--fp-border);
	color: var(--fp-text-muted);
	font-size: 0.8rem;
	font-weight: 400;
	margin: 0;
	line-height: 1.2;
}

body.archive .content-archive .entry-header .entry-categories::before,
body.blog .content-archive .entry-header .entry-categories::before,
body.search .content-archive .entry-header .entry-categories::before {
	content: "Раздел: ";
	color: var(--fp-text-muted);
	font-weight: 400;
}

body.archive .content-archive .entry-header .entry-categories svg,
body.blog .content-archive .entry-header .entry-categories svg,
body.search .content-archive .entry-header .entry-categories svg {
	display: none;
}

body.archive .content-archive .entry-header .entry-categories a,
body.blog .content-archive .entry-header .entry-categories a,
body.search .content-archive .entry-header .entry-categories a {
	color: var(--fp-accent) !important;
	font-weight: 600;
	text-decoration: none;
}

body.archive .content-archive .entry-header .entry-categories a:hover,
body.blog .content-archive .entry-header .entry-categories a:hover,
body.search .content-archive .entry-header .entry-categories a:hover {
	color: #a5b4fc !important;
}

body.archive .content-archive .entry-meta a,
body.blog .content-archive .entry-meta a,
body.search .content-archive .entry-meta a {
	color: #a5b4fc !important;
}

body.archive .content-archive .entry-meta a:hover,
body.blog .content-archive .entry-meta a:hover,
body.search .content-archive .entry-meta a:hover {
	color: #c7d2fe !important;
}

body.archive .content-archive .entry-content,
body.blog .content-archive .entry-content,
body.search .content-archive .entry-content {
	color: var(--fp-text-muted) !important;
	font-size: 0.9375rem;
	line-height: 1.5;
}

body.archive .content-archive .more-link,
body.blog .content-archive .more-link,
body.search .content-archive .more-link {
	display: inline-block;
	margin-top: 0.75em;
	padding: 0.5rem 1rem;
	font-size: 0.9rem;
	font-weight: 600;
	color: #fff !important;
	background: var(--fp-accent);
	border-radius: var(--fp-radius-sm);
	text-decoration: none !important;
	transition: background 0.2s;
}

body.archive .content-archive .more-link:hover,
body.blog .content-archive .more-link:hover,
body.search .content-archive .more-link:hover {
	background: #6366f1;
	color: #fff !important;
}

body.archive .content-archive .entry-footer,
body.blog .content-archive .entry-footer,
body.search .content-archive .entry-footer {
	margin-top: 0.75em;
	padding-top: 0.75em;
	border-top: 1px solid var(--fp-border);
	font-size: 0.875em;
	color: var(--fp-text-muted) !important;
}

/* Пустой подвал на карточках архива не показывать */
body.archive .content-archive .type-post .entry-footer:empty,
body.blog .content-archive .type-post .entry-footer:empty,
body.search .content-archive .type-post .entry-footer:empty {
	display: none;
}

body.archive .content-archive .entry-footer a,
body.blog .content-archive .entry-footer a,
body.search .content-archive .entry-footer a {
	color: var(--fp-accent) !important;
	text-decoration: none;
}

body.archive .content-archive .entry-footer a:hover,
body.blog .content-archive .entry-footer a:hover,
body.search .content-archive .entry-footer a:hover {
	color: #a5b4fc !important;
}

/* Пагинация */
body.archive .content-archive .pagination,
body.blog .content-archive .pagination,
body.search .content-archive .pagination {
	margin-top: 2rem;
}

body.archive .content-archive .pagination .nav-links a,
body.archive .content-archive .pagination .nav-links span,
body.archive .content-archive .pagination .page-numbers,
body.blog .content-archive .pagination .nav-links a,
body.blog .content-archive .pagination .nav-links span,
body.blog .content-archive .pagination .page-numbers,
body.search .content-archive .pagination .nav-links a,
body.search .content-archive .pagination .nav-links span,
body.search .content-archive .pagination .page-numbers {
	display: inline-block;
	padding: 0.4em 0.8em;
	margin-right: 0.25em;
	background: var(--fp-btn);
	color: var(--fp-text);
	text-decoration: none;
	border-radius: var(--fp-radius-sm);
	border: 1px solid var(--fp-border);
}

body.archive .content-archive .pagination .nav-links a:hover,
body.blog .content-archive .pagination .nav-links a:hover,
body.search .content-archive .pagination .nav-links a:hover {
	background: var(--fp-btn-hover);
	color: var(--fp-text);
}

body.archive .content-archive .pagination .nav-links .current,
body.archive .content-archive .pagination .page-numbers.current,
body.blog .content-archive .pagination .nav-links .current,
body.blog .content-archive .pagination .page-numbers.current,
body.search .content-archive .pagination .nav-links .current,
body.search .content-archive .pagination .page-numbers.current {
	background: var(--fp-accent);
	border-color: var(--fp-accent);
	color: #fff;
}

/* Сайдбар на архивах */
body.archive .widget,
body.blog .widget,
body.search .widget {
	background: var(--fp-bg-card);
	border: 1px solid var(--fp-border);
	border-radius: var(--fp-radius);
	padding: 1.25rem;
	margin-bottom: 1.5rem;
	color: var(--fp-text);
}

body.archive .widget-title,
body.blog .widget-title,
body.search .widget-title {
	margin: 0 0 0.75rem;
	font-size: 1rem;
	font-weight: 700;
	color: var(--fp-text);
	border-bottom: 1px solid var(--fp-border);
	padding-bottom: 0.5rem;
}

body.archive .widget a,
body.blog .widget a,
body.search .widget a {
	color: var(--fp-accent);
	text-decoration: none;
}

body.archive .widget a:hover,
body.blog .widget a:hover,
body.search .widget a:hover {
	color: #a5b4fc;
	text-decoration: underline;
}

body.archive .widget ul,
body.blog .widget ul,
body.search .widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

body.archive .widget li,
body.blog .widget li,
body.search .widget li {
	margin-bottom: 0.35em;
	padding-left: 0;
}

body.archive .widget input[type="search"],
body.blog .widget input[type="search"],
body.search .widget input[type="search"] {
	width: 100%;
	padding: 0.5rem 0.75rem;
	background: var(--fp-bg-soft);
	border: 1px solid var(--fp-border);
	border-radius: var(--fp-radius-sm);
	color: var(--fp-text);
	font-size: 0.9375rem;
}

body.archive .widget .search-submit,
body.blog .widget .search-submit,
body.search .widget .search-submit {
	margin-top: 0.5rem;
	padding: 0.5rem 1rem;
	background: var(--fp-accent);
	color: #fff !important;
	border: none;
	border-radius: var(--fp-radius-sm);
	font-weight: 600;
	cursor: pointer;
}

body.archive .widget .search-submit:hover,
body.blog .widget .search-submit:hover,
body.search .widget .search-submit:hover {
	background: #6366f1;
}

/* Миниатюра в карточке архива */
body.archive .content-archive .post-thumbnail,
body.blog .content-archive .post-thumbnail,
body.search .content-archive .post-thumbnail {
	margin: -1.25rem -1.25rem 1rem;
	border-radius: var(--fp-radius) var(--fp-radius) 0 0;
	overflow: hidden;
}

body.archive .content-archive .post-thumbnail img,
body.blog .content-archive .post-thumbnail img,
body.search .content-archive .post-thumbnail img {
	display: block;
	width: 100%;
	height: auto;
	vertical-align: middle;
}
