/* =====================================================
   CryptoCoinNews — основной стиль
   Тёмная тема по умолчанию (как news.bitcoin.com)
   ===================================================== */

:root {
	--bg: #0b0e11;
	--bg-secondary: #12161b;
	--card-bg: #161b21;
	--border: #242a31;
	--text: #eef1f4;
	--text-muted: #93a0ac;
	--accent: #f7931a;
	--accent-hover: #ffab3d;
	--accent-contrast: #14181c;
	--radius: 10px;
	--shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
	--header-h: 64px;
	--maxw: 1240px;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="light"] {
	--bg: #ffffff;
	--bg-secondary: #f4f6f8;
	--card-bg: #ffffff;
	--border: #e6e9ec;
	--text: #14181c;
	--text-muted: #647280;
	--accent: #f7931a;
	--accent-hover: #d97c0a;
	--accent-contrast: #ffffff;
	--shadow: 0 4px 16px rgba(20, 24, 28, 0.08);
}

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

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

body {
	margin: 0;
	font-family: var(--font);
	background: var(--bg);
	color: var(--text);
	line-height: 1.6;
	font-size: 16px;
	transition: background-color .25s ease, color .25s ease;
}

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

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }

p { margin: 0 0 1em; }

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

button { font-family: inherit; cursor: pointer; }

.screen-reader-text {
	position: absolute !important;
	left: -9999px;
	width: 1px; height: 1px;
	overflow: hidden;
}

.container {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 0 20px;
}

.container--narrow {
	max-width: 820px;
}

/* -------------------- Header -------------------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--bg);
	border-bottom: 1px solid var(--border);
}

.site-header__top-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: var(--header-h);
	gap: 16px;
}

.site-branding {
	display: flex;
	align-items: center;
	flex: 1;
	justify-content: center;
}

.site-branding img { max-height: 38px; width: auto; }

.site-title-link {
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -.02em;
	color: var(--text);
}
.site-title-link:hover { color: var(--accent); }

.site-header__actions {
	display: flex;
	align-items: center;
	gap: 6px;
}

.menu-toggle,
.search-toggle,
.theme-toggle,
.back-to-top {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: transparent;
	border: none;
	border-radius: 8px;
	color: var(--text);
	transition: background-color .15s ease, color .15s ease;
}
.menu-toggle:hover,
.search-toggle:hover,
.theme-toggle:hover {
	background: var(--bg-secondary);
	color: var(--accent);
}

/* Burger icon */
.menu-toggle {
	flex-direction: column;
	gap: 5px;
	order: -1;
}
.menu-toggle__bar {
	display: block;
	width: 20px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform .25s ease, opacity .25s ease;
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* Theme toggle icons */
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Search dropdown */
.header-search {
	max-height: 0;
	overflow: hidden;
	transition: max-height .25s ease;
	border-top: 1px solid transparent;
}
.header-search.is-open {
	max-height: 90px;
	border-top-color: var(--border);
}
.header-search .container { padding: 14px 20px; }

.search-form {
	display: flex;
	gap: 8px;
}
.search-field {
	flex: 1;
	height: 44px;
	border-radius: var(--radius);
	border: 1px solid var(--border);
	background: var(--bg-secondary);
	color: var(--text);
	padding: 0 16px;
	font-size: 15px;
}
.search-field:focus { outline: 2px solid var(--accent); }
.search-submit {
	width: 44px;
	height: 44px;
	border-radius: var(--radius);
	border: 1px solid var(--border);
	background: var(--accent);
	color: var(--accent-contrast);
	display: flex;
	align-items: center;
	justify-content: center;
}

/* -------------------- Main nav -------------------- */
.main-navigation {
	border-top: 1px solid var(--border);
	background: var(--bg-secondary);
}
.primary-menu,
.ccn-cat-nav {
	display: flex;
	gap: 4px;
	overflow-x: auto;
	-ms-overflow-style: none;
	scrollbar-width: none;
	white-space: nowrap;
	padding: 0;
}
.primary-menu::-webkit-scrollbar,
.ccn-cat-nav::-webkit-scrollbar { display: none; }

.primary-menu li a,
.ccn-cat-nav li a {
	display: block;
	padding: 12px 14px;
	font-size: 14px;
	font-weight: 600;
	color: var(--text-muted);
	border-bottom: 2px solid transparent;
	transition: color .15s ease, border-color .15s ease;
}
.primary-menu li a:hover,
.ccn-cat-nav li a:hover,
.primary-menu li.current-menu-item a,
.primary-menu li.current-menu-ancestor a {
	color: var(--text);
	border-bottom-color: var(--accent);
}

/* Mobile nav drawer */
@media (max-width: 900px) {
	.main-navigation {
		position: fixed;
		top: var(--header-h);
		left: 0;
		right: 0;
		bottom: 0;
		background: var(--bg);
		transform: translateX(-100%);
		transition: transform .3s ease;
		overflow-y: auto;
		z-index: 99;
	}
	.main-navigation.is-open { transform: translateX(0); }
	.primary-menu, .ccn-cat-nav {
		flex-direction: column;
		padding: 10px 0;
	}
	.primary-menu li a, .ccn-cat-nav li a {
		padding: 14px 20px;
		border-bottom: 1px solid var(--border);
		border-left: 3px solid transparent;
	}
	.primary-menu li a:hover, .ccn-cat-nav li a:hover,
	.primary-menu li.current-menu-item a {
		border-left-color: var(--accent);
		border-bottom-color: var(--border);
		background: var(--bg-secondary);
	}
}

/* -------------------- Hero -------------------- */
.hero {
	padding: 24px 0;
	border-bottom: 1px solid var(--border);
}
.hero__post { display: block; }
.hero__media {
	position: relative;
	display: block;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--bg-secondary);
	aspect-ratio: 16/9;
}
.hero__media img {
	width: 100%; height: 100%;
	object-fit: cover;
	transition: transform .4s ease;
}
.hero__post:hover .hero__media img { transform: scale(1.03); }

.hero__body { padding-top: 18px; }
.hero__title {
	font-size: clamp(24px, 4vw, 38px);
	margin: 10px 0 12px;
}
.hero__title a { color: var(--text); }
.hero__post:hover .hero__title a { color: var(--accent); }
.hero__excerpt {
	color: var(--text-muted);
	font-size: 16px;
	max-width: 760px;
}

/* -------------------- Card tag -------------------- */
.ccn-card__tag {
	position: absolute;
	top: 12px;
	left: 12px;
	background: var(--accent);
	color: var(--accent-contrast);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	padding: 5px 10px;
	border-radius: 6px;
	z-index: 2;
}
.ccn-card__tag--static { position: static; display: inline-block; margin-bottom: 14px; }

/* -------------------- Sections -------------------- */
.section { padding: 32px 0; border-bottom: 1px solid var(--border); }
.section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 18px;
	gap: 12px;
}
.section__title {
	font-size: 22px;
	position: relative;
	padding-left: 14px;
	border-left: 4px solid var(--accent);
}
.section__more {
	font-size: 14px;
	font-weight: 600;
	color: var(--accent);
	white-space: nowrap;
}
.section__more:hover { color: var(--accent-hover); }

/* -------------------- Grid / Cards -------------------- */
.ccn-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
}
@media (min-width: 700px) {
	.ccn-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
	.ccn-grid { grid-template-columns: repeat(4, 1fr); }
}

.ccn-card {
	background: var(--card-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.ccn-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow);
	border-color: var(--accent);
}
.ccn-card__media {
	position: relative;
	display: block;
	aspect-ratio: 16/10;
	background: var(--bg-secondary);
	overflow: hidden;
}
.ccn-card__media img {
	width: 100%; height: 100%;
	object-fit: cover;
	transition: transform .35s ease;
}
.ccn-card:hover .ccn-card__media img { transform: scale(1.06); }

.ccn-card__placeholder {
	display: block;
	width: 100%; height: 100%;
	background: linear-gradient(135deg, var(--bg-secondary), var(--border));
}

.ccn-card__body {
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}
.ccn-card__title {
	font-size: 15px;
	margin: 0;
	line-height: 1.35;
}
.ccn-card__title a {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.ccn-card:hover .ccn-card__title a { color: var(--accent); }

.ccn-card__excerpt {
	font-size: 13px;
	color: var(--text-muted);
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ccn-card__meta {
	margin-top: auto;
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--text-muted);
}
.ccn-card__dot { opacity: .6; }

/* -------------------- Breadcrumbs -------------------- */
.ccn-breadcrumbs {
	font-size: 13px;
	color: var(--text-muted);
	padding: 16px 0 0;
}
.ccn-breadcrumbs a { color: var(--text-muted); }
.ccn-breadcrumbs a:hover { color: var(--accent); }
.ccn-breadcrumbs .sep { margin: 0 6px; opacity: .5; }
.ccn-breadcrumbs .current { color: var(--text); }

/* -------------------- Archive header -------------------- */
.archive-header { padding: 20px 0 24px; }
.archive-title {
	font-size: clamp(24px, 4vw, 34px);
	border-left: 4px solid var(--accent);
	padding-left: 14px;
}
.archive-description { color: var(--text-muted); margin-top: 8px; }

.site-main { padding-bottom: 16px; }
.site-main > .container > .ccn-grid { padding-bottom: 32px; }

/* -------------------- Pagination -------------------- */
.pagination,
.navigation.pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 24px 0 40px;
	flex-wrap: wrap;
}
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--border);
	border-radius: 8px;
	color: var(--text-muted);
	font-weight: 600;
	font-size: 14px;
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover {
	border-color: var(--accent);
	color: var(--accent);
}

/* -------------------- Single article -------------------- */
.single-article__header { padding-top: 16px; }
.single-article__title {
	font-size: clamp(26px, 4.5vw, 40px);
	margin-top: 6px;
}
.single-article__meta {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	color: var(--text-muted);
	font-size: 14px;
	margin: 14px 0 22px;
}
.single-article__avatar img { border-radius: 50%; }
.single-article__media {
	margin: 0 0 22px;
	border-radius: var(--radius);
	overflow: hidden;
}
.single-article__media figcaption {
	font-size: 13px;
	color: var(--text-muted);
	padding: 8px 0;
}

.single-article__share {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 20px;
}
.share-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.single-article__share a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px; height: 36px;
	border-radius: 50%;
	border: 1px solid var(--border);
	color: var(--text-muted);
	transition: all .15s ease;
}
.single-article__share a:hover {
	color: var(--accent-contrast);
	background: var(--accent);
	border-color: var(--accent);
}

.single-article__content {
	font-size: 17px;
	line-height: 1.8;
}
.single-article__content h2,
.single-article__content h3 { margin-top: 1.6em; }
.single-article__content p { margin-bottom: 1.2em; }
.single-article__content img,
.single-article__content iframe {
	border-radius: var(--radius);
	margin: 1.2em 0;
}
.single-article__content blockquote {
	margin: 1.5em 0;
	padding: 4px 0 4px 18px;
	border-left: 3px solid var(--accent);
	color: var(--text-muted);
	font-style: italic;
}
.single-article__content a { color: var(--accent); text-decoration: underline; }
.single-article__content ul,
.single-article__content ol { padding-left: 1.4em; margin-bottom: 1.2em; list-style-position: outside; }
.single-article__content ul { list-style: disc; }
.single-article__content ol { list-style: decimal; }
.single-article__content table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.2em 0;
	font-size: 15px;
}
.single-article__content table th,
.single-article__content table td {
	border: 1px solid var(--border);
	padding: 8px 12px;
}

.single-article__tags {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin: 28px 0;
}
.tag-pill {
	font-size: 13px;
	padding: 6px 12px;
	border-radius: 20px;
	background: var(--bg-secondary);
	color: var(--text-muted);
	border: 1px solid var(--border);
}
.tag-pill:hover { color: var(--accent); border-color: var(--accent); }

.single-article__disclaimer {
	margin-top: 28px;
	padding: 14px 16px;
	border-radius: var(--radius);
	background: var(--bg-secondary);
	border: 1px solid var(--border);
	font-size: 13px;
	color: var(--text-muted);
}
.single-article__disclaimer p { margin: 0; }

.section--related { border-top: 1px solid var(--border); margin-top: 32px; padding-top: 28px; border-bottom: none; }

/* -------------------- Comments -------------------- */
.comments-area { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border); }
.comments-title { font-size: 20px; margin-bottom: 16px; }
.comment-list { margin: 0 0 24px; }
.comment-list .comment {
	padding: 14px 0;
	border-bottom: 1px solid var(--border);
}
.comment-respond input,
.comment-respond textarea {
	width: 100%;
	padding: 10px 14px;
	border-radius: 8px;
	border: 1px solid var(--border);
	background: var(--bg-secondary);
	color: var(--text);
	margin-bottom: 12px;
	font-family: inherit;
	font-size: 15px;
}
.comment-respond textarea { min-height: 120px; }

/* -------------------- Buttons -------------------- */
.button,
input#submit,
.comment-respond input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	background: var(--accent);
	color: var(--accent-contrast);
	border: none;
	border-radius: 8px;
	padding: 12px 22px;
	font-weight: 700;
	font-size: 15px;
	width: auto;
	transition: background-color .15s ease;
}
.button:hover,
input#submit:hover { background: var(--accent-hover); color: var(--accent-contrast); }

/* -------------------- 404 -------------------- */
.error-404 {
	text-align: center;
	padding: 60px 20px;
}
.error-404__code {
	font-size: 88px;
	color: var(--accent);
	margin-bottom: 0;
}
.error-404__text { color: var(--text-muted); margin-bottom: 24px; }
.error-404 .search-form { max-width: 420px; margin: 0 auto 24px; }
.error-404 .button { margin-top: 8px; }

/* -------------------- Footer -------------------- */
.site-footer {
	background: var(--bg-secondary);
	border-top: 1px solid var(--border);
	margin-top: 24px;
	padding: 40px 0 0;
}
.site-footer__top {
	display: flex;
	flex-wrap: wrap;
	gap: 32px;
	padding-bottom: 28px;
}
.site-footer__brand { flex: 1 1 260px; }
.site-footer__brand img { max-height: 36px; margin-bottom: 12px; }
.site-footer__desc { color: var(--text-muted); font-size: 14px; max-width: 360px; }

.site-footer__widgets {
	flex: 2 1 480px;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 24px;
}
.footer-widget-title { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 12px; }
.footer-widget ul, .footer-menu { display: flex; flex-direction: column; gap: 8px; }
.footer-widget a, .footer-menu a { font-size: 14px; color: var(--text-muted); }
.footer-widget a:hover, .footer-menu a:hover { color: var(--accent); }

.site-footer__bottom {
	border-top: 1px solid var(--border);
	padding: 18px 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 10px;
	font-size: 13px;
	color: var(--text-muted);
}
.site-footer__copy, .site-footer__disclaimer { margin: 0; }

/* -------------------- Back to top -------------------- */
.back-to-top {
	position: fixed;
	right: 20px;
	bottom: 20px;
	width: 44px; height: 44px;
	border-radius: 50%;
	background: var(--accent);
	color: var(--accent-contrast);
	border: none;
	box-shadow: var(--shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
	z-index: 90;
}
.back-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.back-to-top:hover { background: var(--accent-hover); }

/* -------------------- Misc -------------------- */
::selection { background: var(--accent); color: var(--accent-contrast); }

@media (max-width: 480px) {
	.container { padding: 0 14px; }
	.ccn-grid { gap: 12px; }
	.ccn-card__body { padding: 10px; gap: 6px; }
	.ccn-card__title { font-size: 14px; }
}
