/* Import modern fonts */
@import url('https://api.fontshare.com/v2/css?f[]=onest@400,500,600,700&f[]=sora@400,600,700&display=swap');

/*
  The CSS in this style tag is based off of Bear Blog's default CSS.
  https://github.com/HermanMartinus/bearblog/blob/297026a877bc2ab2b3bdfbd6b9f7961c350917dd/templates/styles/blog/default.css
  License MIT: https://github.com/HermanMartinus/bearblog/blob/master/LICENSE.md
 */

:root {
	--accent: #2337ff;
	--accent-dark: #000d8a;
	--black: 15, 18, 25;
	--gray: 96, 115, 159;
	--gray-light: 246, 248, 250;
	--gray-dark: 34, 41, 57;
	/* Light mode gradient from a soft blue-white to pure white */
	--gray-gradient: rgba(246, 248, 250, 0.8), #f8fafc;
	--box-shadow: 0 2px 6px rgba(var(--gray), 25%), 0 8px 24px rgba(var(--gray), 33%),
		0 16px 32px rgba(var(--gray), 33%);
	
	/* Add transition for smooth theme switching */
	--theme-transition: background-color 0.3s ease, color 0.3s ease;

	/* Font family variables */
	--font-heading: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--font-body: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--font-mono: 'Fira Code', 'SF Mono', Monaco, Consolas, monospace;

	--card-bg: 245, 250, 243;
}

/* Dark mode variables */
[data-theme='dark'] {
	--accent: #818cf8;
	--accent-dark: #4f46e5;
	--black: 240, 242, 245;
	--gray: 180, 190, 210;
	--gray-light: 30, 41, 59;
	--gray-dark: 226, 232, 240;
	/* Keep the beautiful dark mode gradient */
	--gray-gradient: rgba(30, 41, 59, 0.8), #0f172a;
	--box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.2),
		0 16px 32px rgba(0, 0, 0, 0.2);

	--card-bg: 30, 41, 59;
}

/* Apply transitions */
body {
	transition: var(--theme-transition);
}

a, button, input {
	transition: var(--theme-transition);
}

body {
	font-family: var(--font-body);
	margin: 0;
	padding: 0;
	text-align: left;
	background: linear-gradient(
		to bottom,
		rgba(var(--gray-light), 0.5),
		rgba(var(--gray-light), 0.1)
	), linear-gradient(180deg, var(--gray-gradient)) no-repeat;
	background-size: 100% 100%;
	word-wrap: break-word;
	overflow-wrap: break-word;
	color: rgb(var(--gray-dark));
	font-size: 1.0625rem;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-weight: 400;
}

main {
	width: 920px;
	max-width: calc(100% - 2em);
	margin: auto;
	padding: 3em 1em;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.5rem 0;
	color: rgb(var(--black));
	line-height: 1.2;
	font-family: var(--font-heading);
	font-weight: 600;
	letter-spacing: -0.015em;
}

h1 {
	font-size: 2.5rem;
	font-weight: 700;
	margin-bottom: 1rem;
	letter-spacing: -0.02em;
}

h2 {
	font-size: 2rem;
	margin-top: 2.5rem;
}

h3 {
	font-size: 1.5rem;
	margin-top: 2rem;
}

h4 {
	font-size: 1.25rem;
	margin-top: 1.5rem;
}

h5 {
	font-size: 1.125rem;
	margin-top: 1.25rem;
}

strong,
b {
	font-weight: 600;
}

a {
	color: var(--accent);
	text-decoration: none;
	font-weight: 500;
}

a:hover {
	color: var(--accent);
	text-decoration: underline;
}

p {
	margin-bottom: 1.25em;
	font-size: 1.0625rem;
	line-height: 1.75;
	font-weight: 400;
}

.prose p {
	margin-bottom: 1.5em;
}

textarea {
	width: 100%;
	font-size: 16px;
	font-family: var(--font-mono);
	padding: 0.5rem;
	border-radius: 4px;
	border: 1px solid rgba(var(--gray), 0.2);
}

input {
	font-size: 16px;
	font-family: var(--font-body);
	padding: 0.5rem;
	border-radius: 4px;
	border: 1px solid rgba(var(--gray), 0.2);
}

table {
	width: 100%;
	margin: 2rem 0;
	border-collapse: collapse;
}

table td,
table th {
	padding: 0.75rem;
	border: 1px solid rgba(var(--gray), 0.2);
}

img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	margin: 2rem 0;
}

code {
	padding: 0.2em 0.4em;
	background-color: rgba(var(--gray-light), 0.5);
	border-radius: 4px;
	font-family: var(--font-mono);
	font-size: 0.875em;
	font-weight: 500;
}

pre {
	padding: 1.5em;
	border-radius: 8px;
	background-color: rgb(var(--gray-light));
	overflow-x: auto;
}

pre > code {
	all: unset;
	font-family: var(--font-mono);
	font-size: 0.875em;
}

blockquote {
	border-left: 4px solid var(--accent);
	padding: 0 0 0 1.5rem;
	margin: 2rem 0;
	font-size: 1.125em;
	font-style: italic;
	color: rgb(var(--gray-dark));
	background-color: rgba(var(--gray-light), 0.3);
	padding: 1.5rem;
	border-radius: 0 8px 8px 0;
}

hr {
	border: none;
	border-top: 1px solid rgba(var(--gray), 0.2);
	margin: 3rem 0;
}

/* Improved list styling */
ul, ol {
	padding-left: 1.5rem;
	margin: 1.5rem 0;
}

li {
	margin: 0.5rem 0;
	line-height: 1.7;
}

@media (max-width: 720px) {
	body {
		font-size: 1rem;
	}
	
	h1 {
		font-size: 2rem;
	}
	
	h2 {
		font-size: 1.5rem;
	}
	
	h3 {
		font-size: 1.25rem;
	}
	
	main {
		padding: 1em;
	}

	.prose p {
		margin-bottom: 1.25em;
	}
}

.sr-only {
	border: 0;
	padding: 0;
	margin: 0;
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
	clip: rect(1px 1px 1px 1px);
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Markdown Content Styling */
.prose {
	max-width: 65ch;
	margin: 0 auto;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
	margin-top: 2em;
	margin-bottom: 1em;
	color: rgb(var(--black));
	font-weight: 600;
}

.prose h1 {
	font-size: 2.5rem;
	margin-top: 0;
}

.prose h2 {
	font-size: 1.75rem;
}

.prose h3 {
	font-size: 1.5rem;
}

.prose p {
	margin-bottom: 1.5em;
	line-height: 1.75;
}

/* Enhanced List Styling */
.prose ul,
.prose ol {
	margin: 1.5em 0;
	padding-left: 1.5em;
}

.prose ul {
	list-style-type: disc;
}

.prose ol {
	list-style-type: decimal;
}

.prose li {
	margin: 0.5em 0;
	padding-left: 0.5em;
}

.prose ul ul,
.prose ol ul {
	list-style-type: circle;
	margin: 0.5em 0;
}

.prose ul ul ul,
.prose ol ul ul {
	list-style-type: square;
}

/* Code Blocks */
.prose pre {
	padding: 1.25em 1.5em;
	margin: 1.5em 0;
	background-color: rgb(var(--gray-light));
	border-radius: 8px;
	overflow-x: auto;
	font-family: var(--font-mono);
	font-size: 0.9em;
	line-height: 1.7;
}

.prose code {
	font-family: var(--font-mono);
	font-size: 0.875em;
	font-weight: 500;
	background-color: rgba(var(--gray-light), 0.5);
	padding: 0.2em 0.4em;
	border-radius: 4px;
}

.prose pre code {
	background-color: transparent;
	padding: 0;
	border-radius: 0;
	color: inherit;
	font-size: 0.9em;
	white-space: pre;
}

/* Tables */
.prose table {
	width: 100%;
	margin: 2em 0;
	border-collapse: collapse;
	font-size: 0.9em;
	line-height: 1.5;
}

.prose th {
	font-weight: 600;
	text-align: left;
	padding: 0.75em;
	border-bottom: 2px solid rgba(var(--gray), 0.2);
}

.prose td {
	padding: 0.75em;
	border-bottom: 1px solid rgba(var(--gray), 0.1);
	vertical-align: top;
}

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

/* Blockquotes */
.prose blockquote {
	margin: 2em 0;
	padding: 1em 1.5em;
	border-left: 4px solid var(--accent);
	background-color: rgba(var(--gray-light), 0.3);
	border-radius: 0 8px 8px 0;
	font-style: italic;
	color: rgb(var(--gray-dark));
}

.prose blockquote p {
	margin: 0.5em 0;
}

.prose blockquote cite {
	display: block;
	margin-top: 1em;
	font-size: 0.875em;
	font-style: normal;
	opacity: 0.8;
}

/* Horizontal Rule */
.prose hr {
	margin: 3em 0;
	border: 0;
	border-top: 1px solid rgba(var(--gray), 0.2);
}

/* Links */
.prose a {
	color: var(--accent);
	text-decoration: none;
	font-weight: 500;
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s ease;
}

.prose a:hover {
	border-bottom-color: var(--accent);
	text-decoration: none;
}

/* Images */
.prose img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	margin: 2em 0;
}

.prose figure {
	margin: 2em 0;
}

.prose figcaption {
	text-align: center;
	font-size: 0.875em;
	color: rgb(var(--gray));
	margin-top: 0.5em;
}

/* Task Lists */
.prose ul[data-type="taskList"] {
	list-style: none;
	padding-left: 0;
}

.prose ul[data-type="taskList"] li {
	display: flex;
	align-items: center;
	gap: 0.5em;
}

.prose ul[data-type="taskList"] li input[type="checkbox"] {
	margin: 0;
	width: 1em;
	height: 1em;
}

/* Footnotes */
.prose .footnotes {
	margin-top: 3em;
	font-size: 0.875em;
	color: rgb(var(--gray));
}

.prose .footnotes::before {
	content: "";
	display: block;
	width: 100%;
	max-width: 10rem;
	margin-bottom: 1em;
	border-top: 1px solid rgba(var(--gray), 0.2);
}
