/* ============================================
   SCROLLYTELLING SIDEBAR STYLES
   For trans-journey.html reading guide
   Following radicalkjax.com Design System
   ============================================ */

/* ============================================
   MAIN PAGE LAYOUT
   ============================================ */

.scrolly-page {
  position: relative;
  min-height: 100vh;
  display: flex;
}

/* Override container for scrolly page */
.container:has(.scrolly-page) {
  max-width: 100% !important;
  padding: 0 !important;
}

/* ============================================
   SCROLLYTELLING SIDEBAR (FIXED LEFT)
   ============================================ */

.scrolly-sidebar {
  position: fixed;
  left: 20px;
  top: 150px;
  width: 300px;
  max-height: calc(100vh - 200px);
  background-color: #1a1a1a;
  border: 2px solid #6d105a;
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Collapsed state */
.scrolly-sidebar.collapsed {
  transform: translateX(-280px);
}

.scrolly-sidebar.collapsed .scrolly-collapse-btn {
  transform: rotate(180deg);
}

/* ============================================
   SIDEBAR HEADER
   ============================================ */

.scrolly-header {
  background-color: #6d105a;
  color: #ffffff;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.scrolly-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.scrolly-collapse-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 1rem;
  transition: transform 0.3s ease, opacity 0.3s ease;
  line-height: 1;
}

.scrolly-collapse-btn:hover {
  opacity: 0.7;
}

/* ============================================
   CURRENT SECTION DISPLAY
   ============================================ */

.scrolly-current-section {
  padding: 15px;
  background: rgba(109, 16, 90, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.section-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 5px;
}

#current-section-title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: #f84ef8;
  line-height: 1.3;
}

.current-section-icon {
  margin-right: 8px;
  opacity: 0.8;
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.scrolly-progress {
  padding: 10px 15px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 2px solid #f84ef8;
  flex-shrink: 0;
}

.scrolly-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.scrolly-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6d105a, #f84ef8);
  border-radius: 3px;
  width: 0%;
  transition: width 0.15s ease-out;
}

/* CSS Scroll-Driven Animation for progress bar (Chrome 115+) */
@supports (animation-timeline: scroll()) {
  .scrolly-progress-bar {
    animation: scrollProgress linear;
    animation-timeline: scroll(root);
  }

  @keyframes scrollProgress {
    from { width: 0%; }
    to { width: 100%; }
  }
}

.scrolly-progress-text {
  display: block;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: right;
  margin-top: 5px;
}

/* ============================================
   RELATED POSTS SECTION
   ============================================ */

.scrolly-related {
  padding: 0;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 2px solid #f84ef8;
  flex-shrink: 0;
  max-height: 180px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #6d105a #1a1a1a;
}

.scrolly-related h4 {
  position: sticky;
  top: 0;
  background: rgba(26, 26, 26, 0.95);
  padding: 12px 15px 8px;
  margin: 0;
  z-index: 5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.9);
}

.scrolly-related .related-posts-list {
  padding: 10px 15px 15px;
}

.scrolly-related::-webkit-scrollbar {
  width: 6px;
}

.scrolly-related::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.scrolly-related::-webkit-scrollbar-thumb {
  background-color: #6d105a;
  border-radius: 3px;
}

/* h4 styling moved to sticky header above */

.related-posts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Related Post Card */
.related-post-card {
  display: block;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(248, 78, 248, 0.3);
  border-radius: 4px;
  padding: 12px;
  text-decoration: none;
  color: #fff;
  transition: all 0.3s ease;
}

.related-post-card:hover {
  border-color: rgba(248, 78, 248, 0.6);
  background: rgba(0, 0, 0, 0.4);
  transform: translateX(3px);
}

.related-post-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 6px 0;
  line-height: 1.3;
  color: #fff;
}

.related-post-card:hover .related-post-title {
  color: #f84ef8;
}

.related-post-excerpt {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 8px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
}

.related-post-arrow {
  color: #f84ef8;
  transition: transform 0.3s ease;
}

.related-post-card:hover .related-post-arrow {
  transform: translateX(3px);
}

/* Empty state */
.related-posts-empty {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  text-align: center;
  padding: 10px;
}

