/* =========================
   Theme Variables
========================= */
:root {
	/* Backgrounds */
	--bg-main: #fdfcff;
	--bg-gradient-top: #e8fbff;
	--bg-gradient-bottom: #f0eaff;
	--bg-panel: rgba(0, 0, 0, 0.03);
	--bg-panel-hover: rgba(0, 0, 0, 0.06);

	/* Text */
	--text-main: #1a1a1f;
	--text-muted: #58565e;

	/* Accents */
	--accent-cyan: #06b6d4;
	--accent-purple: #a855f7;

	/* UI */
	--border-soft: rgba(0, 0, 0, 0.08);
	--shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.08);
	--radius: 12px;
}

.glow-cyan {
	color: var(--accent-cyan);
	text-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
}

.glow-purple {
	color: var(--accent-purple);
	text-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
}

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

/* =========================
   Code Blocks 
========================= */
pre {
	background: #0f172a;
	color: #e2e8f0;
	border-left: 4px solid var(--accent-cyan);
	border-radius: var(--radius);
	padding: 1rem;
	margin: 1.5rem 0;
	overflow-x: auto;
	overflow-y: hidden;
	max-width: 100%;
	width: 90%;
	display: block; 
	box-sizing: border-box;
}

pre code {
	display: inline-block; 
	min-width: 100%;      
	font-family: "Fira Code", monospace;
	font-size: 0.9rem;
	line-height: 1.5;
	white-space: pre;
}

p code,
li code {
	background: rgba(0, 0, 0, 0.06);
	padding: 0.2rem 0.4rem;
	border-radius: 6px;
	font-size: 0.85rem;
	color: var(--accent-purple);
}

pre::-webkit-scrollbar {
	height: 6px;
}

pre::-webkit-scrollbar-thumb {
	background: var(--accent-cyan);
	border-radius: 4px;
}

/* =========================
   Mobile Optimization
========================= */

@media (max-width: 768px) {
	pre {
		padding: 0.75rem;
		font-size: 0.8rem;

		-webkit-overflow-scrolling: touch;
	}

	pre code {
		font-size: 0.8rem;
	}

	code {
		word-break: break-word;
	}
}

/* =========================
   Reset + Base
========================= */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	scroll-behavior: smooth;
}

body {
	font-family:
		system-ui,
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		Roboto,
		sans-serif;

	background:
		radial-gradient(circle at top left, var(--bg-gradient-top), transparent 60%),
		radial-gradient(circle at bottom right, var(--bg-gradient-bottom), transparent 60%),
		var(--bg-main);

	color: var(--text-main);
	line-height: 1.65;
}

/* =========================
   Typography
========================= */
h1,
h2,
h3 {
	font-weight: 600;
	line-height: 1.25;
}

h1 {
	font-size: clamp(1.9rem, 4vw, 2.4rem);
	margin-bottom: 0.75rem;
}

h2 {
	font-size: 1.4rem;
	color: var(--accent-purple);
	margin-bottom: 0.5rem;
}

p {
	color: var(--text-muted);
	max-width: 70ch;
	margin-bottom: 1rem;
}

a {
	color: var(--accent-cyan);
	text-decoration: none;
}

a:hover {
	color: var(--accent-purple);
}

/* =========================
   Layout Containers
========================= */
.container {
	max-width: 960px;
	margin: 0 auto;
	padding: 2rem 1.25rem;
}

.article {
	max-width: 820px;
}

/* =========================
   Navbar (Mobile First)
========================= */
.navbar {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;

	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--border-soft);

	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.45),
		rgba(0, 0, 0, 0.15)
	);
}

.brand {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.logo {
	width: 56px;
	height: 56px;
	object-fit: contain;
}

.site-title {
	font-size: 1.4rem;
	font-weight: 600;
	color: white;
}

.nav-links {
	display: flex;
	gap: 1rem;
	width: 100%;
	justify-content: flex-start;
}

.nav-links a {
	font-weight: 500;
}

/* =========================
   Cards
========================= */
.cards {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.25rem;
	margin-top: 2rem;
}

.card {
	display: block;
	padding: 1.4rem;

	background: var(--bg-panel);
	border-left: 4px solid var(--accent-cyan);
	border-radius: var(--radius);

	box-shadow: var(--shadow-soft);
	transition: all 0.25s ease;

	color: var(--text-main);
}

.card h2 {
	margin-top: 0;
	font-size: 1.15rem;
}

.card p {
	font-size: 0.95rem;
}

.card .meta {
	display: block;
	margin-top: 0.75rem;
	font-size: 0.8rem;
	opacity: 0.75;
}

.card:hover {
	background: var(--bg-panel-hover);
	border-left-color: var(--accent-purple);
	transform: translateY(-2px);
}

/* =========================
   Panels / Callouts
========================= */
.panel {
	background: var(--bg-panel);
	border-left: 4px solid var(--accent-cyan);
	border-radius: var(--radius);

	padding: 1.4rem;
	margin: 2rem 0;
}

.panel strong {
	color: var(--text-main);
}

.pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap; 
	gap: 0.5rem;
	margin: 2rem 0;
	padding: 0 1rem;
}

.page-button {
	background: transparent;
	border: 1px solid #ccc;
	padding: 0.5rem 0.9rem;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.95rem;
	min-width: 2.5rem;
	text-align: center;
}

.page-button.active {
	background: #111;
	color: #fff;
	border-color: #111;
}

.page-button:hover {
	background: #eee;
}

/* 📱 Mobile-specific tweaks */
@media (max-width: 600px) {
	.pagination {
		gap: 0.75rem;
	}

	.page-button {
		font-size: 1rem;
		padding: 0.6rem 1rem;
	}
}

/* =========================
   Footer
========================= */
footer {
	text-align: center;
	padding: 2rem 1rem;
	font-size: 0.8rem;
	opacity: 0.6;
	border-top: 1px solid var(--border-soft);
}

/* =========================
   Desktop Enhancements
========================= */
@media (min-width: 768px) {
	.nav-links {
		width: auto;
	}

	.logo {
		width: 72px;
		height: 72px;
	}

	.site-title {
		font-size: 1.8rem;
	}

	.cards {
		grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	}
}

.image-gallery {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
	margin-top: 1rem;
}

.image-gallery figure {
	max-width: 220px;
	text-align: center;
}

.image-gallery img {
	width: 100%;
	border-radius: 12px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-gallery figcaption {
	margin-top: 0.5rem;
	font-size: 0.9rem;
	color: #666;
}

/* =========================
   Mobile Optimization
   ========================= */

@media (max-width: 768px) {

	body {
		font-size: 15px;
		line-height: 1.6;
		padding: 0;
		margin: 0;
	}

	.container {
		padding: 1rem;
	}

	.navbar {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5rem;
		padding: 0.8rem 1rem;
	}

	.brand {
		display: flex;
		align-items: center;
		gap: 0.5rem;
	}

	.logo {
		width: 32px;
		height: 32px;
	}

	.site-title {
		font-size: 1rem;
	}

	.nav-links {
		display: flex;
		gap: 1rem;
		flex-wrap: wrap;
		font-size: 0.9rem;
	}

	h1 {
		font-size: 1.6rem;
	}

	h2 {
		font-size: 1.2rem;
		margin-top: 1.5rem;
	}

	pre {
		overflow-x: auto;
		padding: 0.8rem;
		font-size: 0.8rem;
		border-radius: 8px;
	}

	code {
		word-break: break-word;
	}

	.image-gallery {
		flex-direction: column;
		align-items: center;
	}

	.image-gallery figure {
		max-width: 100%;
	}

	.image-gallery img {
		width: 100%;
		max-width: 300px;
	}

	.meta {
		font-size: 0.85rem;
		line-height: 1.4;
	}

	a {
		word-break: break-word;
	}
}
