
/* -----------------------------------
  # blog/blog.css
   Terminal-Themed Blog Styles (2024 Clean)
   ----------------------------------- */

/* Import JetBrains Mono font */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700;800&display=swap');

/* -------------------------
   Root Variables
------------------------- */
:root {
  --bg-dark: #080a0f;
  --bg-panel: #20252c;
  --border-color: #454c54;

  --neon-green: #40c000;
  --neon-blue:  #36c2c2;
  --neon-yellow: #dfc700;
  --neon-red:   #ff4d4d;
  --neon-purple: #a040c0;
  --neon-orange: #ff8c00;
  --neon-pink:  #ff40c0;
  --neon-cyan:  #00c0c0;

  --text-primary:   #d3d9df;
  --text-highlight: #ffffff;
}

/* -------------------------
   Reset & Core Setup
------------------------- */
html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: var(--bg-dark);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  line-height: 1.8;
}

/* -------------------------
   Scrollbar Styling
------------------------- */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--neon-green) var(--bg-dark);
}
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background-color: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background-color: var(--neon-green);
  border-radius: 4px;
  border: 1px solid var(--border-color);
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--neon-blue);
}

/* -------------------------
   Layout Containers
------------------------- */
.container {
  width: 100%;
  max-width: 1042px;
  margin: 0 auto;
  padding: 1rem;
  flex: 1;
  position: relative;
}

/* -------------------------
   Header & Branding
------------------------- */
.site-header {
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.header-branding {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.header-logo {
  width: 64px;
  height: 64px;
  border-radius: 0.5rem;
  box-shadow: 0 0 12px var(--neon-green);
  transition: transform 0.3s ease;
}
.header-logo:hover {
  transform: rotate(-21deg) scale(1.84);
}
.header-text h1 {
  font-size: 2.2rem;
  line-height: 1.1;
  color: var(--neon-green);
  text-shadow: 0 0 2px var(--neon-green);
}
.header-text h3 {
  font-size: 1.1rem;
  line-height: 1.2;
  color: var(--neon-blue);
}
        /* Align Table of Contents to the left */
nav.table-of-contents {
    justify-content: flex-start;
    flex-direction: column;
}
nav.table-of-contents ul {
    text-align: left;
}


/* -------------------------
   Navigation Button
------------------------- */
nav {
  display: flex;
  justify-content: center;
}
.cta-button {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.33rem 0.88rem;
  background-color: var(--neon-green);
  color: var(--bg-panel);
  border: 2px solid var(--neon-green);
  border-radius: 0.33rem;
  text-decoration: none;
  font-weight: 800;
  text-shadow: 1px 1px 1px var(--neon-blue);

  transition: background-color 0.3s ease, color 0.3s ease;
  font-size: 1rem;
}
.cta-button:hover {
  background-color: var(--neon-blue);
  color: var(--text-highlight);
  transform: rotate(0.42deg) scale(1.13);
}

/* -------------------------
   Typography
------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'JetBrains Mono', monospace;
  text-rendering: optimizeLegibility;
  font-weight: 700;
}

h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 0.7rem;
  color: var(--neon-green);
  text-shadow: 0 0 2px var(--neon-green);
}

h2 {
  font-size: 1.7rem;
  margin-bottom: 0.8rem;
  color: var(--neon-green);
  border-bottom: 1px solid var(--neon-green);
  padding-bottom: 0.2rem;
}

h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--neon-blue);
}

p {
  margin: 1.1rem 0;
  font-size: 1.05rem;
  line-height: 1.7;
}

ul, ol {
  margin: 1.1rem 0;
  padding-left: 1.5rem;
  line-height: 1.5;
}

a {
  color: var(--neon-green);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover, a:focus {
  color: var(--text-highlight);
}
.toc-link {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--neon-blue);
  text-decoration: underline;
}

/* -------------------------
   Main Content
------------------------- */
main.blog-content {
  padding: 2rem 0;
}

/* -------------------------
   Highlight & Listings
------------------------- */
.highlight-box,
.blog-post-listing {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 0 8px rgba(64,192,0,0.3);
  padding: 2rem;
  margin-bottom: 2rem;
}
.blog-post-listing {
  padding: 1.5rem;
}

/* -------------------------
   Grid & Cards
------------------------- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.post-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post-card:hover {
  transform: translateY(-0.25rem);
  box-shadow: 0 6px 20px rgba(64,192,0,0.3);
}
.post-card h3 {
  margin-bottom: 0.5rem;
}
.post-card .summary {
  flex-grow: 1;
  margin: 1rem 0;
  font-size: 1rem;
  line-height: 1.5;
}

/* -------------------------
   Images & Figures
------------------------- */
figure {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem auto;
  padding: 1rem;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 0 8px rgba(64,192,0,0.3);
  max-width: 100%;
}
figure img,
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* -------------------------
   Code Blocks & Copy Button
------------------------- */
pre {
  background-color: #2d2d2d;
  color: #f8f8f2;
  padding: 1.1rem;
  border-radius: 0.5rem;
  overflow: auto;
  margin-bottom: 1.5rem;
  position: relative;
}
code {
  font-family: 'JetBrains Mono', monospace;
}
.copy-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: var(--neon-green);
  border: none;
  color: #000;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.95rem;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}
.copy-button:hover {
  opacity: 1;
}

/* -------------------------
   Footer
------------------------- */
footer {
  background-color: var(--bg-panel);
  border-top: 1px solid var(--border-color);
  text-align: center;
  padding: 2rem 1rem;
  margin-top: auto;
  color: var(--text-primary);
}

/* -------------------------
   Responsive: Mobile First Enhancements
------------------------- */
@media (max-width: 700px) {
  html {
    font-size: 102.42%; /* Bump base for easier reading on mobile */
  }
  .container {
    padding: 0.7rem;
  }
  .site-header,
  footer {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  h1 {
    font-size: 2.2rem;
  }
  h2 {
    font-size: 1.4rem;
  }
  h3 {
    font-size: 1.15rem;
  }
  p,
  .post-card .summary {
    font-size: 1.1rem;
  }
  .highlight-box,
  .blog-post-listing {
    padding: 1rem;
  }
  .posts-grid {
    gap: 0.7rem;
    margin: 1rem 0;
  }
  .header-logo {
    width: 64px;
    min-height: 64px;
  }
}
/* Accessibility: Skip Link */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  background: var(--neon-green);
  color: #000;
  padding: 0.5rem 1.2rem;
  font-weight: bold;
  z-index: 1000;
  border-radius: 0.33rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: left 0.2s;
}
.skip-link:focus {
  left: 10px;
  top: 10px;
  width: auto;
  height: auto;
  outline: 2px solid var(--neon-blue);
  box-shadow: 0 0 0 2px var(--neon-yellow);
}


/* -----------------------------------
   Mermaid Scrollable Container
   enforce min-dimensions + scrollbars
----------------------------------- */
.mermaid {
  display: block;           /* ensure it’s a block-level box */
  min-width: 400px;         /* pick your minimum width */
  min-height: 800px;        /* pick your minimum height */
  overflow: auto;           /* show scrollbars when content exceeds */
}

/* -------------------------
   Hamburger Menu Styles
------------------------- */
.hamburger-toggle {
  position: fixed;
  top: 1.2rem;
  left: 1.2rem;
  z-index: 1200;
  background: none;
  border: none;
  cursor: pointer;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hamburger-icon,
.hamburger-icon::before,
.hamburger-icon::after {
  display: block;
  background: var(--neon-green);
  height: 4px;
  width: 2rem;
  border-radius: 2px;
  position: relative;
  transition: all 0.3s;
}
.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  position: absolute;
  left: 0;
}
.hamburger-icon::before {
  top: -0.6rem;
}
.hamburger-icon::after {
  top: 0.6rem;
}


.hamburger-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 18rem;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-panel);
  border-right: 2px solid var(--neon-green);
  box-shadow: 2px 0 16px rgba(64,192,0,0.13);
  z-index: 1342;
  padding: 2.5rem 1.2rem 1.2rem 1.2rem;
  overflow-y: auto;
  transition: transform 0.2s;
}
.hamburger-menu[hidden] {
  display: none !important;
}
.hamburger-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.hamburger-menu li {
  margin-bottom: 1rem;
}
.hamburger-menu a {
  color: var(--neon-green);
  font-size: 1.1rem;
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s;
}
.hamburger-menu a:hover,
.hamburger-menu a:focus {
  color: var(--neon-yellow);
  text-decoration: underline;
}

/* -------------------------
   Responsive: Hide Hamburger Menu
------------------------- */
@media (min-width: 1100px) {
  .hamburger-toggle {
    display: true;
  }
  .hamburger-menu {
    display: true !important;
  }
}
