/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
	/* Colors */
	--color-primary:    #1a56db;
	--color-secondary:  #7e3af2;
	--color-background: #ffffff;
	--color-foreground: #111827;
	--color-muted:      #f3f4f6;

	/* Typography */
	--font-base:        system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-heading:     system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-size-base:   1rem;
	--line-height-base: 1.6;

	/* Spacing */
	--spacing-xs:   0.25rem;
	--spacing-sm:   0.5rem;
	--spacing-md:   1rem;
	--spacing-lg:   1.5rem;
	--spacing-xl:   2rem;
	--spacing-2xl:  3rem;

	/* Border radius */
	--radius-sm: 0.25rem;
	--radius-md: 0.5rem;
	--radius-lg: 1rem;
}

/* ==========================================================================
   Modern CSS Reset
   ========================================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

* {
	margin: 0;
	padding: 0;
}

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	font-family: var(--font-base);
	font-size: var(--font-size-base);
	line-height: var(--line-height-base);
	color: var(--color-foreground);
	background-color: var(--color-background);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
}

input,
button,
textarea,
select {
	font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
	overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-heading);
	line-height: 1.2;
}

a {
	color: var(--color-primary);
	text-decoration-skip-ink: auto;
}

a:hover {
	text-decoration: none;
}

ul,
ol {
	list-style: none;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: var(--spacing-lg);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

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

.flex {
	display: flex;
}

.flex-col {
	flex-direction: column;
}

.items-center {
	align-items: center;
}

.justify-between {
	justify-content: space-between;
}

.gap-sm {
	gap: var(--spacing-sm);
}

.gap-md {
	gap: var(--spacing-md);
}

.gap-lg {
	gap: var(--spacing-lg);
}

/* ==========================================================================
   Site structure
   ========================================================================== */

.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-content {
	flex: 1;
	padding-block: var(--spacing-2xl);
}

/* ==========================================================================
   Site header
   ========================================================================== */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: var(--color-background);
	border-bottom: 1px solid var(--color-muted);
	transition: box-shadow 0.2s ease;
}

.site-header.scrolled {
	box-shadow: 0 2px 8px rgb(0 0 0 / 0.08);
}

.site-header .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-block: var(--spacing-md);
}

.site-branding a {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 1.25rem;
	color: var(--color-foreground);
	text-decoration: none;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav-primary ul {
	display: flex;
	align-items: center;
	gap: var(--spacing-lg);
	list-style: none;
}

.nav-primary a {
	color: var(--color-foreground);
	text-decoration: none;
	font-size: 0.9375rem;
	transition: color 0.15s ease;
}

.nav-primary a:hover {
	color: var(--color-primary);
}

.menu-toggle {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: var(--spacing-xs);
	color: var(--color-foreground);
}

@media (max-width: 768px) {
	.menu-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.nav-primary {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background-color: var(--color-background);
		border-bottom: 1px solid var(--color-muted);
		padding: var(--spacing-md) var(--spacing-lg);
	}

	.nav-primary.is-open {
		display: block;
	}

	.nav-primary ul {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--spacing-sm);
	}
}

/* ==========================================================================
   Site footer
   ========================================================================== */

.site-footer {
	background-color: var(--color-muted);
	padding-block: var(--spacing-xl);
	border-top: 1px solid var(--color-muted);
}

.site-footer .container {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--spacing-md);
}

.nav-footer ul {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-md);
	list-style: none;
}

.nav-footer a {
	color: var(--color-foreground);
	text-decoration: none;
	font-size: 0.875rem;
}

.nav-footer a:hover {
	color: var(--color-primary);
}

.site-info {
	font-size: 0.875rem;
	color: var(--color-foreground);
}

/* ==========================================================================
   Posts / entries
   ========================================================================== */

.entry-header {
	margin-bottom: var(--spacing-lg);
}

.entry-title {
	font-size: clamp(1.5rem, 4vw, 2.25rem);
	margin-bottom: var(--spacing-sm);
}

.entry-title a {
	color: inherit;
	text-decoration: none;
}

.entry-title a:hover {
	color: var(--color-primary);
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-sm);
	font-size: 0.875rem;
	color: var(--color-foreground);
	opacity: 0.7;
}

.entry-content {
	margin-bottom: var(--spacing-xl);
}

.post-thumbnail img {
	width: 100%;
	height: auto;
	border-radius: var(--radius-md);
	margin-bottom: var(--spacing-lg);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.posts-navigation,
.post-navigation {
	margin-top: var(--spacing-2xl);
}

/* ==========================================================================
   Archive / search page
   ========================================================================== */

.page-header {
	margin-bottom: var(--spacing-xl);
	padding-bottom: var(--spacing-lg);
	border-bottom: 1px solid var(--color-muted);
}

.page-title {
	font-size: clamp(1.5rem, 4vw, 2rem);
}

/* ==========================================================================
   404
   ========================================================================== */

.error-404 {
	text-align: center;
	padding-block: var(--spacing-2xl);
}
