/* =====================================================================
   Доработки блога: шапка как на kassa.cc, бегущая строка курсов, авторы
   ===================================================================== */

/* Шрифт основного сайта. Файлы: fonts/museo-sans-cyrl/ (см. README.txt там же).
   Пока файлов нет — используется Arial с подогнанными метриками, вёрстка не прыгает. */
@font-face { font-family: 'museoSansCyrl'; src: url('../fonts/museo-sans-cyrl/museo-sans-cyrl-300.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'museoSansCyrl'; src: url('../fonts/museo-sans-cyrl/museo-sans-cyrl-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'museoSansCyrl'; src: url('../fonts/museo-sans-cyrl/museo-sans-cyrl-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'museoSansCyrl Fallback'; src: local('Arial'); ascent-override: 91.71%; descent-override: 25.37%; line-gap-override: 0%; size-adjust: 102.49%; }

:root {
	--k-brand: #ffd900;
	--k-brand-hover: #f0cb29;
	--k-brand-active: #e6c300;
	--k-text: #1c1c1c;
	--k-muted: #6b6b6b;
	--k-muted-2: #9d9d9d;
	--k-fg2: #ecf0f6;
	--k-link: #86adcc;
	--k-link-hover: #5a90ba;
	--k-page-bg: #f5f3f1;
	--k-up: #1fa35b;
	--k-down: #f0423c;
	--k-font: museoSansCyrl, 'museoSansCyrl Fallback', 'Museo Sans Cyrl', ui-sans-serif, system-ui, sans-serif;
}

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

header.kh {
	padding: 0;
	margin: 0;
	border: 0;
	font-family: var(--k-font);
	font-size: 16px;
	font-weight: 300;
	line-height: 1.5;
	color: var(--k-text);
	position: relative;
	z-index: 50;
}
header.kh a { color: inherit; }
header.kh svg, header.kh img { display: block; }
.kh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.kh-wrap { width: 100%; max-width: 1340px; margin: 0 auto; padding: 0 20px; }

.kh-desk { display: none; }

/* верхняя строка */
.kh-top { background: var(--k-page-bg); }
.kh-top__row { display: flex; align-items: center; padding-top: 8px; padding-bottom: 8px; font-size: 12px; line-height: 16px; color: var(--k-muted); }
.kh-top__best { display: flex; align-items: center; gap: 4px; color: var(--k-muted-2) !important; }
.kh-top__best svg { color: #d9d9d9; transition: color .2s; }
.kh-top__best:hover { color: var(--k-muted) !important; }
.kh-top__best:hover svg { color: var(--k-muted); }
.kh-top__right { margin-left: auto; display: flex; align-items: center; gap: 40px; }
.kh-top__item { display: flex; align-items: center; gap: 6px; }
.kh-top__link:hover { text-decoration: underline; }
.kh-top__chat { color: var(--k-link) !important; text-decoration: underline; }
.kh-top__chat:hover { color: var(--k-link-hover) !important; }

/* основная строка */
.kh-bar { background: #fff; }
.kh-bar__row { display: flex; align-items: center; justify-content: space-between; }
.kh-nav { display: flex; align-items: center; gap: 12px; }
.kh-nav a {
	display: block;
	padding: 24px 4px 20px;
	border-bottom: 4px solid transparent;
	line-height: 26px;
	transition: border-color .2s;
}
.kh-nav a:hover, .kh-nav a.is-active { border-bottom-color: var(--k-brand); }
.kh-bar__right { display: flex; align-items: center; gap: 12px; }
.kh-bar__reg { display: none; align-items: center; gap: 12px; }

.kh-signin { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; white-space: nowrap; }
.kh-signin:hover { text-decoration: underline; }
.kh-signin__avatar { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-right: 4px; border-radius: 50%; background: var(--k-fg2); }

.kh-btn {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 6px 14px; border-radius: 6px;
	background: var(--k-brand); color: var(--k-text) !important;
	font-size: 16px; font-weight: 500; line-height: 24px; white-space: nowrap;
	transition: background-color .2s;
}
.kh-btn:hover { background: var(--k-brand-hover); }
.kh-btn:active { background: var(--k-brand-active); }

/* язык */
.kh-lang { position: relative; }
.kh-lang__btn {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 12px 10px; border: 0; border-radius: 6px;
	background: #f9f9f9; color: var(--k-text);
	font-family: inherit; font-size: 14px; font-weight: 500; line-height: 16px; cursor: pointer;
}
.kh-lang__btn:focus-visible { outline: 2px solid #ffd829; outline-offset: 2px; }
.kh-lang__globe { width: 16px; height: 16px; color: var(--k-muted-2); }
.kh-lang__chev { width: 8px; height: 8px; transition: transform .2s; }
.kh-lang.is-open .kh-lang__chev { transform: rotate(180deg); }
.kh-lang--sm .kh-lang__btn { gap: 4px; padding: 8px 4px; }
.kh-lang__menu {
	position: absolute; right: 0; top: calc(100% + 6px); min-width: 140px; padding: 6px;
	background: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 60;
}
.kh-lang__menu a { display: block; padding: 8px 10px; border-radius: 6px; font-size: 14px; font-weight: 500; }
.kh-lang__menu a:hover, .kh-lang__menu a.is-active { background: #f5f3f1; }

/* мобильная шапка */
.kh-mob { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 10px; background: #fff; }
.kh-mob .kh-logo img { width: 145px; height: 40px; }
.kh-mob__right { display: flex; align-items: center; gap: 6px; }
.kh-iconbtn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; background: none; color: var(--k-text); cursor: pointer; }

/* выезжающее меню */
.kh-drawer {
	position: fixed; inset: 0; z-index: 1000; overflow-y: auto;
	background: #fff; font-family: var(--k-font); color: var(--k-text);
	display: flex; flex-direction: column;
}
.kh-drawer[hidden] { display: none; }
.kh-drawer a { color: inherit; }
.kh-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px; }
.kh-drawer__nav { display: flex; flex-direction: column; padding: 8px 20px; }
.kh-drawer__nav a { padding: 14px 0; border-bottom: 1px solid #eee; font-size: 18px; font-weight: 500; }
.kh-drawer__nav a.is-active { box-shadow: inset 4px 0 0 var(--k-brand); padding-left: 12px; }
.kh-drawer__auth { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 24px 20px; }
.kh-drawer__contacts { display: flex; flex-direction: column; gap: 10px; padding: 0 20px 32px; font-size: 14px; color: var(--k-muted); }
body.kh-locked { overflow: hidden; }

@media (min-width: 1024px) {
	.kh-mob, .kh-drawer { display: none !important; }
	.kh-desk { display: block; }
}
@media (min-width: 1280px) {
	.kh-nav { gap: 28px; }
	.kh-bar__reg { display: flex; }
}
@media (min-width: 1024px) and (max-width: 1150px) {
	.kh-nav { gap: 4px; }
	.kh-top__right { gap: 20px; }
}

/* ---------- Бегущая строка курсов ---------- */

.kticker {
	position: relative;
	overflow: hidden;
	background: #fff;
	border-top: 1px solid #eaeaea;
	border-bottom: 1px solid #eaeaea;
	margin-bottom: 50px;
	font-family: var(--k-font);
	color: var(--k-text);
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
	        mask-image: linear-gradient(90deg, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
}
.home .kticker { margin-bottom: 55px; }
.kticker[hidden] { display: block; visibility: hidden; height: 0; border: 0; }

.kticker__track {
	display: flex;
	width: max-content;
	animation: kticker-scroll var(--kticker-duration, 40s) linear infinite;
	will-change: transform;
}
.kticker:hover .kticker__track,
.kticker:focus-within .kticker__track { animation-play-state: paused; }

.kticker__list { display: flex; flex-shrink: 0; margin: 0; padding: 0; list-style: none; }
.kticker__item { flex-shrink: 0; }
.kticker__item a {
	display: flex; align-items: center; gap: 8px;
	padding: 10px 18px;
	color: inherit; text-decoration: none; white-space: nowrap;
}
.kticker__icon { width: 24px; height: 24px; flex-shrink: 0; object-fit: contain; }
.kticker__icon--letter { display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--k-fg2); font-size: 12px; font-weight: 700; }
.kticker__symbol { font-size: 16px; font-weight: 700; line-height: 24px; }
.kticker__quote {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 4px 8px; border-radius: 6px; background: #f6f6f6;
	font-size: 16px; font-weight: 500; line-height: 24px;
	font-variant-numeric: tabular-nums;
}
.kticker__item a:hover .kticker__quote { background: #efefef; }
.kticker__change { display: inline-flex; align-items: center; gap: 3px; font-size: 15px; }
.kticker__change::before { content: ''; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.kticker__change.is-up { color: var(--k-up); }
.kticker__change.is-up::before { border-bottom: 5px solid currentColor; }
.kticker__change.is-down { color: var(--k-down); }
.kticker__change.is-down::before { border-top: 5px solid currentColor; }

/* мягкая подсветка при изменении цены */
.kticker__price { border-radius: 4px; transition: background-color .8s; }
.kticker__price.flash-up { background: rgba(31,163,91,.18); transition: none; }
.kticker__price.flash-down { background: rgba(240,66,60,.18); transition: none; }

@keyframes kticker-scroll {
	from { transform: translate3d(0, 0, 0); }
	to   { transform: translate3d(-50%, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
	.kticker__track { animation-duration: calc(var(--kticker-duration, 40s) * 3); }
}
@media (max-width: 660px) {
	.kticker { margin-bottom: 30px; }
	.kticker__item a { padding: 8px 12px; gap: 6px; }
	.kticker__symbol, .kticker__quote { font-size: 14px; line-height: 20px; }
	.kticker__change { font-size: 13px; }
	.kticker__icon { width: 20px; height: 20px; }
}

/* ---------- Автор в записи ---------- */

.autor_box { gap: 16px 24px; flex-wrap: wrap; }
.kpost-author { display: flex; align-items: center; gap: 16px; min-width: 0; }
.kpost-author__photo { flex-shrink: 0; display: block; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: #e3e3e3; }
.kpost-author__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kpost-author__info { display: flex; flex-direction: column; gap: 4px; font-size: 18px; line-height: 1.3; }
.kpost-author__name a { color: #0a0a0a; text-decoration: underline; text-decoration-color: rgba(10,10,10,.25); text-underline-offset: 3px; }
.kpost-author__name a:hover { text-decoration-color: #ffd828; }
.kpost-author__date { color: #0a0a0a; }

.kauthor-initials {
	display: flex; align-items: center; justify-content: center;
	width: 100%; height: 100%;
	background: #ffd828; color: #0a0a0a; font-weight: 700; font-size: 18px; letter-spacing: .02em;
}

/* ---------- Страница автора ---------- */

.kauthor-card { display: flex; gap: 40px; align-items: flex-start; margin: 24px 0 60px; padding: 40px; border-radius: 24px; background: rgb(224 223 223 / 35%); }
.kauthor-card__photo { flex-shrink: 0; width: 180px; height: 180px; border-radius: 50%; overflow: hidden; background: #e3e3e3; }
.kauthor-card__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kauthor-card__photo .kauthor-initials { font-size: 52px; }
.kauthor-card__body { flex: 1; min-width: 0; }
.kauthor-card__name { margin-bottom: 8px; }
.kauthor-card__position { font-size: 18px; color: #6b6b6b; margin-bottom: 20px; }
.kauthor-card__socials { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.kauthor-card__socials a { display: block; transition: opacity .2s; }
.kauthor-card__socials a:hover { opacity: .75; }
.kauthor-card__socials img, .kauthor-card__socials svg { width: 40px; height: 40px; display: block; }
.kauthor-card__bio { max-width: 780px; font-size: 18px; }

.kauthor-posts__title { font-family: 'Halvar Breitschrift'; font-size: 28px; margin-bottom: 30px; display: flex; align-items: center; gap: 12px; }
.kauthor-posts__title span { font-family: 'PP Neue Montreal'; font-size: 16px; font-weight: 500; padding: 2px 10px; border-radius: 20px; background: #ffd828; }
.kauthor-posts__empty { color: #6b6b6b; margin-bottom: 60px; }
.kauthor-page .navigation { margin: 10px 0 60px; }

/* список авторов */
.kauthors-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; margin: 30px 0 60px; }
.kauthors-grid__item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 20px; border-radius: 24px; background: rgb(224 223 223 / 35%); }
.kauthors-grid__item:hover { background: rgb(255 216 40 / 25%); }
.kauthors-grid__photo { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; background: #e3e3e3; margin-bottom: 8px; }
.kauthors-grid__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kauthors-grid__name { font-weight: 500; font-size: 18px; }
.kauthors-grid__position { color: #6b6b6b; font-size: 15px; }

@media (max-width: 660px) {
	.kpost-author__photo { width: 44px; height: 44px; }
	.kpost-author__info { font-size: 15px; }
	.kauthor-card { flex-direction: column; align-items: center; text-align: center; gap: 20px; padding: 28px 20px; margin-bottom: 40px; }
	.kauthor-card__photo { width: 128px; height: 128px; }
	.kauthor-card__socials { justify-content: center; }
	.kauthor-card__bio { font-size: 16px; text-align: left; }
	.kauthor-posts__title { font-size: 22px; }
}

/* ---------- SEO-блоки статьи ---------- */

.kblock-summary { margin: 0 0 32px; padding: 20px 24px; border-left: 4px solid #ffd828; border-radius: 0 16px 16px 0; background: rgb(255 216 40 / 12%); font-size: 18px; line-height: 1.5; }
.kblock-summary__label { font-weight: 700; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.kblock-summary p { margin: 0; }

.toc_box ul { list-style: none; margin: 0; padding: 0; }
.toc_box li.h3 { padding-left: 20px; }

.kblock-cta {
	display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; align-items: center;
	margin: 40px 0; padding: 28px 32px; border-radius: 24px; background: #0a0a0a; color: #fff;
}
.kblock-cta__title { font-family: 'Halvar Breitschrift'; font-size: 22px; line-height: 1.25; margin-bottom: 6px; }
.kblock-cta__text { margin: 0; color: rgba(255,255,255,.8); font-size: 16px; }
.kblock-cta__btn { display: inline-flex; align-items: center; justify-content: center; padding: 14px 24px; border-radius: 8px; background: #ffd828; color: #0a0a0a !important; font-weight: 500; white-space: nowrap; }
.kblock-cta__btn:hover { background: #fff; }
.kblock-cta__note { grid-column: 1 / -1; margin: 6px 0 0 !important; font-size: 12px; color: rgba(255,255,255,.5); }

.kblock-faq { margin: 40px 0; }
.kblock-faq__item { padding: 16px 0; border-bottom: 1px solid #eaeaea; }
.kblock-faq__item h3 { margin: 0 0 6px; font-size: 20px; line-height: 1.3; font-weight: 500; }
.kblock-faq__item p { margin: 0; }

.kblock-sources { margin: 32px 0 0; padding-top: 20px; border-top: 1px solid #eaeaea; font-size: 15px; color: #6b6b6b; }
.kblock-sources__title { font-weight: 700; color: #0a0a0a; margin-bottom: 8px; }
.kblock-sources ol { margin: 0; padding-left: 20px; }
.kblock-sources a { color: #2b6cb0; word-break: break-word; }

.kpost-author__updated { color: #6b6b6b; font-size: 15px; }

@media (max-width: 660px) {
	.kblock-cta { grid-template-columns: 1fr; padding: 22px 20px; }
	.kblock-cta__btn { width: 100%; }
	.kblock-summary { font-size: 16px; padding: 16px 18px; }
}
