/*
Theme Name: HighTech News
Theme URI: https://example.com/hightech-news
Author: v0
Author URI: https://v0.app
Description: Тёмная high-tech тема для новостных и технологичных блогов. Включает лендинг-шаблон рубрик (слайдер + сетка) и шаблон одиночной записи с озвучкой текста (browser TTS) и переключателем языка RU/EN. Mobile-first, без сторонних зависимостей.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hightech
Tags: news, blog, dark, technology, two-columns, right-sidebar, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   Базовые глобальные токены и сброс.
   Шаблонные стили (single / category) лежат в отдельных файлах в /css и
   подключаются только на нужных экранах. Здесь — общий каркас темы:
   шапка, подвал, типографика, контейнеры.
   ========================================================================== */

:root {
	--ht-bg: #05070d;
	--ht-bg-soft: #0a0e18;
	--ht-panel: #0d1220;
	--ht-panel-2: #111829;
	--ht-border: rgba(120, 160, 220, 0.16);
	--ht-border-strong: rgba(120, 160, 220, 0.32);
	--ht-text: #e7edf7;
	--ht-text-dim: #9aa7bd;
	--ht-text-mute: #66718a;
	--ht-accent: #22d3ee;
	--ht-accent-2: #38bdf8;
	--ht-accent-soft: rgba(34, 211, 238, 0.14);
	--ht-danger: #f87171;
	--ht-radius: 14px;
	--ht-radius-sm: 10px;
	--ht-shell: 1180px;
	--ht-edge: 16px;
	--ht-font-display: "Orbitron", "Segoe UI", system-ui, sans-serif;
	--ht-font-body: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

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

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

body.hightech {
	margin: 0;
	background-color: var(--ht-bg);
	color: var(--ht-text);
	font-family: var(--ht-font-body);
	font-size: 16px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

a {
	color: var(--ht-accent-2);
	text-decoration: none;
	transition: color 0.2s ease;
}

a:hover {
	color: var(--ht-accent);
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

h1, h2, h3, h4 {
	font-family: var(--ht-font-display);
	line-height: 1.2;
	color: var(--ht-text);
	letter-spacing: 0.01em;
}

/* Доступность: видимый фокус для клавиатуры. */
:focus-visible {
	outline: 2px solid var(--ht-accent);
	outline-offset: 2px;
}

.ht-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
	padding: 10px 16px;
	background: var(--ht-accent);
	color: #04222a;
	font-family: var(--ht-font-display);
	border-radius: 0 0 8px 0;
}

.ht-skip-link:focus {
	left: 0;
}

.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;
}

/* ---------- Контейнер ---------- */
.ht-container {
	width: 100%;
	max-width: var(--ht-shell);
	margin-inline: auto;
	padding-inline: var(--ht-edge);
}

/* ==========================================================================
   Шапка сайта
   ========================================================================== */
.ht-site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(5, 7, 13, 0.82);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--ht-border);
}

.ht-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 64px;
}

.ht-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--ht-font-display);
	font-weight: 900;
	font-size: 1.15rem;
	letter-spacing: 0.06em;
	color: var(--ht-text);
	text-transform: uppercase;
}

.ht-brand:hover {
	color: var(--ht-text);
}

.ht-brand-mark {
	width: 30px;
	height: 30px;
	display: grid;
	place-items: center;
	border-radius: 8px;
	background: linear-gradient(135deg, var(--ht-accent), var(--ht-accent-2));
	color: #04222a;
	box-shadow: 0 0 18px var(--ht-accent-soft);
}

/* Логотип-картинка в шапке */
.ht-brand--img { gap: 0; }
.ht-brand-logo {
	display: block;
	height: 40px;
	width: auto;
	object-fit: contain;
}
@media (max-width: 600px) {
	.ht-brand-logo { height: 32px; }
}
/* Светлый логотип невидим на белом фоне — инвертируем в светлой теме */
html[data-theme="light"] .ht-brand-logo {
	filter: invert(1) brightness(0.35) saturate(1.4) hue-rotate(150deg);
}

.ht-brand-desc {
	display: block;
	font-family: var(--ht-font-body);
	font-size: 0.7rem;
	font-weight: 400;
	letter-spacing: 0.04em;
	color: var(--ht-text-mute);
	text-transform: none;
}

/* ---------- Навигация ---------- */
.ht-nav-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border: 1px solid var(--ht-border-strong);
	border-radius: 10px;
	background: var(--ht-panel);
	color: var(--ht-text);
	cursor: pointer;
}

.ht-nav-toggle svg {
	width: 20px;
	height: 20px;
}

.ht-primary-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ht-primary-nav a {
	display: block;
	padding: 12px 14px;
	color: var(--ht-text-dim);
	font-size: 0.9rem;
	letter-spacing: 0.03em;
	border-radius: 8px;
	text-transform: uppercase;
}

.ht-primary-nav a:hover,
.ht-primary-nav .current-menu-item > a {
	color: var(--ht-text);
	background: var(--ht-accent-soft);
}

/* ---------- Подменю (выпадающие архивы рубрик) ---------- */
.ht-menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}
.ht-menu .menu-item-has-children > a {
	position: relative;
}
.ht-submenu-all > a {
	color: var(--ht-accent) !important;
	font-weight: 700;
}
/* Кнопка-стрелка раскрытия (важна на мобильном) */
.ht-submenu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 0;
	background: transparent;
	color: var(--ht-text-dim);
	cursor: pointer;
}
.ht-submenu-toggle span {
	width: 9px;
	height: 9px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}
.ht-submenu-toggle[aria-expanded="true"] span {
	transform: rotate(-135deg);
}

/* Мобильное меню по умолчанию скрыто. */
.ht-primary-nav {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	padding: 12px var(--ht-edge) 18px;
	background: rgba(5, 7, 13, 0.97);
	border-bottom: 1px solid var(--ht-border);
	display: none;
	max-height: calc(100vh - 64px);
	overflow-y: auto;
}

.ht-primary-nav.is-open {
	display: block;
}

/* На мобильном: пункт с детьми — строка с кнопкой-стрелкой, подменю аккордеоном */
.ht-menu .menu-item-has-children {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}
.ht-menu .menu-item-has-children > a {
	flex: 1;
}
.ht-menu .sub-menu {
	flex-basis: 100%;
	display: none;
	padding-left: 12px;
	margin: 2px 0 6px;
	border-left: 1px solid var(--ht-border);
}
.ht-menu .menu-item-has-children.is-open > .sub-menu {
	display: block;
}
.ht-menu .sub-menu a {
	font-size: 0.82rem;
	text-transform: none;
	color: var(--ht-text-mute);
	letter-spacing: 0.01em;
}

/* ==========================================================================
   Подвал
   ========================================================================== */
.ht-site-footer {
	margin-top: 64px;
	border-top: 1px solid var(--ht-border);
	background: var(--ht-bg-soft);
}

.ht-footer-inner {
	display: flex;
	flex-direction: column;
	gap: 24px;
	padding-block: 40px;
}

.ht-footer-top {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.ht-footer-about {
	max-width: 420px;
}

.ht-footer-about p {
	color: var(--ht-text-dim);
	font-size: 0.9rem;
	margin: 12px 0 0;
}

.ht-footer-widgets {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
}

.ht-footer-widgets .ht-widget__title {
	font-size: 0.95rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin: 0 0 12px;
	color: var(--ht-text);
}

.ht-footer-widgets ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ht-footer-widgets a {
	color: var(--ht-text-dim);
	font-size: 0.88rem;
}

.ht-footer-bottom {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-top: 20px;
	border-top: 1px solid var(--ht-border);
	color: var(--ht-text-mute);
	font-size: 0.82rem;
}

/* ==========================================================================
   Общий каркас контента (index / page / search / 404)
   ========================================================================== */
.ht-main {
	padding-block: 40px;
}

.ht-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 40px;
}

.ht-page-title {
	font-size: 1.7rem;
	margin: 0 0 24px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--ht-border);
}

/* ---------- Сетка постов (архивы по умолчанию) ---------- */
.ht-posts {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
}

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

.ht-post-card__thumb {
	aspect-ratio: 16 / 9;
	background: var(--ht-panel-2);
	overflow: hidden;
}

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

.ht-post-card__body {
	padding: 18px 20px 22px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1;
}

.ht-post-card__cat {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ht-accent);
}

.ht-post-card__title {
	font-size: 1.1rem;
	margin: 0;
}

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

.ht-post-card__title a:hover {
	color: var(--ht-accent);
}

.ht-post-card__excerpt {
	color: var(--ht-text-dim);
	font-size: 0.88rem;
	margin: 0;
}

.ht-post-card__meta {
	margin-top: auto;
	font-size: 0.78rem;
	color: var(--ht-text-mute);
}

/* ---------- Пагинация ---------- */
.ht-pagination {
	margin-top: 36px;
}

.ht-pagination .page-numbers {
	display: inline-flex;
	min-width: 42px;
	height: 42px;
	align-items: center;
	justify-content: center;
	padding-inline: 10px;
	border: 1px solid var(--ht-border-strong);
	border-radius: 10px;
	color: var(--ht-text-dim);
	margin: 0 4px 8px 0;
}

.ht-pagination .page-numbers.current {
	background: var(--ht-accent);
	border-color: var(--ht-accent);
	color: #04222a;
}

/* ---------- Виджеты сайдбара ---------- */
.ht-sidebar .ht-widget {
	background: var(--ht-panel);
	border: 1px solid var(--ht-border);
	border-radius: var(--ht-radius);
	padding: 20px;
	margin-bottom: 24px;
}

.ht-sidebar .ht-widget__title {
	font-size: 1rem;
	margin: 0 0 14px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.ht-sidebar ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ht-sidebar a {
	color: var(--ht-text-dim);
	font-size: 0.88rem;
}

/* ---------- 404 ---------- */
.ht-404 {
	text-align: center;
	padding-block: 60px;
}

.ht-404__code {
	font-family: var(--ht-font-display);
	font-size: clamp(4rem, 18vw, 9rem);
	font-weight: 900;
	background: linear-gradient(135deg, var(--ht-accent), var(--ht-accent-2));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	line-height: 1;
}

.ht-search-form {
	display: flex;
	gap: 8px;
	max-width: 440px;
	margin: 24px auto 0;
}

.ht-search-form input[type="search"] {
	flex: 1;
	padding: 12px 14px;
	background: var(--ht-panel);
	border: 1px solid var(--ht-border-strong);
	border-radius: 10px;
	color: var(--ht-text);
	font-family: var(--ht-font-body);
}

.ht-search-form button {
	padding: 12px 20px;
	background: var(--ht-accent);
	border: none;
	border-radius: 10px;
	color: #04222a;
	font-family: var(--ht-font-display);
	font-weight: 700;
	cursor: pointer;
}

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (min-width: 600px) {
	.ht-posts {
		grid-template-columns: repeat(2, 1fr);
	}

	.ht-footer-widgets {
		grid-template-columns: repeat(2, 1fr);
	}

	.ht-footer-bottom {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
}

@media (min-width: 900px) {
	:root {
		--ht-edge: 24px;
	}

	.ht-nav-toggle {
		display: none;
	}

	.ht-primary-nav {
		position: static;
		display: block;
		padding: 0;
		background: none;
		border: none;
		max-height: none;
		overflow: visible;
	}

	.ht-primary-nav ul {
		flex-direction: row;
		gap: 4px;
	}

	/* Десктоп: всё в один ряд, подменю выпадает по наведению */
	.ht-menu {
		flex-wrap: nowrap;
	}
	.ht-menu > .menu-item {
		position: relative;
		flex-wrap: nowrap;
	}
	.ht-menu > .menu-item > a {
		white-space: nowrap;
	}
	/* Стрелку-кнопку на десктопе прячем — раскрытие по hover */
	.ht-submenu-toggle {
		display: none;
	}
	.ht-menu .sub-menu {
		position: absolute;
		top: 100%;
		left: 0;
		display: block;
		min-width: 240px;
		max-width: 320px;
		padding: 8px;
		margin: 0;
		border: 1px solid var(--ht-border);
		border-radius: 12px;
		background: rgba(8, 11, 18, 0.98);
		backdrop-filter: blur(12px);
		box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
		opacity: 0;
		visibility: hidden;
		transform: translateY(8px);
		transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
		z-index: 200;
	}
	.ht-menu > .menu-item-has-children:hover > .sub-menu,
	.ht-menu > .menu-item-has-children:focus-within > .sub-menu {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}
	.ht-menu .sub-menu .menu-item {
		display: block;
	}
	.ht-menu .sub-menu a {
		padding: 9px 12px;
		border-radius: 8px;
		white-space: normal;
	}
	.ht-menu .sub-menu a:hover {
		background: var(--ht-accent-soft);
		color: var(--ht-text);
	}

	.ht-footer-top {
		flex-direction: row;
		justify-content: space-between;
	}

	.ht-footer-widgets {
		grid-template-columns: repeat(3, 1fr);
		min-width: 60%;
	}

	/* Двухколоночный каркас, когда активен сайдбар. */
	.ht-layout.has-sidebar {
		grid-template-columns: minmax(0, 1fr) 320px;
	}

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

	.ht-layout.has-sidebar .ht-posts {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		scroll-behavior: auto !important;
		transition-duration: 0.001ms !important;
		animation-duration: 0.001ms !important;
	}
}

/* ==========================================================================
   Подвал ideipro.ru — центрированный
   ========================================================================== */
.ip-footer {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(900px 420px at 50% 0%, rgba(34, 211, 238, 0.08), transparent 65%),
		linear-gradient(180deg, #0a1120, #05070d);
	border-top: 1px solid rgba(120, 160, 220, 0.18);
	color: #e7eefc;
	font-family: var(--ht-font-mono, "JetBrains Mono", monospace);
}

.ip-footer__grid {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(120, 160, 220, 0.1) 1px, transparent 1px),
		linear-gradient(90deg, rgba(120, 160, 220, 0.1) 1px, transparent 1px);
	background-size: 44px 44px;
	mask-image: radial-gradient(circle at 50% 0%, #000 15%, transparent 70%);
	-webkit-mask-image: radial-gradient(circle at 50% 0%, #000 15%, transparent 70%);
	opacity: 0.45;
	pointer-events: none;
}
.ip-footer__glow {
	position: absolute;
	top: -120px;
	left: 50%;
	width: 480px;
	height: 320px;
	transform: translateX(-50%);
	background: radial-gradient(circle, rgba(34, 211, 238, 0.18), transparent 70%);
	filter: blur(20px);
	pointer-events: none;
}

.ip-footer__inner {
	position: relative;
	z-index: 1;
	max-width: 720px;
	margin: 0 auto;
	padding: 64px 16px 44px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 28px;
}

/* Бренд + слоган */
.ip-footer__brand { display: flex; flex-direction: column; align-items: center; }
.ip-footer__logo {
	font-family: var(--ht-font-display, "Orbitron", sans-serif);
	font-size: clamp(28px, 5vw, 38px);
	font-weight: 900;
	letter-spacing: 0.04em;
	color: #e7eefc;
	text-decoration: none;
	text-shadow: 0 0 28px rgba(34, 211, 238, 0.25);
}
.ip-footer__logo-accent { color: #22d3ee; }
/* Логотип-картинка в подвале */
.ip-footer__logo--img { display: inline-block; line-height: 0; }
.ip-footer__logo--img img {
	display: block;
	height: 58px;
	width: auto;
	object-fit: contain;
	filter: drop-shadow(0 0 26px rgba(34, 211, 238, 0.25));
}
@media (max-width: 600px) {
	.ip-footer__logo--img img { height: 46px; }
}
.ip-footer__tagline {
	margin: 14px auto 0;
	max-width: 480px;
	color: #93a4c4;
	font-size: 14px;
	line-height: 1.7;
}

/* Разделитель */
.ip-footer__divider {
	width: 100%;
	max-width: 220px;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.5), transparent);
}

/* Документы */
.ip-footer__docs-title {
	display: block;
	font-family: var(--ht-font-display, "Orbitron", sans-serif);
	font-size: 12px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: #22d3ee;
	margin-bottom: 16px;
}
.ip-footer__links {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px 14px;
}
.ip-footer__links li { margin: 0; }
.ip-footer__links a {
	display: inline-block;
	color: #cdd8ee;
	text-decoration: none;
	font-size: 13.5px;
	padding: 7px 16px;
	border: 1px solid rgba(120, 160, 220, 0.18);
	border-radius: 999px;
	background: rgba(14, 22, 38, 0.5);
	transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.ip-footer__links a:hover {
	color: #06121a;
	background: #22d3ee;
	border-color: #22d3ee;
}

/* Реквизиты — стеклянная карточка */
.ip-footer__req {
	width: 100%;
	max-width: 540px;
	padding: 24px 26px;
	border: 1px solid rgba(120, 160, 220, 0.16);
	border-radius: 16px;
	background: rgba(13, 18, 32, 0.6);
	backdrop-filter: blur(6px);
}
.ip-footer__name {
	margin: 0 0 16px;
	font-family: var(--ht-font-display, "Orbitron", sans-serif);
	font-size: 13px;
	font-weight: 300;
	letter-spacing: 0.02em;
	color: #44506a;
}
.ip-footer__details {
	margin: 0;
	display: grid;
	gap: 10px;
}
.ip-footer__details > div {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 14px;
	font-size: 13.5px;
	border-top: 1px dashed rgba(120, 160, 220, 0.12);
	padding-top: 10px;
}
.ip-footer__details > div:first-child { border-top: 0; padding-top: 0; }
.ip-footer__details dt {
	color: #66718a;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-size: 11px;
	white-space: nowrap;
}
.ip-footer__details dd {
	margin: 0;
	color: #cdd8ee;
	text-align: right;
}
.ip-footer__details a {
	color: #cdd8ee;
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: color 0.18s ease, border-color 0.18s ease;
}
.ip-footer__details a:hover { color: #22d3ee; border-color: #22d3ee; }

/* Низ */
.ip-footer__bottom {
	width: 100%;
	padding-top: 24px;
	color: #66718a;
	font-size: 13px;
	line-height: 1.9;
}
.ip-footer__bottom p { margin: 0; }
.ip-footer__motto {
	color: #22d3ee;
	letter-spacing: 0.1em;
}

/* ==========================================================================
   Действия в шапке: переключатель языка + темы
   ========================================================================== */
.ht-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}
.ht-lang {
	display: inline-flex;
	border: 1px solid var(--ht-border);
	border-radius: 999px;
	overflow: hidden;
	background: var(--ht-panel);
}
.ht-lang-btn {
	border: 0;
	background: transparent;
	color: var(--ht-text-dim);
	font-family: var(--ht-font-display);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	padding: 7px 12px;
	cursor: pointer;
	transition: color 0.18s ease, background 0.18s ease;
}
.ht-lang-btn:hover { color: var(--ht-text); }
.ht-lang-btn.is-active {
	background: var(--ht-accent);
	color: #06121a;
}
.ht-theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 1px solid var(--ht-border);
	border-radius: 50%;
	background: var(--ht-panel);
	color: var(--ht-accent);
	cursor: pointer;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}
.ht-theme-toggle:hover {
	border-color: var(--ht-accent);
	box-shadow: 0 0 0 4px var(--ht-accent-soft);
}
.ht-theme-toggle .ht-icon-moon { display: none; }
.ht-theme-toggle .ht-icon-sun { display: block; }
/* В светлой теме показываем луну (предложение перейти в тёмную) */
html[data-theme="light"] .ht-theme-toggle .ht-icon-sun { display: none; }
html[data-theme="light"] .ht-theme-toggle .ht-icon-moon { display: block; }

/* ==========================================================================
   СВЕТЛАЯ ТЕМА
   ========================================================================== */
html[data-theme="light"] {
	--ht-bg: #f4f7fc;
	--ht-bg-soft: #ffffff;
	--ht-panel: #ffffff;
	--ht-panel-2: #eef3fb;
	--ht-border: rgba(20, 50, 90, 0.14);
	--ht-border-strong: rgba(20, 50, 90, 0.28);
	--ht-text: #0d1828;
	--ht-text-dim: #41506a;
	--ht-text-mute: #6b7894;
	--ht-accent: #0e8aa6;
	--ht-accent-2: #2563eb;
	--ht-accent-soft: rgba(14, 138, 166, 0.12);
}
html[data-theme="light"] body.hightech {
	background-color: var(--ht-bg);
	color: var(--ht-text);
}

/* Светлая тема для главной (.ip-*) */
html[data-theme="light"] .ip-front {
	--ip-bg: #f4f7fc;
	--ip-bg-2: #eaf0fa;
	--ip-panel: #ffffff;
	--ip-line: rgba(20, 50, 90, 0.12);
	--ip-text: #0d1828;
	--ip-muted: #51607a;
	--ip-accent: #0e8aa6;
	--ip-accent-2: #2563eb;
}
/* На светлой теме затемняющий градиент слайдера ослабляем,
   а текст-оверлей делаем читаемым на любой картинке (тень сохраняем). */
html[data-theme="light"] .ip-slide__media::after {
	background: linear-gradient(180deg, rgba(6, 10, 18, 0) 40%, rgba(6, 10, 18, 0.45) 70%, rgba(6, 10, 18, 0.88) 100%);
}

/* Светлая тема для подвала */
html[data-theme="light"] .ip-footer {
	background:
		radial-gradient(900px 420px at 50% 0%, rgba(14, 138, 166, 0.1), transparent 65%),
		linear-gradient(180deg, #eef3fb, #e2e9f5);
	border-top-color: rgba(20, 50, 90, 0.16);
	color: #0d1828;
}
html[data-theme="light"] .ip-footer__logo { color: #0d1828; text-shadow: none; }
html[data-theme="light"] .ip-footer__logo--img img {
	filter: invert(1) brightness(0.35) saturate(1.4) hue-rotate(150deg);
}
html[data-theme="light"] .ip-footer__tagline,
html[data-theme="light"] .ip-footer__bottom { color: #51607a; }
html[data-theme="light"] .ip-footer__req {
	background: rgba(255, 255, 255, 0.7);
	border-color: rgba(20, 50, 90, 0.14);
}
html[data-theme="light"] .ip-footer__name { color: #0d1828; }
html[data-theme="light"] .ip-footer__details dd,
html[data-theme="light"] .ip-footer__details a { color: #41506a; }
html[data-theme="light"] .ip-footer__links a {
	color: #41506a;
	background: rgba(255, 255, 255, 0.7);
	border-color: rgba(20, 50, 90, 0.16);
}
html[data-theme="light"] .ip-footer__links a:hover {
	color: #ffffff;
	background: #0e8aa6;
	border-color: #0e8aa6;
}

/* Плавный переход при смене темы */
body.hightech,
.ip-front,
.ip-footer,
.ht-site-header {
	transition: background-color 0.3s ease, color 0.3s ease;
}

/* 2026-06-09: спецстраницы рубрик — 4 карточки в ряд как в архивах */
.ht-page-category-posts .ht-posts {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

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

@media (min-width: 992px) {
  .ht-page-category-posts .ht-posts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .ht-page-category-posts .ht-posts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* 2026-06-09: форсируем 4 колонки для рубричных Page */
@media (min-width: 1280px) {
  .ht-page-category-posts .ht-posts {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* 2026-06-09: рубричные page-витрины */
.ht-page-category-posts {
  margin-top: 40px;
}

.ht-page-category-posts__title {
  margin: 0 0 24px;
}

.ht-page-category-posts .ht-posts {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

.ht-page-newsletter {
  margin-top: 40px;
}

@media (min-width: 600px) {
  .ht-page-category-posts .ht-posts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .ht-page-category-posts .ht-posts {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}
