/* ------------------------------
   Dark Theme Variables
------------------------------ */
:root {
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --accent-color: #00aaff;
  --header-bg: #1f1f1f;
  --footer-bg: #1f1f1f;
  --transition-speed: 0.3s;

  /* Enhanced Typography */
  --body-font: 'Roboto', sans-serif;
  --code-font: 'Fira Code', monospace;
  --base-font-size: 1.05rem;
  --line-height: 1.65;
}

/* ------------------------------
   Global Reset & Base
------------------------------ */
html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--body-font);
  font-size: var(--base-font-size);
  line-height: var(--line-height);
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ------------------------------
   Header Navigation
------------------------------ */
.site-header {
  width: 100%;
  background-color: var(--header-bg);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  transition: transform var(--transition-speed);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
}

.site-nav a {
  display: block;
  padding: 1rem;
  color: var(--text-color);
  text-decoration: none;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

.site-nav a:hover {
  background-color: var(--accent-color);
  color: #000;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Responsive Menu: Show button, hide links */
@media (max-width: 240px) {
  .menu-toggle {
    display: block; /* Show the hamburger icon */
  }

  .site-nav ul {
    display: none; /* Hide the menu by default */
    flex-direction: column; /* Stack links vertically */
    background-color: var(--header-bg);
    position: absolute;
    top: 100%; /* Below the header */
    left: 0;
    right: 0;
    padding: 1rem;
  }

  .site-nav ul.show {
    display: flex; /* Show the menu when active */
  }
}

/* ------------------------------
   Layout Wrapper & Footer
------------------------------ */
.page-layout-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-footer {
  text-align: center;
  background-color: var(--footer-bg);
  padding: 0.75rem;
  margin: 0rem;
  font-size: 0.85rem;
}

.footer-line {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-line a + a {
  margin-left: -0.3rem;
}

.footer-line a {
  color: var(--text-color);
  display: flex;
  align-items: center;
  opacity: 0.7;
}

.footer-line a:hover {
  opacity: 1;
}

/* ------------------------------
   Main Content
------------------------------ */
.main-content {
  flex: 1;
  margin-top: 30px; /* Enough to avoid overlap with fixed header */
  padding: 1rem;
}

.home-wrapper,
.about-wrapper {
  max-width: 48rem;
  margin: 2rem auto;
  line-height: var(--line-height);
}

/* ------------------------------
   Posts List Page
------------------------------ */
.posts-list-wrapper {
  max-width: 48rem;
  margin: 2rem auto; /* Matches the single post container for alignment */
  padding: 0;
}

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post-item {
  background-color: #1c1c1c;
  padding: 1rem;
  border-radius: 5px;
  word-wrap: break-word; /* Handles long unbroken text */
  overflow-wrap: break-word; /* Modern equivalent */
  word-break: break-word;
}

/* ------------------------------
   Single Post Layout
------------------------------ */
.post-article {
  /* Same width and positioning to align with .posts-list-wrapper */
  max-width: 48rem;
  margin: 2rem auto;
  background-color: #1c1c1c;
  padding: 1rem;
  border-radius: 5px;
  line-height: var(--line-height);
  word-wrap: break-word; /* Handles long unbroken text */
  overflow-wrap: break-word; /* Modern equivalent */
  word-break: break-word;
}


/* Titles & Dates */
.post-title {
  margin: 0 0 0.5rem 0;
  font-weight: 500;
}

.post-date {
  display: block;
  margin-top: -0.25rem;
  margin-bottom: 1rem;
  color: #bbb;
}

/* Thumbnails, Excerpts, etc. */
.post-thumbnail img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 1rem;
}

.post-excerpt {
  margin: 1rem 0;
}

/* Read More Button */
.read-more-button {
  padding: 0.5rem 1rem;
  background-color: transparent;
  color: var(--accent-color);
  text-decoration: none;
  border: 2px solid var(--accent-color);
  border-radius: 5px;
  font-size: 1rem;
  display: inline-block;
  text-align: center;
  transition: all var(--transition-speed);
}

.read-more-button:hover {
  background-color: var(--accent-color);
  color: #000;
}

/* ------------------------------
   Extra Elements in Single Post
------------------------------ */
article.post-article details {
  margin-left: 1rem;
  padding: 0.5rem 0;
}

article.post-article details summary {
  cursor: pointer;
  color: #0077cc;
  font-weight: normal;
  text-decoration: underline dashed;
  text-underline-offset: 2px;
}

/* Centered Images */
img.centered {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

/* ------------------------------
   Code Blocks & Inline Code
------------------------------ */
code,
pre {
  font-family: var(--code-font);
  background-color: #2a2a2a;
  color: #fff;
  border-radius: 4px;
}

code {
  padding: 0.2em 0.4em;
  font-size: 0.95em;
}

pre {
  padding: 1rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

/* ------------------------------
   Links
------------------------------ */
.post-article a,
.home-wrapper a,
.about-wrapper a,
.posts-list-wrapper a:not(.read-more-button) {
  color: #5bb8ff;
  text-decoration: none;
}

.post-article a:visited,
.home-wrapper a:visited,
.about-wrapper a:visited,
.posts-list-wrapper a:not(.read-more-button):visited {
  color: #a78bfa;
}

.post-article a:hover,
.home-wrapper a:hover,
.about-wrapper a:hover,
.posts-list-wrapper a:not(.read-more-button):hover {
  text-decoration: underline;
}

/* ------------------------------
   Callout / Anecdote Boxes
------------------------------ */
.callout {
  background-color: #242424;
  border-left: 3px solid #555;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 4px;
}

.callout > p:first-child { margin-top: 0; }
.callout > p:last-child { margin-bottom: 0; }

/* ------------------------------
   Blockquotes
------------------------------ */
blockquote {
  border-left: 3px solid var(--accent-color);
  margin: 1rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  color: #bbb;
}