/* infected.gr — reading enhancements (2026-11-02) */

/* ---- monospace stack (no external fonts) ---- */
.entry-content pre,
.entry-content code,
.code-lang,
.code-copy {
	font-family: ui-monospace, "JetBrains Mono", "Cascadia Code", "SF Mono", "Fira Code", Menlo, Consolas, "Liberation Mono", monospace;
}

/* ---- heading anchors ---- */
.single .entry-content h2,
.single .entry-content h3 { scroll-margin-top: 24px; }
.heading-anchor {
	margin-left: .4em;
	color: var(--muted) !important;
	text-decoration: none !important;
	font-weight: 400;
	opacity: 0;
	transition: opacity .15s;
}
.entry-content h2:hover .heading-anchor,
.entry-content h3:hover .heading-anchor,
.heading-anchor:focus { opacity: 1; }
.heading-anchor:hover { color: var(--acc) !important; }

/* ---- reading time ---- */
.reading-time { color: var(--muted); }

/* ---- progress bar ---- */
.read-progress {
	position: fixed; top: 0; left: 0; right: 0;
	height: 3px;
	background: var(--acc);
	transform: scaleX(0);
	transform-origin: 0 50%;
	z-index: 1000;
	pointer-events: none;
}
.admin-bar .read-progress { top: 32px; }

/* ---- TOC widget ---- */
.toc-widget .widget-title { margin-bottom: .7em; }
.toc-list { list-style: none; margin: 0; padding: 0; counter-reset: toc; border-left: 1px solid var(--line); }
.toc-list li { margin: 0 !important; line-height: 1.35; }
.sidebar .toc-list a {
	display: block;
	padding: .38em 0 .38em 14px;
	margin-left: -1px;
	border-left: 2px solid transparent;
	color: var(--muted);
	text-decoration: none;
	font-size: 14.5px;
	transition: color .12s, border-color .12s;
}
.toc-list .toc-h3 { display: none; }
.toc-list .toc-h3.open { display: block; }
.sidebar .toc-list .toc-h3 a { padding-left: 28px; font-size: 13.5px; }
.sidebar .toc-list a:hover { color: var(--head); }
.sidebar .toc-list a.active { color: var(--acc); border-left-color: var(--acc); font-weight: 600; }
.sidebar .toc-list .toc-h2.open > a:not(.active) { color: var(--head); }
.sidebar .toc-top { display: inline-block; margin-top: .9em; font-size: 13px; color: var(--muted); text-decoration: none; }
.sidebar .toc-top:hover { color: var(--acc); }

/* keep the TOC usable: cap the sticky sidebar to the viewport on posts */
.single.has-toc .widget-area { max-height: calc(100vh - 40px); overflow-y: auto; scrollbar-width: thin; }
@media (max-width: 1100px) {
	.single.has-toc .widget-area { max-height: none; overflow: visible; }
	.toc-widget { display: none; }
}

/* ---- code blocks: copy + language ---- */
.code-wrap { position: relative; margin: 1.5em 0; }
.code-wrap pre { margin: 0 !important; }
.code-lang {
	position: absolute; top: 0; right: 76px;
	padding: 3px 9px;
	font-size: 11px; letter-spacing: .05em; text-transform: uppercase;
	color: var(--muted);
	background: var(--card2);
	border: 1px solid var(--line); border-top: 0;
	border-radius: 0 0 4px 4px;
}
.code-copy {
	position: absolute; top: 8px; right: 8px;
	padding: 4px 10px;
	font-size: 12px; line-height: 1.4;
	color: var(--muted);
	background: var(--card2);
	border: 1px solid var(--line);
	border-radius: 4px;
	cursor: pointer;
	opacity: 0;
	transition: opacity .15s, color .15s, border-color .15s;
}
.code-wrap:hover .code-copy,
.code-copy:focus { opacity: 1; }
.code-copy:hover { color: var(--acc); border-color: var(--acc); }
.code-copy.ok { opacity: 1; color: #6fbf73; border-color: #6fbf73; }
@media (hover: none) { .code-copy { opacity: 1; } }

/* ---- lightbox ---- */
.entry-content img.zoomable { cursor: zoom-in; }
.lightbox {
	position: fixed; inset: 0;
	background: rgba(10, 10, 12, .92);
	display: flex; align-items: center; justify-content: center;
	padding: 3vh 3vw;
	z-index: 10000;
	cursor: zoom-out;
	animation: lb-in .15s ease-out;
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
html.lb-open { overflow: hidden; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

/* ---- prev / next + related (PHP-rendered) ---- */
.post-after { margin-top: 3em; }
.post-nav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-nav-grid a {
	display: block;
	padding: 18px 22px;
	background: var(--card2);
	border: 1px solid var(--line);
	border-radius: 6px;
	text-decoration: none !important;
	transition: border-color .15s;
}
.post-nav-grid a:hover { border-color: var(--acc); }
.post-nav-grid .lbl { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .35em; }
.post-nav-grid .ttl { color: var(--head); font-weight: 600; line-height: 1.35; }
.post-nav-grid .next { text-align: right; grid-column: 2; }
.related-posts { margin-top: 2em; }
.related-posts h3 { font-size: 18px !important; margin: 0 0 .7em !important; color: var(--head) !important; }
.related-posts ul { margin: 0; padding: 0; list-style: none; }
.related-posts li { padding: .55em 0; border-top: 1px solid var(--line); margin: 0; }
.related-posts li span { color: var(--muted); font-size: 13px; margin-left: .5em; }
@media (max-width: 700px) { .post-nav-grid { grid-template-columns: 1fr; } .post-nav-grid .next { grid-column: 1; } }
