/*
Theme Name: KetoBalance
Theme URI: https://ketobalance.ru/
Author: KetoBalance
Author URI: https://ketobalance.ru/
Description: Собственная тема для ketobalance.ru — шапка, меню, сайдбар, подвал.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: ketobalance
*/

/* 09.09.2026: базовые стили темы KetoBalance — начало */
:root {
	/* 09.09.2026: боковины как на calorazh.ru — сэмпл со скрина #fefbf2 */
	--kb-bg: #fefbf2;
	--kb-surface: #ffffff;
	--kb-text: #222222;
	--kb-muted: #6b7280;
	--kb-border: #efefef;
	--kb-accent: #ff6b00;
	--kb-green: #22c55e;
	--kb-green-dark: #15803d;
	--kb-green-soft: #f0fdf4;
	--kb-gold: #d4a74c;
	--kb-header-z: 11000;
	/* 09.09.2026: ширина колонки как Cook IT (не на весь экран) */
	--kb-site-width: 1140px;
	--kb-container: 1140px;
	--kb-sidebar: 300px;
	--kb-gap: 40px;
	--kb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
	scroll-behavior: smooth;
	height: 100%;
}

body {
	margin: 0;
	min-height: 100%;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	font-family: var(--kb-font);
	font-size: 16px;
	line-height: 1.6;
	color: var(--kb-text);
	/* 09.09.2026: было серое #e8e8e8 → крем по бокам, как Calorazh */
	background: var(--kb-bg);
	-webkit-font-smoothing: antialiased;
}

/* 09.09.2026: узкая центрированная «коробка» сайта (Cook IT ~1140px) — начало */
#page.site {
	display: flex;
	flex-direction: column;
	flex: 1 0 auto;
	width: 100%;
	max-width: var(--kb-site-width);
	margin: 0 auto;
	min-height: 100vh;
	min-height: 100dvh;
	/* 09.09.2026: было крем #fdfbf2 → белый фон колонки, как Calorazh */
	background: #ffffff;
	/* 09.09.2026: мягкая тёплая тень края как на Calorazh (без неё белый сливается с #fefbf2) */
	-webkit-box-shadow: 0 0 100px rgba(178, 165, 105, 0.19);
	box-shadow: 0 0 100px rgba(178, 165, 105, 0.19);
}

#content.site-content {
	flex: 1 0 auto;
}
/* 09.09.2026: узкая центрированная «коробка» сайта — конец */

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

a {
	color: var(--kb-green-dark);
	text-decoration: none;
	transition: color 0.2s ease;
}

/* 10.09.2026: было оранжевый --kb-accent → зелёный hover текста, как Calorazh (оранж только в меню/бренде) */
a:hover {
	color: var(--kb-green);
}

.kb-container {
	width: 100%;
	max-width: none;
	margin: 0 auto;
	padding: 0 20px;
	box-sizing: border-box;
}

@media (min-width: 768px) {
	.kb-container {
		padding: 0 45px;
	}
}

/* --- Шапка + меню под шапкой (параметры как в Cook IT) --- */
.site-header {
	position: relative;
	z-index: var(--kb-header-z);
	background: #ffffff;
	padding-top: 20px;
	padding-bottom: 20px;
	/* 09.09.2026: было box-shadow 0 0 100px → серая/тёплая полоса на меню под шапкой */
	-webkit-box-shadow: none;
	box-shadow: none;
	border-bottom: none;
}

/* 09.09.2026: было position:sticky → обычная шапка без закрепления */
.site-header.fixed {
	position: relative;
	top: auto;
	-webkit-box-shadow: none;
	box-shadow: none;
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 0;
	padding-top: 0;
	padding-bottom: 0;
}

.site-branding {
	flex: 0 1 auto;
	min-width: 0;
}

/* 09.09.2026: бренд как Calorazh — иконка + 2 строки — начало */
.site-branding__link {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: inherit;
	max-width: 100%;
}

.site-branding__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	flex: 0 0 auto;
	font-size: 42px;
	line-height: 1;
	user-select: none;
}

.site-branding__text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	min-width: 0;
}

.site-title {
	display: block;
	margin: 0;
	font-size: clamp(1.35rem, 2vw, 1.65rem);
	line-height: 1.15;
	font-weight: 700;
	color: #ff4e00;
}

.site-branding__link:hover .site-title {
	color: #ff6b00;
}

.custom-logo-link {
	display: inline-block;
	line-height: 0;
}

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

.site-description {
	display: block;
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.3;
	font-weight: 400;
	color: #555555;
}
/* 09.09.2026: бренд как Calorazh — иконка + 2 строки — конец */

.kb-top-nav {
	flex: 1 1 auto;
	display: flex;
	justify-content: flex-end;
}

.kb-top-nav .menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 4px 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.kb-top-nav .menu > li > a {
	display: inline-block;
	padding: 6px 0;
	font-size: 0.92rem;
	font-weight: 500;
	color: #333;
	text-decoration: none;
}

.kb-top-nav .menu > li > a:hover {
	color: #ff6b00;
}

/* 09.09.2026: без постоянного оранжевого current — только hover, как Calorazh */
.kb-top-nav .menu > li.current-menu-item > a,
.kb-top-nav .menu > li.current_page_item > a {
	color: #333;
}

#site-navigation {
	/* 09.09.2026: две линии как на Calorazh — сверху и снизу второго меню */
	background: #ffffff !important;
	border-top: 1px solid #efefef;
	border-bottom: 1px solid #efefef;
	-webkit-box-shadow: none;
	box-shadow: none;
}

#site-navigation .kb-container,
#site-navigation .menu-secondary-container {
	display: block;
	width: 100%;
	background: transparent;
}

#site-navigation .menu,
#site-navigation .nav-menu {
	display: flex;
	flex-wrap: wrap;
	flex-direction: row;
	align-items: stretch;
	/* 09.09.2026: пункты слева (не по центру и не на всю ширину) */
	justify-content: flex-start !important;
	gap: 8px 12px;
	margin: 0;
	padding: 0;
	list-style: none;
	width: 100%;
	background: transparent;
}

#site-navigation .menu > .menu-item,
#site-navigation .nav-menu > .menu-item {
	position: relative;
	flex: 0 0 auto;
	padding-right: 0;
	text-align: left;
}

#site-navigation .menu-item > a {
	position: relative;
	display: block;
	width: auto;
	/* 09.09.2026: первый ряд слева — меньше padding у края контейнера */
	padding: 18px 22px;
	font-size: 0.95em;
	font-weight: 700;
	text-transform: uppercase;
	text-align: left;
	color: #222;
	text-decoration: none;
	transition: color 0.3s ease, transform 0.2s ease;
	cursor: pointer;
}

#site-navigation .menu > .menu-item:first-child > a,
#site-navigation .nav-menu > .menu-item:first-child > a {
	padding-left: 0;
}

#site-navigation .menu-item > a:hover {
	color: #ff6b00;
	transform: translateY(-2px);
}

/* 09.09.2026: было current оранжевый → как обычный пункт (оранж только :hover) */
#site-navigation .menu-item.current-menu-item > a,
#site-navigation .menu-item.current_page_item > a {
	color: #222;
}

#site-navigation .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	min-width: 220px;
	margin: 0;
	padding: 10px 0;
	list-style: none;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 2px 45px rgba(178, 165, 105, 0.19);
	z-index: 20;
	text-align: left;
}

#site-navigation .menu-item:hover > .sub-menu {
	display: block;
}

#site-navigation .sub-menu li a {
	display: block;
	padding: 10px 20px;
	font-size: 0.95em;
	font-weight: 500;
	color: #333;
	text-decoration: none;
	text-align: left;
	text-transform: none;
}

#site-navigation .sub-menu li a:hover {
	color: #ff6b00;
	background: transparent;
}

@media (max-width: 991px) {
	.kb-top-nav,
	#site-navigation .menu-secondary-container,
	#site-navigation .nav-menu,
	#site-navigation .menu {
		display: none !important;
	}

	.site-header__inner {
		padding-right: 56px;
	}
}

/* --- Контент + сайдбар --- */
.site-content {
	padding: 28px 0 48px;
}

.content-area-wrap {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--kb-sidebar);
	gap: var(--kb-gap);
	align-items: start;
}

.content-area-wrap--no-sidebar {
	grid-template-columns: minmax(0, 1fr);
}

#primary.content-area {
	min-width: 0;
}

/* 09.09.2026: было белая карточка с рамкой → плоский контент на креме, как Calorazh */
.site-main {
	background: transparent;
	border: none;
	border-radius: 0;
	padding: 0;
	box-shadow: none;
}

/* 10.09.2026: .kb-page-title / .kb-page-head / .kb-page-lead — в template-parts/kb-page-title.css */

/* 10.09.2026: типографика контента как на Calorazh (Типографика H1–H6, без оранжевого) — начало */
.entry-content {
	color: #222222;
	font-size: 16px;
	line-height: 1.6;
}

.entry-content > *:first-child {
	margin-top: 0;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6,
.home-text h1,
.home-text h2,
.home-text h3,
.home-text h4,
.home-text h5,
.home-text h6 {
	font-family: Roboto, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: #1f2937;
	font-weight: 700;
	letter-spacing: normal;
	text-transform: none;
	font-style: normal;
	text-decoration: none;
}

.entry-content h1,
.home-text h1 {
	font-size: 2.3em;
	line-height: 1.1;
	margin: 0 0 0.6em;
}

.entry-content h2,
.home-text h2 {
	font-size: 2em;
	line-height: 1.2;
	margin-top: 1.75rem !important;
	margin-bottom: 1.2rem !important;
}

.entry-content > h2:first-child,
.home-text > h2:first-child {
	margin-top: 1.25rem !important;
}

.entry-content h3,
.home-text h3 {
	font-size: 1.75em;
	line-height: 1.3;
	margin: 1.4rem 0 0.85rem;
}

.entry-content h4,
.home-text h4 {
	font-size: 1.5em;
	line-height: 1.4;
	margin: 1.25rem 0 0.75rem;
}

.entry-content h5,
.home-text h5 {
	font-size: 1.25em;
	line-height: 1.5;
	margin: 1.1rem 0 0.65rem;
}

.entry-content h6,
.home-text h6 {
	font-size: 1em;
	line-height: 1.6;
	margin: 1rem 0 0.55rem;
}

.entry-content p,
.home-text p {
	margin: 0 0 1em;
	color: #222222;
}

.entry-content a,
.home-text a {
	color: var(--kb-green-dark);
}

.entry-content a:hover,
.home-text a:hover {
	color: var(--kb-green);
}

/* 10.09.2026: листочек вместо кубиков в списках контента (как Calorazh) — начало */
.entry-content ul:not([class]),
.entry-content ul.wp-block-list,
.home-text ul:not([class]),
.home-text ul.wp-block-list,
.page-content ul:not([class]),
.page-content ul.wp-block-list,
.taxonomy-description ul:not([class]),
.taxonomy-description ul.wp-block-list {
	list-style: none;
	margin: 0 0 1em;
	padding: 0;
}

.entry-content ul:not([class]) > li,
.entry-content ul.wp-block-list > li,
.home-text ul:not([class]) > li,
.home-text ul.wp-block-list > li,
.page-content ul:not([class]) > li,
.page-content ul.wp-block-list > li,
.taxonomy-description ul:not([class]) > li,
.taxonomy-description ul.wp-block-list > li {
	position: relative;
	margin: 0 0 6px;
	padding: 0 0 0 1.35rem;
}

.entry-content ul:not([class]) > li::before,
.entry-content ul.wp-block-list > li::before,
.home-text ul:not([class]) > li::before,
.home-text ul.wp-block-list > li::before,
.page-content ul:not([class]) > li::before,
.page-content ul.wp-block-list > li::before,
.taxonomy-description ul:not([class]) > li::before,
.taxonomy-description ul.wp-block-list > li::before {
	content: '';
	position: absolute;
	left: 0;
	width: 0.85rem;
	height: 0.85rem;
	top: 0.45em;
	background-color: transparent !important;
	background-image: url('assets/icons/icon-leaf.svg');
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
}
/* 10.09.2026: листочек в списках контента — конец */
/* 10.09.2026: типографика контента как на Calorazh — конец */

.entry-meta {
	margin: 0 0 16px;
	font-size: 0.875rem;
	color: var(--kb-muted);
}

.entry-footer {
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid var(--kb-border);
	font-size: 0.875rem;
	color: var(--kb-muted);
}

/* Сайдбар */
#secondary.widget-area {
	min-width: 0;
}

/* 09.09.2026: сайдбар — мягче, без тяжёлой «коробки» */
.widget {
	background: transparent;
	border: none;
	border-radius: 0;
	padding: 0 0 20px;
	margin-bottom: 20px;
	box-shadow: none;
	border-bottom: 1px solid #efefef;
}

.widget:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.widget-title,
.widget .wp-block-heading {
	margin: 0 0 12px;
	font-size: 1rem;
	font-weight: 700;
	color: #1f2937;
}

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

.widget ul li {
	margin: 0;
	padding: 6px 0;
	border-bottom: 1px solid #f3f3f3;
}

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

.widget ul li a {
	color: #666;
	text-decoration: none;
}

.widget ul li a:hover {
	color: #27ae60;
}

@media (max-width: 991px) {
	.content-area-wrap {
		grid-template-columns: 1fr;
	}

	#secondary.widget-area {
		display: none;
	}

	.site-main {
		padding: 0;
	}
}

/* --- Подвал --- */
.site-footer {
	background: #1f2937;
	color: #e5e7eb;
	padding: 36px 0 28px;
	margin-top: auto;
	flex-shrink: 0;
	width: 100%;
}

.site-footer a {
	color: #f3f4f6;
}

.site-footer a:hover {
	color: var(--kb-gold);
}

.site-footer__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
}

.site-footer .menu {
	/* 11.09.2026: было в ряд → списком друг под другом, как на Calorazh */
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer__copy {
	margin: 0;
	font-size: 0.9rem;
	color: #9ca3af;
}

/* --- Записи в ленте --- */
.kb-post-card {
	margin-bottom: 28px;
	padding-bottom: 28px;
	border-bottom: 1px solid var(--kb-border);
}

.kb-post-card:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.kb-post-card .entry-title {
	margin: 0 0 8px;
	font-size: 1.35rem;
}

.kb-post-card .entry-title a {
	color: #1f2937;
}

/* 10.09.2026: было оранжевый --kb-accent → зелёный, без оранжевого выделения заголовков */
.kb-post-card .entry-title a:hover {
	color: var(--kb-green);
}

.kb-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 28px;
}

.kb-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border-radius: 8px;
	background: #fff;
	border: 1px solid var(--kb-border);
	color: #333;
	font-weight: 600;
	text-decoration: none;
}

.kb-pagination .page-numbers.current,
.kb-pagination .page-numbers:hover {
	border-color: var(--kb-green);
	color: var(--kb-green-dark);
	background: var(--kb-green-soft);
}

.kb-empty {
	padding: 24px;
	text-align: center;
	color: var(--kb-muted);
}

.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;
	width: 1px;
	word-wrap: normal !important;
}

/* Поля: без кольца на фокусе */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="url"],
input[type="password"],
textarea,
select {
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	border: 1px solid #dbe3ec;
	border-radius: 10px;
	outline: none !important;
	box-shadow: none !important;
	background: #fff;
}

input:focus,
input:focus-visible,
textarea:focus,
textarea:focus-visible,
select:focus,
select:focus-visible {
	border-color: #dbe3ec !important;
	outline: none !important;
	box-shadow: none !important;
	-webkit-box-shadow: none !important;
}

/* Кнопки темы — без чёрной рамки */
button,
.button,
input[type="submit"] {
	border: 2px solid transparent !important;
	outline: none !important;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
	cursor: pointer;
}

button:focus,
button:active,
.button:focus,
.button:active,
input[type="submit"]:focus,
input[type="submit"]:active {
	outline: none !important;
	box-shadow: none !important;
}

button:focus-visible,
.button:focus-visible,
input[type="submit"]:focus-visible {
	outline: none !important;
	box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.35) !important;
}
/* 09.09.2026: базовые стили темы KetoBalance — конец */
