/* ============================================================
   beyondabe.com — Blog Styles
   Design system: #0a192f / #64ffda / #ffd700 / #8892b0
   Fonts: Space Grotesk (body), Roboto Mono (headings/code)
   ============================================================ */

:root {
  --primary-color:   #0a192f;
  --secondary-color: #64ffda;
  --highlight-color: #ffd700;
  --text-color:      #8892b0;
  --bg-color:        #0a192f;
  --surface-color:   rgba(17, 34, 64, 0.9);
  --border-color:    rgba(100, 255, 218, 0.15);
  --light-text:      #a8b2d8;
  --heading-text:    #ccd6f6;
}

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

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.8;
  overflow-x: hidden;
}

/* ── Header / Nav ── */
#preamble header {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1000;
  padding: 20px 0;
  background-color: rgba(10, 25, 47, 0.97);
  backdrop-filter: blur(4px);
}

/* org wraps h1.title in a <header> inside #content — reset it */
#content header {
  position: static;
  background: none;
  padding: 0;
  backdrop-filter: none;
}

.ba-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Roboto Mono', monospace;
  font-size: 1.5rem;
  color: var(--secondary-color);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0;
}

.nav-links li {
  margin-left: 30px;
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 400;
  transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--secondary-color);
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background-color: var(--secondary-color);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Main content area (org-publish wraps in #content) ── */
#content {
  max-width: 780px;
  margin: 0 auto;
  padding: 120px 24px 80px;
}

/* ── Article title ── */
h1.title {
  font-family: 'Roboto Mono', monospace;
  font-size: 2.2rem;
  color: var(--secondary-color);
  line-height: 1.25;
  margin-bottom: 12px;
}

/* org emits subtitle/date as .subtitle */
.subtitle {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  color: var(--secondary-color);
  opacity: 0.6;
  margin-bottom: 40px;
  letter-spacing: 0.05em;
}

/* ── Table of Contents ── */
#table-of-contents {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 20px 28px;
  margin-bottom: 48px;
  font-size: 0.9rem;
}

#table-of-contents h2 {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.75rem;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

#table-of-contents ul {
  list-style: none;
  padding: 0;
}

#table-of-contents li {
  margin-bottom: 6px;
  padding-left: 16px;
  position: relative;
}

#table-of-contents li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--secondary-color);
  opacity: 0.6;
}

#table-of-contents a {
  color: var(--light-text);
  text-decoration: none;
}

#table-of-contents a:hover {
  color: var(--secondary-color);
}

/* ── Headings ── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Roboto Mono', monospace;
  color: var(--heading-text);
  line-height: 1.3;
}

.outline-2 h2 {
  font-size: 1.5rem;
  color: var(--highlight-color);
  margin: 48px 0 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.outline-3 h3 {
  font-size: 1.15rem;
  color: var(--secondary-color);
  margin: 32px 0 14px;
}

.outline-4 h4 {
  font-size: 1rem;
  color: var(--light-text);
  margin: 24px 0 10px;
}

/* ── Body text ── */
p {
  margin-bottom: 1.3em;
  color: var(--light-text);
  font-size: 1.02rem;
}

a {
  color: var(--secondary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Lists ── */
ul, ol {
  margin-bottom: 1.3em;
  padding-left: 24px;
}

li {
  margin-bottom: 0.4em;
  color: var(--light-text);
  font-size: 1rem;
}

/* Custom bullet for unordered lists */
ul {
  list-style: none;
  padding-left: 20px;
}

ul li {
  position: relative;
  padding-left: 18px;
}

ul li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--secondary-color);
  opacity: 0.7;
}

/* Preserve ordered list numbers */
ol {
  list-style: decimal;
}

/* ── Inline code ── */
code, kbd, samp {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.88em;
  color: var(--secondary-color);
  background-color: rgba(100, 255, 218, 0.06);
  padding: 2px 6px;
  border-radius: 3px;
}

/* ── Code blocks ── */
pre {
  background-color: rgba(17, 34, 64, 0.95);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--secondary-color);
  border-radius: 6px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 1.6em 0;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.87rem;
  line-height: 1.6;
  color: var(--light-text);
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
}

.org-src-container {
  margin: 1.6em 0;
}

/* org language label */
pre.src::before {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.7rem;
  color: var(--secondary-color);
  opacity: 0.5;
  float: right;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: -4px;
}

/* ── Blockquote ── */
blockquote {
  border-left: 3px solid var(--secondary-color);
  background-color: var(--surface-color);
  padding: 16px 24px;
  margin: 1.6em 0;
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--light-text);
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 0.93rem;
}

th {
  font-family: 'Roboto Mono', monospace;
  color: var(--secondary-color);
  font-weight: 400;
  padding: 10px 16px;
  border-bottom: 2px solid var(--border-color);
  text-align: left;
}

td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(100, 255, 218, 0.07);
  color: var(--light-text);
}

tr:hover td {
  background-color: rgba(100, 255, 218, 0.03);
}

/* ── Horizontal rule ── */
hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2.5em 0;
}

/* ── Images ── */
img {
  max-width: 100%;
  border-radius: 6px;
}

/* ── Blog listing intro line ── */
.blog-intro {
  color: var(--text-color);
  font-size: 0.95rem;
  margin-bottom: 32px;
  border-left: 2px solid var(--border-color);
  padding-left: 16px;
  opacity: 0.75;
}

/* ── Post cards (blog listing page) ── */
.post-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 16px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.post-card:hover {
  border-color: var(--secondary-color);
  transform: translateX(4px);
}

.post-card > a {
  display: block;
  padding: 22px 28px;
  text-decoration: none;
}

.post-card-title {
  font-family: 'Roboto Mono', monospace;
  font-size: 1.05rem;
  color: var(--highlight-color);
  margin: 0 0 8px;
  line-height: 1.35;
  transition: color 0.2s;
}

.post-card:hover .post-card-title {
  color: var(--secondary-color);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-color);
  margin-bottom: 10px;
}

.post-card-excerpt {
  color: var(--text-color);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0;
  opacity: 0.8;
}

/* ── Post page metadata (injected by JS) ── */
.back-link {
  display: inline-flex;
  align-items: center;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-color);
  text-decoration: none;
  opacity: 0.5;
  margin-bottom: 16px;
  transition: opacity 0.2s, color 0.2s;
}

.back-link:hover {
  opacity: 1;
  color: var(--secondary-color);
  text-decoration: none;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-color);
  opacity: 0.6;
  margin: -4px 0 40px;
}

.meta-sep { opacity: 0.4; }

/* ── Prev/next post navigation ── */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.post-nav a {
  display: flex;
  flex-direction: column;
  max-width: 48%;
  text-decoration: none;
  transition: opacity 0.2s;
  opacity: 0.7;
}

.post-nav a:hover {
  opacity: 1;
  text-decoration: none;
}

.post-nav .nav-label {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-color);
  margin-bottom: 5px;
  opacity: 0.5;
}

.post-nav .nav-title {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.88rem;
  color: var(--highlight-color);
  line-height: 1.35;
  transition: color 0.2s;
}

.post-nav a:hover .nav-title {
  color: var(--secondary-color);
}

.post-nav-next {
  text-align: right;
  margin-left: auto;
}

/* ── Footer ── */
.ba-footer {
  text-align: center;
  padding: 30px 0;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-color);
  opacity: 0.4;
  border-top: 1px solid var(--border-color);
}

.ba-footer a {
  color: var(--text-color);
  text-decoration: none;
}

.ba-footer a:hover {
  color: var(--secondary-color);
  opacity: 1;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background-color: rgba(10, 25, 47, 0.97);
    padding: 20px;
    gap: 15px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    margin-left: 0;
  }

  #content {
    padding: 100px 16px 60px;
  }

  h1.title {
    font-size: 1.6rem;
  }

  .outline-2 h2 {
    font-size: 1.25rem;
  }

  pre {
    padding: 14px 16px;
    font-size: 0.82rem;
  }
}
