/* ─── Theme colour overrides ────────────────────────────── */

:root,
body,
.theme-orange,
.theme-green {
  --accent:                #00ff99 !important;
  --accent-secondary:      #00cc7a !important;
  --background:            #0a0f0a !important;
  --background-secondary:  #0d1a0d !important;
  --color:                 #c8f0c8 !important;
  --border-color:          rgba(0, 255, 153, 0.2) !important;
  --header-background:     #0a0f0a !important;
}

html, body {
  background-color: #0a0f0a !important;
  color: #c8f0c8 !important;
}

a, a:visited, a:link { color: #00ff99 !important; }
a:hover, a:focus     { color: #00cc7a !important; }

.logo, .logo a, .logo__text, a.logo__text {
  color: #00ff99 !important;
  border-color: #00ff99 !important;
  background-color: transparent !important;
}
.logo__cursor { background-color: #00ff99 !important; }

.menu a, .menu__inner a, .menu__sub-inner a { color: #00ff99 !important; }
h1, h2, h3, h4, h5, h6                     { color: #00ff99 !important; }

.post-list__separator, hr {
  border-color: rgba(0, 255, 153, 0.25) !important;
  color:        rgba(0, 255, 153, 0.25) !important;
}

.tags li, .tags a, .tag, .post-tags a, .tags__tag {
  color:        #00ff99 !important;
  border-color: rgba(0, 255, 153, 0.3) !important;
}

.read-more, .read-more a            { color: #00ff99 !important; }
.pagination, .pagination a,
.posts-nav a, [rel="next"], [rel="prev"] { color: #00ff99 !important; }
.post-meta, .post-date, time        { color: rgba(0, 255, 153, 0.6) !important; }
footer, .footer, .footer__inner     {
  color: rgba(200, 240, 200, 0.45) !important;
  border-top-color: rgba(0, 255, 153, 0.2) !important;
}
footer a { color: #00ff99 !important; }


/* ─── Reading progress bar ──────────────────────────────── */

#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #00ff99, #00cc7a);
  box-shadow: 0 0 8px rgba(0, 255, 153, 0.6);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}


/* ─── ET Book font — body prose ─────────────────────────── */

.post__content,
.post__content p,
.post__content li,
.post__content blockquote,
.post__content td {
  font-family: 'et-book', Palatino, 'Palatino Linotype', 'Book Antiqua', Georgia, serif !important;
}


/* ─── Post typography ───────────────────────────────────── */

.post__content {
  font-size: 1.12rem;
  line-height: 1.9;
}

.post__content p { margin-bottom: 1.7em; }

.post__content h2 {
  margin-top: 2.5em;
  margin-bottom: 0.6em;
  padding-bottom: 0.25em;
  border-bottom: 1px solid rgba(0, 255, 153, 0.15);
}

.post__content h3 {
  margin-top: 2em;
  margin-bottom: 0.4em;
  color: rgba(0, 255, 153, 0.85) !important;
}


/* ─── Inline code ───────────────────────────────────────── */

p code, li code, td code, h1 code, h2 code, h3 code {
  background: rgba(0, 255, 153, 0.08) !important;
  border: 1px solid rgba(0, 255, 153, 0.18) !important;
  border-radius: 4px;
  padding: 0.15em 0.45em;
  font-size: 0.87em;
  color: #00ff99 !important;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  white-space: nowrap;
}


/* ─── Code blocks ───────────────────────────────────────── */

/* Reset bare pre/code so our block styles are the source of truth */
pre, pre code {
  background: transparent !important;
  border: none !important;
}

.post__content pre {
  position: relative;
  margin: 2em 0;
  padding: 0 !important;
  background: #0b1a0e !important;
  border: 1px solid rgba(0, 255, 153, 0.18) !important;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* Header strip — always visible, shows language when set */
.post__content pre::before {
  content: attr(data-lang);
  display: block;
  min-height: 2.2em;
  padding: 0.45em 1em;
  background: rgba(0, 255, 153, 0.06);
  border-bottom: 1px solid rgba(0, 255, 153, 0.12);
  font-size: 0.7rem;
  color: rgba(0, 255, 153, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  line-height: 1.3em;
}

/* No header strip when language is unknown */
.post__content pre:not([data-lang])::before {
  content: none;
}

/* The actual code */
.post__content pre code {
  display: block;
  padding: 1.2em 1.5em 1.4em !important;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.7;
  color: #c8f0c8 !important;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  background: transparent !important;
  border: none !important;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 255, 153, 0.2) transparent;
}

.post__content pre code::-webkit-scrollbar {
  height: 5px;
}
.post__content pre code::-webkit-scrollbar-track {
  background: transparent;
}
.post__content pre code::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 153, 0.25);
  border-radius: 3px;
}


/* ─── Drop cap ──────────────────────────────────────────── */

.dropcap {
  float: left;
  font-size: 4.8rem;
  line-height: 0.72;
  margin: 0.08em 0.1em 0 0;
  color: #00ff99;
  font-weight: 700;
  text-shadow: 0 0 18px rgba(0, 255, 153, 0.4);
}


/* ─── Block quote (Markdown >) ──────────────────────────── */

.post__content blockquote {
  position: relative;
  margin: 2.2em 0;
  padding: 1em 1.5em 1em 2em;
  border-left: 3px solid #00ff99;
  background: rgba(0, 255, 153, 0.04);
  color: rgba(200, 240, 200, 0.8) !important;
  font-style: italic;
  font-size: 1.05rem;
}

.post__content blockquote::before {
  content: '\201C';
  position: absolute;
  top: -0.1em;
  left: 0.35em;
  font-size: 3rem;
  line-height: 1;
  color: rgba(0, 255, 153, 0.3);
  font-style: normal;
}

.post__content blockquote p { margin: 0; }


/* ─── Pull quote ────────────────────────────────────────── */

.pullquote {
  margin: 2.8em auto;
  max-width: 580px;
  padding: 1.4em 0;
  border-top: 2px solid rgba(0, 255, 153, 0.5);
  border-bottom: 2px solid rgba(0, 255, 153, 0.5);
  text-align: center;
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1.55;
  color: #00ff99;
  text-shadow: 0 0 20px rgba(0, 255, 153, 0.25);
  letter-spacing: 0.01em;
}


/* ─── Attributed quote ({{< quote >}}) ─────────────────── */

.attributed-quote {
  margin: 2.4em 0;
}

.attributed-quote blockquote {
  font-size: 1.25rem;
  font-style: italic;
  color: rgba(200, 240, 200, 0.9) !important;
  border-left: 3px solid #00ff99;
  padding: 0.8em 1.4em;
  margin: 0;
  background: rgba(0, 255, 153, 0.04);
}

.attributed-quote blockquote::before { content: none; }

.attributed-quote figcaption {
  display: block;
  text-align: right;
  font-size: 0.85rem;
  color: rgba(0, 255, 153, 0.6) !important;
  background: transparent !important;
  margin-top: 0.5em;
  padding: 0 0.4em;
  border: none !important;
  letter-spacing: 0.03em;
  font-style: normal;
  width: auto;
}


/* ─── Callout boxes ─────────────────────────────────────── */

.callout {
  margin: 2em 0;
  padding: 1em 1.4em;
  border-radius: 3px;
  border-left: 3px solid rgba(0, 255, 153, 0.5);
  background: rgba(0, 255, 153, 0.05);
  font-size: 0.97rem;
  line-height: 1.7;
}

.callout--tip     { border-left-color: #00ff99; background: rgba(0, 255, 153, 0.07); }
.callout--warning { border-left-color: #ffcc00; background: rgba(255, 204, 0, 0.06); }
.callout--note    { border-left-color: rgba(0, 255, 153, 0.4); background: rgba(0, 255, 153, 0.04); }
.callout--quote   { border-left-color: rgba(0, 255, 153, 0.35); font-style: italic; }

.callout__body p:last-child  { margin-bottom: 0; }
.callout__body p:first-child { margin-top: 0; }
.callout__body strong        { color: #00ff99; }


/* ─── Section divider ───────────────────────────────────── */

.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  margin: 3em 0;
}

.section-divider span {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 255, 153, 0.4);
}

.section-divider span:nth-child(2) {
  background: #00ff99;
  box-shadow: 0 0 8px rgba(0, 255, 153, 0.6);
}


/* ─── Figure / image with caption ──────────────────────── */

.post-figure {
  margin: 2.2em 0;
  text-align: center;
}

.post-figure img {
  max-width: 100%;
  border: 1px solid rgba(0, 255, 153, 0.12);
}

.post-figure figcaption {
  font-size: 0.82rem;
  color: rgba(200, 240, 200, 0.55);
  margin-top: 0.6em;
  font-style: italic;
  /* override the theme's global figcaption green bar */
  background: none;
  padding: 0;
  border-radius: 0;
}

.post-figure--wide {
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
}


/* ─── Tables ────────────────────────────────────────────── */

.post__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 0.9rem;
  border: 1px solid rgba(0, 255, 153, 0.15);
  border-radius: 4px;
  overflow: hidden;
}

.post__content thead {
  background: rgba(0, 255, 153, 0.07);
}

.post__content th {
  color: #00ff99 !important;
  font-weight: 600;
  padding: 0.7em 1em;
  text-align: left;
  border-bottom: 1px solid rgba(0, 255, 153, 0.25) !important;
  border-right: 1px solid rgba(0, 255, 153, 0.1) !important;
  white-space: nowrap;
}

.post__content th:last-child { border-right: none !important; }

.post__content td {
  padding: 0.6em 1em;
  border-bottom: 1px solid rgba(0, 255, 153, 0.08) !important;
  border-right: 1px solid rgba(0, 255, 153, 0.07) !important;
  vertical-align: top;
  color: rgba(200, 240, 200, 0.85) !important;
}

.post__content td:last-child { border-right: none !important; }

.post__content td:first-child {
  color: rgba(0, 255, 153, 0.75) !important;
  font-weight: 500;
}

.post__content tr:last-child td { border-bottom: none !important; }

.post__content tbody tr:hover {
  background: rgba(0, 255, 153, 0.03);
}


/* ─── Inline TOC block ──────────────────────────────────── */

.article-toc {
  margin: 2em 0 2.5em;
  padding: 1.2em 1.5em;
  border: 1px solid rgba(0, 255, 153, 0.15);
  background: rgba(0, 255, 153, 0.03);
  border-radius: 4px;
  font-family: 'et-book', Palatino, Georgia, serif;
  font-size: 0.92rem;
}

.article-toc__title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(0, 255, 153, 0.5);
  margin: 0 0 0.8em 0;
}

.article-toc #TableOfContents ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-toc #TableOfContents > ul > li {
  margin: 0.3em 0;
}

.article-toc #TableOfContents > ul > li > ul {
  padding-left: 1.2em;
  margin-top: 0.2em;
}

.article-toc #TableOfContents > ul > li > ul > li {
  margin: 0.2em 0;
  font-size: 0.88rem;
  color: rgba(200, 240, 200, 0.7);
}

.article-toc #TableOfContents a {
  color: rgba(200, 240, 200, 0.75) !important;
  text-decoration: none !important;
  transition: color 0.15s;
}

.article-toc #TableOfContents a:hover {
  color: #00ff99 !important;
}


/* ─── Margin sidenotes ──────────────────────────────────── */

/* On wide screens: float into the right margin */
@media (min-width: 1200px) {
  .post-content {
    overflow: visible;
  }

  .sidenote {
    float: right;
    clear: right;
    width: 200px;
    margin-right: -228px;
    margin-top: 0.15em;
    margin-bottom: 1.2em;
    padding: 0.6em 0 0.6em 1em;
    border-left: 2px solid rgba(0, 255, 153, 0.35);
    font-family: 'et-book', Palatino, Georgia, serif;
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgba(200, 240, 200, 0.8);
    font-style: italic;
  }

  .sidenote p { margin: 0 0 0.4em; }
  .sidenote p:last-child { margin-bottom: 0; }

  .sidenote strong { color: #00ff99; font-style: normal; }
  .sidenote a      { color: rgba(0, 255, 153, 0.85) !important; font-style: normal; }

  .sidenote code {
    font-size: 0.8rem;
    background: rgba(0, 255, 153, 0.08) !important;
    border: 1px solid rgba(0, 255, 153, 0.18) !important;
    border-radius: 3px;
    padding: 0.05em 0.35em;
    color: #00ff99 !important;
    font-style: normal;
    white-space: nowrap;
  }
}

/* On smaller screens: inline note */
@media (max-width: 1199px) {
  .sidenote {
    display: block;
    margin: 0.8em 0 1.4em 0;
    padding: 0.7em 1.1em;
    border-left: 2px solid rgba(0, 255, 153, 0.3);
    background: rgba(0, 255, 153, 0.03);
    border-radius: 0 3px 3px 0;
    font-size: 0.88rem;
    line-height: 1.6;
    color: rgba(200, 240, 200, 0.75);
    font-style: italic;
    font-family: 'et-book', Palatino, Georgia, serif;
  }

  .sidenote p { margin: 0 0 0.3em; }
  .sidenote p:last-child { margin-bottom: 0; }
  .sidenote strong { color: #00ff99; font-style: normal; }
}


/* ─── View count in post meta ───────────────────────────── */

.post-views {
  color: rgba(0, 255, 153, 0.5);
  font-size: 0.85em;
}

.post-views:not(:empty)::before {
  content: '· ';
}


/* ─── Giscus comments section ───────────────────────────── */

.giscus-comments {
  margin-top: 3.5em;
  padding-top: 2em;
  border-top: 1px solid rgba(0, 255, 153, 0.15);
}

/* Override giscus iframe colours to match dark green theme */
.giscus,
.giscus-frame {
  width: 100%;
  color-scheme: dark;
}


/* ─── List pages ────────────────────────────────────────── */

.index-content     { margin: 8px 0 !important; }
.index-content p   { margin-bottom: 4px !important; }
.posts-group       { margin-bottom: 0.5rem !important; }
.posts-group__year { margin-bottom: 0.25rem !important; }


/* ─── Thoughts list — Medium-style cards ───────────────── */

.thoughts-list {
  margin-top: 2.5rem;
}

/* Card is an <a> — reset ALL link inheritance first */
a.thought-card,
a.thought-card:visited,
a.thought-card:link {
  display: block;
  padding: 1.8em 1.4em;
  margin: 0 -1.4em;
  border-radius: 6px;
  text-decoration: none !important;
  color: inherit !important;
  border-bottom: 1px solid rgba(0, 255, 153, 0.08);
  transition: background 0.2s;
  position: relative;
  cursor: pointer;
}

a.thought-card:last-child {
  border-bottom: none;
}

a.thought-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 2px;
  background: #00ff99;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}

a.thought-card:hover {
  background: rgba(0, 255, 153, 0.03) !important;
  color: inherit !important;
}

a.thought-card:hover::before {
  opacity: 1;
}

a.thought-card:hover .thought-card__title {
  color: #00ff99 !important;
}

/* Reset underlines on every child */
a.thought-card *,
a.thought-card *:hover {
  text-decoration: none !important;
}

/* ── Top meta row ── */
.thought-card__meta {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 0.6em;
  font-family: monospace;
  font-size: 0.72rem;
  line-height: 1;
}

.thought-card__read {
  display: inline-block;
  color: rgba(0, 255, 153, 0.7) !important;
  background: rgba(0, 255, 153, 0.07);
  border: 1px solid rgba(0, 255, 153, 0.18);
  border-radius: 4px;
  padding: 0.2em 0.55em;
  white-space: nowrap;
  text-decoration: none !important;
}

.thought-card__dot {
  color: rgba(200, 240, 200, 0.2) !important;
}

.thought-card__topic {
  color: rgba(200, 240, 200, 0.3) !important;
  white-space: nowrap;
}

.thought-card__topic + .thought-card__topic::before {
  content: '· ';
  color: rgba(200, 240, 200, 0.15);
}

/* ── Title ── */
.thought-card__title {
  margin: 0 0 0.45em !important;
  padding: 0 !important;
  border: none !important;
  font-size: 1.3rem !important;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: rgba(200, 240, 200, 0.92) !important;
  transition: color 0.2s;
  text-decoration: none !important;
}

/* ── Description ── */
.thought-card__desc {
  margin: 0 0 0.85em !important;
  font-size: 0.92rem !important;
  line-height: 1.65;
  font-family: 'et-book', Palatino, Georgia, serif !important;
  font-style: italic;
  color: rgba(200, 240, 200, 0.38) !important;
  max-width: 640px;
  text-decoration: none !important;
}

/* ── Tag pills ── */
.thought-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin-top: 0.1em;
}

.thought-card__tag {
  display: inline-block;
  font-size: 0.67rem !important;
  padding: 0.2em 0.6em;
  border-radius: 99px;
  background: rgba(0, 255, 153, 0.05);
  border: 1px solid rgba(0, 255, 153, 0.13);
  color: rgba(0, 255, 153, 0.45) !important;
  font-family: monospace;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-decoration: none !important;
}

@media (max-width: 600px) {
  a.thought-card {
    padding: 1.4em 0.8em;
    margin: 0 -0.8em;
  }

  .thought-card__title {
    font-size: 1.1rem !important;
  }
}
