/* Universal Box-Sizing Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Ensure images and media never overflow their containers */
img, video {
  max-width: 100%;
  height: auto;
}

/* Light Theme Defaults (Root) */
:root {
  --bg-color: #f9fafb;
  --text-color: #111827;
  --header-bg: #ffffff;
  --border-color: #e5e7eb;
  --link-color: #1d4ed8;
  --muted-color: #6b7280;
  --card-bg: #ffffff;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-color: #0f172a;
  --text-color: #f8fafc;
  --header-bg: #1e293b;
  --border-color: #334155;
  --link-color: #60a5fa;
  --muted-color: #94a3b8;
  --card-bg: #1e293b;
}

/* Apply Variables */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.2s ease, color 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-color);
  text-decoration: none;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--muted-color);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--text-color);
}

.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--link-color);
  border-radius: 2px;
}

/* Theme Toggle Button Style */
#theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background-color 0.2s ease;
}

#theme-toggle:hover {
  background-color: var(--border-color);
}

.site-content {
  flex: 1;
  padding: 3rem 0;
}

.site-footer {
  background: var(--header-bg);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-color);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Post list items styling using variables */
.post-item {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.post-item:hover {
  transform: translateY(-2px);
  border-color: var(--muted-color);
}

.post-item a.post-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
}

.post-title {
  color: var(--link-color);
  font-weight: 600;
}

.post-date {
  font-size: 0.85rem;
  color: var(--muted-color);
}


pre {
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Remove bullet points from your post lists */
.posts,
.recent-posts {
  list-style: none;
  padding-left: 0;
  margin-top: 1.5rem;
}

.formatted-text {
  white-space: pre-wrap; /* Preserves line breaks, collapses extra indentation, and wraps cleanly on mobile */
  line-height: 1.8;
}
