:root {
  /* Light Theme Colors */
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #777;
  --accent: #7f18b4;
  /* --accent: #0066cc; */
  --border: #eee;
  --code-bg: #f8f8f8;
  --nav-bg: #fafafa;
}

[data-theme="dark"] {
  /* Dark Theme Colors */
  --bg: #121212;
  --text: #e0e0e0;
  --muted: #a0a0a0;
  --accent: #4dabf7;
  --border: #2d2d2d;
  --code-bg: #1e1e1e;
  --nav-bg: #1a1a1a;
}

html {
  font-size: 62.5%; /* 1rem = 10px */
}

body {
  font-family: 'Geist', Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.6rem; /* Default text is 16px */
  line-height: 1.7;
  background-color: var(--bg);
  color: var(--text);
  max-width: 80rem; /* 800px */
  margin: 0 auto;
  padding: 0 2rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 2. Header & Navigation */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0;
  border-bottom: 0.1rem solid var(--border);
  margin-bottom: 4rem;
}

nav a {
  margin-right: 2rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

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

/* 3. Theme Toggle */
#theme-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border: 0.1rem solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 0.4rem;
  font-size: 1.4rem;
}

.icon {
  width: 2.4rem;
  height: 2.4rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: middle;
  transition: all 0.2s ease;
}
#theme-toggle:hover {
  color: #fff;
  box-shadow: 3px 3px 3px rgba(27, 37, 46, 0.2);
}
#theme-toggle:hover .icon { transform: rotate(-15deg) scale(1.1); }

/* 4. Typography & Blog Content */
h1 {
  font-size: 3.2rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}
h2 { font-size: 2.4rem; margin-top: 3rem; }
h3 { font-size: 2rem; }

p { margin-bottom: 2rem; }

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

.small-text { font-size: 1rem; }
.muted-text { color: var(--muted); }

/* 5. Post Metadata */
.post-header {
  display: flex;
  flex-direction: column;

  margin-bottom: 4rem;
}

.post-meta {
  font-size: 1.4rem;
  color: var(--muted);
  display: flex;
  gap: 1rem;
  align-items: center;
}

.tag-container {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.tag-badge {
  font-size: 1.2rem;
  background: var(--code-bg);
  padding: 0.4rem 1rem;
  border-radius: 0.3rem;
  border: 0.1rem solid var(--border);
  color: var(--muted);
}

.tag-badge:hover {
  background: var(--accent);
  color: white;
  text-decoration: none;
}

/* 6. Markdown Article Styling */
article img {
  max-width: 100%;
  height: auto;
  border-radius: 0.8rem;
  margin: 2rem 0;
}

pre {
  background: var(--code-bg);
  padding: 2rem;
  border-radius: 0.8rem;
  overflow-x: auto;
  border: 0.1rem solid var(--border);
  margin: 2rem 0;
}

blockquote {
  border-left: 0.4rem solid var(--accent);
  margin: 2rem 0;
  padding-left: 2rem;
  font-style: italic;
  color: var(--muted);
}


/* 7. Home & Search Page Layouts */
.post-list {
  list-style: none;
  padding: 0;
}

.post-entry {
  padding: 2.5rem 0;
  border-bottom: 0.1rem solid var(--border);
}

.post-entry:last-child {
  border-bottom: none;
}

.post-entry h2 {
  font-size: 2.2rem;
  margin: 0 0 1rem 0;
}

.post-entry .description {
  color: var(--muted);
  font-size: 1.5rem;
  margin-bottom: 1.2rem;
}

/* 8. Search Form Styling */
.search-container {
  margin-bottom: 4rem;
}

.search-input {
  width: 100%;
  padding: 1.2rem;
  font-size: 1.6rem;
  border: 0.1rem solid var(--border);
  border-radius: 0.6rem;
  background: var(--nav-bg);
  color: var(--text);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.2);
}

/* 9. Previous/Next Navigation */
.post-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 6rem;
  padding-top: 2rem;
  border-top: 0.1rem solid var(--border);
}

.nav-item span {
  font-size: 1.2rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1rem;
}

.nav-item a {
  display: block;
  font-weight: 600;
  margin-top: 0.5rem;
}
