/* Line-anchored code-walkthrough annotations: a source file (from
 * #+INCLUDE via snippet:) on the left, commentary from #+begin_linenotes
 * on the right, vertically aligned per line by enhanceLinenotes() in
 * article.js. Falls back to a plain stacked list under the code on
 * narrow screens — the notes are already fully server-rendered, so the
 * fallback is a pure CSS position:absolute -> static toggle, no extra
 * client-side DOM construction (unlike the footnote card fallback in
 * footnotes.css). */

.org-linenotes {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.org-linenotes > .org-src-container {
  flex: 1 1 60%;
  min-width: 0;
  margin: 0;
}

.org-linenotes-layer {
  position: relative;
  flex: 1 1 34%;
  min-width: 11rem;
  min-height: var(--org-linenotes-overflow, 0px);
}

.org-linenote {
  position: absolute;
  left: 0;
  right: 0;
  box-sizing: border-box;
  padding-left: 0.75rem;
  border-left: 2px solid var(--site-rule);
  color: var(--site-dim);
  font-size: 0.8rem;
  line-height: 1.4;
}

.org-linenote-lines {
  margin-right: 0.4em;
  color: var(--org-footnote-accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  .org-linenotes {
    display: block;
  }

  .org-linenotes > .org-src-container {
    margin: 0.75rem 0;
  }

  .org-linenotes-layer {
    position: static;
    min-height: 0;
  }

  .org-linenote {
    position: static;
    margin: 0.6rem 0;
    padding: 0.5rem 0 0.5rem 0.75rem;
  }
}

@media print {
  .org-linenotes {
    display: block;
  }

  .org-linenotes-layer {
    position: static;
    min-height: 0;
  }

  .org-linenote {
    position: static;
    margin: 0.5rem 0;
  }
}
