/* =========================================
   Sidebar Container
   ========================================= */
.sidebar-links {
    width: 100%;
    padding-left: 2rem;
    border-left: 1px solid #e2e8f0;
    margin-top: 2rem;
    position: static;
}

@media (min-width: 1280px) {
    .sidebar-links {
        position: fixed;
        top: 2rem;
        width: 300px; 
        right: max(2rem, calc(50vw - 700px + 2rem)); 
        height: fit-content;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
        border-left: none;
        padding-left: 0;
    }
}


.sidebar-links::-webkit-scrollbar {
    width: 4px;
}
.sidebar-links::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

/* =========================================
   Group & Section Styling
   ========================================= */
.sidebar-group {
    margin-bottom: 2.5rem;
}

.group-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 1rem;
}

/* =========================================
   Link List Styling
   ========================================= */
.link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.link-list li {
    margin-bottom: 0.75rem;
}

.link-list a {
    text-decoration: none;
    color: #006aff;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: block;
}

.link-list a:hover {
    color: #000000; 
    transform: translateX(4px);
}

/* =========================================
   Meta Links (Tags/RSS Feed)
   ========================================= */
.meta-links {
    font-size: 0.95rem;
    color: #000000;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.meta-links a {
    text-decoration: none;
    color: #006aff;
    transition: color 0.2s;
    font-weight: 500;
}

.meta-links a:hover {
    color: #000000;
}

.separator {
    color: #cbd5e1;
}

.rss-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #f97316 !important;
}

/* =========================================
   Table of Contents
   ========================================= */
#TableOfContents ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#TableOfContents > ul > li > a {
    font-weight: 600;
    color: #006aff;
}

#TableOfContents a {
    text-decoration: none;
    color: #006aff;
    font-size: 0.95rem;
    display: block;
    padding: 4px 0;
    line-height: 1.4;
    transition: color 0.2s;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
    margin-left: -0.75rem;
}

#TableOfContents a:hover {
    color: #000000;
    border-left-color: #000000;
}

#TableOfContents ul ul {
    margin-top: 0.25rem;
    padding-left: 1rem;
    border-left: 1px solid #64748b;
}

#TableOfContents ul ul li > a {
    font-size: 0.9rem;
    color: #006aff;
}

#TableOfContents li > a::before {
    content: none;
}


/* =========================================================
   Table of Contents - Animations
   ========================================================= */
html {
  scroll-behavior: smooth;
}

:target {
  scroll-margin-top: 80px; 
}

@keyframes toc-focus {
  0% {
    background-color: #d4e6ff;
    transform: scale(1.01);
  }
  100% {
    background-color: transparent;
    transform: scale(1);
  }
}

:target {
  animation: toc-focus 0.9s ease-out;
  padding: 0.35em 0.6em;
  border-radius: 8px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

@media (prefers-color-scheme: dark) {
  @keyframes toc-focus {
    0% {
      background-color: #d4e6ff;
      transform: scale(1.01);
    }
    100% {
      background-color: transparent;
      transform: scale(1);
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  :target {
    animation: none;
  }
}
