/* ============================================================
   OpsMechanic Theme CSS — Zinc/Emerald Glassmorphism
   ============================================================ */

body {
  background-color: #09090b;
  color: #e4e4e7;
}

/* ── Grid background pattern ── */
.bg-grid-pattern {
  background-size: 40px 40px;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
}

/* ── Glassmorphism cards ── */
.glass-card {
  background: rgba(24, 24, 27, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px -10px rgba(16, 185, 129, 0.1);
}

/* ── Glow text effect ── */
.text-glow {
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

/* ── Terminal background (CSS content) ── */
.term-bg {
  position: relative;
}

.term-bg::before {
  content: "Feb 24 03:14:15 kernel: [ 0.000000] Linux version 5.15.0-82-generic... \A Feb 24 03:14:15 kernel: [ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz... \A Feb 24 03:14:15 kernel: [ 0.000000] x86/fpu: Supporting XSAVE feature 0x001... \A Feb 24 03:14:17 systemd[1]: Starting Network Configuration... \A Feb 24 03:14:18 systemd[1]: Started Network Configuration. \A Feb 24 03:14:18 systemd[1]: Reached target Network. \A Feb 24 03:14:19 nginx[842]: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) \A Feb 24 03:14:19 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE \A Feb 24 03:14:20 kernel: [    4.123456] Out of memory: Killed process 842 (nginx) \A Feb 24 03:14:21 systemd[1]: Restarting crashed service...";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  color: #10b981;
  opacity: 0.03;
  white-space: pre-wrap;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  padding: 2rem;
  mask-image: radial-gradient(circle at center, black, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at center, black, transparent 80%);
}

/* ── Terminal cursor blink ── */
.cursor-blink {
  animation: blink 1s step-end infinite;
  display: inline-block;
  width: 8px;
  height: 1.2em;
  background-color: #10b981;
  vertical-align: middle;
  margin-left: 4px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Sticky nav blur state ── */
.nav-scrolled {
  background-color: rgba(9, 9, 11, 0.85) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Custom scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #09090b;
}
::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

/* ============================================================
   Blog layout: post + sidebar
   ============================================================ */

.post-wrapper {
  display: flex;
  gap: 4rem;
  align-items: flex-start;
}

.post-content-area {
  flex: 1;
  min-width: 0;
  max-width: 48rem;
}

.sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
  align-self: flex-start;
}

.sidebar-card {
  background: rgba(24, 24, 27, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.sidebar-card:hover {
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 5px 20px -5px rgba(16, 185, 129, 0.1);
}

.sidebar-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.sidebar-card p {
  margin: 0 0 0.75rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #a1a1aa;
}

.sidebar-card a {
  font-size: 0.85rem;
  font-weight: 600;
  color: #10b981;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-card a:hover {
  color: #34d399;
}

@media (max-width: 1024px) {
  .post-wrapper {
    flex-direction: column;
  }

  .post-content-area {
    max-width: none;
  }

  .sidebar {
    width: 100%;
    position: static;
  }
}

/* ============================================================
   Post content typography (prose)
   ============================================================ */

.post-content.prose {
  color: #d4d4d8;
  font-size: 1.05rem;
  line-height: 1.8;
  font-weight: 300;
}

.post-content.prose h1,
.post-content.prose h2,
.post-content.prose h3,
.post-content.prose h4 {
  color: #fff;
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 0.75em;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.post-content.prose h2 { font-size: 1.5rem; }
.post-content.prose h3 { font-size: 1.25rem; }
.post-content.prose h4 { font-size: 1.1rem; }

.post-content.prose p {
  margin-bottom: 1.25em;
}

.post-content.prose a {
  color: #10b981;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(16, 185, 129, 0.4);
}

.post-content.prose a:hover {
  color: #34d399;
  text-decoration-color: #34d399;
}

.post-content.prose strong {
  font-weight: 600;
  color: #f4f4f5;
}

.post-content.prose ul,
.post-content.prose ol {
  margin-bottom: 1.25em;
  padding-left: 1.5em;
}

.post-content.prose li {
  margin-bottom: 0.5em;
}

.post-content.prose blockquote {
  border-left: 3px solid #10b981;
  padding: 0.75em 1.25em;
  margin: 1.5em 0;
  background: rgba(24, 24, 27, 0.6);
  color: #a1a1aa;
  font-style: italic;
  border-radius: 0 0.75rem 0.75rem 0;
}

.post-content.prose img {
  max-width: 100%;
  height: auto;
  margin: 1.5em 0;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.post-content.prose hr {
  border: none;
  border-top: 1px solid #27272a;
  margin: 2em 0;
}

.post-content.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
}

.post-content.prose th,
.post-content.prose td {
  border: 1px solid #27272a;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.post-content.prose th {
  background: #18181b;
  font-weight: 600;
  color: #f4f4f5;
}

/* ── Code blocks ── */

.post-content.prose code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: rgba(24, 24, 27, 0.8);
  padding: 0.15em 0.4em;
  border-radius: 0.375rem;
  color: #10b981;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.post-content.prose pre {
  position: relative;
  background: #0f0f11;
  border: 1px solid #27272a;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5em 0;
  line-height: 1.6;
  border-radius: 0.75rem;
}

.post-content.prose pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  border: none;
  color: inherit;
  font-size: 0.85rem;
}

/* Code copy button */
.code-copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #71717a;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.2s;
  border-radius: 0.375rem;
}

.code-copy-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

/* ── Table of contents ── */

.toc-inner nav ul {
  list-style: none;
  padding-left: 0;
}

.toc-inner nav ul ul {
  padding-left: 1rem;
}

.toc-inner nav a {
  color: #a1a1aa;
  text-decoration: none;
}

.toc-inner nav a:hover {
  color: #10b981;
}

/* ============================================================
   Print styles
   ============================================================ */

@media print {
  nav, .term-bg, footer, .sidebar, .code-copy-btn {
    display: none !important;
  }
  section {
    break-inside: avoid;
    padding: 1rem 0;
  }
  body {
    background: white;
    color: black;
  }
  .post-content.prose a {
    color: inherit;
    text-decoration: underline;
  }
}
