/* === Base === */
body {
  background: linear-gradient(180deg, #0a0f1a 0%, #101828 100%);
  color: #e5e7eb;
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.2rem 1.5rem;
  box-sizing: border-box;
}

/* Newsletter Section */
.newsletter {
  text-align: center;
  background: var(--bg-card);
  padding: 1rem 1rem;
  margin-top: 1rem;
  border-top: 1px solid #21262d;
}

.newsletter h3 {
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

.newsletter form {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.newsletter input {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  border: 1px solid #30363d;
  background: #0d1117;
  color: var(--text-primary);
  width: 280px;
}

.newsletter button {
  background: #238636;
  border: none;
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.newsletter button:hover {
  box-shadow: 0 0 15px rgba(46, 160, 67, 0.4);
  background: var(--accent);
  color: white;
}

/* Newsletter inside post */
.post-newsletter {
  text-align: center;
  margin-top: 4rem;
  padding: 2rem;
  background: var(--bg-dark);
  border-radius: var(--radius);
  border: 1px solid #30363d;
}

.post-newsletter h3 {
  color: var(--accent);
  margin-bottom: 1rem;
}

.post-newsletter p {
  margin-bottom: 1.5rem;
  color: #b1bac4;
}

.post-newsletter input {
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid #30363d;
  background: #0d1117;
  color: var(--text-primary);
  width: 260px;
}

.post-newsletter button {
  background: #238636;
  border: none;
  color: white;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.post-newsletter button:hover {
  box-shadow: 0 0 15px rgba(46, 160, 67, 0.4);
}

/* === Buttons === */
.buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.btn {
  background: #238636;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn:hover {
  background: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 0 15px rgba(46, 160, 67, 0.4);
}

.btn.outline {
  background: #238636;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn.outline:hover {
  background: var(--accent);
  color: white;
}

/* === Header === */
.site-header {
  background: rgba(10, 15, 26, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.6rem 0;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;               /* fixed container height you want to keep */
  overflow: visible;          /* allow logo to overflow if scaled */
}

.logo a {
  font-weight: 700;
  font-size: 1.6rem;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: 0.5px;
  display: inline-block;
  height: 48px;
  line-height: 1;
}

.site-nav {
  display: flex;
  align-items: center;
}

.site-nav a {
  color: #e5e7eb;
  text-decoration: none;
  margin-left: 1.8rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: #60a5fa;
}

/* Logo: rounded corners with subtle shadow to blend into page */
.site-header .site-logo {
  display: block;
  height: 70px;
  width: auto;
  object-fit: contain;
  border-radius: 8px;               /* rounded corners */
  background: transparent;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06); /* soft edge for blending */
}

/* keep header height/layout, scale logo visually (doesn't affect document flow) */
.site-header .container {
  height: 70px;               /* fixed container height you want to keep */
  align-items: center;
  overflow: visible;          /* allow logo to overflow if scaled */
}

/* keep a small intrinsic size so layout remains stable, then scale */
.logo a { display: inline-block; height: 48px; line-height: 1; }
.site-logo {
  max-height: 48px;
  width: auto;
  display: block;
  transform-origin: left center;
  /* add a small downward offset before scaling to create top gap */
  /* transform: translateY(4px) scale(1.3); */
  will-change: transform;
  margin-top: 0;
}
/* responsive: reduce offset/scale on small screens */
@media (max-width: 480px) {
  .site-header .container { height: 5px; }
  .logo a { height: 34px; }
  .site-logo { max-height: 34px; transform: translateY(2px) scale(1.15); }
}

/* === Hero Section === */
.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
  background: linear-gradient(180deg, #0a0f1a 0%, #111c33 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hero h1 {
  font-size: 2.8rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.hero p {
  color: #ffffff;
  font-size: 1.2rem;
}

/* === Blog Grid === */
.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 3rem 1rem;
}

.post-card {
  background: #1e293b;
  border-radius: 12px;
  padding: 1.6rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.post-card h2 a {
  color: #93c5fd;
  text-decoration: none;
  font-size: 1.3rem;
}

.post-card h2 a:hover {
  color: #60a5fa;
}

.post-card p {
  color: #cbd5e1;
  font-size: 0.95rem;
  margin: 0.8rem 0 1rem;
}

.read-more {
  display: inline-block;
  color: #60a5fa;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.read-more:hover {
  text-decoration: underline;
}

/* === Single Post === */
.post {
  padding: 3rem 1rem;
}

.post h1 {
  color: #ffffff;
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.post-meta {
  color: #9ca3af;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.post-content p {
  color: #e2e8f0;
  margin-bottom: 1.2rem;
}

.post-content code {
  background: rgba(255, 255, 255, 0.1);
  font-family: 'Fira Code', monospace;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Table styling */
.post-content table {
    border-collapse: collapse;
    width: auto;  /* changed from 100% to auto */
    margin: 1rem auto;  /* centered with auto margins */
    border: 2px solid #e2e8f0;
    max-width: 100%;  /* prevent overflow on small screens */
}

.post-content table th,
.post-content table td {
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1.5rem;  /* increased horizontal padding */
    text-align: left;
    white-space: nowrap;  /* prevent text wrapping */
}

.post-content table th {
    background-color: #1e293b;  /* darker background to match theme */
    color: #e2e8f0;  /* lighter text for dark theme */
    font-weight: 600;
}

.post-content table tr:hover {
    background-color: #1e293b;  /* darker hover for dark theme */
}

/* Add horizontal scroll for small screens */
.post-content .table-wrapper {
    overflow-x: auto;
    margin: 1rem 0;
}

/* === Footer === */
/* ===== Fixed Footer (Improved) ===== */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  background: rgba(0, 0, 0, 0.4);
  color: #9ca3af;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0;
  z-index: 100;
  backdrop-filter: blur(8px); /* elegant blur effect */
}

/* Keep your inner container spacing */
.site-footer .container {
  padding: 0.3rem 0;
}

/* Prevent content from hiding behind footer */
body {
  padding-bottom: 45px; /* Adjust to your footer height */
}

/* === Responsive === */
@media (max-width: 768px) {
  .site-header .container {
    flex-direction: column;
  }

  .site-nav {
    margin-top: 0.6rem;
  }

  .site-nav a {
    margin-left: 0.8rem;
    font-size: 0.95rem;
  }

  .hero {
    padding: 3rem 1rem 2rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .post-card {
    padding: 1.3rem;
  }

  .post-card h2 a {
    font-size: 1.15rem;
  }

  .container {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.8rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .site-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* === Hero Slider === */
.hero-slider {
  position: relative;
  height: 65vh;
  overflow: hidden;
  font-family: "Inter", sans-serif;
}

/* Slides */
.hero-slider .slide {
  position: absolute;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-slider .slide.active {
  opacity: 2;
}

/* Overlay for better text contrast */
.hero-slider .overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1;
}

/* Content Box */
.hero-slider .content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding: 2rem;
  max-width: 800px;
}

.hero-slider h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 900;
}

.hero-slider p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: #e0e0e0;
  font-weight: 1000; /* Makes the text bold */
}

.hero-slider .buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Buttons */
.hero-slider .btn {
  background: #0078ff;
  color: #fff;
  padding: 0.8rem 1.8rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s;
}

.hero-slider .btn:hover {
  background: #005ecf;
}

.hero-slider .btn.outline {
  background: transparent;
  border: 2px solid #0078ff;
}

.hero-slider .btn.outline:hover {
  background: #0078ff;
  color: #fff;
}

/* Navigation Arrows */
.hero-slider .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: white;
  cursor: pointer;
  padding: 0 1rem;
  user-select: none;
  z-index: 3;
  transition: opacity 0.3s;
}

.hero-slider .nav:hover {
  opacity: 0.7;
}

.hero-slider .nav.prev { left: 10px; }
.hero-slider .nav.next { right: 10px; }

/* Dots */
.hero-slider .dots {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.6rem;
  z-index: 3;
}

.hero-slider .dot {
  width: 12px;
  height: 12px;
  background: #bbb;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s;
}

.hero-slider .dot.active {
  background: #0078ff;
}

/* ✅ Responsive (mobile friendly) */
@media (max-width: 768px) {
  .hero-slider {
    height: 80vh;
  }

  .hero-slider .slide {
    background-position: center;
    filter: brightness(0.5); /* darken background */
  }

  .hero-slider h1 {
    font-size: 2rem;
  }

  .hero-slider p {
    font-size: 1rem;
    color: #f0f0f0;
  }

  .hero-slider .btn {
    padding: 0.6rem 1.2rem;
  }

  .hero-slider .nav {
    font-size: 2.5rem;
  }

  .hero-slider .dots {
    bottom: 15px;
  }
}

/* Minimal: keep only the Latest Articles <h3> behavior; do not change card colors/layout */
.post-list > h3,
.post-list.container > h3 {
  display: block !important;
  width: 100% !important;
  margin: 0 0 1rem !important;
  font-size: 1.6rem;
  line-height: 0.2;
  text-align: left;
  font-weight: 500;
  color: var(--heading-color, inherit); /* preserves theme color if available */
  /* span across grid parents or flex rows without altering layout */
  grid-column: 1 / -1 !important;
  flex-basis: 100% !important;
  order: -1 !important;
  background: transparent !important;
}

/* === Latest Articles Section (Your Existing Structure) === */
.post-list.container {
  margin-top: 3rem;
  max-width: 1200px;
  padding: 1.5rem;
}

.post-list h3 {
  font-size: 1.4rem;
  color: #e5e7eb;
  margin-bottom: 1.2rem;
  border-left: 3px solid #2563eb;
  padding-left: 0.6rem;
}

.post-list .post-card {
  background: rgba(17, 24, 39, 0.85);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.post-list .post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.post-list .post-card h2 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.post-list .post-card h2 a {
  color: #fff;
  text-decoration: none;
}

.post-list .post-card h2 a:hover {
  color: #60a5fa;
}

.post-list .post-card p {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.post-list .read-more {
  font-size: 0.8rem;
  font-weight: 600;
  color: #60a5fa;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-list .read-more:hover {
  text-decoration: underline;
}

/* Compact Grid Version (Optional, 2–4 per row on desktop) */
@media (min-width: 768px) {
  .post-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }

  .post-list .post-card {
    margin-bottom: 0;
  }
}

/* === Code & Syntax Highlighting === */
pre,
code {
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  background: rgba(17, 24, 39, 0.85);
  border-radius: 6px;
  color: #e5e7eb;
}

pre {
  padding: 1rem;
  overflow-x: auto;
  line-height: 1.6;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: 1.2rem 0;
}

code {
  padding: 0.2rem 0.4rem;
}

/* Inline code (like `this`) */
p code, li code {
  background: rgba(255, 255, 255, 0.08);
  color: #93c5fd;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* === Syntax Colors === */
.highlight .c { color: #9ca3af; font-style: italic; } /* Comment */
.highlight .k { color: #60a5fa; } /* Keyword */
.highlight .o { color: #f472b6; } /* Operator */
.highlight .cm { color: #9ca3af; font-style: italic; } /* Comment.Multiline */
.highlight .cp { color: #93c5fd; } /* Preprocessor */
.highlight .cs { color: #a78bfa; font-style: italic; } /* Comment.Special */
.highlight .gd { color: #f87171; } /* Deleted */
.highlight .ge { font-style: italic; } /* Emphasis */
.highlight .gh { color: #60a5fa; font-weight: bold; } /* Heading */
.highlight .gi { color: #4ade80; } /* Inserted */
.highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr { color: #60a5fa; }
.highlight .kt { color: #facc15; } /* Type */
.highlight .m { color: #fbbf24; } /* Number */
.highlight .s { color: #34d399; } /* String */
.highlight .na { color: #fcd34d; } /* Name.Attribute */
.highlight .nb { color: #60a5fa; } /* Builtin */
.highlight .nc { color: #a78bfa; } /* Class */
.highlight .no { color: #f87171; } /* Constant */
.highlight .nd { color: #93c5fd; } /* Decorator */
.highlight .nf { color: #93c5fd; } /* Function */
.highlight .nn { color: #a78bfa; } /* Namespace */
.highlight .nt { color: #f472b6; } /* Tag */
.highlight .nv { color: #fbbf24; } /* Variable */
.highlight .w { color: #9ca3af; } /* Whitespace */

/* Scrollbar inside code blocks */
pre::-webkit-scrollbar {
  height: 8px;
}
pre::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* === Blockquotes & Callouts === */

/* General blockquote style */
blockquote {
  border-left: 4px solid #60a5fa;
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #d1d5db;
  border-radius: 8px;
}

blockquote p {
  margin: 0;
}

/* === Custom callouts === */
.callout {
  border-left: 4px solid;
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  line-height: 1.6;
}

.callout strong {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
}

/* Info (Blue) */
.callout.info {
  border-color: #60a5fa;
  background: rgba(96, 165, 250, 0.08);
}
.callout.info strong {
  color: #60a5fa;
}

/* Note (Green) */
.callout.note {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.08);
}
.callout.note strong {
  color: #34d399;
}

/* Warning (Yellow) */
.callout.warning {
  border-color: #facc15;
  background: rgba(250, 204, 21, 0.08);
}
.callout.warning strong {
  color: #facc15;
}

/* Danger (Red) */
.callout.danger {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.08);
}
.callout.danger strong {
  color: #f87171;
}

/* === Elegant Blog Image Styling === */
.post-content img {
  display: block;
  max-width: 800px;
  width: 100%;
  height: auto;
  margin: 1.5rem auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: zoom-in;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.post-content img:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

/* === Caption Styling === */
.post-content figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.5rem auto;
}

.post-content figcaption {
  font-size: 0.9rem;
  color: #aaa;
  margin-top: 0.5rem;
  text-align: center;
  font-style: italic;
}

/* === Lightbox Overlay === */
.lightbox {
  position: fixed;
  z-index: 9999;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.05);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.lightbox.visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* === Lightbox Image Animation === */
.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lightbox.visible img {
  opacity: 1;
  transform: scale(1);
  cursor: zoom-out;
}

/* === Additional Custom Styles for posts page === */
.page-section {
  max-width: 850px;
  margin: 3rem auto;
  color: #eee;
}

.page-section h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #00d4ff;
}

.tool-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.tool-card {
  background: rgba(255,255,255,0.05);
  padding: 1.5rem;
  border-radius: 12px;
  transition: transform 0.2s ease;
}

.tool-card:hover {
  transform: translateY(-5px);
  background: rgba(255,255,255,0.1);
}

/* Blog list page styles */
.blog-list {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.post-card {
  background: #f9fafb;
  border-radius: 12px;
  padding: 1.2rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.post-card h2 {
  color: #004aad;
}

/* Projects page styles */
.projects {
  max-width: 900px;
  margin: 2rem auto;
  padding: 1rem;
}
.project-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1rem;
}
.project-card h2 {
  color: #004aad;
}

body {
  background: #0f172a;
  color: #e2e8f0;
  font-family: 'Inter', sans-serif;
  margin: 0;
  line-height: 1.6;
}

.page-section {
  padding: 4rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.page-title {
  font-size: 2.2rem;
  margin-bottom: 2rem;
  color: #38bdf8;
  border-bottom: 2px solid #1e293b;
  display: inline-block;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: #1e293b;
  padding: 1.5rem;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
}

.post-card:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.2);
}

.post-card h2 {
  color: #38bdf8;
  margin-bottom: 0.5rem;
}

.post-card p {
  color: #94a3b8;
  font-size: 0.95rem;
}

.post-date {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.75rem;
}

.contact-list li {
  list-style: none;
  margin-bottom: 0.5rem;
}

a {
  color: #38bdf8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .page-section {
    padding: 2rem 1rem;
  }
}

/*about page styles*/
.about {
  max-width: 750px;
  margin: 2rem auto;
  line-height: 1.6;
}

.about h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.social-links {
  list-style: none;
  display: flex;
  gap: 1.2rem;
  padding: 0;
}

.social-links a {
  color: #00bcd4;
  text-decoration: none;
}

.social-links a:hover {
  text-decoration: underline;
}

/* Contact Page Styles */
.contact {
  max-width: 700px;
  margin: 2rem auto;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 1.5rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #00bcd4;
  outline: none;
}

.contact-form button {
  background: #00bcd4;
  color: #000;
  border: none;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.contact-form button:hover {
  background: #00a0b5;
}

/* === Blog Container === */
.blog-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.page-title {
  font-size: 1.8rem;
  margin-bottom: 1.2rem;
  color: #e5e7eb;
  text-align: center;
}

/* .spacer {
  height: 0.5rem;
} */

/* === Blog Page Filter Layout Fix === */
.search-filter {
  display: flex;
  flex-wrap: wrap;              /* allow wrapping on small screens */
  align-items: flex-start;
  gap: 0.8rem;                  /* spacing between search and categories */
  margin-bottom: 1.5rem;
}

.search-widget {
  flex: 1 1 300px;              /* search box grows/shrinks smoothly */
  min-width: 250px;
  position: relative;
}

.search-widget input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(17, 24, 39, 0.7);
  color: #e5e7eb;
  outline: none;
}

.category-filter {
  display: flex;
  flex-wrap: wrap;              /* wrap category buttons */
  gap: 0.5rem;
  justify-content: flex-start;
}

.filter-btn {
  background: rgba(31, 41, 55, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d1d5db;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.filter-btn.active,
.filter-btn:hover {
  background: #2563eb;
  color: #fff;
}

/* Responsive: stack on narrow screens */
@media (max-width: 768px) {
  .search-filter {
    flex-direction: column;
    align-items: stretch;
  }
  .category-filter {
    justify-content: flex-start;
  }
}

/* === Blog Grid === */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
}

/* Compact Blog Card */
.post-card {
  background: rgba(17, 24, 39, 0.85);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.post-thumb img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.post-content {
  padding: 0.8rem 1rem;
}

.post-content h2 {
  font-size: 1rem;
  margin: 0 0 0.4rem 0;
}

.post-content h2 a {
  color: #fff;
  text-decoration: none;
}

.post-content h2 a:hover {
  color: #60a5fa;
}

.excerpt {
  font-size: 0.85rem;
  color: #9ca3af;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  height: 2.6em;
  overflow: hidden;
}

.meta {
  font-size: 0.75rem;
  color: #6b7280;
}

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.pagination a {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 500;
}

/* === Responsive Tweaks === */
@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .post-thumb img {
    height: 120px;
  }

  .post-content h2 {
    font-size: 0.9rem;
  }
}

.blog-list {
  padding: 3rem 0;
}

.category-section {
  margin-bottom: 3rem;
}

.category-section h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: rgba(255, 255, 255, 0.03);
  padding: 1.2rem;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.post-card:hover {
  background: rgba(255, 255, 255, 0.08);
}

.post-card h3 a {
  color: #fff;
  text-decoration: none;
}

.read-more {
  display: inline-block;
  margin-top: 0.6rem;
  color: #3b82f6;
  font-weight: 500;
}

/* Pagination */
.pagination { text-align:center; margin-top:2rem; color:#9ca3af; }
.pagination .page-info { margin: 0 1rem; color:#cbd5e1; }

/* Search UI */
.search-widget { position: relative; max-width:360px; margin-left: auto; }
#searchBox { width:100%; padding:0.4rem; border-radius:8px; border:1px solid rgba(255,255,255,0.06); background:rgba(255,255,255,0.02); color:#fff; }
.search-results { position:absolute; width:100%; top:110%; left:0; background: rgba(10, 12, 20, 0.95); border-radius:8px; max-height:320px; overflow:auto; padding:0.5rem; display:none; }
.search-results .search-hit { padding:0.5rem 0; border-bottom:1px solid rgba(255,255,255,0.03); }
.search-results .search-hit a { color:#60a5fa; }

/* Lazy image placeholder */
img.lazy-img { background: linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); display:block; }

/* posts-grid & card tweaks (if not already present) */
.posts-grid, .blog-grid { display:grid; gap:1.2rem; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); }
.post-card, .project-card { background: rgba(255,255,255,0.03); border-radius:10px; padding:1rem; transition: transform .2s ease; }
.post-card:hover, .project-card:hover { transform: translateY(-6px); box-shadow:0 6px 18px rgba(0,0,0,0.45); }

img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.4s ease;
}
img[loading="lazy"].loaded {
  opacity: 1;
}

/* ===== Responsive search-widget override (place at end of CSS) ===== */

/* Ensure no fixed size is forcing extra space */
.blog-container .search-widget,
.blog-container .search-widget * {
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  box-sizing: border-box !important;
}

/* Make search-widget occupy available width and be compact */
.blog-container .search-widget {
  display: block;
  flex: 1 1 100% !important;    /* grow/shrink to full width */
  margin: 0 !important;
  padding: 0.4rem 0 !important;
  max-width: 100% !important;
}

/* Input full width and compact height */
.blog-container .search-widget input,
.blog-container #searchBox {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  padding: 0.55rem 0.8rem !important;
  font-size: 0.95rem !important;
  border-radius: 6px !important;
  margin: 0 !important;
}

/* Category area: appear immediately below search box, compact */
.blog-container .category-filter {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.4rem !important;
  margin: 0 !important;
  padding-top: 0.45rem !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  flex: 1 1 100% !important;
}

/* Each button minimal size */
.blog-container .filter-btn {
  padding: 0.35rem 0.6rem !important;
  font-size: 0.84rem !important;
  margin: 0 !important;
}

/* Tighten the gaps for mobile screens */
@media (max-width: 768px) {
  .blog-container {
    gap: 0.6rem !important;
  }

  .blog-container .sidebar,
  .blog-container .search-widget,
  .blog-container .category-filter {
    padding: 0.4rem !important;
  }

  .blog-container .search-widget input {
    padding: 0.5rem 0.7rem !important;
  }

  .blog-container .category-filter {
    gap: 0.35rem !important;
  }
}

/* Revert node (box) visual overrides applied earlier — restore theme/default */
.mermaid svg .node rect,
.mermaid svg .node ellipse,
.mermaid svg .node polygon {
  /* unset any forced fill/stroke/filters applied previously */
  fill: unset !important;
  stroke: unset !important;
  filter: none !important;
  box-shadow: none !important;
}

/* Keep edges and arrowheads white */
.mermaid svg .edgePath path,
.mermaid svg .edgePaths path,
.mermaid svg path[marker-end],
.mermaid svg path[class*="edge"] {
  stroke: #ffffff !important;
  stroke-width: 2.2px !important;
  opacity: 0.95 !important;
  fill: none !important; /* ensure lines are strokes only */
}

.mermaid svg marker path,
.mermaid svg .arrowheadPath {
  fill: #ffffff !important;
}

/* keep labels readable */
.mermaid svg .label,
.mermaid svg .nodeLabel,
.mermaid svg .edgeLabel tspan {
  fill: #ffffff !important;
}