/* ---------------------------------------------------------
   sw-sticky-sidebar.css
   Makes the left sidebar column sticky on all sw-card pages.

   HOW TO USE:
   Add this single line in the <head> of each page, right
   after the "styles/main.css" link (or anywhere after the
   Tailwind CDN script):

     <link rel="stylesheet" href="styles/sw-sticky-sidebar.css">

   No other markup changes are needed — this targets the
   existing sidebar column structure
   (.grid.lg:grid-cols-12 > first child) that is already
   present on every converted page.
--------------------------------------------------------- */

.grid.lg\:grid-cols-12 > div:first-child {
  position: -webkit-sticky;
  position: sticky;
  top: 1.5rem;
  align-self: start;
}

/* Keep the sidebar within the viewport height and let it
   scroll internally if it's ever taller than the screen,
   instead of overflowing off the bottom edge. */
@media (min-width: 1024px) {
  .grid.lg\:grid-cols-12 > div:first-child {
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
  }
}