/*
Theme Name: Потік
Theme URI: https://www.infopotik.com.ua
Author: Інформаційний потік
Description: Тема для новинного сайту, де головне — час. Новини йдуть єдиною хронологічною стрічкою з підпорядкованими за днями розділами, нові матеріали з’являються без перезавантаження, а старіші підвантажуються при прокручуванні. Є світла і темна тема, мобільна версія зроблена першою.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: potik
*/

/* ==========================================================================
   Шрифти (власні файли WOFF2, без запитів до сторонніх серверів)
   IBM Plex Sans і Source Serif 4, ліцензія OFL, див. assets/fonts.
   Набір символів: українська абетка, латиниця, потрібна пунктуація.
   ========================================================================== */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('assets/fonts/plex-sans-var.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('assets/fonts/source-serif-var.woff2') format('woff2'); }

/* ==========================================================================
   Змінні
   ========================================================================== */
:root {
	--accent-base: #1456C8;
	--accent: var(--accent-base);
	--bg: #F4F6F9;
	--surface: #FFFFFF;
	--ink: #141B26;
	--muted: #586374;
	--line: #DCE1E8;
	--mark: #FFD23F;
	--mark-ink: #3A2E00;

	--serif: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
	--ui: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

	--hh: 100px;   /* висота шапки: смуга 56 + меню 44 */
	--abh: 0px;    /* висота адмін-панелі WordPress */
	--tw: 76px;    /* ширина колонки часу */
	--rw: 22px;    /* ширина колонки зі стрічкою-лінією */

	color-scheme: light;
}

:root[data-theme="dark"] {
	--accent: color-mix(in srgb, var(--accent-base) 55%, #fff);
	--bg: #0E131B;
	--surface: #151C27;
	--ink: #E8ECF2;
	--muted: #9AA6B6;
	--line: #263041;
	--mark-ink: #FFE9A0;
	color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--accent: color-mix(in srgb, var(--accent-base) 55%, #fff);
		--bg: #0E131B;
		--surface: #151C27;
		--ink: #E8ECF2;
		--muted: #9AA6B6;
		--line: #263041;
		--mark-ink: #FFE9A0;
		color-scheme: dark;
	}
}

body.admin-bar { --abh: 32px; }
@media (max-width: 782px) { body.admin-bar { --abh: 46px; } }
@media (max-width: 600px) { body.admin-bar { --abh: 0px; } }

/* ==========================================================================
   База
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--abh) + var(--hh) + 16px); }

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 400 16px/1.5 var(--ui);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }

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

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

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

.skip {
	position: absolute; left: 12px; top: -60px; z-index: 100;
	padding: 10px 14px; background: var(--ink); color: var(--bg);
	border-radius: 6px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ==========================================================================
   Шапка
   ========================================================================== */
.site-header {
	position: sticky; top: var(--abh); z-index: 50;
	background: var(--surface);
	border-bottom: 1px solid var(--line);
}

.bar { display: flex; align-items: center; gap: 16px; height: 56px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand__logo { display: block; flex: none; width: auto; height: 36px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand__name { font: 700 19px/1.05 var(--ui); letter-spacing: -.01em; white-space: nowrap; }
.brand__city { font: 500 12px/1.2 var(--ui); color: var(--muted); margin-top: 2px; }
.brand .custom-logo { display: block; height: 36px; width: auto; }

.bar__tools { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.bar__clock { display: flex; gap: 10px; align-items: baseline; margin-right: 8px; font: 500 14px/1 var(--ui); color: var(--muted); }
.bar__time { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.bar__temp[hidden] { display: none; }

.icon-btn {
	display: inline-grid; place-items: center;
	width: 40px; height: 40px;
	background: transparent; border: 0; border-radius: 50%;
	color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn[aria-expanded="true"] { background: var(--bg); }

.site-search { border-top: 1px solid var(--line); padding: 10px 0; }
.site-search[hidden] { display: none; }

.nav { border-top: 1px solid var(--line); }
.nav .menu {
	display: flex; align-items: center; gap: 4px;
	height: 44px; margin: 0 -8px; padding: 0 8px;
	list-style: none; overflow-x: auto;
	scrollbar-width: none;
}
.nav .menu::-webkit-scrollbar { display: none; }
.nav .menu { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scroll-snap-type: x proximity; }
.nav .menu li { scroll-snap-align: start; }
/* На вузьких екранах праворуч видно, що меню гортається вбік */
@media (max-width: 920px) {
	.nav .wrap { position: relative; }
	.nav .wrap::after {
		content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 36px; pointer-events: none;
		background: linear-gradient(to right, transparent, var(--surface));
	}
	.nav .menu { padding-right: 36px; }
}
.nav .menu li { flex: none; }
.nav .menu a {
	display: block; padding: 7px 12px;
	border-radius: 999px;
	font: 600 14px/1.2 var(--ui);
	color: var(--ink); text-decoration: none; white-space: nowrap;
}
.nav .menu a:hover { background: var(--bg); }
.nav .menu .current-menu-item > a,
.nav .menu .current-cat > a,
.nav .menu .current-menu-ancestor > a { background: var(--ink); color: var(--surface); }

/* ==========================================================================
   Сітка сторінки
   ========================================================================== */
.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 56px;
	align-items: start;
	padding-top: 24px;
}
.col-main { min-width: 0; max-width: 780px; }
.layout--single .col-main { max-width: 700px; }

.rail { position: sticky; top: calc(var(--abh) + var(--hh) + 20px); }

@media (max-width: 920px) {
	.layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
	.col-main, .layout--single .col-main { max-width: none; }
	.rail { position: static; }
}

/* ==========================================================================
   Стрічка
   ========================================================================== */
.status {
	display: flex; align-items: center; gap: 8px;
	margin: 0 0 6px;
	font: 500 13px/1 var(--ui); color: var(--muted);
}
.status__dot { width: 8px; height: 8px; border-radius: 50%; background: #2F9E55; flex: none; }
.status.is-flash .status__dot { animation: ping .9s ease-out 1; }

.feed { position: relative; }

.day {
	position: sticky; top: calc(var(--abh) + var(--hh));
	z-index: 5;
	margin: 0;
	padding: 14px 0 12px;
	background: var(--bg);
	font: 600 15px/1 var(--ui);
	color: var(--muted);
}

.item {
	position: relative;
	display: grid;
	grid-template-columns: var(--tw) var(--rw) minmax(0, 1fr);
	padding: 0 0 24px;
}

/* лінія стрічки й точка */
.item::before {
	content: ""; position: absolute;
	left: calc(var(--tw) + var(--rw) / 2 - 1px);
	top: 0; bottom: 0; width: 2px;
	background: var(--line);
}
.item::after {
	content: ""; position: absolute;
	left: calc(var(--tw) + var(--rw) / 2 - 5px);
	top: 9px; width: 10px; height: 10px;
	border-radius: 50%;
	background: var(--c, var(--muted));
	box-shadow: 0 0 0 4px var(--bg);
}
.day + .item::before { top: 14px; }
.item:last-child::before,
.item:has(+ .day)::before,
.item:has(+ .feed-slot)::before { bottom: auto; height: 14px; }

.item__time { grid-column: 1; text-align: right; padding-top: 1px; }
.item__time time {
	display: block;
	font: 600 22px/1.1 var(--ui);
	letter-spacing: -.01em;
	font-variant-numeric: tabular-nums;
}
.ago { display: block; min-height: 15px; margin-top: 3px; font: 400 12px/1.2 var(--ui); color: var(--muted); }

.item__body { grid-column: 3; display: flex; gap: 16px; align-items: flex-start; min-width: 0; padding-left: 8px; }
.item__text { flex: 1; min-width: 0; }

.item__cat {
	display: inline-block;
	font: 600 13px/1.2 var(--ui);
	color: var(--c, var(--muted));
	text-decoration: none;
}
.item__cat:hover { text-decoration: underline; text-underline-offset: 3px; }
:root[data-theme="dark"] .item__cat { color: color-mix(in srgb, var(--c, #9AA6B6) 55%, #fff); }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .item__cat { color: color-mix(in srgb, var(--c, #9AA6B6) 55%, #fff); }
}

.item__title { margin: 2px 0 0; font: 650 20px/1.28 var(--serif); letter-spacing: -.005em; }
.item__title a { color: var(--ink); text-decoration: none; }
.item__title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.item__title a:visited { color: var(--muted); }

.item__excerpt { margin: 6px 0 0; font: 400 15px/1.5 var(--serif); color: var(--muted); }

.item__thumb { flex: none; display: block; }
.item__thumb img { display: block; width: 112px; height: 76px; object-fit: cover; border-radius: 6px; background: var(--line); }

.item.is-new .item__body { animation: arrive 2.6s ease-out 1; }

@keyframes arrive {
	from { background: color-mix(in srgb, var(--mark) 45%, transparent); box-shadow: -8px 0 0 color-mix(in srgb, var(--mark) 45%, transparent), 8px 0 0 color-mix(in srgb, var(--mark) 45%, transparent); }
	to   { background: transparent; box-shadow: none; }
}
@keyframes ping {
	from { box-shadow: 0 0 0 0 rgba(47, 158, 85, .6); }
	to   { box-shadow: 0 0 0 10px rgba(47, 158, 85, 0); }
}

/* Кнопка «нові новини» */
.newpill {
	position: fixed; z-index: 40;
	top: calc(var(--abh) + var(--hh) + 12px); left: 50%;
	transform: translateX(-50%);
	padding: 9px 16px;
	background: var(--mark); color: #3A2E00;
	border: 0; border-radius: 999px;
	font: 600 14px/1 var(--ui);
	box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
	cursor: pointer;
}
.newpill[hidden] { display: none; }

/* Закріплені */
.pinned {
	margin: 0 0 28px; padding: 16px 20px 6px;
	background: var(--surface);
	border: 1px solid var(--line); border-left: 6px solid var(--mark);
	border-radius: 6px;
}
.pinned__title { margin: 0 0 4px; font: 700 15px/1.2 var(--ui); }
.pinned .item { display: block; padding: 14px 0 16px; border-top: 1px solid var(--line); }
.pinned .item:first-of-type { border-top: 0; }
.pinned .item::before, .pinned .item::after { display: none; }
.pinned .item__time { display: flex; align-items: baseline; gap: 8px; text-align: left; margin-bottom: 4px; }
.pinned .item__time time { font-size: 14px; font-weight: 600; color: var(--muted); }
.pinned .ago { display: inline; min-height: 0; margin: 0; }
.pinned .item__body { gap: 20px; padding-left: 0; }
.pinned .item__title { font-size: 24px; line-height: 1.22; }
.pinned .item__thumb { width: 240px; }
.pinned .item__thumb img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; }

.feed-slot { margin: 0 0 24px; }

.sentinel { height: 1px; }
.retry {
	display: block; margin: 8px auto 24px; padding: 10px 16px;
	background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
	font: 600 14px var(--ui); cursor: pointer;
}
.retry[hidden] { display: none; }

/* Пагінація без JS */
.pager { margin: 8px 0 0; }
.pager .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pager .page-numbers {
	padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px;
	background: var(--surface); color: var(--ink); text-decoration: none;
	font: 600 14px var(--ui);
}
.pager .page-numbers.current { background: var(--ink); color: var(--surface); border-color: var(--ink); }
/* З увімкненим JS сторінки лишаються в HTML для пошукових систем і клавіатури, але візуально сховані */
.js-feed .pager { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.js-feed .pager:focus-within { position: static; width: auto; height: auto; margin: 8px 0 0; overflow: visible; clip: auto; }

.empty { padding: 24px 0; }
.empty__title { font: 700 22px/1.2 var(--serif); margin: 0 0 8px; }

/* ==========================================================================
   Заголовок архіву
   ========================================================================== */
.archive-head { margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.archive-head__title { margin: 0; font: 700 clamp(26px, 4vw, 34px)/1.15 var(--serif); letter-spacing: -.01em; }
.archive-head__desc { margin-top: 6px; color: var(--muted); font: 400 15px/1.5 var(--ui); }
.archive-head__desc p { margin: 0; }

/* ==========================================================================
   Права колонка
   ========================================================================== */
.box { margin: 0 0 28px; }
.box__title { margin: 0 0 10px; font: 700 15px/1.2 var(--ui); }

.subscribe, .cats { list-style: none; margin: 0; padding: 0; }
.subscribe li + li { margin-top: 8px; }
.subscribe__link {
	display: flex; flex-direction: column; gap: 2px;
	padding: 11px 14px;
	background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
	text-decoration: none; color: var(--ink);
}
.subscribe__link:hover { border-color: var(--accent); }
.subscribe__name { font: 700 15px/1.2 var(--ui); }
.subscribe__desc { font: 400 13px/1.3 var(--ui); color: var(--muted); }

.cats li { border-top: 1px solid var(--line); }
.cats li:first-child { border-top: 0; }
.cats a {
	display: flex; align-items: center; gap: 10px;
	padding: 9px 0;
	color: var(--ink); text-decoration: none;
	font: 500 15px/1.2 var(--ui);
}
.cats a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.cats a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   Сторінка новини
   ========================================================================== */
.story__head { margin-bottom: 18px; }
.crumbs { margin: 0 0 6px; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; margin: 0; padding: 0; list-style: none; font: 500 13px/1.4 var(--ui); }
.crumbs li + li::before { content: "›"; margin-right: 8px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.crumbs .item__cat { color: var(--c, var(--muted)); font-weight: 600; }
.source-button { margin-top: 18px; }
.story__title {
	margin: 0 0 12px;
	font: 700 clamp(28px, 4.4vw, 42px)/1.14 var(--serif);
	letter-spacing: -.015em;
	text-wrap: balance;
}
.story__meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font: 500 14px/1.4 var(--ui); color: var(--muted); }
.story__meta a { color: inherit; text-decoration: none; }
.story__meta a:hover { text-decoration: underline; }

.story__hero { margin: 0 0 24px; }
.story__hero img { display: block; width: 100%; height: auto; border-radius: 6px; }
.story__hero figcaption { margin-top: 8px; font: 400 13px/1.4 var(--ui); color: var(--muted); }

.entry { font: 400 19px/1.72 var(--serif); }
.entry > * { max-width: 100%; }
.entry p { margin: 0 0 1.1em; }
.entry h2, .entry h3, .entry h4 { font-family: var(--serif); font-weight: 700; line-height: 1.25; margin: 1.7em 0 .5em; letter-spacing: -.01em; }
.entry h2 { font-size: 1.4em; }
.entry h3 { font-size: 1.2em; }
.entry h4 { font-size: 1.05em; }
.entry ul, .entry ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.entry li { margin: 0 0 .4em; }
.entry li::marker { color: var(--muted); }
.entry a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.entry blockquote { margin: 1.4em 0; padding: .1em 0 .1em 1.1em; border-left: 4px solid var(--accent); color: var(--ink); }
.entry blockquote p:last-child { margin-bottom: 0; }
.entry figure { margin: 1.4em 0; }
.entry figcaption, .wp-caption-text { margin-top: 6px; font: 400 13px/1.4 var(--ui); color: var(--muted); }
.entry img { border-radius: 4px; }
.entry hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.entry table { width: 100%; border-collapse: collapse; font: 400 16px/1.4 var(--ui); display: block; overflow-x: auto; }
.entry th, .entry td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; }
.entry iframe { width: 100%; }
.entry .wp-block-embed__wrapper, .entry .is-type-video .wp-block-embed__wrapper { position: relative; }
.entry strong { font-weight: 700; }

.alignleft { float: left; margin: .3em 1.2em .8em 0; }
.alignright { float: right; margin: .3em 0 .8em 1.2em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.sticky, .bypostauthor { display: block; }

.page-links { margin: 1em 0; font: 600 14px var(--ui); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; padding: 0; }
.tags--rail { margin: 0; }

.chip {
	display: inline-flex; align-items: center;
	padding: 7px 13px;
	background: var(--surface); color: var(--ink);
	border: 1px solid var(--line); border-radius: 999px;
	font: 600 14px/1.2 var(--ui); text-decoration: none; cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip[hidden] { display: none; }
.chip.is-done { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.share__label { margin-right: 4px; font: 600 14px var(--ui); color: var(--muted); }

.box--subscribe { margin-top: 32px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--mark); border-radius: 6px; }
.layout--single .box--subscribe .subscribe { display: flex; flex-wrap: wrap; gap: 8px; }
.layout--single .box--subscribe .subscribe li + li { margin-top: 0; }
.layout--single .box--subscribe .subscribe__link { background: var(--bg); }

.related { margin-top: 40px; }
.related__title { margin: 0 0 6px; font: 700 18px/1.2 var(--ui); }
.related__list { list-style: none; margin: 0; padding: 0; }
.related__list li { padding: 14px 0; border-top: 1px solid var(--line); }
.related__time { display: block; margin-bottom: 3px; font: 500 13px/1.2 var(--ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.related__link { font: 650 18px/1.3 var(--serif); color: var(--ink); text-decoration: none; }
.related__link:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ==========================================================================
   Форми, коментарі
   ========================================================================== */
.searchform { display: flex; gap: 8px; }
.searchform__input,
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 11px 14px;
	background: var(--surface); color: var(--ink);
	border: 1px solid var(--line); border-radius: 8px;
	font: 400 16px/1.3 var(--ui);
}
.searchform__input { flex: 1; }
.searchform__btn, .comment-form .submit {
	padding: 11px 18px;
	background: var(--ink); color: var(--surface);
	border: 0; border-radius: 8px;
	font: 600 15px/1.2 var(--ui); cursor: pointer;
}

.comments { margin-top: 44px; }
.comments__title, .comment-reply-title { font: 700 18px/1.2 var(--ui); margin: 0 0 14px; }
.comments__list { list-style: none; margin: 0 0 24px; padding: 0; }
.comments__list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 14px 0; border-top: 1px solid var(--line); font: 400 16px/1.55 var(--serif); }
.comment-author .avatar { border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.comment-meta, .comment-author { font: 500 14px/1.4 var(--ui); color: var(--muted); }
.comment-form p { margin: 0 0 12px; }
.comment-form label { display: block; margin-bottom: 4px; font: 600 14px var(--ui); }

/* ==========================================================================
   Футер
   ========================================================================== */
.site-footer { margin-top: 64px; padding: 32px 0 28px; background: var(--surface); border-top: 1px solid var(--line); color: var(--muted); font: 400 14px/1.5 var(--ui); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer__name { margin: 0 0 6px; color: var(--ink); font: 700 18px/1.2 var(--ui); }
.footer__about p { margin: 0; max-width: 36ch; }
.footer__menu, .footer__social { list-style: none; margin: 0; padding: 0; }
.footer__menu li, .footer__social li { margin: 0 0 8px; }
.footer__menu a, .footer__social a { color: var(--ink); text-decoration: none; font-weight: 500; }
.footer__menu a:hover, .footer__social a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer__legal { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.footer__legal p { margin: 0; }

@media (max-width: 720px) {
	.footer__grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ==========================================================================
   Мобільна версія
   ========================================================================== */
@media (max-width: 640px) {
	:root { --tw: 54px; --rw: 20px; --hh: 100px; }
	.wrap { padding: 0 16px; }
	.layout { padding-top: 16px; }
	.bar { height: 56px; gap: 8px; }
	.brand__name { font-size: 17px; }
	.bar__clock { margin-right: 2px; font-size: 13px; }
	.item { padding-bottom: 22px; }
	.item__time time { font-size: 17px; }
	.ago { font-size: 11px; }
	.item__title { font-size: 18px; }
	.item__body { padding-left: 6px; gap: 12px; }
	.item__thumb img { width: 84px; height: 84px; }
	.entry { font-size: 18px; line-height: 1.7; }
	/* «Головне» на телефоні: компактна смужка без картинки, щоб не займати перший екран. */
	.pinned { margin: 4px 0 16px; padding: 10px 14px 4px; }
	.pinned__title { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.pinned .item { padding: 8px 0 10px; }
	.pinned .item__time { margin-bottom: 2px; }
	.pinned .item__time time { font-size: 12px; }
	.pinned .item:first-of-type .item__time::before { content: "Головне · "; color: var(--ink); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; }
	.pinned .ago, .pinned .item__cat, .pinned .item__excerpt, .pinned .item__thumb { display: none; }
	.pinned .item__title { font-size: 16px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

/* Шапка на вузьких екранах: годинник і температуру ховаємо, щоб назва не налізала на кнопки */
@media (max-width: 520px) {
	.bar__clock { display: none; }
	.brand { flex: 1 1 auto; }
	.brand .custom-logo { max-width: 58vw; height: auto; max-height: 36px; }
}
@media (max-width: 380px) {
	.brand { gap: 8px; }
	.brand__logo { height: 30px; }
	.brand__name { font-size: 15px; white-space: normal; line-height: 1.1; }
	.brand__city { display: none; }
	.icon-btn { width: 36px; height: 36px; }
}
@media (max-width: 340px) {
	.wrap { padding: 0 12px; }
	.brand__logo { height: 26px; }
	.brand__name { font-size: 14px; }
}


/* ==========================================================================
   Інфосмуга: погода і курс валют
   ========================================================================== */
.infobar { position: relative; width: 100%; min-width: 0; max-width: 100vw; background: var(--surface); border-bottom: 1px solid var(--line); }
.infobar__in { display: flex; align-items: center; gap: 20px; min-height: 40px; min-width: 0; }
.info-chip { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; background: none; color: var(--ink); font: 500 14px/1 var(--ui); cursor: pointer; }
.info-chip:hover .rate__v, .info-chip:hover .info-weather__t { text-decoration: underline; text-underline-offset: 3px; }
.info-weather { min-height: 40px; padding-right: 20px; border-right: 1px solid var(--line); }
.info-weather__icon svg, .ip-now__icon svg { display: block; color: var(--muted); }
.info-weather__icon { display: inline-flex; width: 18px; height: 18px; }
.info-weather__t { min-width: 3.2ch; font-variant-numeric: tabular-nums; }
.info-weather__txt { color: var(--muted); font-weight: 400; }
.info-rates { gap: 20px; min-height: 40px; }
.rate { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.rate__cc { font: 600 12px/1 var(--ui); color: var(--muted); letter-spacing: .02em; }
.rate__v { font-variant-numeric: tabular-nums; font-weight: 600; }
.rate__d { font: 500 12px/1 var(--ui); }
.is-up { color: #2F7D32; }
.is-down { color: #C62828; }
:root[data-theme="dark"] .is-up { color: #7FCB84; }
:root[data-theme="dark"] .is-down { color: #F08A8A; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .is-up { color: #7FCB84; }
	:root:not([data-theme="light"]) .is-down { color: #F08A8A; }
}
.info-src { margin-left: auto; font: 400 12px/1 var(--ui); color: var(--muted); }

.info-panel {
	position: absolute; z-index: 60; top: calc(100% + 8px);
	left: max(16px, calc((100vw - var(--container, 1120px)) / 2 + 20px));
	width: 380px; max-width: calc(100vw - 32px); max-height: calc(100vh - 140px); overflow: auto;
	padding: 20px; background: var(--surface); color: var(--ink);
	border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.16);
}
.info-panel[hidden], .info-backdrop[hidden] { display: none; }
.info-panel__handle, .ip-close { display: none; }
.ip-title { margin: 0 0 10px; font: 600 14px/1.2 var(--ui); color: var(--muted); }
.ip-now { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ip-now__icon { display: inline-flex; width: 40px; height: 40px; }
.ip-now__icon svg { width: 40px; height: 40px; }
.ip-now__t { font: 700 40px/1 var(--serif); }
.ip-now__d { display: flex; flex-direction: column; gap: 2px; min-width: 0; font: 400 13px/1.3 var(--ui); color: var(--muted); }
.ip-now__d b { color: var(--ink); font-weight: 600; font-size: 14px; }
.ip-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.ip-day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; background: var(--bg); border-radius: 8px; font: 500 12px/1.2 var(--ui); }
.ip-day__n { color: var(--muted); font-weight: 600; text-transform: uppercase; }
.ip-day svg { width: 22px; height: 22px; color: var(--muted); }
.ip-table { width: 100%; border-collapse: collapse; font: 500 14px/1.2 var(--ui); }
.ip-table th, .ip-table td { padding: 8px 0; border-bottom: 1px solid var(--line); text-align: left; }
.ip-table th { font-weight: 600; }
.ip-table__d { text-align: right !important; font-size: 12px; padding-right: 10px !important; }
.ip-table__v { text-align: right !important; font-weight: 700; font-variant-numeric: tabular-nums; }
.ip-src { margin: 12px 0 0; font: 400 12px/1.3 var(--ui); color: var(--muted); }
.info-backdrop { position: fixed; inset: 0; z-index: 59; background: rgba(0,0,0,.4); }

@media (max-width: 640px) {
	.infobar { overflow-x: hidden; }
	.infobar__in { overflow-x: auto; scrollbar-width: none; gap: 8px; padding-top: 8px; padding-bottom: 8px; min-height: 0; }
	.infobar__in::-webkit-scrollbar { display: none; }
	.info-src, .info-weather__txt { display: none; }
	.info-weather { min-height: 0; padding: 6px 12px; border: 0; background: var(--bg); border-radius: 999px; flex: none; }
	.info-rates { gap: 8px; min-height: 0; flex: none; }
	.rate { padding: 6px 12px; background: var(--bg); border-radius: 999px; }
	.info-panel {
		position: fixed; z-index: 61; left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none;
		max-height: 88vh; padding: 12px 20px 24px; border: 0; border-radius: 16px 16px 0 0;
	}
	.info-panel__handle { display: block; width: 40px; height: 4px; margin: 0 auto 14px; border-radius: 2px; background: var(--line); }
	.ip-close { display: block; width: 100%; margin-top: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: 600 15px/1 var(--ui); }
}
@media (prefers-reduced-motion: no-preference) {
	.info-panel:not([hidden]) { animation: ip-in .18s ease-out; }
	@keyframes ip-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* ==========================================================================
   Рух і друк
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
	.site-header, .rail, .share, .box--subscribe, .related, .comments, .site-footer, .newpill, .skip { display: none !important; }
	body { background: #fff; color: #000; }
	.entry { font-size: 12pt; }
	.layout { display: block; }
}

/* Логотип синій: у темній темі робимо його світлим, щоб він читався */
:root[data-theme="dark"] .brand__logo { filter: brightness(0) invert(1) opacity(.9); }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .brand__logo { filter: brightness(0) invert(1) opacity(.9); }
}

/* Найчитаніше і лічильник читань */
.popular { margin: 0; padding: 0; list-style: none; counter-reset: pop; }
.popular li { counter-increment: pop; display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.popular li:first-child { border-top: 0; padding-top: 0; }
.popular li::before { content: counter(pop); font: 700 14px/1.35 var(--ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.popular a { color: var(--ink); text-decoration: none; font: 600 15px/1.35 var(--serif, Georgia, serif); }
.popular a:hover { color: var(--accent); }

/* Кнопка сповіщень і підказка */
.info-push { flex: none; margin-left: 12px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); font: 600 13px/1.2 var(--ui); cursor: pointer; }
.info-src + .info-push { margin-left: 16px; }
.info-push:hover { border-color: var(--accent); color: var(--accent); }
.info-push[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.info-push:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.info-push[hidden] { display: none; }
.info-push--solo, .info-rates ~ .info-push { margin-left: auto; }
.info-src ~ .info-push { margin-left: 16px; }
.push-ask { position: fixed; z-index: 58; left: 16px; bottom: 16px; width: min(380px, calc(100vw - 32px)); padding: 16px 18px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.18); font: 500 15px/1.4 var(--ui); }
.push-ask p { margin: 0 0 12px; font-weight: 600; }
.push-ask__row { display: flex; gap: 8px; }
.push-ask button { padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 600 14px/1 var(--ui); cursor: pointer; }
.push-ask button[data-yes] { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 640px) { .push-ask { left: 8px; right: 8px; bottom: 8px; width: auto; } }

.ip-weather + .ip-rates, .ip-rates + .ip-rates { margin-top: 18px; }
.rate--crypto { margin-left: 4px; }

/* Архів новин (/sitemap/) */
.map { max-width: 860px; padding-top: 28px; padding-bottom: 56px; }
.map__title { margin: 0 0 14px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); font: 700 34px/1.1 var(--ui); letter-spacing: -.01em; }
.map__quick { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 4px 0 14px; border-bottom: 1px solid var(--line); font: 500 15px/1.2 var(--ui); }
.map__quick a, .map__crumbs a { color: var(--ink); text-decoration: none; padding: 8px 0; }
.map__quick a:hover, .map__crumbs a:hover { color: var(--accent); text-decoration: underline; }
.map__crumbs ol { display: flex; flex-wrap: wrap; align-items: baseline; margin: 18px 0 6px; padding: 0; list-style: none; font: 700 20px/1.2 var(--ui); }
.map__crumbs li + li::before { content: "›"; margin: 0 10px; color: var(--muted); font-weight: 400; }
.map__crumbs h2 { margin: 0; font: inherit; }
.map__crumbs a { font-weight: 700; padding: 0; }
.map__sub { margin: 22px 0 10px; font: 700 16px/1.2 var(--ui); }
.map__grid { display: grid; margin: 12px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.map__grid--years { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.map__grid--months { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); column-gap: 28px; }
.map__grid--days { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
.map__grid a, .map__empty { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-height: 48px; padding: 12px 10px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font: 500 16px/1.2 var(--ui); }
.map__grid--days a, .map__grid--days .map__empty { justify-content: center; padding-left: 0; padding-right: 0; }
.map__grid a:hover { background: var(--surface); color: var(--accent); }
.map__grid a span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.map__grid b { font-weight: 600; }
.map__empty { color: #8A94A6; }
.map__empty b { font-weight: 500; }
.map__day { margin: 26px 0 0; padding-bottom: 6px; font: 700 15px/1.2 var(--ui); text-transform: capitalize; }
.map__list { margin: 0; padding: 0; list-style: none; }
.map__list li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.map__list time { font: 600 13px/1.6 var(--ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.map__list a { color: var(--ink); text-decoration: none; font: 600 18px/1.35 var(--serif); }
.map__list a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 640px) { .map__title { font-size: 28px; } .map__grid--months { grid-template-columns: 1fr 1fr; column-gap: 12px; } }
.map__crumbs li { display: flex; align-items: baseline; }

.footer__brand { display: inline-block; margin-bottom: 10px; line-height: 0; }
.footer__brand .brand__logo { height: 36px; width: auto; }
