@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Arimo:ital,wght@0,400..700;1,400..700&family=REM:ital,wght@0,100..900;1,100..900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,100..900;1,100..900&display=swap");

body {
	font-family: "Inter", sans-serif;
}

.img-fluid {
	width: 100%;
	height: auto;
}

.pink-link {
	background: linear-gradient(
		to bottom,
		#7281c4,
		#7281c4,
		#a891c6,
		#dd8aab,
		#ff4f38
	);
	background-clip: border-box;
	-webkit-text-fill-color: transparent;
	-webkit-background-clip: text;
}

.pink-title {
	background: linear-gradient(
		to bottom,
		#7281c4,
		#7281c4,
		#a891c6,
		#dd8aab,
		#e27477,
		#ff5144,
		#ff4f38
	);
	background-clip: border-box;
	-webkit-text-fill-color: transparent;
	-webkit-background-clip: text;
}

.pink-link:hover {
	text-decoration: underline solid #ff4f38;
	font-weight: bold;
}

.hero-subtitle {
	display: inline-flex;
	align-items: center;
	gap: 0.75em;
	flex-wrap: wrap;
	justify-content: center;
}

.hero-subtitle-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	padding: 0.35em 1.1em;
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.95em;
	color: #fff;
	text-decoration: none;
	background: linear-gradient(
		110deg,
		#7281c4,
		#a891c6 32%,
		#dd8aab 65%,
		#ff4f38
	);
	box-shadow: 0 6px 18px rgba(255, 79, 56, 0.22);
	transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.hero-subtitle-link:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 26px rgba(255, 79, 56, 0.3);
}

.commure-font {
	font-family: "Work Sans", "Inter", sans-serif;
	font-weight: 500;
	letter-spacing: -0.02em;
}

/* Default Light Mode Styles */
body.bg-light {
	background-color: #f8f9fa;
	color: #212529;
}

/* Dark Mode Styles */
body.bg-dark {
	background-color: #212529;
	color: #f8f9fa;
}

.dark-mode .hero-subtitle {
	color: rgba(248, 249, 250, 0.78);
}

.dark-mode .bg-light {
	background-color: #343a40 !important;
}

/* Blog Styles */
.blog-content {
	line-height: 1.7;
}

.blog-content h2 {
	margin-top: 2em;
	margin-bottom: 1em;
}

.blog-content p {
	margin-bottom: 1.2em;
}

.blog-content ul {
	margin-bottom: 1.2em;
	padding-left: 1.5em;
}

.blog-content li {
	margin-bottom: 0.5em;
}

.blog-excerpt {
	font-size: 1.1em;
	line-height: 1.6;
	margin-bottom: 1em;
}

.blog-post {
	padding: 1.5em;
	border-radius: 12px;
	transition: all 0.25s ease;
	background-color: #f6f8fa; /* subtle light gray, not white */
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
	position: relative;
}

.blog-post:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
	border-color: rgba(0, 0, 0, 0.12);
}

/* subtle gradient accent at the top of each card */
.blog-post::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	border-top-left-radius: 12px;
	border-top-right-radius: 12px;
	background: linear-gradient(to right, #7281c4, #a891c6, #dd8aab, #ff4f38);
}

/* refine spacing inside cards */
.blog-post h2,
.blog-post h3 {
	margin-top: 0.1em;
	margin-bottom: 0.35em;
}

.blog-post .text-muted {
	font-size: 0.95em;
	opacity: 0.9;
	margin-bottom: 0.75em;
}

/* dark mode card styles */
body.bg-dark .blog-post {
	background-color: #2b2f36;
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

body.bg-dark .blog-post:hover {
	box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
	border-color: rgba(255, 255, 255, 0.12);
}

pre {
	background-color: #f8f9fa;
	padding: 1em;
	border-radius: 4px;
	overflow-x: auto;
	margin: 1.5em 0;
}

.dark-mode pre {
	background-color: #343a40;
	color: #f8f9fa;
}

/* Blog Figure Styles */
.blog-figure {
	margin: 2em 0;
	text-align: center;
}

.blog-figure img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.blog-figure figcaption {
	margin-top: 0.5em;
	font-style: italic;
	color: #666;
	font-size: 0.9em;
}

.dark-mode .blog-figure figcaption {
	color: #aaa;
}

/* Math Formula Styles */
.blog-content .math {
	overflow-x: auto;
	margin: 1em 0;
}

.blog-content .math-display {
	text-align: center;
	margin: 1.5em 0;
}

/* Table Styles */
.blog-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.5em 0;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
	background-color: #1f2230;
	color: #f1f3f5;
	border: 1px solid rgba(255, 255, 255, 0.06);
}

.blog-content th,
.blog-content td {
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
	background-color: rgba(255, 255, 255, 0.02);
}

.blog-content th {
	font-weight: 600;
	border-bottom: 2px solid rgba(255, 255, 255, 0.1);
	background-color: rgba(255, 255, 255, 0.08);
	color: #ffffff;
}

.blog-content tbody tr:nth-child(even) td {
	background-color: rgba(255, 255, 255, 0.06);
}

.blog-content tbody tr:hover td {
	background-color: rgba(255, 255, 255, 0.1);
}

.blog-content tr:last-child td {
	border-bottom: none;
}

.blog-content caption {
	caption-side: bottom;
	text-align: left;
	font-size: 0.95em;
	color: rgba(255, 255, 255, 0.6);
	padding-top: 8px;
}

/* Dark mode table styles */
.dark-mode .blog-content table {
	background-color: #171a26;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
	border: 1px solid rgba(255, 255, 255, 0.08);
}

.dark-mode .blog-content th {
	background-color: rgba(255, 255, 255, 0.12);
	color: #ffffff;
	border-bottom-color: rgba(255, 255, 255, 0.16);
}

.dark-mode .blog-content th,
.dark-mode .blog-content td {
	border-bottom-color: rgba(255, 255, 255, 0.12);
	background-color: rgba(255, 255, 255, 0.06);
}

.dark-mode .blog-content tr:hover td {
	background-color: rgba(255, 255, 255, 0.14);
}

.dark-mode .blog-content tbody tr:nth-child(even) td {
	background-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .blog-content caption {
	color: rgba(255, 255, 255, 0.65);
}

/* Mermaid diagram styles */
.mermaid {
	margin: 2em 0;
	text-align: center;
}

.mermaid svg {
	max-width: 100%;
	height: auto;
}

/* Back button padding */
.blog-content > div:last-child {
	margin-bottom: 3em;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
	/* Container and layout adjustments */
	.container {
		padding-left: 1rem;
		padding-right: 1rem;
	}

	/* Keep tag filter comfy on tablets */
	.tag-filter {
		padding: 1.25rem;
	}

	.tag-filter .blog-tags {
		gap: 0.4em;
	}

	.tag {
		padding: 0.35em 0.9em;
	}

	.blog-post.mb-4 {
		margin-bottom: 1.1rem;
	}

	/* Typography improvements for mobile */
	.blog-content {
		font-size: 16px;
		line-height: 1.6;
		padding: 0 0.5rem;
	}

	.blog-content h1 {
		font-size: 1.8rem;
		line-height: 1.3;
		margin-bottom: 0.5rem;
	}

	.blog-content h2 {
		font-size: 1.5rem;
		line-height: 1.4;
		margin-top: 1.5rem;
		margin-bottom: 0.8rem;
	}

	.blog-content h3 {
		font-size: 1.3rem;
		line-height: 1.4;
		margin-top: 1.2rem;
		margin-bottom: 0.6rem;
	}

	.blog-content p {
		margin-bottom: 1rem;
		font-size: 16px;
		line-height: 1.6;
	}

	/* Mobile-friendly code blocks */
	pre {
		font-size: 14px;
		padding: 0.8rem;
		margin: 1rem 0;
		border-radius: 6px;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		white-space: pre;
		word-wrap: normal;
	}

	/* Mobile table responsiveness */
	.blog-content table {
		display: block;
		width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		border-radius: 6px;
		margin: 1rem 0;
	}

	.blog-content table thead,
	.blog-content table tbody,
	.blog-content table tr {
		display: table;
		width: 100%;
		table-layout: fixed;
	}

	.blog-content th,
	.blog-content td {
		padding: 8px 12px;
		font-size: 14px;
		word-wrap: break-word;
	}

	/* Mobile image and figure improvements */
	.blog-figure {
		margin: 1.5rem 0;
	}

	.blog-figure img {
		border-radius: 6px;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	}

	.blog-figure figcaption {
		font-size: 0.85rem;
		margin-top: 0.4rem;
		padding: 0 0.5rem;
	}

	/* Mobile list improvements */
	.blog-content ul,
	.blog-content ol {
		padding-left: 1.2rem;
		margin-bottom: 1rem;
	}

	.blog-content li {
		margin-bottom: 0.4rem;
		font-size: 16px;
		line-height: 1.5;
	}

	/* Mobile Mermaid diagram improvements */
	.mermaid {
		margin: 1.5rem 0;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.mermaid svg {
		max-width: 100%;
		height: auto;
		min-width: 300px;
	}

	/* Mobile math formula improvements */
	.blog-content .math {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		margin: 1rem 0;
		padding: 0.5rem;
	}

	.blog-content .math-display {
		text-align: center;
		margin: 1rem 0;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	/* Mobile link improvements */
	.blog-content a {
		word-break: break-word;
		hyphens: auto;
	}

	/* Mobile back button */
	.blog-content > div:last-child {
		margin-bottom: 2rem;
		padding: 0 0.5rem;
	}

	.blog-content > div:last-child a {
		font-size: 16px;
		display: inline-block;
		padding: 0.5rem 0;
	}
}

/* Tag styles */
.blog-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
}

.tag {
	display: inline-block;
	padding: 0.4em 1em;
	background: rgba(114, 129, 196, 0.1);
	border: 1px solid rgba(114, 129, 196, 0.3);
	color: #7281c4;
	border-radius: 25px;
	font-size: 0.8em;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.3s ease;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	-webkit-background-clip: padding-box;
	background-clip: padding-box;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.tag::before {
	content: "";
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(255, 255, 255, 0.2),
		transparent
	);
	transition: left 0.3s ease;
}

.tag:hover {
	transform: translateY(-2px);
	background: rgba(114, 129, 196, 0.2);
	border-color: #7281c4;
	box-shadow: 0 4px 12px rgba(114, 129, 196, 0.3);
	text-decoration: none;
	color: #7281c4;
}

.tag:hover::before {
	left: 100%;
}

.tag.active {
	background: linear-gradient(
		120deg,
		#7281c4 0%,
		#8a8ecc 35%,
		#c595c4 70%,
		#ff4f38 100%
	);
	background-size: 200% 200%;
	background-position: center;
	background-repeat: no-repeat;
	color: white;
	border-color: transparent;
	box-shadow: 0 4px 12px rgba(114, 129, 196, 0.4);
	-webkit-background-clip: padding-box;
	background-clip: padding-box;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.tag.active:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(114, 129, 196, 0.5);
}

/* Dark mode tag styles */
body.bg-dark .tag {
	background: rgba(114, 129, 196, 0.15);
	border-color: rgba(114, 129, 196, 0.4);
	color: #a891c6;
}

body.bg-dark .tag:hover {
	background: rgba(114, 129, 196, 0.25);
	border-color: #a891c6;
	color: #a891c6;
	box-shadow: 0 4px 12px rgba(114, 129, 196, 0.2);
}

body.bg-dark .tag.active {
	background: linear-gradient(
		120deg,
		#7281c4 0%,
		#8a8ecc 35%,
		#c595c4 70%,
		#ff4f38 100%
	);
	background-size: 200% 200%;
	background-position: center;
	background-repeat: no-repeat;
	color: white;
	border-color: transparent;
	-webkit-background-clip: padding-box;
	background-clip: padding-box;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Tag filter section */
.tag-filter {
	margin-bottom: 2rem;
	padding: 1.5rem;
	background: rgba(114, 129, 196, 0.05);
	border-radius: 12px;
	border: 1px solid rgba(114, 129, 196, 0.1);
}

.tag-filter h3 {
	margin-bottom: 1rem;
	color: #7281c4;
	font-size: 1em;
	font-weight: 600;
	text-align: center;
}

.tag-filter .blog-tags {
	margin-bottom: 1rem;
}

.clear-filters {
	background: rgba(255, 79, 56, 0.1);
	border: 1px solid rgba(255, 79, 56, 0.3);
	color: #ff4f38;
	padding: 0.5em 1em;
	border-radius: 20px;
	font-size: 0.85em;
	text-decoration: none;
	transition: all 0.3s ease;
	cursor: pointer;
}

.clear-filters:hover {
	background: rgba(255, 79, 56, 0.2);
	border-color: #ff4f38;
	text-decoration: none;
	color: #ff4f38;
	transform: translateY(-1px);
}

body.bg-dark .tag-filter {
	background: rgba(114, 129, 196, 0.08);
	border-color: rgba(114, 129, 196, 0.2);
}

body.bg-dark .tag-filter h3 {
	color: #a891c6;
}

body.bg-dark .clear-filters {
	background: rgba(255, 79, 56, 0.15);
	border-color: rgba(255, 79, 56, 0.4);
	color: #ff4f38;
}

body.bg-dark .clear-filters:hover {
	background: rgba(255, 79, 56, 0.25);
	border-color: #ff4f38;
}

/* Extra small mobile devices */
@media (max-width: 480px) {
	.blog-content {
		font-size: 15px;
		padding: 0 0.25rem;
	}

	.tag-filter {
		padding: 1rem;
	}

	.tag {
		padding: 0.3em 0.8em;
		font-size: 0.75em;
	}

	.clear-filters {
		padding: 0.45em 0.8em;
	}

	.blog-post.mb-4 {
		margin-bottom: 0.85rem;
	}

	.blog-content h1 {
		font-size: 1.6rem;
	}

	.blog-content h2 {
		font-size: 1.4rem;
	}

	.blog-content h3 {
		font-size: 1.2rem;
	}

	pre {
		font-size: 13px;
		padding: 0.6rem;
	}

	.blog-content th,
	.blog-content td {
		padding: 6px 8px;
		font-size: 13px;
	}

	.blog-figure figcaption {
		font-size: 0.8rem;
	}
}
