/* КАМЫШ.press — шаблон kamysh. Mobile-first, без сторонних CSS-библиотек. */

:root {
	--nav: #12162d;
	--nav-2: #1b2142;
	--accent: #fc3c2d;
	--bg: #f3f4f7;
	--surface: #ffffff;
	--ink: #14172b;
	--ink-2: #3d4257;
	--muted: #6b7084;
	--line: #e3e5ec;
	--radius: 10px;
	--shadow: 0 1px 2px rgba(18, 22, 45, .06), 0 4px 16px rgba(18, 22, 45, .06);
	--font: "PT Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--wrap: 1240px;
	--c: var(--accent); /* цвет рубрики */
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0e1120;
		--surface: #171b30;
		--ink: #eef0f7;
		--ink-2: #c6cad8;
		--muted: #9297ab;
		--line: #262b45;
		--shadow: 0 1px 2px rgba(0, 0, 0, .3);
		color-scheme: dark;
	}
}

/* Цвета рубрик (data-cat = id рубрики) */
[data-cat="1"]  { --c: #194fb0; }
[data-cat="2"]  { --c: #e5193d; }
[data-cat="3"]  { --c: #c99a12; }
[data-cat="4"]  { --c: #5a9e4f; }
[data-cat="5"]  { --c: #1f9e95; }
[data-cat="6"]  { --c: #7b5fd1; }
[data-cat="8"]  { --c: #2b7bd8; }
[data-cat="9"]  { --c: #0f8b7e; }
[data-cat="10"] { --c: #d0632f; }
[data-cat="11"] { --c: #c2407a; }
[data-cat="12"] { --c: #c47a22; }
[data-cat="13"] { --c: #2193a8; }
[data-cat="14"] { --c: #a6429c; }
[data-cat="15"] { --c: #b3261e; }
[data-cat="16"] { --c: #2e9d5a; }
[data-cat="17"] { --c: #7d8f2a; }
[data-cat="18"] { --c: #3c86c6; }
[data-cat="19"] { --c: #00918a; }

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
	margin: 0;
	font: 17px/1.55 var(--font);
	color: var(--ink);
	background: var(--bg);
	text-rendering: optimizeLegibility;
	overflow-wrap: anywhere;
}
img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
button { font: inherit; }

.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.sr-only {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 6px; }
.skip-link:focus { top: 8px; color: #fff; }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 44px; padding: 0 20px; border: 0; border-radius: 8px;
	background: var(--accent); color: #fff; font-weight: 700; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.age { display: inline-block; padding: 0 6px; border-radius: 4px; background: #000; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; vertical-align: middle; }

/* ---------- Шапка ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--nav); color: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.site-header__bar { display: flex; align-items: center; gap: 8px; min-height: 60px; }
.logo { font-size: 24px; font-weight: 700; letter-spacing: .3px; color: #fff; white-space: nowrap; }
.logo span { color: var(--accent); }
.logo:hover { color: #fff; }
.icon-btn {
	display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
	border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer;
}
.icon-btn:hover { background: var(--nav-2); }
.site-header__tools { margin-left: auto; display: flex; }

.site-nav { display: none; }
.site-nav__list { list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; color: #dfe2ef; font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: .4px; }
.site-nav a:hover { color: #fff; }

/* мобильное меню */
.site-nav.is-open {
	display: block; position: fixed; inset: 60px 0 0; overflow-y: auto;
	background: var(--nav); padding: 8px 16px 32px;
}
.site-nav.is-open a { padding: 14px 4px; border-bottom: 1px solid var(--nav-2); }

.site-search { background: var(--nav-2); padding: 12px 0; }
.site-search__form { display: flex; gap: 8px; }
.site-search input[type=search] {
	flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border: 0; border-radius: 8px;
	font: inherit; background: #fff; color: #111;
}

@media (min-width: 1024px) {
	.site-header__burger { display: none; }
	.site-nav { display: block; flex: 1; min-width: 0; margin-left: 20px; }
	.site-nav__list { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
	.site-nav__list::-webkit-scrollbar { display: none; }
	.site-nav a { padding: 20px 10px; font-size: 14px; white-space: nowrap; position: relative; }
	.site-nav a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 12px; height: 2px; background: var(--accent); transform: scaleX(0); transition: transform .2s; }
	.site-nav a:hover::after { transform: scaleX(1); }
}

/* ---------- Общие блоки ---------- */
.site-main { padding: 20px 0 8px; }
.section { margin-bottom: 32px; }
.section__title {
	display: flex; align-items: center; gap: 10px;
	font-size: 22px; text-transform: uppercase; letter-spacing: .3px; margin-bottom: 16px;
}
.section__title::before { content: ""; width: 6px; height: 22px; border-radius: 3px; background: var(--c); flex: none; }
.section__title a:hover { color: var(--c); }

.layout { display: grid; gap: 28px; }
.layout__main { min-width: 0; }
@media (min-width: 1024px) {
	.layout { grid-template-columns: minmax(0, 1fr) 340px; }
	.layout__side { position: relative; }
	.widget--sticky { position: sticky; top: 80px; }
}

.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; color: var(--muted); }
.meta--light { color: rgba(255, 255, 255, .8); }

/* метка рубрики ({category} = ссылки) */
.card__cat { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.card__cat a {
	display: inline-block; padding: 2px 9px; border-radius: 4px;
	background: var(--c); color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
}
.card__cat a:hover { color: #fff; filter: brightness(1.1); }

/* ---------- Карточки ---------- */
.card {
	display: flex; flex-direction: column; overflow: hidden;
	background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card__media { display: block; aspect-ratio: 16 / 9; background: var(--line); overflow: hidden; }
.card__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card__media img { transform: scale(1.03); }
.card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.card__title { font-size: 20px; margin-bottom: 8px; }
.card--sm .card__title { font-size: 17px; }
.card__excerpt { margin: 0 0 10px; color: var(--ink-2); font-size: 16px; }
.card .meta { margin-top: auto; }

.grid-cards, .grid-3 { display: grid; gap: 20px; }
@media (min-width: 640px) {
	.grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
	.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.grid-cards > .pager, .grid-cards > .notice { grid-column: 1 / -1; }

.row-list { display: grid; gap: 14px; }
.row-card { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; align-items: start; }
.row-card__media { display: block; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: var(--line); }
.row-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.row-card__title { font-size: 16px; margin: 0 0 4px; }

/* ---------- Главная: hero ---------- */
.hero { display: grid; gap: 20px; margin-bottom: 24px; }
.lead {
	position: relative; overflow: hidden; border-radius: var(--radius); background: var(--nav);
	min-height: 320px; display: flex; align-items: flex-end; color: #fff;
}
.lead__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lead::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 12, 28, .95) 0%, rgba(10, 12, 28, .55) 45%, rgba(10, 12, 28, 0) 75%); }
.lead__body { position: relative; z-index: 1; padding: 20px; }
.lead__title { font-size: 26px; margin-bottom: 10px; }
.lead__title a { color: #fff; }
.lead__title a::after { content: ""; position: absolute; inset: 0; z-index: -1; }
.lead__excerpt { display: none; margin: 0 0 12px; color: rgba(255, 255, 255, .85); }
.lead .card__cat { position: relative; z-index: 2; }
.hero__side { display: grid; gap: 14px; align-content: start; background: var(--surface); padding: 16px; border-radius: var(--radius); box-shadow: var(--shadow); }
@media (min-width: 768px) {
	.lead { min-height: 440px; }
	.lead__title { font-size: 34px; }
	.lead__body { padding: 32px; }
	.lead__excerpt { display: block; }
}
@media (min-width: 1024px) {
	.hero { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
	.lead { min-height: 100%; }
}

/* лента «Не пропусти» */
.ticker {
	display: flex; align-items: center; gap: 14px; margin-bottom: 28px;
}
.ticker__label { flex: none; margin: 0; padding: 6px 12px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.ticker__list {
	display: flex; gap: 24px; margin: 0; padding: 8px 0; list-style: none;
	overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; min-width: 0;
}
.ticker__list li { flex: none; max-width: 360px; scroll-snap-align: start; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker__list time { color: var(--accent); margin-right: 6px; }

/* секции рубрик на главной */
.sections { display: grid; gap: 28px; margin-bottom: 32px; }
@media (min-width: 768px) { .sections { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .sections { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cat-section { display: flex; flex-direction: column; gap: 14px; }
.cat-section .section__title { margin-bottom: 0; font-size: 20px; }
.more { font-weight: 700; color: var(--c); font-size: 15px; }
.more:hover { text-decoration: underline; color: var(--c); }

/* ---------- Сайдбар ---------- */
.widget { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 20px; }
.widget__title { font-size: 17px; text-transform: uppercase; letter-spacing: .4px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid var(--line); position: relative; }
.widget__title::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 48px; height: 2px; background: var(--accent); }
.top-list { list-style: none; counter-reset: top; margin: 0; padding: 0; display: grid; gap: 12px; }
.top-item { counter-increment: top; display: grid; grid-template-columns: 32px 1fr; column-gap: 8px; font-weight: 700; font-size: 16px; line-height: 1.3; }
.top-item::before { content: counter(top); grid-row: span 2; font-size: 26px; line-height: 1; color: var(--accent); }
.top-item .meta { font-weight: 400; font-size: 13px; }
.plain-list { margin: 0; padding-left: 18px; }
.widget--ad img { display: block; margin: 0 auto; border-radius: 8px; }

/* ---------- Статья ---------- */
.speedbar { font-size: 14px; color: var(--muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.speedbar a { color: var(--ink-2); }
.speedbar a:hover { color: var(--accent); }
.speedbar:empty { display: none; }

.article { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 32px; }
.article__title { font-size: 28px; margin-bottom: 12px; }
.article__meta { margin-bottom: 18px; }
.meta__author { color: var(--ink-2); font-weight: 700; }
.article__cover { margin: 0 -18px 20px; }
.article__cover img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
@media (min-width: 768px) {
	.article { padding: 32px 40px; }
	.article__title { font-size: 38px; }
	.article__cover { margin: 0 0 24px; }
	.article__cover img { border-radius: 8px; }
}

.prose { font-size: 18px; line-height: 1.7; color: var(--ink); }
.prose p { margin: 0 0 1.1em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose img { display: block; margin: 1.2em auto; border-radius: 8px; height: auto !important; }
.prose iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; margin: 1.2em 0; border-radius: 8px; }
.prose h2 { font-size: 26px; margin-top: 1.4em; }
.prose h3 { font-size: 21px; margin-top: 1.3em; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--c); color: var(--ink-2); font-style: italic; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; max-width: 100%; }
.prose td, .prose th { border: 1px solid var(--line); padding: 6px 10px; }
.prose [style*="width"] { max-width: 100% !important; }

.article__foot { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; display: grid; gap: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0; }
.tags__label { font-size: 15px; font-weight: 700; margin-right: 4px; }
.tags a { font-size: 14px; padding: 4px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.tags a:hover { border-color: var(--accent); }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share__label { font-weight: 700; font-size: 15px; }
.share__btn { font-size: 14px; padding: 6px 12px; border-radius: 6px; border: 0; background: var(--nav); color: #fff; cursor: pointer; }
.share__btn:hover { background: var(--accent); color: #fff; }
.share__btn[data-net="telegram"] { background: #229ed9; }
.share__btn[data-net="vk"] { background: #0077ff; }
.share__btn[data-net="fb"] { background: #1877f2; }

.ad-slot { margin-top: 20px; margin-bottom: 20px; text-align: center; overflow: hidden; }
.ad-slot img { display: inline-block; border-radius: 8px; }

/* ---------- Списки, рубрики, пагинация ---------- */
.page-head { margin-bottom: 20px; }
.page-head__title { font-size: 30px; text-transform: none; }
.page-head__title::first-letter { color: var(--accent); }
.page-head__descr { color: var(--ink-2); }
.page-head__descr:empty { display: none; }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 28px; font-weight: 700; }
.pager__pages { display: flex; flex-wrap: wrap; gap: 6px; }
.pager a, .pager span > span, .pager__pages > span {
	display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px;
	border-radius: 8px; background: var(--surface); box-shadow: var(--shadow);
}
.pager__pages > span:not(.nav_ext) { background: var(--accent); color: #fff; }
.pager .nav_ext { background: transparent !important; box-shadow: none !important; color: var(--muted) !important; }
.pager__prev > span, .pager__next > span { opacity: .45; }

.notice { background: var(--surface); border-left: 4px solid var(--accent); border-radius: 8px; padding: 16px 18px; margin-bottom: 20px; box-shadow: var(--shadow); }
.notice p { margin: 6px 0 0; color: var(--ink-2); }

.static { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 32px; }
@media (min-width: 768px) { .static { padding: 32px 40px; } }

.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tagcloud a { padding: 4px 12px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-size: 14px; }
.tagcloud .clouds_large, .tagcloud .clouds_xlarge { font-size: 17px; font-weight: 700; }
.tagcloud .clouds_xsmall { font-size: 13px; color: var(--ink-2); }
.tags_more { flex-basis: 100%; margin-top: 8px; font-weight: 700; }
.tags_more a { background: none; box-shadow: none; padding: 0; color: var(--accent); }

.catmenu { list-style: none; margin: 0; padding: 0; }
.catmenu a { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.catmenu span { color: var(--muted); }

/* ---------- Партнёры и «О проекте» ---------- */
.partners { margin-bottom: 32px; }
.partners__grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .partners__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .partners__grid { grid-template-columns: repeat(4, 1fr); } }
.partner {
	display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--radius);
	background: linear-gradient(135deg, var(--nav) 0%, #2a2f5c 100%); color: #fff;
}
.partner:hover { color: #fff; transform: translateY(-2px); transition: transform .2s; }
.partner__name { font-size: 20px; }
.partner__text { font-size: 15px; color: rgba(255, 255, 255, .8); }
.partner__link { margin-top: auto; font-weight: 700; color: #ffb4ad; }
.partners__sub { text-align: center; margin: 28px 0 14px; font-size: 18px; }
.sponsors { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; list-style: none; margin: 0; padding: 0; }
.sponsors li { position: relative; width: 80px; height: 80px; display: grid; place-items: center; }
.sponsors img { max-width: 80px; max-height: 80px; width: auto; object-fit: contain; }
.sponsors .age { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); z-index: 1; }

.about { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 32px; font-size: 16px; }
.about__logo { float: left; margin: 0 16px 8px 0 !important; width: 96px; border-radius: 8px; }
.about h2 { clear: both; }

/* ---------- Подвал ---------- */
.sponsor { margin: 8px auto 32px; text-align: center; }
.sponsor__label { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.sponsor__banner img { display: block; margin: 0 auto; border-radius: 10px; }
.site-footer { background: var(--nav); color: #c9cde0; padding: 36px 0 24px; font-size: 15px; }
.site-footer__inner { display: grid; gap: 24px; }
.site-footer__nav { display: flex; flex-direction: column; gap: 8px; }
.site-footer a:hover { color: #fff; }
.logo--footer { font-size: 26px; }
.site-footer__copy { border-top: 1px solid var(--nav-2); margin-top: 24px; padding-top: 16px; color: #8d92ab; font-size: 14px; }
@media (min-width: 768px) { .site-footer__inner { grid-template-columns: 2fr 1fr 1fr; } }

/* cookie и промо */
.cookie {
	position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; max-width: 720px; margin: 0 auto;
	display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px;
	background: var(--nav); color: #e6e8f2; border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .35); font-size: 14px;
}
.cookie[hidden] { display: none; }
.cookie p { margin: 0; flex: 1 1 260px; }
.cookie a { text-decoration: underline; }
.promo {
	position: fixed; right: 12px; bottom: 12px; z-index: 55; width: 220px;
	border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); background: #000;
}
.promo[hidden] { display: none; }
.promo img { display: block; width: 100%; }
.promo__close {
	position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; border-radius: 50%;
	background: rgba(0, 0, 0, .7); color: #fff; font-size: 20px; line-height: 1; cursor: pointer;
}
@media (min-width: 768px) { .promo { width: 280px; right: 20px; bottom: 20px; } }

/* ---------- Окно входа (dialog) ---------- */
.dialog { border: 0; border-radius: 14px; padding: 0; width: min(380px, calc(100% - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.dialog::backdrop { background: rgba(10, 12, 28, .6); }
.dialog__head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 18px; }
.dialog__head .icon-btn { color: var(--ink); }
.dialog__body { padding: 20px; display: grid; gap: 14px; }
.dialog label { display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.dialog input[type=text], .dialog input[type=password] { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--bg); color: var(--ink); }
.dialog .check { display: flex; align-items: center; gap: 8px; }
.dialog__links { display: flex; justify-content: space-between; font-size: 14px; }
.dialog__links a { color: var(--accent); }
.dialog ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

/* ---------- Опрос, комментарии (DLE) ---------- */
.vote-box__title { font-size: 17px; }
.vote_list .vote { margin-bottom: 6px; }
.lastcomm { margin-bottom: 8px; font-size: 15px; }

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

@media print {
	.site-header, .site-footer, .layout__side, .sponsor, .share, .ad-slot, .promo, .cookie { display: none !important; }
	body { background: #fff; color: #000; }
	.article { box-shadow: none; padding: 0; }
}

/* подсказка, что меню прокручивается */
@media (min-width: 1024px) {
	.site-nav__list { -webkit-mask-image: linear-gradient(to right, #000 92%, transparent); mask-image: linear-gradient(to right, #000 92%, transparent); padding-right: 24px; }
}

.grid-cards > .tagcloud { grid-column: 1 / -1; }
