:root {
	--muted: #f5f5f7;
	/* Variables usadas por highlight.css */
	--vh-bg-light: #f5f5f7;
	--vh-fg-light: #0f172a;
	--vh-bg-dark: #0b1220;
	--vh-fg-dark: #e2e8f0;
	--vh-comment: #6b7280;
	--vh-purple: #7c3aed;
	--vh-orange: #f59e0b;
	--vh-green: #10b981;
	--vh-cyan: #06b6d4;
	--vh-yellow: #facc15;
	--vh-pink: #ec4899;
}
/* Tag color classes (one color per main category and their tags) */
.tag-default {
	background: rgba(203, 213, 225, 0.15);
	color: #334155;
	border: 1px solid rgba(203, 213, 225, 0.2);
}
/* Emtix */
.tag-emtix {
	background: rgba(17, 17, 17, 0.08);
	color: #111111;
	border: 1px solid rgba(17, 17, 17, 0.12);
}
/* Infraestructura */
.tag-infraestructura {
	background: rgba(124, 181, 100, 0.08);
	color: #7cb564;
	border: 1px solid rgba(124, 181, 100, 0.18);
}
/* Dev */
.tag-dev {
	background: rgba(33, 158, 188, 0.08);
	color: #219ebc;
	border: 1px solid rgba(33, 158, 188, 0.18);
}
/* Design */
.tag-design {
	background: rgba(166, 99, 204, 0.08);
	color: #a663cc;
	border: 1px solid rgba(166, 99, 204, 0.18);
}
/* SaaS */
.tag-saas {
	background: rgba(232, 140, 48, 0.08);
	color: #e88c30;
	border: 1px solid rgba(232, 140, 48, 0.18);
}

/* Dark mode adjustments: keep colored text visible on dark background */
.dark .tag-default {
	background: rgba(255, 255, 255, 0.04);
	color: var(--muted);
	border-color: rgba(255, 255, 255, 0.06);
}
.dark .tag-emtix {
	background: rgba(255, 255, 255, 0.02);
	color: #e6eef8;
	border-color: rgba(255, 255, 255, 0.04);
}
.dark .tag-infraestructura {
	background: rgba(124, 181, 100, 0.08);
	color: #7cb564;
	border-color: rgba(124, 181, 100, 0.14);
}
.dark .tag-dev {
	background: rgba(33, 158, 188, 0.06);
	color: #7dd3fc;
	border-color: rgba(33, 158, 188, 0.12);
}
.dark .tag-design {
	background: rgba(166, 99, 204, 0.06);
	color: #c4b5fd;
	border-color: rgba(166, 99, 204, 0.12);
}
.dark .tag-saas {
	background: rgba(232, 140, 48, 0.06);
	color: #ffd8b5;
	border-color: rgba(232, 140, 48, 0.12);
}
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
::-webkit-scrollbar {
	width: 6px;
	height: 6px;
}
::-webkit-scrollbar-track {
	background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 3px;
}
.dark ::-webkit-scrollbar-track {
	background: #222;
}
.dark ::-webkit-scrollbar-thumb {
	background: #555;
}

/* Force exact dark background and readable text color without rebuilding Tailwind */
.dark body {
	background-color: #111111 !important;
	color: #e6eef8 !important;
}

/* Muted text variable override for greys used across the site */
.text-slate-500,
.text-slate-400 {
	color: var(--muted) !important;
}

.glass {
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}
.grid-bg {
	background-image: radial-gradient(#e5e7eb 1px, transparent 1px);
	background-size: 20px 20px;
}
.grid-bg-dark {
	background-image: radial-gradient(#333 1px, transparent 1px);
	background-size: 20px 20px;
}
/* Copy button for code blocks */
pre {
	position: relative;
}
.copy-btn {
	position: absolute;
	right: 0.5rem;
	top: 0.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.1rem;
	height: 2.1rem;
	background: rgba(255, 255, 255, 0.04);
	color: var(--vh-fg-dark, #e6eef8);
	border: none;
	padding: 0.25rem;
	font-size: 0.9rem;
	border-radius: 0.5rem;
	cursor: pointer;
	backdrop-filter: blur(4px);
	transition:
		transform 160ms ease,
		background 120ms ease;
}
.copy-btn:hover {
	background: rgba(255, 255, 255, 0.08);
	transform: translateY(-2px);
}
.copy-btn svg {
	width: 1.1rem;
	height: 1.1rem;
	display: block;
}
.copy-btn .icon-check {
	display: none;
}
.copy-btn.copied {
	transform: scale(0.96);
	background: rgba(124, 58, 237, 0.12);
}
.copy-btn.copied .icon-clipboard {
	display: none;
}
.copy-btn.copied .icon-check {
	display: block;
}
.copy-btn:active {
	transform: scale(0.94);
}

/* Math/KaTeX styles: evitar overflow horizontal en fórmulas largas
		- contenedores de display (ecuaciones centradas) quedan como bloque y permiten scroll
		- fórmulas inline se limitan al ancho del contenedor y permiten quiebre o scroll
		Elección: scroll horizontal para preservar la presentación matemática cuando sea necesario.
*/
.math,
.math-display,
.katex,
.katex-display,
.mjx-chtml {
	max-width: 100%;
	box-sizing: border-box;
	-webkit-overflow-scrolling: touch;
}

/* Bloques de ecuación: permitir scroll horizontal dentro del bloque */
.katex-display,
.math-display,
.mjx-chtml {
	display: block;
	overflow-x: auto;
	overflow-y: hidden; /* evitar scroll vertical */
	white-space: nowrap;
	padding: 0.25rem 0;
}

/* Fórmulas inline: evitar que estiren el contenedor principal */
.katex {
	display: inline-block;
	max-width: 100%;
	vertical-align: middle;
	overflow-x: auto;
	overflow-y: hidden; /* evitar scroll vertical en fórmulas inline */
	white-space: nowrap;
}
