/* Feature enhancements — loaded after combined CSS */

/* Soft cyber atmosphere: grid + amber glows on black */
html {
	background-color: #050505;
}

body {
	background-color: #050505;
	background-image:
		radial-gradient(ellipse 90% 55% at 12% -10%, rgba(196, 139, 0, 0.22), transparent 55%),
		radial-gradient(ellipse 70% 45% at 100% 110%, rgba(196, 139, 0, 0.16), transparent 50%),
		radial-gradient(ellipse 40% 30% at 70% 20%, rgba(240, 193, 75, 0.1), transparent 60%),
		linear-gradient(rgba(196, 139, 0, 0.09) 1px, transparent 1px),
		linear-gradient(90deg, rgba(196, 139, 0, 0.09) 1px, transparent 1px),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23c48b00' stroke-opacity='0.16' stroke-width='1'%3E%3Cpath d='M20 20h20v20H20zM80 20h20v20H80zM20 80h20v20H20zM80 80h20v20H80z'/%3E%3Cpath d='M40 30h40M30 40v40M90 40v40M40 90h40'/%3E%3Ccircle cx='60' cy='60' r='3' fill='%23c48b00' fill-opacity='0.2' stroke='none'/%3E%3C/g%3E%3C/svg%3E"),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Ctext x='4' y='14' fill='%23c48b00' fill-opacity='0.07' font-family='monospace' font-size='9'%3E01%3C/text%3E%3Ctext x='36' y='38' fill='%23f0c14b' fill-opacity='0.06' font-family='monospace' font-size='9'%3E10%3C/text%3E%3Ctext x='12' y='58' fill='%23c48b00' fill-opacity='0.05' font-family='monospace' font-size='9'%3E11%3C/text%3E%3C/svg%3E");
	background-size:
		auto,
		auto,
		auto,
		48px 48px,
		48px 48px,
		120px 120px,
		64px 64px;
	background-attachment: fixed;
}

/* Sidebar: soft grey-only texture (no glyphs, no amber) */
.sidebar.bg-dark {
	background-color: #1c1f23 !important;
	background-image:
		linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 32%, transparent 70%, rgba(0, 0, 0, 0.18)),
		repeating-linear-gradient(
			-55deg,
			transparent,
			transparent 7px,
			rgba(255, 255, 255, 0.025) 7px,
			rgba(255, 255, 255, 0.025) 8px
		),
		linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
	background-size: auto, auto, 28px 28px, 28px 28px;
	border-right: 1px solid rgba(255, 255, 255, 0.06);
}

/* Keep texture out of the circular logo */
.sidebar .banner-image.rounded-circle {
	position: relative;
	z-index: 1;
	background-color: #1c1f23;
	background-image: none;
	box-shadow:
		0 0 0 10px #1c1f23,
		0 0 30px 5px #000000;
}

/* Per-block reading surfaces inside posts (not a full-column panel) */
.post-container {
	position: relative;
	background: transparent;
	box-shadow: none;
	padding-left: 0.5rem;
	padding-right: 0.5rem;
}

.post-meta,
.post-content > p,
.post-content > h1,
.post-content > h2,
.post-content > h3,
.post-content > h4,
.post-content > h5,
.post-content > h6,
.post-content > ul,
.post-content > ol,
.post-content > blockquote,
.post-content > table,
.post-content > .table-responsive,
.post-content > .code-block-wrap,
.post-content > pre,
.post-nav .btn {
	background: rgba(14, 14, 14, 0.92);
	border: none;
	border-radius: 10px;
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.02),
		0 0 14px 4px rgba(8, 8, 8, 0.75),
		0 0 28px 12px rgba(8, 8, 8, 0.35);
}

.post-meta {
	padding: 0.75rem 1rem;
	margin-bottom: 1rem !important;
}

.post-content > p,
.post-content > ul,
.post-content > ol,
.post-content > blockquote {
	padding: 0.65rem 0.9rem;
	margin-bottom: 0.85rem;
}

.post-content > h1,
.post-content > h2,
.post-content > h3,
.post-content > h4,
.post-content > h5,
.post-content > h6 {
	padding: 0.45rem 0.85rem;
	margin-top: 1.1rem;
	margin-bottom: 0.65rem;
	width: fit-content;
	max-width: 100%;
}

.post-content > pre,
.post-content > .code-block-wrap {
	padding: 0.35rem;
	margin-bottom: 0.85rem;
}

.post-content > .code-block-wrap > pre {
	margin-bottom: 0;
	background: transparent;
	border: none;
	box-shadow: none;
}

.post-content img {
	background: rgba(14, 14, 14, 0.92);
	border: none;
	border-radius: 10px;
	padding: 0.4rem;
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.02),
		0 0 14px 4px rgba(8, 8, 8, 0.75),
		0 0 28px 12px rgba(8, 8, 8, 0.35);
}

.post-content > table,
.post-content > .table-responsive {
	padding: 0.35rem;
	margin-bottom: 0.85rem;
	display: block;
	overflow-x: auto;
}

.post-nav .btn {
	padding: 0.35rem 0.75rem;
}

.post-nav .btn:hover {
	background: rgba(28, 28, 28, 0.95);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.04),
		0 0 16px 5px rgba(8, 8, 8, 0.8),
		0 0 30px 12px rgba(8, 8, 8, 0.4);
}

#fx-binary-trail {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 5;
}

@media (prefers-reduced-motion: reduce) {
	#fx-binary-trail {
		display: none !important;
	}
}

.reading-progress {
	position: sticky;
	top: 0;
	left: 0;
	height: 4px;
	width: 0;
	max-width: 100%;
	background: linear-gradient(90deg, #c48b00, #f0c14b);
	box-shadow: 0 0 8px rgba(240, 193, 75, 0.55);
	z-index: 20;
	opacity: 0;
	transition: width 0.08s linear, opacity 0.2s ease;
	pointer-events: none;
	margin: 0 0 0.35rem;
	flex-shrink: 0;
}

.reading-progress.is-active {
	opacity: 1;
}

.post-meta .tag-chip,
.card-tags .tag-chip,
a.tag-chip,
.tag-chip {
	display: inline-block !important;
	padding: 0.15rem 0.55rem !important;
	margin: 0 0.3rem 0.35rem 0 !important;
	border: 1px solid #666 !important;
	border-radius: 999px !important;
	color: #f0f0f0 !important;
	text-decoration: none !important;
	font-size: 0.72rem !important;
	line-height: 1.3 !important;
	background: rgba(20, 20, 20, 0.92) !important;
	white-space: nowrap;
}

a.tag-chip:hover,
.tag-chip:hover {
	border-color: #c48b00 !important;
	color: #f0c14b !important;
	background: #2a2210 !important;
}

/* Card tags: pinned top-right, same spot on every post */
.category-content .post-item {
	position: relative;
	overflow: visible;
}

.category-content .card-tags {
	position: absolute;
	top: 0.65rem;
	right: 0.75rem;
	z-index: 3;
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	align-items: center;
	gap: 0.3rem;
	max-width: min(55%, 280px);
	pointer-events: none;
}

.category-content .card-tags .tag-chip {
	margin: 0 !important;
	pointer-events: auto;
}

.category-content .post-item .card-body {
	padding-right: 6.5rem;
	padding-top: 0.85rem;
}

.articles-container.column-view .post-item {
	display: flex;
	flex-direction: column;
}

.articles-container.column-view .card-link {
	order: 1;
}

.articles-container.column-view .card-tags {
	position: static;
	order: 2;
	top: auto;
	left: auto;
	right: auto;
	max-width: 100%;
	justify-content: center;
	padding: 0.35rem 0.5rem 0.75rem;
	pointer-events: auto;
}

.articles-container.column-view .post-item .card-body {
	padding-right: 0.75rem;
	padding-top: 0.5rem;
}

.code-block-wrap {
	position: relative;
	margin: 0.75rem 0;
}

.code-copy-btn {
	position: absolute;
	top: 0.4rem;
	right: 0.4rem;
	z-index: 2;
	border: 1px solid #555;
	background: #222;
	color: #ddd;
	font-size: 0.75rem;
	padding: 0.15rem 0.45rem;
	border-radius: 4px;
	opacity: 0.7;
}

.code-block-wrap:hover .code-copy-btn,
.code-copy-btn:focus {
	opacity: 1;
}

.spoiler {
	background: #333;
	color: transparent;
	border-radius: 3px;
	cursor: pointer;
	padding: 0 0.2em;
	transition: color 0.15s ease, background 0.15s ease;
	user-select: none;
}

.spoiler.is-revealed,
.spoiler:focus {
	color: inherit;
	background: rgba(196, 139, 0, 0.25);
	user-select: text;
}

.notification {
	position: fixed;
	bottom: 1.25rem;
	right: 1.25rem;
	background: #222;
	color: #fff;
	border: 1px solid #c48b00;
	padding: 0.6rem 0.9rem;
	border-radius: 6px;
	display: none;
	z-index: 10000;
}

/* Command palette */
.cmdk-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	z-index: 10001;
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding-top: 12vh;
}

.cmdk-overlay.is-open {
	display: flex;
}

.cmdk-modal {
	width: min(640px, 92vw);
	background: #151515;
	border: 1px solid #444;
	border-radius: 10px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	overflow: hidden;
}

.cmdk-input {
	width: 100%;
	border: 0;
	border-bottom: 1px solid #333;
	background: transparent;
	color: #fff;
	padding: 1rem 1.1rem;
	font-size: 1.05rem;
	outline: none;
}

.cmdk-list {
	max-height: 360px;
	overflow: auto;
	margin: 0;
	padding: 0.4rem;
	list-style: none;
}

.cmdk-item {
	padding: 0.55rem 0.75rem;
	border-radius: 6px;
	color: #ddd;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}

.cmdk-item mark {
	background: transparent;
	color: #f0c14b;
	padding: 0;
}

.cmdk-item.is-active,
.cmdk-item:hover {
	background: #2a2a2a;
}

.cmdk-item-meta {
	color: #888;
	font-size: 0.8rem;
	text-transform: uppercase;
}

.cmdk-hint {
	padding: 0.5rem 0.9rem 0.7rem;
	color: #777;
	font-size: 0.75rem;
	border-top: 1px solid #333;
}

/* Editor extras */
.editor-meta-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.5rem 0.75rem;
	margin: 0.75rem 0;
}

.editor-meta-grid label {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.editor-meta-span {
	grid-column: 1 / -1;
}

@media (max-width: 992px) {
	.editor-meta-grid {
		grid-template-columns: 1fr 1fr;
	}
}

.publish-checklist {
	background: #111;
	border: 1px solid #333;
	border-radius: 6px;
	padding: 0.75rem 1rem;
	margin-bottom: 0.75rem;
	color: #ddd;
}

.publish-checklist li.is-ok {
	color: #7dcea0;
}

.publish-checklist li.is-bad {
	color: #f1948a;
}

.editor-toolbar-extra {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.75rem 0;
	align-items: center;
}

.diff-panel {
	display: none;
	margin-top: 0.75rem;
	background: #111;
	border: 1px solid #333;
	border-radius: 6px;
	max-height: 360px;
	overflow: auto;
	padding: 0.75rem;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.85rem;
	white-space: pre-wrap;
}

.diff-panel.is-open {
	display: block;
}

.diff-add { color: #7dcea0; background: rgba(125, 206, 160, 0.08); }
.diff-del { color: #f1948a; background: rgba(241, 148, 138, 0.08); }
.diff-ctx { color: #aaa; }

/* Printable cheatsheets */
@media print {
	body {
		background: #fff !important;
		color: #000 !important;
	}

	#fx-binary-trail,
	.sidebar,
	.navbar-toggler,
	.toc-bar,
	#google_translate_widget,
	.search-buttons,
	.reading-progress,
	.cmdk-overlay,
	.post-nav,
	#notification,
	.btn,
	footer,
	script {
		display: none !important;
	}

	.post-container,
	.category-content,
	.col-sm-12,
	.col-md-8,
	.offset-2 {
		position: static !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
		float: none !important;
		background: transparent !important;
		box-shadow: none !important;
	}

	.post-meta,
	.post-content > p,
	.post-content > h1,
	.post-content > h2,
	.post-content > h3,
	.post-content > h4,
	.post-content > h5,
	.post-content > h6,
	.post-content > ul,
	.post-content > ol,
	.post-content > blockquote,
	.post-content > table,
	.post-content > pre,
	.post-content > .code-block-wrap,
	.post-content img,
	.post-nav .btn {
		background: transparent !important;
		border: none !important;
		box-shadow: none !important;
		padding: 0 !important;
	}

	.post-content,
	.post-content * {
		color: #000 !important;
		background: transparent !important;
	}

	pre, code {
		border: 1px solid #ccc;
		page-break-inside: avoid;
	}

	a[href]::after {
		content: none !important;
	}
}
