/*
Theme Name: BT24
Theme URI: https://bt24news.ru
Description: Лёгкая тема для новостного сайта BT24News. Без jQuery и конструкторов, цвета рубрик, тёмный режим, встроенные SEO-метаданные.
Version: 1.3.1
Requires at least: 5.9
Requires PHP: 7.4
Text Domain: bt24
License: GNU General Public License v2 or later
*/

/* ---------- Шрифты ---------- */

@font-face {
	font-family: "Golos Text";
	src: url("assets/fonts/golostext-cyrillic.woff2") format("woff2");
	font-weight: 400 700;
	font-display: swap;
	unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
	font-family: "Golos Text";
	src: url("assets/fonts/golostext-latin.woff2") format("woff2");
	font-weight: 400 700;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Unbounded";
	src: url("assets/fonts/unbounded-cyrillic.woff2") format("woff2");
	font-weight: 500 800;
	font-display: swap;
	unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
	font-family: "Unbounded";
	src: url("assets/fonts/unbounded-latin.woff2") format("woff2");
	font-weight: 500 800;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Токены ---------- */

:root {
	--ink: #15171c;
	--ink-2: #4a505b;
	--muted: #6b7280;
	--paper: #ffffff;
	--surface: #f3f4f6;
	--line: #e3e5e9;
	--link: #1d4ed8;
	--cat: #3a3f47;

	/* Цвета рубрик — те же, что в functions.php */
	--c-politics: #d7263d;
	--c-incidents: #e85d04;
	--c-economics: #0f8b8d;
	--c-science: #2b59c3;
	--c-health: #2a9d5c;
	--c-sport: #7a3fd1;
	--c-people: #b07d00;

	--font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--display: "Unbounded", "Golos Text", system-ui, sans-serif;

	--wrap: 1200px;
	--text: 700px;
	--gutter: clamp(16px, 4vw, 32px);
	--radius: 10px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--ink: #eceef2;
		--ink-2: #b9bec8;
		--muted: #8d94a0;
		--paper: #121418;
		--surface: #1b1e24;
		--line: #2a2e36;
		--link: #8ab4ff;
	}
}

/* ---------- База ---------- */

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

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

body {
	margin: 0;
	overflow-x: clip;
	background: var(--paper);
	color: var(--ink);
	font: 400 17px/1.55 var(--font);
	font-feature-settings: "kern", "liga";
	-webkit-font-smoothing: antialiased;
}

img, svg, video, iframe { max-width: 100%; }
img { height: auto; display: block; }

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

:focus-visible {
	outline: 3px solid var(--cat);
	outline-offset: 2px;
	border-radius: 4px;
}

h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; text-wrap: balance; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-text { width: 100%; max-width: calc(var(--text) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-wide { width: 100%; max-width: calc(980px + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.skip-link {
	position: absolute; left: 8px; top: -60px; z-index: 100;
	background: var(--ink); color: var(--paper);
	padding: 10px 14px; border-radius: var(--radius);
}
.skip-link:focus { top: 8px; color: var(--paper); }

.site-main { padding-bottom: 64px; }

/* ---------- Фирменная полоса рубрик ---------- */

.spectrum {
	height: 4px;
	background: linear-gradient(90deg,
		var(--c-politics) 0 14.28%,
		var(--c-incidents) 0 28.57%,
		var(--c-economics) 0 42.85%,
		var(--c-science) 0 57.14%,
		var(--c-health) 0 71.42%,
		var(--c-sport) 0 85.71%,
		var(--c-people) 0 100%);
}

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

.masthead { background: var(--paper); }

.masthead__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 72px;
}

.brand { display: inline-flex; align-items: baseline; gap: 10px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__img { max-height: 44px; width: auto; }
.brand__word {
	font: 800 30px/1 var(--display);
	letter-spacing: -0.02em;
}
.brand__word b { font-weight: 800; color: var(--c-politics); }
.brand__sub {
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--muted);
}

.masthead__tools { display: flex; align-items: center; gap: 12px; }
.masthead__date { color: var(--muted); font-size: 14px; }
.masthead__date::first-letter { text-transform: uppercase; }

.icon-btn {
	display: inline-grid; place-items: center;
	width: 40px; height: 40px;
	border: 1px solid var(--line); border-radius: 50%;
	background: transparent; color: var(--ink);
	cursor: pointer;
}
.icon-btn:hover { background: var(--surface); }

/* Рубрики: на телефоне лента прокручивается пальцем */
.nav { border-bottom: 1px solid var(--line); }
.nav__list {
	display: flex;
	gap: 4px;
	margin: 0; padding: 0;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.nav__list::-webkit-scrollbar { display: none; }
.nav__list a {
	display: block;
	padding: 14px 12px 12px;
	border-top: 3px solid transparent;
	font-weight: 600;
	font-size: 15px;
	white-space: nowrap;
	color: var(--ink-2);
}
.nav__list a:hover,
.nav__list a[aria-current="page"],
.nav__list .current-menu-item > a {
	border-top-color: var(--cat);
	color: var(--ink);
}

.site-search { padding-block: 16px; border-bottom: 1px solid var(--line); }

.search-form { display: flex; gap: 8px; max-width: 560px; }
.search-form__input {
	flex: 1;
	min-width: 0;
	padding: 12px 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--paper);
	color: var(--ink);
	font: inherit;
}
.search-form__btn, .button {
	display: inline-block;
	padding: 12px 18px;
	border: 0; border-radius: var(--radius);
	background: var(--ink); color: var(--paper);
	font: 600 15px/1.2 var(--font);
	cursor: pointer;
}
.search-form__btn:hover, .button:hover { color: var(--paper); opacity: 0.88; }

@media (max-width: 640px) {
	.masthead__date { display: none; }
	.brand__word { font-size: 26px; }
}

/* ---------- Ярлык рубрики ---------- */

.chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 12.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--cat);
}
.chip::before {
	content: "";
	width: 8px; height: 8px;
	border-radius: 2px;
	background: var(--cat);
}
.chip:hover { color: var(--ink); }

/* ---------- Карточки ---------- */

.post-card { position: relative; display: flex; flex-direction: column; gap: 14px; }
.post-card__media {
	display: block;
	overflow: hidden;
	border-radius: var(--radius);
	background: var(--surface);
	aspect-ratio: 16 / 10;
}
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .post-card__media img { transform: scale(1.03); }

.post-card__body { display: flex; flex-direction: column; gap: 8px; }
.post-card__title { font-size: 19px; line-height: 1.28; }
.post-card__title a:hover { color: var(--cat); }
.post-card__lead {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	color: var(--ink-2);
	font-size: 15.5px;
	line-height: 1.5;
}
.post-card__meta { color: var(--muted); font-size: 13.5px; }

/* Главная новость */
.post-card--lead { gap: 20px; }
.post-card--lead .post-card__title { font-size: clamp(26px, 3.4vw, 40px); line-height: 1.12; letter-spacing: -0.01em; }
.post-card--lead .post-card__lead { font-size: 18px; -webkit-line-clamp: 4; max-width: 62ch; }

/* Строка в ленте */
.post-card--line { flex-direction: row; padding: 14px 0; border-top: 1px solid var(--line); }
.post-card--line .post-card__body { flex-direction: row; gap: 14px; align-items: baseline; }
.post-card--line .post-card__time {
	flex: none;
	width: 52px;
	color: var(--cat);
	font-size: 13px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.post-card--line .post-card__title { font-size: 16px; font-weight: 600; line-height: 1.35; }

/* Строка в архиве */
.post-card--row {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 22px;
	padding-block: 22px;
	border-top: 1px solid var(--line);
}
.post-card--row:not(.has-post-thumbnail) { grid-template-columns: 1fr; }
.post-card--row .post-card__title { font-size: 21px; }

@media (max-width: 640px) {
	.post-card--row { grid-template-columns: 104px minmax(0, 1fr); gap: 14px; padding-block: 16px; }
	.post-card--row .post-card__media { aspect-ratio: 1; }
	.post-card--row .post-card__title { font-size: 16.5px; }
	.post-card--row .chip { font-size: 11px; }
}

/* ---------- Главная ---------- */

.top {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 40px;
	padding-block: 32px 16px;
}
.top__feed { align-self: start; }

.section-title {
	margin-bottom: 4px;
	font: 700 14px/1 var(--display);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

@media (max-width: 960px) {
	.top { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 20px; }
}

.rubric { padding-top: 48px; }
.rubric__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 22px;
	padding-top: 14px;
	border-top: 3px solid var(--cat);
}
.rubric__title {
	font: 700 clamp(20px, 2.4vw, 26px)/1.15 var(--display);
	letter-spacing: -0.01em;
}
.rubric__more { color: var(--cat); font-weight: 600; font-size: 15px; white-space: nowrap; }
.rubric__more:hover { color: var(--ink); }

.grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 32px 24px;
}
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
	.grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}

/* ---------- Архивы ---------- */

.archive-head { padding-block: 40px 20px; }
.archive-head__kicker {
	margin-bottom: 10px;
	color: var(--cat);
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
}
.archive-head__title {
	font: 700 clamp(28px, 4.4vw, 48px)/1.08 var(--display);
	letter-spacing: -0.02em;
}
.archive-head__desc { margin-top: 12px; max-width: 640px; color: var(--ink-2); }

.list { max-width: 900px; }

.pagination { margin-top: 32px; max-width: 900px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers {
	min-width: 44px;
	padding: 10px 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	text-align: center;
	font-weight: 600;
}
.pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pagination .dots { border: 0; }

.empty, .notfound { padding-block: 24px 40px; display: grid; gap: 20px; }
.notfound { padding-top: 64px; }

/* ---------- Статья ---------- */

.article__head { padding-top: 40px; display: grid; gap: 16px; }
.article__title {
	font-size: clamp(28px, 4.6vw, 46px);
	line-height: 1.1;
	letter-spacing: -0.015em;
}
.article__lead { font-size: clamp(18px, 2vw, 21px); line-height: 1.5; color: var(--ink-2); }
.article__meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 14.5px; }
.article__author { color: var(--ink); font-weight: 600; text-decoration: none; }
.article__author:hover { text-decoration: underline; }
.footer__legal a { color: inherit; }

.article__cover { margin-block: 32px 8px; }
.article__cover img { width: 100%; border-radius: var(--radius); }
.article__cover figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }

.article__body { padding-top: 24px; }
.article__foot { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; gap: 20px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { padding: 6px 12px; background: var(--surface); border-radius: 999px; font-size: 14px; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share__label { margin-right: 6px; color: var(--muted); font-size: 14px; }
.share__btn {
	padding: 9px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: transparent;
	color: var(--ink);
	font: 600 14px/1 var(--font);
	cursor: pointer;
}
.share__btn:hover { border-color: var(--cat); color: var(--cat); }

/* ---------- Текст статьи ---------- */

.prose { font-size: 18.5px; line-height: 1.7; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 1.8em; font-size: 1.45em; }
.prose h3 { margin-top: 1.5em; font-size: 1.2em; }
.prose a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--cat); }
.prose blockquote, .prose .wp-block-quote {
	margin-inline: 0;
	padding: 4px 0 4px 22px;
	border-left: 4px solid var(--cat);
	font-size: 1.08em;
	font-style: italic;
}
.prose blockquote cite { display: block; margin-top: 8px; font-size: 0.85em; font-style: normal; color: var(--muted); }
.prose figure { margin-inline: 0; }
.prose figure img { border-radius: var(--radius); }
.prose figcaption, .prose .wp-element-caption { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.prose th, .prose td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.prose strong { font-weight: 700; }

/* Галереи: старая разметка (ul) и новая (вложенные figure) */
.wp-block-gallery { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 8px; }
.wp-block-gallery .blocks-gallery-grid { display: contents; list-style: none; margin: 0; padding: 0; }
.wp-block-gallery .blocks-gallery-item,
.wp-block-gallery .wp-block-image { margin: 0; list-style: none; }
.prose .wp-block-gallery li + li { margin-top: 0; }
.wp-block-gallery figure { margin: 0; height: 100%; }
.wp-block-gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.wp-block-gallery.is-cropped img { aspect-ratio: 4 / 3; }
.wp-block-gallery.columns-1 { --cols: 1; }
.wp-block-gallery.columns-2 { --cols: 2; }
.wp-block-gallery.columns-4 { --cols: 4; }
.wp-block-gallery.columns-1.is-cropped img { aspect-ratio: auto; }
.wp-block-gallery > figcaption,
.wp-block-gallery .blocks-gallery-caption { grid-column: 1 / -1; }
@media (max-width: 560px) { .wp-block-gallery:not(.columns-1) { --cols: 2; } }

/* Встроенные видео (YouTube и др.) */
.wp-block-embed__wrapper { position: relative; }
.wp-embed-responsive .wp-has-aspect-ratio .wp-block-embed__wrapper::before { content: ""; display: block; padding-top: 56.25%; }
.wp-embed-responsive .wp-has-aspect-ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.prose iframe { border: 0; }

.aligncenter { margin-inline: auto; }
.alignleft { float: left; margin: 0.3em 1.2em 0.8em 0; max-width: 50%; }
.alignright { float: right; margin: 0.3em 0 0.8em 1.2em; max-width: 50%; }
.wp-block-image .aligncenter { text-align: center; }

/* ---------- Подвал ---------- */

.footer { margin-top: 32px; background: var(--surface); }
.footer__inner {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 24px 40px;
	padding-block: 40px;
}
.footer__brand { display: grid; gap: 10px; max-width: 420px; color: var(--ink-2); }
.footer__brand .brand__word { font-size: 24px; color: var(--ink); }
.footer__list { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; font-weight: 600; }
.footer__privacy { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; font-size: 14px; }
.footer__privacy a, .linklike { color: var(--ink-2); }
.linklike { padding: 0; border: 0; background: none; font: inherit; text-decoration: underline; cursor: pointer; }
.footer__legal { grid-column: 1 / -1; color: var(--muted); font-size: 13.5px; }

@media (max-width: 640px) { .footer__inner { grid-template-columns: 1fr; } }

/* ---------- Движение ---------- */

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
