/* =====================================================================
   Редизайн блога по дизайн-системе Kassa.cc 0.3
   Бренд #FFD900 · фон #F5F3F1 · поверхность #FFF · поле #ECF0F6
   Текст #1C1C1C · вторичный #676767 · ссылка #487391 · выбор #FFF9D6
   Радиусы: поверхность 14, контрол 6. Шрифт Museo Sans Cyrl 300/500/700.
   ===================================================================== */

/* Шрифты старой темы → фирменный Museo Sans Cyrl (тот же вид, что на kassa.cc) */
@font-face { font-family: 'PP Neue Montreal'; src: url('../fonts/museo-sans-cyrl/museo-sans-cyrl-300.woff2') format('woff2'); font-weight: 100 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'PP Neue Montreal'; src: url('../fonts/museo-sans-cyrl/museo-sans-cyrl-500.woff2') format('woff2'); font-weight: 500 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'PP Neue Montreal'; src: url('../fonts/museo-sans-cyrl/museo-sans-cyrl-700.woff2') format('woff2'); font-weight: 700 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Halvar Breitschrift'; src: url('../fonts/museo-sans-cyrl/museo-sans-cyrl-700.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
	--ds-brand: #ffd900;
	--ds-bg: #f5f3f1;
	--ds-surface: #fff;
	--ds-field: #ecf0f6;
	--ds-text: #1c1c1c;
	--ds-text-2: #676767;
	--ds-link: #487391;
	--ds-select: #fff9d6;
	--ds-line: #ebe8e4;
	--ds-r-card: 14px;
	--ds-r-control: 6px;
}

body { font-family: var(--k-font); font-weight: 300; color: var(--ds-text); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.container { max-width: 1340px; padding-left: 20px; padding-right: 20px; }

/* ---------- Заголовки ---------- */
h1.page_title { font-family: var(--k-font); font-weight: 700; font-size: 40px; line-height: 48px; letter-spacing: -.015em; margin: 0 0 20px; }
.home h1.page_title { margin: 8px 0 32px; }
.block_title, .recent_block_title { font-family: var(--k-font) !important; font-weight: 700; font-size: 30px; line-height: 36px; letter-spacing: -.01em; }
.news_block_title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.news_block { margin-bottom: 72px; }

/* ---------- Хлебные крошки ---------- */
p#breadcrumbs, .archive p#breadcrumbs, .gloss_top_box + p#breadcrumbs {
	margin: 24px 0 16px; padding: 0;
	font-size: 14px; line-height: 20px; font-weight: 300; color: var(--ds-text-2);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
p#breadcrumbs a { color: var(--ds-text-2); text-decoration: none; }
p#breadcrumbs a:hover { color: var(--ds-text); }
p#breadcrumbs .breadcrumb_last { color: var(--ds-text); }

/* ---------- Кнопка «Все материалы» ---------- */
.kbtn-more {
	display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
	padding: 10px 18px; border-radius: var(--ds-r-control);
	background: var(--ds-bg); color: var(--ds-text) !important;
	font-size: 15px; font-weight: 500; line-height: 20px; white-space: nowrap;
	transition: background-color .2s;
}
.kbtn-more:hover { background: var(--ds-brand); }
a.kbtn-more.pc_hide { margin-top: 24px; }

/* ---------- Сетка и карточка ---------- */
.kgrid { display: grid; gap: 40px 28px; align-items: stretch; }
.kgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kgrid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.kcard { position: relative; display: flex; flex-direction: column; min-width: 0; }
.kcard__media {
	display: block; position: relative; aspect-ratio: 16 / 9; margin-bottom: 16px;
	border-radius: var(--ds-r-card); overflow: hidden; background: var(--ds-field);
}
.kcard__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.kcard:hover .kcard__media img { transform: scale(1.03); }
.kcard__placeholder {
	display: flex; align-items: flex-end; height: 100%; padding: 20px;
	background: linear-gradient(135deg, var(--ds-select), var(--ds-brand));
	font-weight: 700; font-size: 22px; line-height: 1.2; color: var(--ds-text);
}
.kcard__body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.kcard__top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 10px; font-size: 13px; line-height: 18px; color: var(--ds-text-2); }
.kcard__cat {
	position: relative; z-index: 2;
	padding: 3px 10px; border-radius: var(--ds-r-control);
	background: var(--ds-bg); color: var(--ds-text) !important; font-weight: 500;
	transition: background-color .2s;
}
.kcard__cat:hover { background: var(--ds-select); }
.kcard__title {
	margin: 0 0 14px; font-size: 18px; line-height: 26px; font-weight: 500; letter-spacing: -.005em;
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.kcard__link { color: var(--ds-text) !important; border: 0 !important; text-decoration: none; }
.kcard__link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.kcard:hover .kcard__link { text-decoration: underline; text-decoration-color: var(--ds-brand); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.kcard__meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; line-height: 18px; color: var(--ds-text-2); }
.kcard__ago::before { content: '·'; margin-right: 10px; }
.kcard a:focus-visible { outline: 2px solid var(--ds-text); outline-offset: 3px; }

.kcard--panel { background: var(--ds-surface); border-radius: var(--ds-r-card); overflow: hidden; transition: box-shadow .25s, transform .25s; }
.kcard--panel:hover { box-shadow: 0 14px 36px rgba(28, 28, 28, .08); transform: translateY(-2px); }
.kcard--panel .kcard__media { border-radius: 0; margin: 0; }
.kcard--panel .kcard__body { padding: 18px 20px 20px; }

/* Ajax Load More в рубриках — та же сетка */
.alm-listing { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 28px; padding-top: 40px; }
.alm-listing .alm-reveal { display: contents; }
.alm-btn-wrap { margin-top: 32px; }
.alm-btn-wrap .alm-load-more-btn {
	height: auto !important; padding: 14px 28px !important; border-radius: var(--ds-r-control) !important;
	background: var(--ds-brand) !important; color: var(--ds-text) !important; font-family: var(--k-font) !important;
	font-size: 16px !important; font-weight: 500 !important; box-shadow: none !important;
}

/* ---------- Статья ---------- */
.kpost > .container { max-width: 1160px; }
.kpost__grid { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 72px; align-items: start; }
.kpost__grid--single { grid-template-columns: minmax(0, 780px); }
.kpost__main { min-width: 0; max-width: 780px; }
.kpost__title { font-size: 40px; line-height: 48px; }

.kpost__meta {
	display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px;
	padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--ds-line);
}
.kpost__meta .kpost-author { gap: 12px; }
.kpost__meta .kpost-author__photo { width: 44px; height: 44px; }
.kpost__meta .kpost-author__info { flex-direction: row; flex-wrap: wrap; gap: 2px 0; font-size: 14px; line-height: 20px; color: var(--ds-text-2); }
.kpost__meta .kpost-author__name { flex-basis: 100%; font-size: 15px; color: var(--ds-text); font-weight: 500; }
.kpost__meta .kpost-author__name a { color: var(--ds-text); text-decoration: none; }
.kpost__meta .kpost-author__name a:hover { text-decoration: underline; text-decoration-color: var(--ds-brand); text-decoration-thickness: 2px; }
.kpost__meta .kpost-author__date { color: var(--ds-text-2); }
.kpost__meta .kpost-author__read::before,
.kpost__meta .kpost-author__updated::before { content: '·'; margin: 0 8px; }
.kpost__meta .kpost-author__updated { font-size: 14px; }

.kshare { display: flex; align-items: center; gap: 8px; }
.kshare__label { font-size: 13px; color: var(--ds-text-2); margin-right: 4px; }
.kshare a { display: block; border-radius: 50%; transition: transform .2s, opacity .2s; }
.kshare a:hover { transform: translateY(-2px); }
.kshare img { display: block; width: 36px; height: 36px; }
.kshare__copy {
	position: relative; display: flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; padding: 0; border: 1px solid var(--ds-line); border-radius: 50%;
	background: var(--ds-surface); color: var(--ds-text); cursor: pointer; transition: border-color .2s;
}
.kshare__copy:hover { border-color: var(--ds-text); }
.kshare__done {
	position: absolute; bottom: calc(100% + 8px); right: 0; padding: 4px 8px; border-radius: 6px;
	background: var(--ds-text); color: #fff; font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.kshare__copy.is-done .kshare__done { opacity: 1; }

.kpost__cover { margin: 0 0 32px; }
.kpost__cover img { display: block; width: 100%; height: auto; border-radius: var(--ds-r-card); }
.kblock-summary { border-radius: var(--ds-r-card); border-left: 0; background: var(--ds-select); box-shadow: inset 4px 0 0 var(--ds-brand); }

/* Текст статьи */
.kpost .post_content { font-size: 18px; line-height: 30px; font-weight: 300; color: var(--ds-text); }
.kpost .post_content p { margin: 0 0 20px; }
.kpost .post_content h2 { font-size: 28px; line-height: 36px; font-weight: 700; letter-spacing: -.01em; margin: 48px 0 16px; scroll-margin-top: 24px; }
.kpost .post_content h3 { font-size: 22px; line-height: 30px; font-weight: 700; margin: 32px 0 12px; scroll-margin-top: 24px; }
.kpost .post_content h4 { font-size: 18px; line-height: 26px; font-weight: 700; margin: 24px 0 10px; }
.kpost .post_content a { color: var(--ds-link); text-decoration: underline; text-decoration-color: rgba(72, 115, 145, .35); text-underline-offset: 3px; }
.kpost .post_content a:hover { text-decoration-color: var(--ds-link); }
.kpost .post_content ul, .kpost .post_content ol { margin: 0 0 20px; padding-left: 24px; }
.kpost .post_content li { margin-bottom: 8px; }
.kpost .post_content li::marker { color: var(--ds-text-2); }
.kpost .post_content strong, .kpost .post_content b { font-weight: 700; }
.kpost .post_content blockquote {
	margin: 28px 0; padding: 20px 24px; border: 0; border-radius: var(--ds-r-card);
	background: var(--ds-bg); box-shadow: inset 4px 0 0 var(--ds-brand); font-size: 18px;
}
.kpost .post_content img { max-width: 100%; height: auto; border-radius: var(--ds-r-card); }
.kpost .post_content table { width: 100%; margin: 24px 0; border-collapse: separate; border-spacing: 0; font-size: 16px; line-height: 24px; border: 1px solid var(--ds-line); border-radius: var(--ds-r-card); overflow: hidden; }
.kpost .post_content th { background: var(--ds-bg); font-weight: 700; text-align: left; }
.kpost .post_content th, .kpost .post_content td { padding: 12px 16px; border-bottom: 1px solid var(--ds-line); vertical-align: top; }
.kpost .post_content tr:last-child td { border-bottom: 0; }

/* ---------- Оглавление справа (как на Binance) ---------- */
.kpost__aside { position: relative; height: 100%; }
.ktoc-sticky { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; padding: 4px 4px 4px 0; scrollbar-width: thin; }
.ktoc__title { margin-bottom: 18px; font-size: 13px; line-height: 16px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ds-text-2); }
ol.ktoc { position: relative; list-style: none; margin: 0; padding: 0; counter-reset: none; }
ol.ktoc::before { content: ''; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--ds-line); }
.ktoc__item { position: relative; padding-left: 26px; margin: 0; }
.ktoc__item + .ktoc__item { margin-top: 14px; }
.ktoc__item::before {
	content: ''; position: absolute; left: 1px; top: 5px; width: 10px; height: 10px; box-sizing: border-box;
	transform: rotate(45deg); background: #d6d2cc; border: 2px solid #fff; transition: background-color .2s, box-shadow .2s;
}
.ktoc__item--h3 { padding-left: 40px; }
.ktoc__item--h3::before { left: 2px; width: 8px; height: 8px; top: 6px; }
.ktoc__link { display: block; font-size: 14px; line-height: 20px; font-weight: 300; color: #8a8a8a !important; text-decoration: none; transition: color .15s; }
.ktoc__link:hover { color: var(--ds-text) !important; }
.ktoc__link.is-active { color: var(--ds-text) !important; font-weight: 500; }
.ktoc__item.is-passed::before { background: var(--ds-text); }
.ktoc__item:has(.ktoc__link.is-active)::before { background: var(--ds-brand); box-shadow: 0 0 0 1.5px var(--ds-text); border-color: var(--ds-brand); }
.ktoc__top { display: inline-block; margin-top: 22px; font-size: 13px; color: var(--ds-text-2) !important; }
.ktoc__top:hover { color: var(--ds-text) !important; }

.ktoc-mobile { display: none; margin: 0 0 28px; border: 1px solid var(--ds-line); border-radius: var(--ds-r-card); background: var(--ds-surface); }
.ktoc-mobile summary { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; font-size: 15px; font-weight: 700; cursor: pointer; list-style: none; }
.ktoc-mobile summary::-webkit-details-marker { display: none; }
.ktoc-mobile summary::after { content: ''; width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-top: -4px; transition: transform .2s; }
.ktoc-mobile[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.ktoc-mobile ol.ktoc { margin: 0 20px 20px; }

/* Промо-блоки под статьёй (бывший сайдбар) */
.kpromo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 56px auto 0; max-width: 1120px; }
.kpromo .sidebar_block { margin: 0 !important; width: auto !important; border-radius: var(--ds-r-card); }

/* ---------- Читайте также ---------- */
.krelated { margin-top: 80px; padding: 72px 0 88px; background: var(--ds-bg); }
.krelated__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 32px; }
.krelated__title { margin: 0; font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -.01em; }
.krelated__sub { margin: 6px 0 0 !important; font-size: 15px; line-height: 22px; color: var(--ds-text-2); }
.krelated .kbtn-more { background: var(--ds-surface); }
.krelated .kbtn-more:hover { background: var(--ds-brand); }

/* Подвал после «Читайте также»: скруглённый край ложится на серый фон */
.krelated + footer.kf, .kpost + footer.kf { margin-top: 0; }
.single .kpost:has(.krelated) + footer.kf--dark { margin-top: -32px; }
.single .krelated { padding-bottom: 120px; }

/* ---------- Поиск, автор ---------- */
.ksearch__count { color: var(--ds-text-2); margin: 0 0 28px !important; }
.kauthor-posts__title { font-family: var(--k-font); }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
	.kgrid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.kpost__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.kpost__aside { display: none; }
	.ktoc-mobile { display: block; }
	.kpost__main { max-width: 780px; }
}
@media (max-width: 900px) {
	.kgrid--3, .alm-listing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.kpromo { grid-template-columns: 1fr; }
}
@media (max-width: 660px) {
	h1.page_title, .kpost__title { font-size: 28px; line-height: 36px; }
	.block_title, .recent_block_title, .krelated__title { font-size: 24px; line-height: 30px; }
	.kgrid { gap: 32px; }
	.kgrid--3, .alm-listing { grid-template-columns: minmax(0, 1fr); }
	.kpost .post_content { font-size: 17px; line-height: 28px; }
	.kpost .post_content h2 { font-size: 23px; line-height: 30px; margin-top: 36px; }
	.kpost .post_content h3 { font-size: 19px; line-height: 26px; }
	.kpost__meta { align-items: flex-start; }
	.kshare__label { display: none; }
	/* «Читайте также» — горизонтальная лента с прокруткой */
	.krelated { padding: 48px 0 64px; margin-top: 56px; }
	.krelated__grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 20px; margin: 0 -20px; padding: 0 20px 8px; scrollbar-width: none; }
	.krelated__grid::-webkit-scrollbar { display: none; }
	.krelated__grid .kcard { scroll-snap-align: start; }
	.kpromo { margin-top: 40px; }
}

/* Промо «статус для избранных» (Premium): стили не были описаны в теме */
.sidebar_block4 {
	display: flex; flex-direction: column; justify-content: space-between;
	background: linear-gradient(107deg, #121111 0%, #1c1b1b 45%, #3c3535 100%);
	color: #fff;
}
.sidebar_block4::after {
	content: ''; position: absolute; inset: 0;
	background: url(../images/man.png) 100% 0 / auto 100% no-repeat; opacity: .9; pointer-events: none;
}
.sidebar_block4 .sidebar_block_title { position: relative; z-index: 3; }
.sidebar_bar_text { max-width: 60%; font-size: 22px; line-height: 1.2; font-weight: 700; text-transform: lowercase; color: #fff; }
.sidebar_bar_text::first-letter { text-transform: uppercase; }
.sidebar_block4 .sb_btn_box span { color: var(--ds-brand); opacity: 1; font-weight: 500; }

/* Белые обложки (логотипы на белом) не сливаются с фоном */
.kcard__media::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(28, 28, 28, .07); pointer-events: none; }
.kcard--panel .kcard__media::after { box-shadow: inset 0 -1px 0 rgba(28, 28, 28, .06); }
.kpost__cover img { box-shadow: 0 0 0 1px rgba(28, 28, 28, .06); }

/* Рубрики и архивы */
h1.page_title.arch_title { margin-bottom: 32px; }
.archive_posts { margin-bottom: 72px; }
@media (max-width: 660px) {
	.kpost__meta .kpost-author__updated { flex-basis: 100%; }
	.kpost__meta .kpost-author__updated::before { content: none; }
}
