/* ==========================================================================
   Paraštė – mkc.lt tema
   Idėja: sąsiuvinio lapas. Visa svetainė turi raudoną paraštės liniją;
   kairėje jos pusėje – mokytojo pastabos (skilčių pavadinimai, datos,
   turinio planas), dešinėje – tekstas. Fonas – vos matomi langeliai.
   ========================================================================== */

/* ---------- Šriftai (savame serveryje, be Google Fonts slapukų) ---------- */
@font-face {
	font-family: "Bitter";
	src: url("../fonts/bitter.woff") format("woff");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Bitter";
	src: url("../fonts/bitter-italic.woff") format("woff");
	font-weight: 100 900;
	font-style: italic;
	font-display: swap;
}
@font-face {
	font-family: "Source Sans 3";
	src: url("../fonts/sourcesans3.woff") format("woff");
	font-weight: 200 900;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Source Sans 3";
	src: url("../fonts/sourcesans3-italic.woff") format("woff");
	font-weight: 200 900;
	font-style: italic;
	font-display: swap;
}

/* ---------- Spalvos ir matmenys ---------- */
:root {
	--paper: #F6F9FD;
	--grid: #E6EDF6;
	--sheet: #FFFFFF;
	--rule: #CFDAEA;
	--ink: #1A2B5F;
	--ink-2: #3F4C78;
	--ink-3: #5F6A92;
	--red: #C81E2B;
	--marker: #FFE45C;
	--marker-soft: rgba(255, 228, 92, .62);
	--on-ink: #FFFFFF;

	--f-head: "Bitter", "Rockwell", "Roboto Slab", Georgia, serif;
	--f-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

	--wrap: 1320px;
	--pad: clamp(1rem, 3vw, 2rem);
	--m: 172px;          /* paraštės plotis */
	--gut: 3rem;         /* tarpas tarp paraštės ir teksto */
	--cell: 24px;        /* langelio dydis */
	--header-h: 76px;
	--radius: 5px;

	color-scheme: light;
}

:root[data-theme="dark"] {
	--paper: #0E1530;
	--grid: #172150;
	--sheet: #141D40;
	--rule: #2A3770;
	--ink: #E8EDFB;
	--ink-2: #BAC4E6;
	--ink-3: #929DC7;
	--red: #FF6F78;
	--marker: #F0D545;
	--marker-soft: rgba(240, 213, 69, .3);
	--on-ink: #0E1530;
	color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--paper: #0E1530;
		--grid: #172150;
		--sheet: #141D40;
		--rule: #2A3770;
		--ink: #E8EDFB;
		--ink-2: #BAC4E6;
		--ink-3: #929DC7;
		--red: #FF6F78;
		--marker: #F0D545;
		--marker-soft: rgba(240, 213, 69, .3);
		--on-ink: #0E1530;
		color-scheme: dark;
	}
}

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header-h) + 1rem);
}
@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

body {
	margin: 0;
	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);
	background-position: -1px -1px;
	color: var(--ink);
	font-family: var(--f-body);
	font-size: 1.125rem;
	line-height: 1.6;
	font-kerning: normal;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	overflow-wrap: break-word;
}

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

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

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

::selection { background: var(--marker); color: #1A2B5F; }

h1, h2, h3, h4 {
	font-family: var(--f-head);
	color: var(--ink);
	line-height: 1.15;
	margin: 0;
	text-wrap: balance;
}

p { margin: 0; }

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	word-wrap: normal !important;
}

.skip-link {
	position: absolute;
	left: 1rem;
	top: -100px;
	z-index: 1000;
	background: var(--ink);
	color: var(--on-ink);
	padding: .75rem 1.25rem;
	font-weight: 700;
	border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; color: var(--on-ink); }

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin-inline: auto;
	padding-inline: var(--pad);
}

/* ---------- Mygtukai ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	min-height: 46px;
	padding: .55rem 1.25rem;
	border: 2px solid var(--ink);
	border-radius: var(--radius);
	background: transparent;
	color: var(--ink);
	font: 600 1rem/1.2 var(--f-body);
	text-decoration: none;
	cursor: pointer;
}
.btn:hover { background: var(--marker); color: #1A2B5F; border-color: #1A2B5F; }
.btn--ink { background: var(--ink); color: var(--on-ink); }
.btn--ink:hover { background: var(--marker); color: #1A2B5F; }
.btn--line { width: 100%; }

.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ink);
	cursor: pointer;
}
.icon-btn:hover { background: var(--marker-soft); }

/* ---------- Skaitymo juosta ---------- */
.read-progress {
	position: fixed;
	inset: 0 0 auto 0;
	height: 4px;
	z-index: 200;
	pointer-events: none;
}
.read-progress span {
	display: block;
	height: 100%;
	background: var(--red);
	transform-origin: 0 50%;
	transform: scaleX(0);
}

/* ---------- Viršutinė juosta ---------- */
.topbar {
	background: #1A2B5F;
	color: #DDE4F7;
	font-size: .875rem;
}
:root[data-theme="dark"] .topbar { background: #0A1026; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .topbar { background: #0A1026; } }

.topbar-in {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 38px;
}
.today { white-space: nowrap; }
.today::first-letter { text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 1.25rem; }
.topbar-link {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .35rem 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: none;
	cursor: pointer;
}
.topbar-link:hover { color: #FFE45C; }
.theme-toggle .tt-light { display: none; }
:root[data-theme="dark"] .theme-toggle .tt-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .tt-light { display: inline-flex; align-items: center; gap: .4rem; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .theme-toggle .tt-dark { display: none; }
	:root:not([data-theme="light"]) .theme-toggle .tt-light { display: inline-flex; align-items: center; gap: .4rem; }
}
.tt-dark { display: inline-flex; align-items: center; gap: .4rem; }

/* ---------- Antraštė ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: color-mix(in srgb, var(--paper) 92%, transparent);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--rule);
}
.masthead {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	min-height: var(--header-h);
}
.brand-wrap { margin: 0; font: inherit; flex: 0 0 auto; }
.brand {
	display: inline-flex;
	align-items: center;
	gap: .75rem;
	text-decoration: none;
	color: var(--ink);
}
.brand:hover { color: var(--ink); }
.logo-mark { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 11px; }
:root[data-theme="dark"] .site-header .logo-mark rect:first-child,
:root[data-theme="dark"] .author-box .logo-mark rect:first-child { fill: #2A3C7C; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .site-header .logo-mark rect:first-child,
	:root:not([data-theme="light"]) .author-box .logo-mark rect:first-child { fill: #2A3C7C; }
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font: 800 1.3rem/1.05 var(--f-head); letter-spacing: -.01em; }
.brand-sub { font: italic 500 1rem/1.2 var(--f-head); color: var(--red); }

.primary-nav { margin-left: auto; }
.nav-list {
	display: flex;
	flex-wrap: wrap;
	gap: .25rem 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.nav-list a {
	display: block;
	padding: .4rem 0;
	font-weight: 600;
	font-size: 1.0625rem;
	color: var(--ink-2);
	text-decoration: none;
	background: linear-gradient(transparent 62%, var(--marker) 62%, var(--marker) 92%, transparent 92%) no-repeat 0 0 / 0 100%;
}
.nav-list a:hover,
.nav-list .current-menu-item > a,
.nav-list .current-menu-ancestor > a,
.nav-list .current-post-ancestor > a,
.nav-list .current-category-ancestor > a { color: var(--ink); background-size: 100% 100%; }
.nav-list .sub-menu { display: none; }
.nav-extra { display: none; }

.masthead-actions { display: flex; align-items: center; gap: .25rem; }
.nav-toggle { display: none; }
.nav-toggle .nt-close { display: none; }
.nav-toggle[aria-expanded="true"] .nt-open { display: none; }
.nav-toggle[aria-expanded="true"] .nt-close { display: inline; }

.search-panel { border-top: 1px solid var(--rule); padding: 1rem 0 1.25rem; }
.search-panel[hidden] { display: none; }

.search-form {
	display: flex;
	align-items: center;
	gap: .5rem;
	max-width: 760px;
	padding: .3rem .3rem .3rem .9rem;
	border: 2px solid var(--ink);
	border-radius: var(--radius);
	background: var(--sheet);
}
.search-form > .icon { color: var(--ink-3); flex: 0 0 auto; }
.search-field {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 42px;
	border: 0;
	background: transparent;
	color: var(--ink);
	font: 1.125rem var(--f-body);
}
.search-field:focus { outline: none; }
.search-form:focus-within { outline: 3px solid var(--red); outline-offset: 2px; }
.search-field::placeholder { color: var(--ink-3); }

/* ---------- Sąsiuvinio lapas: paraštė + tekstas ---------- */
.site-main { padding-bottom: 4rem; }

.sheet {
	position: relative;
	padding-top: 2rem;
}
.sheet::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: -4rem;
	left: calc(var(--pad) + var(--m) + var(--gut) / 2 - 1px);
	width: 2px;
	background: var(--red);
	opacity: .85;
	pointer-events: none;
}

.row {
	display: grid;
	grid-template-columns: var(--m) minmax(0, 1fr);
	column-gap: var(--gut);
	padding-block: 2.5rem;
}
.row + .row { border-top: 1px solid var(--rule); }
.row--crumbs { padding-block: 0 1rem; }
.row--crumbs + .row { border-top: 0; padding-top: 0; }
.row--head + .row--feed { border-top: 0; padding-top: 0; }
.row > .m { position: relative; text-align: right; }
.row > .b { min-width: 0; }

/* Paraštės užrašai – raudonas mokytojo tušinukas */
.margin-note {
	position: sticky;
	top: calc(var(--header-h) + 1.25rem);
	margin: 0;
	font: italic 500 1.125rem/1.25 var(--f-head);
	color: var(--red);
	text-wrap: balance;
}
.margin-note a { text-decoration: none; }
.m-link {
	display: inline-block;
	margin-top: .5rem;
	font-size: .9375rem;
	font-weight: 600;
	color: var(--ink-2);
	text-decoration: underline;
	text-decoration-color: var(--rule);
}
.m-link:hover { text-decoration-color: var(--red); }

/* Data paraštėje */
.margin-date {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	line-height: 1;
	color: var(--ink);
}
.md-d { font: 800 2.25rem/1 var(--f-head); letter-spacing: -.02em; }
.md-m { font: italic 500 1.0625rem/1.2 var(--f-head); color: var(--red); margin-top: .2rem; }
.md-y { font-size: .875rem; color: var(--ink-3); margin-top: .2rem; }

/* ---------- Bendri elementai ---------- */
.cat {
	display: inline-block;
	margin-bottom: .45rem;
	padding: 0 .15em;
	font-size: .9375rem;
	font-weight: 700;
	color: var(--ink);
	text-decoration: none;
	background: linear-gradient(100deg, transparent 2%, var(--marker-soft) 4%, var(--marker-soft) 96%, transparent 98%) 0 62% / 100% 58% no-repeat;
}
.cat:hover { color: var(--ink); background-color: transparent; background-size: 100% 100%; }

.meta, .small-meta, .entry-meta, .card-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .25rem .75rem;
	font-size: .9375rem;
	color: var(--ink-3);
}
.meta-sep { width: 1px; height: .9em; background: var(--rule); }

/* Antraštės su žymeklio efektu */
.entry-title a, .card-title a, .lead-title a, .lead-list-title a, .next-title a, .rank-title, .tt-latest {
	text-decoration: none;
	background-image: linear-gradient(var(--marker-soft), var(--marker-soft));
	background-repeat: no-repeat;
	background-position: 0 88%;
	background-size: 0 .42em;
	transition: background-size .35s ease;
	box-decoration-break: clone;
	-webkit-box-decoration-break: clone;
}
.entry-title a:hover, .card-title a:hover, .lead-title a:hover, .lead-list-title a:hover, .next-title a:hover,
a:hover > .rank-title, .tt-latest:hover { background-size: 100% .42em; color: var(--ink); }

.post-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: var(--radius);
	background: var(--grid);
}
.post-img--ph {
	display: grid;
	place-items: center;
	aspect-ratio: inherit;
	background-color: hsl(var(--ph-h) 55% 92%);
	background-image:
		linear-gradient(90deg, transparent 18%, var(--red) 18%, var(--red) calc(18% + 2px), transparent calc(18% + 2px)),
		linear-gradient(hsl(var(--ph-h) 40% 82%) 1px, transparent 1px),
		linear-gradient(90deg, hsl(var(--ph-h) 40% 82%) 1px, transparent 1px);
	background-size: 100% 100%, 16px 16px, 16px 16px;
	color: hsl(var(--ph-h) 45% 30%);
	font: 800 clamp(2rem, 6vw, 4.5rem)/1 var(--f-head);
}
:root[data-theme="dark"] .post-img--ph { background-color: hsl(var(--ph-h) 35% 20%); color: hsl(var(--ph-h) 60% 82%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .post-img--ph { background-color: hsl(var(--ph-h) 35% 20%); color: hsl(var(--ph-h) 60% 82%); } }

.mini-title {
	font: 700 1.125rem/1.3 var(--f-head);
	color: var(--ink);
	margin-bottom: 1rem;
	padding-bottom: .5rem;
	border-bottom: 2px solid var(--ink);
}

.page-title {
	font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
	font-weight: 800;
	letter-spacing: -.015em;
}
.page-num { font-weight: 500; color: var(--ink-3); font-size: .55em; }
.lede { font-size: 1.25rem; color: var(--ink-2); max-width: 60ch; margin-top: 1rem; }

.empty-note { padding: 1.5rem; border: 2px dashed var(--rule); border-radius: var(--radius); color: var(--ink-2); margin-bottom: 2rem; }

.chip-list {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	list-style: none;
	margin: 1.25rem 0 0;
	padding: 0;
}
.chip-list a {
	display: inline-block;
	padding: .35rem .85rem;
	border: 1.5px solid var(--ink);
	border-radius: 999px;
	font-weight: 600;
	font-size: .9375rem;
	text-decoration: none;
	background: var(--sheet);
}
.chip-list a:hover { background: var(--marker); color: #1A2B5F; border-color: #1A2B5F; }

/* ---------- Pagrindinis: pagrindinis straipsnis ---------- */
.lead-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
	gap: 2.5rem;
	align-items: start;
}
.lead-img { display: block; aspect-ratio: 16 / 9; margin-bottom: 1.25rem; }
.lead-title {
	font-size: clamp(1.9rem, 1.1rem + 2.3vw, 2.9rem);
	font-weight: 800;
	line-height: 1.06;
	letter-spacing: -.02em;
	margin-bottom: 1rem;
}
.lead-title a { background-image: none; }
.lead-title .swipe {
	background-image: linear-gradient(var(--marker-soft), var(--marker-soft));
	background-repeat: no-repeat;
	background-position: 0 90%;
	background-size: 100% .34em;
	box-decoration-break: clone;
	-webkit-box-decoration-break: clone;
}
@media (prefers-reduced-motion: no-preference) {
	.js .lead-title .swipe { animation: swipe 1.1s .35s cubic-bezier(.65, 0, .35, 1) both; }
}
@keyframes swipe {
	from { background-size: 0 .34em; }
	to { background-size: 100% .34em; }
}
.lead-excerpt { font-size: 1.25rem; line-height: 1.5; color: var(--ink-2); max-width: 62ch; margin-bottom: 1rem; }

.lead-side { border-left: 1px solid var(--rule); padding-left: 2rem; }
.lead-list { list-style: none; margin: 0; padding: 0; }
.lead-list li { padding: 1rem 0; border-bottom: 1px dashed var(--rule); }
.lead-list li:first-child { padding-top: 0; }
.lead-list li:last-child { border-bottom: 0; }
.lead-list-title { font-size: 1.25rem; font-weight: 700; line-height: 1.25; margin-bottom: .4rem; }

/* ---------- Temų tvarkaraštis ---------- */
.timetable {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 1px;
	list-style: none;
	margin: 0;
	padding: 0;
	background: var(--rule);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	overflow: hidden;
}
.tt-cell {
	display: flex;
	flex-direction: column;
	gap: .25rem;
	padding: 1.1rem 1.25rem 1.25rem;
	background: var(--sheet);
}
.tt-name {
	font: 700 1.25rem/1.2 var(--f-head);
	text-decoration: none;
}
.tt-name::after { content: ""; display: block; width: 2rem; height: 3px; margin-top: .45rem; background: var(--red); }
.tt-count { font-size: .875rem; color: var(--ink-3); }
.tt-latest {
	margin-top: .4rem;
	font-size: 1rem;
	line-height: 1.35;
	color: var(--ink-2);
}

/* ---------- Srautas + šoninė juosta ---------- */
.feed-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 3rem;
	align-items: start;
}
.feed { display: flex; flex-direction: column; }
.feed-title { margin-bottom: 1.5rem; }
.feed-title + .feed .entry:first-child .margin-date { top: .1rem; }

.entry {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 180px;
	gap: 1.5rem;
	padding: 1.5rem 0;
	border-bottom: 1px dashed var(--rule);
}
.entry:first-child { padding-top: 0; }
.entry .margin-date {
	position: absolute;
	top: 1.6rem;
	right: calc(100% + var(--gut));
	width: var(--m);
}
.entry:first-child .margin-date { top: .1rem; }
.entry-title { font-size: 1.5rem; font-weight: 700; line-height: 1.2; margin-bottom: .5rem; }
.entry-excerpt {
	color: var(--ink-2);
	font-size: 1.0625rem;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-bottom: .5rem;
}
.entry-thumb { display: block; aspect-ratio: 4 / 3; align-self: start; }
.entry--page { grid-template-columns: 1fr; }
.entry.is-new { animation: fadein .5s ease both; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.load-more-wrap { margin-top: 2rem; }
.load-more-wrap .btn { width: 100%; border-style: dashed; min-height: 54px; font-size: 1.0625rem; }
.load-more-wrap .btn[aria-busy="true"] { opacity: .65; pointer-events: none; }
.js .has-load-more .pager { display: none; }

.pager { margin-top: 2rem; }
.pager .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.pager .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 44px;
	height: 44px;
	padding: 0 .75rem;
	border: 1.5px solid var(--rule);
	border-radius: var(--radius);
	font-weight: 600;
	text-decoration: none;
	background: var(--sheet);
}
.pager .page-numbers.current { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.pager a.page-numbers:hover { border-color: var(--ink); background: var(--marker); color: #1A2B5F; }
.pager .dots { border: 0; background: none; }

/* Šoninė juosta */
.sidebar { display: flex; flex-direction: column; gap: 2.5rem; }
.side-block { min-width: 0; }
.side-title {
	font: 700 1.125rem/1.3 var(--f-head);
	padding-bottom: .5rem;
	margin-bottom: .75rem;
	border-bottom: 2px solid var(--ink);
}
.rank { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.rank li { counter-increment: rank; border-bottom: 1px dashed var(--rule); }
.rank li:last-child { border-bottom: 0; }
.rank a {
	display: grid;
	grid-template-columns: 2.1rem 1fr;
	grid-template-rows: auto auto;
	column-gap: .25rem;
	padding: .8rem 0;
	text-decoration: none;
}
.rank a::before {
	content: counter(rank);
	grid-row: 1 / span 2;
	font: 800 1.6rem/1 var(--f-head);
	color: var(--red);
}
.rank-title { font: 600 1.0625rem/1.3 var(--f-body); color: var(--ink); justify-self: start; }
.rank-meta { font-size: .875rem; color: var(--ink-3); margin-top: .2rem; }

.topic-list { list-style: none; margin: 0; padding: 0; }
.topic-list a {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: .5rem 0;
	border-bottom: 1px dashed var(--rule);
	text-decoration: none;
	font-weight: 600;
}
.topic-list a:hover span:first-child { background: var(--marker-soft); }
.topic-n { color: var(--ink-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.side-random p { color: var(--ink-2); font-size: 1rem; margin-bottom: 1rem; }

/* ---------- Kortelės ---------- */
.card { display: flex; flex-direction: column; gap: .9rem; min-width: 0; }
.card-img { display: block; aspect-ratio: 3 / 2; }
.card-title { font-size: 1.1875rem; font-weight: 700; line-height: 1.25; margin-bottom: .45rem; }
.card--big .card-title { font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem); font-weight: 800; letter-spacing: -.01em; }
.card-excerpt { color: var(--ink-2); margin-bottom: .6rem; }

.card-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 2rem;
}
.card-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.cat-block {
	display: grid;
	grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
	gap: 2.5rem;
	align-items: start;
}
.cat-block-list { display: flex; flex-direction: column; gap: 0; }
.cat-block-list .card {
	display: grid;
	grid-template-columns: 120px minmax(0, 1fr);
	gap: 1rem;
	padding: 1rem 0;
	border-bottom: 1px dashed var(--rule);
}
.cat-block-list .card:first-child { padding-top: 0; }
.cat-block-list .card:last-child { border-bottom: 0; }
.cat-block-list .card-img { aspect-ratio: 1; }
.cat-block-list .card-title { font-size: 1.125rem; }

/* ---------- Straipsnis ---------- */
.crumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: .25rem;
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: .9375rem;
	color: var(--ink-3);
}
.crumbs li + li::before { content: "/"; margin-right: .3rem; color: var(--rule); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-decoration-color: var(--red); }
.crumbs [aria-current] {
	display: inline-block;
	max-width: 42ch;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	vertical-align: bottom;
}

.article-margin { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.margin-read { font-size: .9375rem; color: var(--ink-3); }

.toc--side {
	position: sticky;
	top: calc(var(--header-h) + 1.5rem);
	margin-top: 2rem;
	max-height: calc(100vh - var(--header-h) - 3rem);
	overflow: auto;
	text-align: right;
	scrollbar-width: thin;
}
.toc--side .margin-note { position: static; margin-bottom: .75rem; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc--side li { margin: 0; }
.toc--side a {
	display: block;
	padding: .35rem 0;
	font-size: .9375rem;
	line-height: 1.3;
	color: var(--ink-3);
	text-decoration: none;
}
.toc--side .toc-l3 a { font-size: .875rem; padding-right: .75rem; }
.toc--side a:hover { color: var(--ink); }
.toc--side a.is-active { color: var(--ink); font-weight: 700; }
.toc--side a.is-active::after { content: ""; display: inline-block; width: .5rem; height: .5rem; margin-left: .4rem; border-radius: 50%; background: var(--red); vertical-align: middle; }

.toc--inline {
	display: none;
	margin: 0 0 2rem;
	border: 2px solid var(--ink);
	border-radius: var(--radius);
	background: var(--sheet);
}
.toc--inline summary {
	padding: .9rem 1.1rem;
	font: 700 1.0625rem/1.3 var(--f-head);
	cursor: pointer;
}
.toc-count { color: var(--ink-3); font-weight: 400; }
.toc--inline ol { padding: 0 1.1rem 1rem 2.4rem; list-style: decimal; }
.toc--inline .toc-l3 { list-style: circle; margin-left: 1rem; }
.toc--inline li { padding: .2rem 0; }

.article-head { max-width: 880px; margin-bottom: 2rem; }
.article-title {
	font-size: clamp(2.1rem, 1.3rem + 2.8vw, 3.6rem);
	font-weight: 800;
	line-height: 1.06;
	letter-spacing: -.02em;
	margin-bottom: 1rem;
}
.article-dek { font-size: 1.375rem; line-height: 1.45; color: var(--ink-2); margin-bottom: 1.25rem; max-width: 60ch; }
.article-meta {
	display: flex;
	flex-wrap: wrap;
	gap: .35rem 1.5rem;
	font-size: .9375rem;
	color: var(--ink-3);
}
.article-meta time { color: var(--ink-2); font-weight: 600; }
.am-author { color: var(--ink); font-weight: 600; }
.am-read { display: none; }

.article-hero { margin: 0 0 2.5rem; }
.article-hero img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: var(--radius); }
.article-hero figcaption { font-size: .9375rem; color: var(--ink-3); margin-top: .5rem; }

.article-grid {
	display: grid;
	grid-template-columns: minmax(0, 720px) minmax(0, 300px);
	justify-content: space-between;
	gap: 3rem;
	align-items: start;
}

/* Straipsnio tekstas */
.entry-content {
	font-size: 1.1875rem;
	line-height: 1.7;
	color: var(--ink);
}
.entry-content > * { margin-top: 0; margin-bottom: 1.25em; }
.entry-content h2 {
	font-size: clamp(1.55rem, 1.25rem + 1vw, 1.95rem);
	font-weight: 800;
	letter-spacing: -.01em;
	margin-top: 2em;
	margin-bottom: .6em;
}
.entry-content h3 { font-size: 1.375rem; font-weight: 700; margin-top: 1.7em; margin-bottom: .5em; }
.entry-content h4 { font-size: 1.1875rem; font-weight: 700; margin-top: 1.5em; margin-bottom: .4em; }
.entry-content a { color: var(--ink); font-weight: 600; }
.entry-content a:hover { background: var(--marker-soft); color: var(--ink); }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin-bottom: .45em; }
.entry-content li::marker { color: var(--red); font-weight: 700; }
.entry-content strong { font-weight: 700; }
.entry-content img { border-radius: var(--radius); height: auto; }
.entry-content figure { margin-inline: 0; }
.entry-content figcaption, .entry-content .wp-element-caption { font-size: .9375rem; color: var(--ink-3); margin-top: .5rem; }
.entry-content blockquote {
	margin-inline: 0;
	padding: .25rem 0 .25rem 1.5rem;
	border-left: 4px solid var(--marker);
	font: italic 500 1.3125rem/1.55 var(--f-head);
	color: var(--ink-2);
}
.entry-content blockquote cite { display: block; margin-top: .5rem; font: normal 600 .9375rem var(--f-body); color: var(--ink-3); }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 1rem; background: var(--sheet); }
.entry-content th, .entry-content td { padding: .6rem .75rem; border: 1px solid var(--rule); text-align: left; vertical-align: top; }
.entry-content th { background: var(--grid); font-weight: 700; }
.entry-content .wp-block-table { overflow-x: auto; }
.entry-content hr { border: 0; border-top: 2px dashed var(--rule); margin: 2.5em 0; }
.entry-content code { font-size: .9em; background: var(--grid); padding: .1em .35em; border-radius: 3px; }
.entry-content pre { overflow-x: auto; background: var(--sheet); border: 1px solid var(--rule); padding: 1rem; border-radius: var(--radius); font-size: .9375rem; }
.entry-content iframe { max-width: 100%; }
.entry-content .alignleft { float: left; margin: .3em 1.5em 1em 0; max-width: 50%; }
.entry-content .alignright { float: right; margin: .3em 0 1em 1.5em; max-width: 50%; }
.entry-content .aligncenter { margin-inline: auto; }
.entry-content::after { content: ""; display: table; clear: both; }
.entry-content mark, .entry-content .has-marker-background-color { background: var(--marker); color: #1A2B5F; }

.read-also {
	display: block;
	margin: 2rem 0;
	padding: 1.1rem 1.25rem;
	border-left: 4px solid var(--red);
	background: var(--sheet);
	font: 700 1.1875rem/1.35 var(--f-head);
}
.read-also-label { display: block; font: italic 500 1rem var(--f-head); color: var(--red); margin-bottom: .25rem; }
.entry-content .read-also a { font-weight: 700; text-decoration: none; }
.entry-content .read-also a:hover { background: var(--marker-soft); }

.page-links { display: flex; gap: .5rem; align-items: center; margin: 2rem 0; font-weight: 600; }
.page-links a, .page-links > span:not(:first-child) { padding: .25rem .65rem; border: 1.5px solid var(--rule); border-radius: var(--radius); text-decoration: none; }

.article-foot { margin-top: 3rem; display: flex; flex-direction: column; gap: 2rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: .5rem 1rem; list-style: none; margin: 0; padding: 0; }
.tag-list a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.tag-list a:hover { color: var(--ink); background: var(--marker-soft); }

.share { padding: 1.5rem 0; border-block: 1px dashed var(--rule); }
.share-label { font: italic 500 1.0625rem var(--f-head); color: var(--red); margin-bottom: .75rem; }
.share-btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.share-btn {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	min-height: 44px;
	padding: 0 1rem;
	border: 1.5px solid var(--ink);
	border-radius: 999px;
	background: var(--sheet);
	color: var(--ink);
	font: 600 1rem var(--f-body);
	text-decoration: none;
	cursor: pointer;
}
.share-btn--icon { width: 44px; padding: 0; justify-content: center; }
.share-btn:hover { background: var(--marker); color: #1A2B5F; border-color: #1A2B5F; }

.author-box {
	display: grid;
	grid-template-columns: 56px 1fr;
	gap: 1rem;
	align-items: start;
}
.author-box .logo-mark { width: 56px; height: 56px; }
.author-name { font: 700 1.125rem var(--f-head); margin-bottom: .25rem; }
.author-bio { color: var(--ink-2); font-size: 1rem; }

/* Kitas straipsnis */
.next-read {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
	gap: 2.5rem;
	align-items: center;
	padding: 1.5rem;
	border: 2px solid var(--ink);
	border-radius: var(--radius);
	background: var(--sheet);
}
.next-img { display: block; aspect-ratio: 16 / 10; }
.next-title { font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2.1rem); font-weight: 800; line-height: 1.12; margin-bottom: .75rem; }
.next-excerpt { color: var(--ink-2); margin-bottom: 1.25rem; }

/* Archyvai */
.archive-head { max-width: 900px; }
.archive-count { margin-top: .5rem; color: var(--ink-3); font-weight: 600; }
.archive-desc { margin-top: 1rem; font-size: 1.1875rem; color: var(--ink-2); max-width: 68ch; }
.archive-desc p + p { margin-top: .75em; }
.search-inline { margin: 1.5rem 0; }
.suggestions .mini-title { margin-top: 2.5rem; }
.suggestions .mini-title:first-child { margin-top: 0; }
.suggestions .chip-list { margin-top: 0; }
.row--404 .btn { margin-top: .5rem; }

/* ---------- Poraštė ---------- */
.site-footer {
	background: #1A2B5F;
	color: #DDE4F7;
	padding: 3.5rem 0 1.5rem;
	font-size: 1rem;
}
:root[data-theme="dark"] .site-footer { background: #0A1026; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-footer { background: #0A1026; } }
.site-footer a { color: #FFFFFF; text-decoration: none; }
.site-footer a:hover { color: #FFE45C; }
.footer-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
	gap: 3rem;
}
.brand--footer { color: #FFFFFF; margin-bottom: 1rem; }
.brand--footer:hover { color: #FFFFFF; }
.brand--footer .brand-name { font-size: 1.2rem; }
.brand--footer .logo-mark rect:first-child { fill: #FFFFFF; fill-opacity: .08; }
.footer-about p { max-width: 46ch; color: #C3CCEA; }
.footer-title { font: italic 500 1.125rem var(--f-head); color: #FF8A92; margin-bottom: .75rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { padding: .3rem 0; }
.footer-random { display: inline-flex; align-items: center; gap: .4rem; }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .15); color: #A9B4DA; font-size: .9375rem; }

/* ---------- Mygtukas „į viršų“ (su skaitymo progreso žiedu) ---------- */
.to-top {
	position: fixed;
	right: clamp(1rem, 3vw, 2rem);
	bottom: clamp(1rem, 3vw, 2rem);
	z-index: 90;
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #1A2B5F;
	color: #FFFFFF;
	box-shadow: 0 6px 18px rgba(26, 43, 95, .28);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: #FFE45C; }
.to-top .icon { position: relative; }
.to-top-ring { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); transform: rotate(-90deg); }
.to-top-ring circle {
	fill: none;
	stroke: #FF6F78;
	stroke-width: 3;
	stroke-dasharray: 100;
	stroke-dashoffset: 100;
}
:root[data-theme="dark"] .to-top { background: #E8EDFB; color: #0E1530; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .to-top { background: #E8EDFB; color: #0E1530; } }

/* ---------- Valdikliai (jei naudojami) ---------- */
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: .4rem 0; border-bottom: 1px dashed var(--rule); }

/* ==========================================================================
   Prisitaikymas prie ekrano
   ========================================================================== */
@media (max-width: 1240px) {
	:root { --m: 132px; --gut: 2.5rem; }
	.feed-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 2.5rem; }
	.article-grid { grid-template-columns: minmax(0, 1fr); }
	.article-grid .sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; margin-top: 1rem; }
	.article-main { max-width: 760px; }
	.toc--side { display: none; }
	.toc--inline { display: block; }
}

@media (max-width: 1080px) {
	.nav-list { gap: .25rem 1.1rem; }
	.lead-grid { grid-template-columns: minmax(0, 1fr); }
	.lead-side { border-left: 0; padding-left: 0; }
	.lead-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
	.lead-list li:first-child { padding-top: 1rem; }
	.lead-list li { border-bottom: 1px dashed var(--rule); }
	.feed-layout { grid-template-columns: minmax(0, 1fr); }
	.feed-layout > .sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
	.cat-block { grid-template-columns: minmax(0, 1fr); }
	.card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.card-grid > .card:nth-child(3) { display: none; }
}

/* Planšetės ir telefonai: meniu išskleidžiamas */
@media (max-width: 960px) {
	.nav-toggle { display: inline-grid; }
	.primary-nav {
		position: absolute;
		inset: 100% 0 auto 0;
		margin: 0;
		padding: 1rem var(--pad) 1.5rem;
		background: var(--paper);
		border-bottom: 2px solid var(--ink);
		box-shadow: 0 18px 30px rgba(14, 21, 48, .15);
		max-height: calc(100vh - var(--header-h));
		overflow-y: auto;
	}
	.js .primary-nav:not(.is-open) { display: none; }
	.nav-list { flex-direction: column; gap: 0; }
	.nav-list a { padding: .8rem 0; font-size: 1.1875rem; border-bottom: 1px dashed var(--rule); background: none; }
	.nav-list .current-menu-item > a { color: var(--red); }
	.nav-list .sub-menu { display: block; list-style: none; padding-left: 1rem; }
	.nav-extra { display: block; margin-top: 1rem; }
	.nav-random { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; text-decoration: none; }
	.masthead-actions { margin-left: auto; }
}

/* Telefonai: paraštė virsta siaura raudona linija kairėje */
@media (max-width: 760px) {
	:root { --m: 0px; --gut: 0px; --header-h: 64px; }
	body { font-size: 1.0625rem; }
	.topbar-link .lbl {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
	.topbar-link { min-width: 40px; min-height: 38px; justify-content: center; }
	.logo-mark { width: 38px; height: 38px; }
	.brand-name { font-size: 1.1rem; }
	.brand-sub { font-size: .9rem; }

	.sheet { padding-left: calc(var(--pad) + 1rem); padding-top: 1.25rem; }
	.sheet::before { left: calc(var(--pad) - 2px); bottom: 0; }

	.row { display: block; padding-block: 2rem; }
	.row > .m { text-align: left; margin-bottom: 1rem; }
	.row > .m:empty { display: none; }
	.margin-note { position: static; font-size: 1.1875rem; }
	.m-link { margin-top: .25rem; }

	.entry { grid-template-columns: minmax(0, 1fr) 96px; gap: 1rem; padding: 1.25rem 0; }
	.entry .margin-date {
		position: static;
		width: auto;
		grid-column: 1 / -1;
		flex-direction: row;
		align-items: baseline;
		gap: .35rem;
		margin-bottom: -.5rem;
	}
	.md-d { font-size: 1.125rem; }
	.md-m, .md-y { font-size: 1rem; margin: 0; }
	.entry-title { font-size: 1.25rem; }
	.entry-excerpt { -webkit-line-clamp: 2; font-size: 1rem; }

	.article-margin { flex-direction: row; align-items: baseline; gap: .75rem; }
	.article-margin .margin-date { flex-direction: row; align-items: baseline; gap: .35rem; }
	.margin-read { display: none; }
	.am-read { display: inline; }
	.entry-content { font-size: 1.125rem; }
	.entry-content .alignleft, .entry-content .alignright { float: none; margin: 0 0 1.25em; max-width: 100%; }

	.lead-excerpt { font-size: 1.125rem; }
	.lead-list { grid-template-columns: minmax(0, 1fr); }
	.timetable { grid-template-columns: minmax(0, 1fr); }
	.feed-layout > .sidebar, .article-grid .sidebar { grid-template-columns: minmax(0, 1fr); }
	.card-grid, .card-grid--2 { grid-template-columns: minmax(0, 1fr); }
	.card-grid > .card:nth-child(3) { display: flex; }
	.cat-block-list .card { grid-template-columns: 92px minmax(0, 1fr); }
	.next-read { grid-template-columns: minmax(0, 1fr); padding: 1rem; gap: 1.25rem; }
	.footer-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
	.crumbs [aria-current] { max-width: 24ch; }
}

@media (max-width: 420px) {
	.topbar .today { font-size: .8125rem; }
	.share-btn:not(.share-btn--icon) span { font-size: .9375rem; }
}

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

/* ---------- Spausdinimas ---------- */
@media print {
	body { background: #fff; color: #000; font-size: 12pt; }
	.topbar, .site-header, .site-footer, .sidebar, .to-top, .read-progress, .share, .row--next, .row--related, .toc, .read-also, .row--crumbs, .article-margin { display: none !important; }
	.sheet::before { display: none; }
	.row { display: block; padding: 0; }
	.article-grid { display: block; }
	a { text-decoration: underline; }
}
