:root {
  /* Automatically activates system-level light/dark mode styling */
  color-scheme: light dark;
  
  /* Layout variables */
  --max-width: 42rem;
  
  /* Light theme color palette defaults */
  --color-text: #222;
  --color-link: #0066cc;
  --color-border: #ddd;
  --color-tag-bg: #f0f0f0;
}

/* Gracefully swaps variables if the user's system prefers Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --color-text: #f0f0f0;
    --color-link: #66b2ff;
    --color-border: #444;
    --color-tag-bg: #2a2a2a;
  }
}

body {
  margin: 0 auto;
  padding: 2rem 1rem;
  max-width: var(--max-width);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--color-text);
}

/* Site Brand/Title */
.site-title {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 300;
  text-transform: lowercase;
  text-decoration: none;
  color: inherit; /* Keeps title text the default text color instead of link blue */
  padding-bottom: 1rem;
}

/* Links behavior */
a {
  color: var(--color-link);
  text-underline-offset: 0.2em;
}

/* Navigation layout */
nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
  padding: 0 0 1rem 0;
  margin: 0;
  border-bottom: 1px solid var(--color-border);
}

nav a {
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

/* Content typography polish */
h1, h2, h3 {
  line-height: 1.2;
  margin-top: 2rem;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Tag Pills */
.post-tags {
  display: flex;
  flex-wrap: wrap; /* Prevents long tag lists from overflowing mobile screens */
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.post-tags li {
  font-size: 0.85rem;
  padding: 0.2rem 0.6rem;
  background-color: var(--color-tag-bg);
  border-radius: 4px;
}

.post-tags a {
  text-decoration: none;
  color: inherit;
}
blockquote {
  border-left: 1px solid #ccc;
  margin: 1.5em 10px;
  padding: 0.5em 10px;
}
blockquote p {
  display: inline;
}
/* --- Mobile Safety & Overflow Fixes --- */

/* 1. Prevent standard images/media from stretching past the 42rem body */
img, video, iframe, svg {
  max-width: 100%;
  height: auto;
}

/* 2. Fix for Markdown code blocks (The #1 cause of overflow in 11ty blogs) */
pre, code {
  white-space: pre-wrap;       /* Forces long code lines to wrap onto a new line */
  word-break: break-all;       /* Breaks long continuous text strings if needed */
}

/* Alternative code block fix: If you prefer code to scroll horizontally 
   instead of wrapping text, uncomment the block below and comment out the one above: */
/*
pre {
  overflow-x: auto;
  max-width: 100%;
}
*/

/* 3. Prevent long URLs or unbroken words in paragraphs from pushing the page out */
p, li, a {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

