@font-face {
  font-family: 'FantasqueSansM Nerd Font';
  src: url('/fonts/FantasqueSansMNerdFontMono-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'FantasqueSansM Nerd Font';
  src: url('/fonts/FantasqueSansMNerdFontMono-Italic.woff2') format('woff2');
  font-weight: normal;
  font-style: italic; /* Maps this file to italic requests */
  font-display: swap;
}

@font-face {
  font-family: 'FantasqueSansM Nerd Font';
  src: url('/fonts/FantasqueSansMNerdFontMono-Bold.woff2') format('woff2');
  font-weight: bold; /* Maps this file to bold requests */
  font-style: normal;
  font-display: swap;
}

:root {
  /* OneDark Palette */
  --bg-primary: #282c34;
  --bg-secondary: #21252b;
  --text-main: #abb2bf;
  --text-dim: #5c6370;
  
  /* Accents */
  --accent-blue: #61afef;
  --accent-red: #e06c75;
  --accent-green: #98c379;
  --accent-yellow: #e5c07b;
  --accent-purple: #c678dd;
  --accent-cyan: #56b6c2;

  /* Responsive Layout Variables */
  --max-width: 800px;
  --spacing: 1.5rem; /* Default for desktop */
  
  /* Typography Scale */
  --font-h1: 2.5rem;
  --font-h2: 1.8rem;
  --font-h3: 1.4rem;

  --font-base: "FantasqueSansM Nerd Font", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "FantasqueSansM Nerd Font", "Fira Code", Consolas, monospace;
}

/* Mobile Overrides */
@media (max-width: 600px) {
  :root {
    --spacing: 1rem;
    --font-h1: 2rem;
    --font-h2: 1.75rem;
    --font-h3: 1.3rem;
  }
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; }

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-base);
  line-height: 1.6;
  font-size: 1.25rem;
  margin: 0;
  padding: 0;

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

/* Typography */
h1, h2, h3 {
  color: var(--accent-blue);
  line-height: 1.2;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h1.title {
  margin-left: 1rem;
}

h1 { font-size: var(--font-h1); border-bottom: 2px solid var(--bg-secondary); padding-bottom: 0.5rem; }
h2 { font-size: var(--font-h2); color: var(--accent-purple); }
h3 { font-size: var(--font-h3); color: var(--accent-cyan); }

a {
  color: var(--accent-blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

a:hover { border-bottom-color: var(--accent-blue); }

code {
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  color: var(--accent-yellow);
  font-size: 0.9em;
}

pre {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #3e4451;
  
  /* Mobile scrolling is critical */
  overflow-x: auto;
  
  /* Break out of the container slightly on mobile for more space? Optional. */
  margin-left: 0;
  margin-right: 0;
}

pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.9rem;
}

/* Blog List */
ul.post-list {
  list-style: none;
  padding: 0;
}

ul.post-list li {
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--bg-secondary);
  padding-bottom: 0.5rem;
  gap: 1rem; /* Ensure space between title and date */
}

@media (max-width: 480px) {
  ul.post-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  /* Make the date smaller and dim when stacked */
  time {
    font-size: 0.8rem;
    color: var(--text-dim);
  }
}

time {
  color: var(--accent-purple);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  white-space: nowrap;
}

time::before {
  content: "[";
  color: var(--accent-yellow);
}

time::after {
  content: "]";
  color: var(--accent-yellow);
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--accent-green);
  margin: 1.5rem 0;
  padding-left: 1rem;
  font-style: italic;
  color: var(--text-dim);
}

/* Navbar Styling */
.site-nav {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid #3e4451;
  padding: 0; /* Let container handle padding */
}

main, 
.nav-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Allows links to drop to next line on mobile */
  padding: 0.5rem var(--spacing); /* Standard padding */
}

.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: auto; /* Auto width on desktop */
}

.nav-toggle {
  display: none; /* Hidden on Desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-main);
  font-size: 1.5rem;
}

.nav-logo {
  font-family: var(--font-mono);
  color: var(--accent-green) !important;
  font-weight: bold;
  font-size: 0.9rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  border: none;
}

.nav-links a:hover {
  color: var(--accent-blue);
  border: none;
}

.nav-links a.active {
  color: var(--accent-blue);
  font-weight: bold;
}

.nav-links a.active::before {
  content: "/";
  color: var(--accent-green);
}

.post-info {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.post-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 0.2rem;
}

.reading-time {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--bg-secondary);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

/* Ensure the main container doesn't feel cramped */
main {
  padding-top: 1rem;
}

/* --- Mobile / Hamburger Styles --- */
@media (max-width: 600px) {
  .nav-header {
    width: 100%; /* Header takes full width so button sits on the right */
  }

  .nav-toggle {
    display: block; /* Show button on mobile */
  }

  /* Hamburger Icon (simple text or CSS shape) */
  .hamburger::after {
    content: "☰"; /* Simple text icon */
    color: var(--accent-blue);
  }

  /* The Links Menu */
  .nav-links {
    display: none; /* Hidden by default */
    flex-direction: column;
    width: 100%;
    padding-top: 1rem;
    border-top: 1px solid #3e4451;
    margin-top: 0.5rem;
  }

  /* The 'Open' State (toggled by JS) */
  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--bg-primary); /* Subtle separator */
  }
  
  /* Indent links slightly to look like a file tree */
  .nav-links a::before {
    content: "  ↳ ";
    color: var(--text-dim);
    font-size: 0.8em;
  }
}
