/*
Theme Name: Užrašai
Theme URI: https://www.lsvka.lt/
Author: Finansisto užrašai
Description: Išskirtinė naujienų portalo tema „Finansisto užrašams“: sąsiuvinio langelių ir paraštės motyvas, automatinis turinys, skaitymo juosta, taupymo skaičiuoklė, skaitomiausi įrašai, SEO ir struktūruoti duomenys, 404 → pagrindinis peradresavimas. Veikia be papildomų įskiepių.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.1
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: uzrasai
Tags: news, blog, one-column, two-columns, custom-logo, custom-menu, featured-images, translation-ready
*/

/* ==========================================================================
   1. Žetonai
   ========================================================================== */
:root {
	--paper: #f5f7f9;
	--sheet: #ffffff;
	--grid: #e1e8ef;
	--ink: #17224a;
	--ink-2: #2b3766;
	--pen: #2740c9;
	--margin: #d93a50;
	--marker: #ddf25c;
	--marker-hl: #e6f77f;
	--pencil: #586282;
	--line: #d6dee8;
	--night: #121a3a;
	--night-grid: #1f2a55;
	--shadow: #17224a;

	--f-head: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
	--f-body: "Literata", "Iowan Old Style", "Charter", Georgia, "Times New Roman", serif;

	--cell: 24px;
	--r: 6px;
	--wrap: 1240px;
	--gutter: clamp(1rem, 4vw, 2.5rem);
	--margin-col: 7.25rem;

	--t-xs: 0.8125rem;
	--t-sm: 0.9375rem;
	--t-md: 1.0625rem;
	--t-lg: 1.3125rem;
	--t-xl: 1.75rem;
	--t-2xl: 2.375rem;
	--t-3xl: clamp(2.25rem, 1.4rem + 3.6vw, 4.25rem);

	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--paper: #0f1631;
		--sheet: #141c3b;
		--grid: #1b2448;
		--ink: #e9edf8;
		--ink-2: #c9d0e6;
		--pen: #9fb1ff;
		--margin: #ff6f82;
		--marker-hl: rgba(221, 242, 92, .3);
		--pencil: #a0a9c6;
		--line: #273258;
		--night: #0a1027;
		--night-grid: #18214a;
		--shadow: #050916;
		color-scheme: dark;
	}
}

/* ==========================================================================
   2. Pagrindai
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 1.0625rem/1.6 var(--f-body);
	font-variant-numeric: lining-nums;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

a { color: var(--pen); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

::selection { background: var(--marker); color: #17224a; }

h1, h2, h3, h4 {
	font-family: var(--f-head);
	font-weight: 750;
	line-height: 1.12;
	letter-spacing: -0.015em;
	color: var(--ink);
	margin: 0;
	text-wrap: pretty;
	font-optical-sizing: auto;
}

p { margin: 0; }

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

.skip {
	position: absolute; left: 1rem; top: -4rem; z-index: 100;
	background: var(--marker); color: #17224a; padding: .6rem 1rem;
	font: 600 var(--t-sm) var(--f-head); border-radius: var(--r);
}
.skip:focus { top: 1rem; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 860px; }

.ico { flex: none; width: 1.15em; height: 1.15em; }

/* Langeliai – sąsiuvinio lapas */
.graph {
	background-color: var(--paper);
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: var(--cell) var(--cell);
}

/* Žymeklio efektas antraštėse */
.hl {
	background-image: linear-gradient(transparent 56%, var(--marker-hl) 56%, var(--marker-hl) 94%, transparent 94%);
	background-repeat: no-repeat;
	background-size: 0% 100%;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}
@media (prefers-reduced-motion: no-preference) { .hl { transition: background-size .35s cubic-bezier(.3, .7, .2, 1); } }
a:hover .hl, a:focus-visible .hl, a:hover.hl { background-size: 100% 100%; }

/* ==========================================================================
   3. Antraštė
   ========================================================================== */
.masthead {
	background-color: var(--paper);
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: var(--cell) var(--cell);
	border-bottom: 2px solid var(--ink);
}

.topbar { background: var(--ink); color: var(--paper); font: 500 var(--t-xs)/1 var(--f-head); }
@media (prefers-color-scheme: dark) { .topbar { background: var(--night); color: var(--ink-2); } }
.topbar__in { display: flex; justify-content: space-between; gap: 1rem; padding-block: .55rem; }
.topbar__date::first-letter { text-transform: uppercase; }
.topbar__count { opacity: .8; }
@media (max-width: 560px) { .topbar__count { display: none; } }

.masthead__in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.1rem; }

.brand { margin: 0; font: inherit; }
.brand__link { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--ink); }
.brand__mark, .brand__img { width: 48px; height: 48px; flex: none; }
.brand__name {
	font: 800 clamp(1.35rem, 1rem + 1.6vw, 2rem)/1 var(--f-head);
	letter-spacing: -0.03em;
	font-variation-settings: "opsz" 96;
}

.masthead__tools { display: flex; gap: .5rem; }
.tool {
	position: relative;
	display: inline-flex; align-items: center; gap: .45rem;
	min-height: 44px; padding: .55rem .9rem;
	background: var(--sheet); color: var(--ink);
	border: 1.5px solid var(--ink); border-radius: 999px;
	font: 600 var(--t-sm)/1 var(--f-head); cursor: pointer;
}
.tool:hover { background: var(--marker); color: #17224a; }
.tool__badge {
	min-width: 1.35rem; height: 1.35rem; padding-inline: .3rem; border-radius: 999px;
	background: var(--margin); color: #fff; font-size: .75rem; display: inline-grid; place-items: center;
}
.tool__badge[hidden] { display: none; }
@media (max-width: 640px) {
	.tool { padding: .55rem .7rem; }
	.tool__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* Kategorijų juosta – slenkama horizontaliai mobiliuose */
.catnav { background: var(--sheet); border-top: 1.5px solid var(--ink); }
.catnav__list {
	display: flex; gap: .25rem; margin: 0; padding: 0; list-style: none;
	overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
	mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.catnav__list::-webkit-scrollbar { display: none; }
.catnav__list a {
	display: block; white-space: nowrap;
	padding: .85rem .75rem .75rem;
	font: 600 var(--t-sm)/1 var(--f-head);
	color: var(--ink-2); text-decoration: none;
	border-bottom: 4px solid transparent;
}
.catnav__list a:hover { color: var(--ink); border-bottom-color: var(--line); }
.catnav__list .current-menu-item > a,
.catnav__list .current-category-ancestor > a,
.catnav__list a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--margin); }

/* Skaitymo juosta */
.progress { position: fixed; inset: 0 0 auto; height: 5px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; background: var(--marker); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 1px 0 rgba(23, 34, 74, .25); }

/* ==========================================================================
   4. Bendri elementai
   ========================================================================== */
.cat {
	display: inline-flex; align-items: center; gap: .45rem;
	font: 600 var(--t-xs)/1.2 var(--f-head);
	color: var(--margin); text-decoration: none;
	margin-bottom: .55rem;
}
.cat:hover { text-decoration: underline; }
.cat__box { width: .62rem; height: .62rem; border: 2px solid currentColor; border-radius: 2px; background: currentColor; box-shadow: inset 0 0 0 1.5px var(--paper); }

.meta {
	display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem;
	margin-top: .7rem;
	font: 500 var(--t-xs)/1.3 var(--f-head); color: var(--pencil);
}
.meta .ico { width: 1em; height: 1em; margin-right: .3rem; vertical-align: -.12em; }

.media { display: block; overflow: hidden; text-decoration: none; border-radius: var(--r); background: var(--grid); aspect-ratio: 16 / 10; }
.media img { width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: no-preference) {
	.media img { transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
	a.media:hover img, .card:hover .media img, .row:hover .media img { transform: scale(1.03); }
}

/* Paveikslėlio pakaitalas: langelių lapas su kategorijos raide */
.ph {
	position: relative; display: grid; place-items: center; width: 100%; height: 100%;
	background-color: var(--sheet);
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: 16px 16px;
}
.ph::before { content: ""; position: absolute; top: 0; bottom: 0; left: 18%; width: 2px; background: var(--margin); opacity: .7; }
.ph__l { font: 800 clamp(2rem, 6vw, 4rem)/1 var(--f-head); color: var(--ink); opacity: .85; }

/* Data paraštėje */
.mdate { display: grid; justify-items: end; text-align: right; font-family: var(--f-head); color: var(--ink); line-height: 1; }
.mdate__d { font-size: 1.75rem; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.mdate__m { font-size: var(--t-sm); font-weight: 600; margin-top: .2rem; }
.mdate__y { font-size: var(--t-xs); color: var(--pencil); margin-top: .25rem; }

.sec-title { font-size: var(--t-xl); margin-bottom: 1.25rem; }

/* ==========================================================================
   5. Pagrindinis: hero
   ========================================================================== */
.hero {
	background-color: var(--paper);
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: var(--cell) var(--cell);
	padding-block: clamp(1.5rem, 4vw, 3rem) clamp(2rem, 5vw, 3.5rem);
	border-bottom: 1.5px solid var(--line);
}
.hero__grid { display: grid; gap: clamp(1.5rem, 3vw, 3rem); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .hero__grid { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); } }

.lead { display: grid; gap: 1.25rem; }
.lead__media { aspect-ratio: 16 / 9; border-radius: 8px; box-shadow: 8px 8px 0 var(--shadow); }
.lead__title { text-wrap: balance; font-size: clamp(2rem, 1.3rem + 2.6vw, 3.4rem); line-height: 1.03; letter-spacing: -0.035em; font-weight: 800; font-variation-settings: "opsz" 96; }
.lead__title a { color: inherit; text-decoration: none; }
.lead__dek { margin-top: .9rem; font-size: var(--t-lg); line-height: 1.5; color: var(--ink-2); max-width: 62ch; }

.side {
	align-self: start;
	background: var(--sheet);
	border: 1.5px solid var(--ink);
	border-radius: 8px;
	padding: 1.25rem 1.25rem .5rem;
}
.side__title { font-size: var(--t-md); padding-bottom: .85rem; border-bottom: 1.5px solid var(--ink); }

.mini { display: grid; grid-template-columns: 3.6rem 1fr; gap: 0 1rem; padding-block: 1rem; border-bottom: 1px solid var(--line); }
.mini:last-child { border-bottom: 0; }
.mini__date { padding-right: .85rem; border-right: 2px solid var(--margin); }
.mini__date .mdate__d { font-size: 1.4rem; }
.mini__date .mdate__y { display: none; }
.mini .cat { margin-bottom: .35rem; }
.mini__title { font-size: var(--t-md); line-height: 1.25; font-weight: 700; }
.mini__title a { color: inherit; text-decoration: none; }

/* ==========================================================================
   6. Skaitomiausi
   ========================================================================== */
.rank { margin-block: clamp(2rem, 5vw, 3.5rem); }
.rank__title { font-size: var(--t-xl); margin-bottom: 1rem; }
.rank__list {
	list-style: none; margin: 0; padding: 0; counter-reset: rank;
	display: grid; gap: 0 2rem;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}
@media (min-width: 1100px) { .rank > .rank__list { grid-template-columns: repeat(5, minmax(0, 1fr)); } .art__aside .rank__list { grid-template-columns: 1fr; } }
.rank__item { counter-increment: rank; position: relative; padding: 1rem 0 1rem 3.1rem; border-top: 2px solid var(--ink); }
.rank__item::before {
	content: counter(rank);
	position: absolute; left: 0; top: .7rem;
	font: 800 2.4rem/1 var(--f-head); letter-spacing: -0.04em;
	color: var(--margin); font-variant-numeric: tabular-nums;
}
.rank__item a { color: var(--ink); text-decoration: none; font: 700 var(--t-md)/1.28 var(--f-head); }
.rank__meta { display: block; margin-top: .4rem; font: 500 var(--t-xs)/1.2 var(--f-head); color: var(--pencil); }
.art__aside .rank { margin-top: 0; }
.art__aside .rank__list { grid-template-columns: 1fr; }
.art__aside .rank__title { font-size: var(--t-lg); }

/* ==========================================================================
   7. Kategorijų blokai
   ========================================================================== */
.rail { margin-block: clamp(2.5rem, 6vw, 4rem); }
.rail__head {
	display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem;
	padding-bottom: .75rem; margin-bottom: 1.5rem;
	border-bottom: 2px solid var(--ink);
}
.rail__title { font-size: var(--t-2xl); letter-spacing: -0.03em; }
.rail__title a { color: inherit; text-decoration: none; }
.rail__title a:hover { text-decoration: underline; text-decoration-color: var(--margin); text-decoration-thickness: 3px; }
.rail__count { font: 500 var(--t-sm)/1 var(--f-head); color: var(--pencil); }
.rail__all { margin-left: auto; font: 600 var(--t-sm)/1 var(--f-head); }

.rail__grid { display: grid; gap: 1.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
@media (min-width: 900px) {
	.rail__grid { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); align-items: start; }
	.rail--flip .rail__grid { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 2fr); }
	.rail--flip .card:first-child { order: 4; }
	.rail__grid .card:first-child .card__title { font-size: var(--t-xl); line-height: 1.12; }
}

.card { display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 899px) {
	.rail__grid { gap: 0; }
	.rail__grid .card:first-child { margin-bottom: 1.25rem; }
	.rail__grid .card:not(:first-child) {
		display: grid; grid-template-columns: 104px minmax(0, 1fr); column-gap: 1rem; align-items: start;
		padding-block: 1rem; border-top: 1px solid var(--line);
	}
	.rail__grid .card:not(:first-child) .card__media { grid-row: 1 / span 3; margin: 0; aspect-ratio: 1; }
	.rail__grid .card:not(:first-child) > :not(.card__media) { grid-column: 2; }
	.rail__grid .card:not(:first-child) .cat { margin-bottom: .3rem; }
	.rail__grid .card:not(:first-child) .meta { margin-top: .4rem; }
	.rail__grid .card:not(:first-child) .ph__l { font-size: 1.75rem; }
}
.card__media { margin-bottom: .9rem; }
.card__title { font-size: var(--t-md); line-height: 1.25; font-weight: 700; }
.card__title a { color: inherit; text-decoration: none; }
.card__sum { margin-top: .6rem; color: var(--ink-2); font-size: var(--t-sm); line-height: 1.55; }

/* ==========================================================================
   8. Sąrašas su paraštės linija
   ========================================================================== */
.feed-sec { margin-block: clamp(2.5rem, 6vw, 4rem); }
.feed { border-top: 2px solid var(--ink); }
.row {
	display: grid; gap: .25rem 1.25rem;
	grid-template-columns: 4.25rem minmax(0, 1fr);
	padding-block: 1.5rem; border-bottom: 1px solid var(--line);
}
.row__date { padding-right: 1rem; border-right: 2px solid var(--margin); }
.row__title { font-size: var(--t-lg); line-height: 1.22; font-weight: 750; }
.row__title a { color: inherit; text-decoration: none; }
.row__sum { margin-top: .5rem; color: var(--ink-2); max-width: 68ch; font-size: var(--t-md); line-height: 1.55; }
.row__media { grid-column: 2; margin-top: 1rem; max-width: 420px; }
@media (min-width: 720px) {
	.row { grid-template-columns: var(--margin-col) minmax(0, 1fr) 240px; gap: 0 2rem; padding-block: 1.75rem; }
	.row__date { padding-right: 1.25rem; }
	.row__media { grid-column: 3; grid-row: 1; margin-top: 0; }
	.row__title { font-size: var(--t-xl); }
}
@media (max-width: 480px) { .row__sum { display: none; } }
.row.is-new { animation: uz-in .45s ease-out both; }
@keyframes uz-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .row.is-new { animation: none; } }

.more { display: flex; justify-content: center; margin-top: 2rem; }
.more__btn {
	display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
	padding: .8rem 1.6rem; border: 2px solid var(--ink); border-radius: 999px;
	background: var(--sheet); color: var(--ink); text-decoration: none;
	font: 700 var(--t-md)/1 var(--f-head); box-shadow: 4px 4px 0 var(--shadow);
}
.more__btn:hover { background: var(--marker); color: #17224a; }
.more__btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow); }
.more__btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.js .more + .pager { display: none; }

.pager { margin-top: 2rem; }
.pager .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.pager .page-numbers {
	min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; padding-inline: .7rem;
	border: 1.5px solid var(--line); border-radius: var(--r);
	font: 600 var(--t-sm)/1 var(--f-head); color: var(--ink); text-decoration: none; background: var(--sheet);
}
.pager .page-numbers.current { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.empty { padding-block: 3rem; font-size: var(--t-lg); }

/* ==========================================================================
   9. Taupymo skaičiuoklė
   ========================================================================== */
.calc {
	display: grid; gap: clamp(1.5rem, 3vw, 3rem);
	margin-block: clamp(2.5rem, 6vw, 4.5rem);
	padding: clamp(1.25rem, 3vw, 2.5rem);
	background: var(--night); color: #e9edf8;
	border-radius: 12px;
	background-image:
		linear-gradient(var(--night-grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--night-grid) 1px, transparent 1px);
	background-size: var(--cell) var(--cell);
}
@media (min-width: 900px) { .calc { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; } }
.calc__title { color: #fff; font-size: var(--t-2xl); letter-spacing: -0.03em; }
.calc__lead { margin-top: .75rem; color: #c3cae3; font-size: var(--t-md); line-height: 1.55; max-width: 46ch; }
.calc__fields { display: grid; gap: 1rem 1.25rem; margin-top: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }

.field { display: grid; gap: .45rem; font-family: var(--f-head); }
.field__label { display: flex; justify-content: space-between; gap: .5rem; font-size: var(--t-sm); font-weight: 600; color: #c3cae3; }
.field__label output { color: var(--marker); font-weight: 700; font-variant-numeric: tabular-nums; }
.field__box { display: flex; align-items: center; background: #fff; border-radius: var(--r); border: 2px solid transparent; }
.field__box:focus-within { border-color: var(--marker); }
.field__box input {
	width: 100%; min-width: 0; border: 0; background: transparent; padding: .7rem .8rem;
	font: 700 var(--t-lg)/1 var(--f-head); color: #17224a; font-variant-numeric: tabular-nums;
}
.field__box input:focus { outline: none; }
.field__unit { padding-right: .8rem; font-weight: 700; color: #586282; }
.field input[type="range"] { width: 100%; accent-color: var(--marker); height: 2rem; margin: 0; }

.calc__sheet { background: var(--sheet); color: var(--ink); border-radius: 10px; padding: clamp(1rem, 2.5vw, 1.5rem); }
@media (prefers-color-scheme: dark) { .calc__sheet { background: #f5f7f9; color: #17224a; } }
.calc__svg text { font-family: var(--f-head); font-weight: 500; }
.calc__svg { display: block; width: 100%; height: auto; aspect-ratio: 600 / 340; }
.calc__out { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0 0; }
.calc__stat { margin: 0; padding-top: .6rem; border-top: 4px solid currentColor; }
.calc__stat dt { font: 600 var(--t-xs)/1.2 var(--f-head); color: #586282; }
.calc__stat dd { margin: .3rem 0 0; font: 800 clamp(1.05rem, .8rem + 1vw, 1.6rem)/1.1 var(--f-head); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: #17224a; }
.calc__stat--total { color: #17224a; }
.calc__stat--paid { color: #9aa6c8; }
.calc__stat--gain { color: #b5cc2a; }
.calc__note { margin-top: .9rem; font: 500 var(--t-xs)/1.45 var(--f-head); color: #586282; }
.prose .calc { margin-block: 2.5rem; grid-template-columns: minmax(0, 1fr); font-size: 1rem; line-height: 1.5; }
.prose .calc > * + * { margin-top: 0; }
.prose .calc__title { margin: 0; padding: 0; border: 0; font-size: var(--t-xl); }
.prose .calc p, .prose .calc dl { font-size: inherit; }

/* ==========================================================================
   10. Puslapių antraštės (archyvai, paieška)
   ========================================================================== */
.pagehead {
	background-color: var(--paper);
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: var(--cell) var(--cell);
	padding-block: clamp(1.5rem, 4vw, 3rem);
	margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
	border-bottom: 1.5px solid var(--line);
}
.pagehead__title { text-wrap: balance; font-size: var(--t-3xl); letter-spacing: -0.035em; font-weight: 800; line-height: 1.02; }
.pagehead__sub { margin-top: .6rem; font: 600 var(--t-md)/1.3 var(--f-head); color: var(--margin); }
.pagehead__desc { margin-top: 1rem; max-width: 66ch; font-size: var(--t-lg); line-height: 1.55; color: var(--ink-2); }
.pagehead__desc p + p { margin-top: .75rem; }
.pagehead__search { margin-top: 1.25rem; max-width: 560px; }

.crumbs ol { display: flex; flex-wrap: wrap; gap: .25rem; list-style: none; margin: 0 0 1rem; padding: 0; font: 500 var(--t-xs)/1.4 var(--f-head); color: var(--pencil); }
.crumbs li + li::before { content: "/"; margin-right: .3rem; color: var(--line); }
.crumbs a { color: var(--pencil); }

/* Paieška */
.search { display: flex; gap: .5rem; }
.search__input {
	flex: 1; min-width: 0; min-height: 52px; padding: .75rem 1rem;
	border: 2px solid var(--ink); border-radius: var(--r); background: var(--sheet); color: var(--ink);
	font: 500 var(--t-lg)/1 var(--f-head);
}
.search__input:focus { outline: none; box-shadow: 0 0 0 4px var(--marker); }
.search__btn {
	min-height: 52px; padding: 0 1.25rem; border: 0; border-radius: var(--r);
	background: var(--ink); color: var(--paper); font: 700 var(--t-md)/1 var(--f-head); cursor: pointer;
}
.search__btn:hover { background: var(--pen); color: #fff; }

/* ==========================================================================
   11. Straipsnis
   ========================================================================== */
.art__head {
	background-color: var(--paper);
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: var(--cell) var(--cell);
	padding-block: clamp(1.5rem, 4vw, 3rem) clamp(1.5rem, 4vw, 2.5rem);
}
.art__title { text-wrap: balance; font-size: clamp(2rem, 1.25rem + 2.5vw, 3.3rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 800; font-variation-settings: "opsz" 96; }
.art__dek { margin-top: 1rem; font-size: var(--t-lg); line-height: 1.5; color: var(--ink-2); }
.art__meta {
	display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin-top: 1.25rem; padding-top: 1rem;
	border-top: 1.5px solid var(--ink);
	font: 500 var(--t-sm)/1.3 var(--f-head); color: var(--pencil);
}
.art__meta .ico { width: 1em; height: 1em; margin-right: .3rem; vertical-align: -.12em; }
.art__author { color: var(--ink); font-weight: 700; }

.art__figure { margin: 0 auto clamp(1.5rem, 4vw, 2.5rem); }
.art__figure img { width: 100%; max-height: 640px; object-fit: cover; border-radius: 10px; }
.art__figure figcaption { margin-top: .6rem; font: 500 var(--t-xs)/1.4 var(--f-head); color: var(--pencil); }

.art__grid { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); padding-bottom: 3rem; }
@media (min-width: 1000px) {
	.art__grid { grid-template-columns: 12rem minmax(0, 1fr); gap: 0 2.5rem; }
	.art__aside { grid-column: 2; margin-top: 2.5rem; }
}
@media (min-width: 1200px) {
	.art__grid { grid-template-columns: 11.5rem minmax(0, 42rem) minmax(15rem, 1fr); }
	.art__aside { grid-column: 3; margin-top: 0; }
	.art__aside .rank { position: sticky; top: 1.5rem; }
	.art__aside .rank__item { padding: .85rem 0 .85rem 2.2rem; }
	.art__aside .rank__item::before { font-size: 1.6rem; top: .75rem; }
	.art__aside .rank__item a { font-size: var(--t-sm); }
}
.art__margin { min-width: 0; }
@media (min-width: 1000px) {
	.art__margin { border-right: 2px solid var(--margin); padding-right: 1.5rem; }
	.art__sticky { position: sticky; top: 1.5rem; display: grid; gap: 1.75rem; }
	.art__margin .mdate__d { font-size: 2.75rem; }
}
@media (max-width: 999px) { .art__margin .mdate { display: none; } }

.toc { font-family: var(--f-head); }
.toc__title { cursor: pointer; font: 700 var(--t-sm)/1.2 var(--f-head); color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: .5rem; }
.toc__title::-webkit-details-marker { display: none; }
.toc__title::after { content: "+"; font-weight: 700; color: var(--margin); }
.toc[open] .toc__title::after { content: "–"; }
.toc__list { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .1rem; }
.toc__item a {
	display: block; padding: .4rem 0 .4rem .7rem; border-left: 3px solid transparent;
	font-size: var(--t-xs); line-height: 1.35; color: var(--pencil); text-decoration: none;
}
.toc__item--h3 a { padding-left: 1.4rem; }
.toc__item a:hover { color: var(--ink); }
.toc__item a.is-active { color: var(--ink); font-weight: 650; border-left-color: var(--marker); background: linear-gradient(90deg, var(--marker-hl), transparent); }
@media (max-width: 999px) {
	.toc { border: 1.5px solid var(--ink); border-radius: 8px; padding: 1rem 1.1rem; background: var(--sheet); }
	.toc__item a { font-size: var(--t-sm); }
}

/* Teksto tipografija */
.prose { font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); line-height: 1.75; color: var(--ink); max-width: 44rem; }
.prose > * + * { margin-top: 1.25em; }
.prose > p:first-child { font-size: 1.12em; line-height: 1.65; }
.prose h2 {
	position: relative;
	margin-top: 2.2em; padding-top: .9em;
	font-size: clamp(1.5rem, 1.2rem + 1vw, 1.95rem); line-height: 1.15;
	border-top: 2px solid var(--ink);
}
.prose h3 { margin-top: 1.8em; font-size: clamp(1.2rem, 1.05rem + .5vw, 1.4rem); line-height: 1.25; }
.prose h4 { margin-top: 1.5em; font-size: 1.1rem; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .7em; }
.prose a { color: var(--pen); text-decoration-thickness: 1.5px; }
.prose a:hover { background: var(--marker-hl); color: var(--ink); }
.prose strong { font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .45em; }
.prose ul li::marker { color: var(--margin); }
.prose ol li::marker { font-family: var(--f-head); font-weight: 700; color: var(--margin); }
.prose blockquote {
	margin-inline: 0; padding: 1.1em 1.3em;
	background: var(--sheet); border-left: 4px solid var(--marker);
	border-radius: 0 8px 8px 0; font-style: italic; color: var(--ink-2);
}
.prose blockquote p + p { margin-top: .75em; }
.prose blockquote cite { display: block; margin-top: .75em; font: normal 600 var(--t-sm) var(--f-head); color: var(--pencil); }
.prose img, .prose figure { border-radius: 8px; }
.prose figure { margin-inline: 0; }
.prose figcaption, .prose .wp-element-caption { margin-top: .5em; font: 500 var(--t-xs)/1.45 var(--f-head); color: var(--pencil); text-align: left; }
.prose hr { border: 0; height: 2px; background: var(--line); margin-block: 2.5em; }
.prose table { width: 100%; border-collapse: collapse; font: 500 var(--t-sm)/1.45 var(--f-head); font-variant-numeric: tabular-nums; display: block; overflow-x: auto; }
.prose th, .prose td { padding: .65em .8em; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose thead th { border-bottom: 2px solid var(--ink); font-weight: 700; }
.prose tbody tr:nth-child(even) { background: var(--sheet); }
.prose code { font-size: .88em; background: var(--sheet); border: 1px solid var(--line); padding: .1em .35em; border-radius: 4px; }
.prose pre { overflow-x: auto; background: var(--night); color: #e9edf8; padding: 1em; border-radius: 8px; font-size: .9rem; }
.prose .alignwide { max-width: none; }
.prose .wp-block-image img { height: auto; }
.prose iframe { max-width: 100%; }

.pages { margin-top: 2rem; display: flex; gap: .5rem; font-family: var(--f-head); }

.tags { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 2.5rem 0 0; padding: 0; }
.tags a {
	display: inline-block; padding: .45rem .8rem; border-radius: 999px;
	background: var(--sheet); border: 1px solid var(--line);
	font: 600 var(--t-xs)/1 var(--f-head); color: var(--ink-2); text-decoration: none;
}
.tags a:hover { border-color: var(--ink); color: var(--ink); }

.share { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 2px solid var(--ink); }
.share__btn {
	display: inline-flex; align-items: center; gap: .45rem; min-height: 44px;
	padding: .55rem .9rem; border: 1.5px solid var(--line); border-radius: 999px; background: var(--sheet);
	font: 600 var(--t-sm)/1 var(--f-head); color: var(--ink); text-decoration: none; cursor: pointer;
}
.share__btn:hover { border-color: var(--ink); }
.share__btn--save { border-color: var(--ink); }
.share__btn--save[aria-pressed="true"] { background: var(--marker); color: #17224a; border-color: #17224a; }
.share__btn--save[aria-pressed="true"] .ico path { fill: currentColor; }

.about {
	display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 1rem; align-items: start;
	margin-top: 2rem; padding: 1.25rem; border-radius: 10px; background: var(--sheet); border: 1px solid var(--line);
}
.about__name { font: 700 var(--t-md)/1.2 var(--f-head); }
.about__text { margin-top: .35rem; font-size: var(--t-sm); line-height: 1.55; color: var(--ink-2); }

.pn { display: grid; gap: 1rem; margin-top: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.pn__link { display: grid; gap: .35rem; padding: 1rem 0; border-top: 2px solid var(--ink); text-decoration: none; color: var(--ink); }
.pn__link--next { text-align: right; }
.pn__dir { font: 600 var(--t-xs)/1 var(--f-head); color: var(--margin); }
.pn__t { font: 700 var(--t-md)/1.3 var(--f-head); }

.related {
	padding-block: clamp(2.5rem, 6vw, 4rem);
	background-color: var(--paper);
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: var(--cell) var(--cell);
	border-top: 2px solid var(--ink);
}
.related__grid { display: grid; gap: 1.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.related .card { background: var(--sheet); padding: .75rem .75rem 1rem; border-radius: 10px; border: 1px solid var(--line); }

/* Pasiūlymas skaityti toliau */
.nextread {
	position: fixed; z-index: 55; right: 1rem; bottom: 5.25rem; width: min(360px, calc(100vw - 2rem));
	padding: 1rem 1rem 1.1rem; background: var(--sheet); color: var(--ink);
	border: 2px solid var(--ink); border-radius: 12px; box-shadow: 6px 6px 0 var(--shadow);
}
.nextread[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .nextread.is-in { animation: uz-in .35s ease-out both; } }
.nextread__k { font: 700 var(--t-xs)/1 var(--f-head); color: var(--margin); margin-bottom: .7rem; }
.nextread__link { display: grid; grid-template-columns: 72px 1fr; gap: .85rem; align-items: center; text-decoration: none; color: var(--ink); }
.nextread__media { aspect-ratio: 1; border-radius: 6px; }
.nextread__t { font: 700 var(--t-sm)/1.3 var(--f-head); }
.nextread__link:hover .nextread__t { text-decoration: underline; }
.nextread__x { position: absolute; top: .4rem; right: .4rem; width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: none; color: var(--pencil); cursor: pointer; border-radius: 50%; }
.nextread__x:hover { background: var(--paper); color: var(--ink); }

/* ==========================================================================
   12. Dialogai (paieška, išsaugoti)
   ========================================================================== */
.dlg {
	width: min(640px, calc(100vw - 2rem)); padding: 1.5rem; margin-top: 12vh;
	border: 2px solid var(--ink); border-radius: 14px;
	background: var(--paper); color: var(--ink); box-shadow: 8px 8px 0 var(--shadow);
}
.dlg::backdrop { background: rgba(15, 22, 49, .55); backdrop-filter: blur(2px); }
.dlg__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.dlg__title { font-size: var(--t-xl); }
.dlg__close { width: 44px; height: 44px; display: grid; place-items: center; border: 1.5px solid var(--line); background: var(--sheet); border-radius: 50%; color: var(--ink); cursor: pointer; }
.dlg__close:hover { border-color: var(--ink); }
.dlg__hint { margin-top: 1rem; font: 500 var(--t-sm)/1.5 var(--f-head); color: var(--pencil); }
.dlg--side { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(420px, 100vw); border-radius: 0; border-width: 0 0 0 2px; box-shadow: none; overflow-y: auto; }

.saved { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.saved li { display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: start; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.saved a { font: 700 var(--t-md)/1.3 var(--f-head); color: var(--ink); text-decoration: none; }
.saved a:hover { text-decoration: underline; }
.saved button { border: 0; background: none; color: var(--pencil); font: 600 var(--t-xs)/1 var(--f-head); cursor: pointer; padding: .4rem; text-decoration: underline; }
.saved__empty { color: var(--pencil); font: 500 var(--t-sm)/1.55 var(--f-head); }
.saved__empty[hidden] { display: none; }

/* ==========================================================================
   13. Poraštė ir „Į viršų“
   ========================================================================== */
.foot {
	margin-top: clamp(2.5rem, 6vw, 4rem);
	background-color: var(--night); color: #c9d0e6;
	background-image:
		linear-gradient(var(--night-grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--night-grid) 1px, transparent 1px);
	background-size: var(--cell) var(--cell);
	padding-top: clamp(2.5rem, 5vw, 3.5rem);
	font-family: var(--f-head);
}
.related + .foot, .art + .foot { margin-top: 0; }
.foot a { color: #fff; text-decoration: none; }
.foot a:hover { text-decoration: underline; text-decoration-color: var(--marker); }
.foot__grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
@media (min-width: 960px) { .foot__grid { grid-template-columns: 1.4fr 1fr 1.2fr; } }
.foot__brand { display: flex; align-items: center; gap: .75rem; font: 800 1.4rem/1 var(--f-head); color: #fff; letter-spacing: -0.02em; }
.foot__brand svg { width: 40px; height: 40px; }
.foot__text { margin-top: 1rem; max-width: 42ch; font: 400 var(--t-sm)/1.6 var(--f-body); }
.foot__social { display: flex; gap: .5rem; margin-top: 1rem; }
.foot__social a { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--night-grid); border-radius: 50%; background: var(--night); }
.foot__h { font-size: var(--t-sm); color: var(--marker); margin-bottom: .9rem; font-weight: 700; letter-spacing: 0; }
.foot__h:not(:first-child) { margin-top: 1.75rem; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; font-size: var(--t-sm); }
.foot__n { color: #7f89ad; font-size: var(--t-xs); margin-left: .25rem; }
.foot__latest li { line-height: 1.35; }
.foot__base {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
	margin-top: 2.5rem; padding-block: 1.25rem 1.5rem; border-top: 1px solid var(--night-grid);
	font-size: var(--t-xs); color: #8f99bb;
}

.totop {
	position: fixed; right: 1rem; bottom: 1rem; z-index: 56;
	width: 56px; height: 56px; display: grid; place-items: center;
	border: 0; border-radius: 50%; padding: 0;
	background: var(--ink); color: var(--paper); cursor: pointer;
	box-shadow: 0 6px 18px rgba(15, 22, 49, .28);
}
@media (prefers-color-scheme: dark) { .totop { background: var(--marker); color: #17224a; } }
.totop[hidden] { display: none; }
.totop .ico { width: 22px; height: 22px; position: relative; z-index: 1; }
.totop__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.totop__ring circle { fill: none; stroke-width: 3; }
.totop__track { stroke: rgba(255, 255, 255, .15); }
.totop__bar { stroke: var(--marker); stroke-dasharray: 100; stroke-dashoffset: 100; stroke-linecap: round; }
@media (prefers-color-scheme: dark) { .totop__track { stroke: rgba(23, 34, 74, .15); } .totop__bar { stroke: #17224a; } }
.totop:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: no-preference) {
	.totop { transition: transform .2s; }
	.totop.is-in { animation: uz-in .3s ease-out both; }
}

/* ==========================================================================
   14. WP klasės
   ========================================================================== */
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.aligncenter { margin-inline: auto; }
.wp-caption-text, .gallery-caption { font: 500 var(--t-xs)/1.4 var(--f-head); color: var(--pencil); }
.sticky, .bypostauthor { }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media print {
	.masthead, .catnav, .foot, .totop, .nextread, .progress, .share, .art__aside, .related, .art__margin { display: none !important; }
	body { background: #fff; color: #000; }
	.art__grid { display: block; }
}
