/* Base Styling */
#cr-scrollbar {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  background-image: url('https://www.cosmicredemption.com/wp-content/uploads/2025/07/scroll-again.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  overflow-y: auto;
  padding: 1rem;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
  border-radius: 12px 0 0 12px;
  transition: transform 0.3s ease-in-out;
  z-index: 9999;
}

/* Desktop — Always visible */
@media (min-width: 1025px) {
  #cr-scrollbar.desktop-only {
    transform: translateX(0);
  }

  #cr-toggle-button {
    display: none;
  }
}

/* Mobile — Hidden by default */
@media (max-width: 1024px) {
  #cr-scrollbar.mobile-only {
    transform: translateX(100%);
  }

  #cr-scrollbar.mobile-only.open {
    transform: translateX(0);
  }

  #cr-toggle-button {
    display: block;
  }
}

/* Toggle Button */
#cr-toggle-button {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  background-color: #3e2b1d;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
}

/* Optional Typography inside Scroll Panel */
.scroll-button h4 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.scroll-button p {
  font-size: 1rem;
}
#cr-scrollbar.mobile-only {
  transition: transform 0.4s ease-in-out;
  will-change: transform;
}

/* Link fixes */
#cr-scrollbar a {
  color: #f2f2f2;
  text-decoration: underline;
}
#cr-scrollbar a:hover {
  color: #fff;
}


/* Optional: smoothing scroll area on all views */
.scroll-button::-webkit-scrollbar {
  width: 8px;
}
.scroll-button::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.5);
  border-radius: 4px;
}
#cr-scrollbar a {
  display: inline-block;
  font-weight: bold;
  color: #5e3c20;
  text-decoration: none;
  border-bottom: 1px solid #5e3c20;
  padding-bottom: 2px;
  transition: all 0.2s ease-in-out;
}

#cr-scrollbar a:hover {
  color: #a86f3a;
  border-bottom-color: #a86f3a;
}
#cr-scrollbar a {
  display: inline-block;
  font-weight: bold;
  color: #5e3c20;
  text-decoration: none;
  border-bottom: 1px solid #5e3c20;
  padding-bottom: 2px;
  transition: all 0.2s ease-in-out;
}

#cr-scrollbar a:hover {
  color: #a86f3a;
  border-bottom-color: #a86f3a;
}
#cr-scrollbar.mobile-only a,
#cr-scrollbar.desktop-only a {
  font-weight: bold;
  color: #5e3c20;
  text-decoration: none;
  border-bottom: 1px solid #5e3c20;
  padding-bottom: 2px;
  transition: all 0.2s ease-in-out;
}

#cr-scrollbar.mobile-only a:hover,
#cr-scrollbar.desktop-only a:hover {
  color: #a86f3a;
  border-bottom-color: #a86f3a;
}
#cr-scrollbar a {
  color: #5e3c20 !important;
  font-weight: bold !important;
  border-bottom: 1px solid #5e3c20 !important;
}
/* Common styling for mobile and desktop */
#cr-scrollbar {
  transition: transform 0.3s ease-in-out;
  z-index: 9999;
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  background-image: url(https://www.cosmicredemption.com/wp-content/uploads/2025/07/scroll-again.jpg);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  overflow-y: auto;
  padding: 1rem;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
  border-radius: 12px 0 0 12px;
}
#scroll-toggle {
  display: none; /* Hide by default */
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #3e2b1d;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  z-index: 10000;
  cursor: pointer;
}

/* Show on mobile */
@media (max-width: 1024px) {
  #scroll-toggle {
    display: block;
  }
}
/* Toggle Button for Mobile */
#scroll-toggle {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #3e2b1d;
  color: white;
  padding: 10px 15px;
  border-radius: 6px;
  z-index: 9999;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Georgia', serif;
}

/* Show toggle on mobile only */
@media (max-width: 1024px) {
  #scroll-toggle {
    display: block;
  }
}

/* Mobile-only scroll panel closed by default */
#cr-scrollbar.mobile-only {
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 80%;
  background-color: #fdf6e3;
  z-index: 9998;
  overflow-y: auto;
  box-shadow: -2px 0 8px rgba(0,0,0,0.2);
}

/* Open panel */
#cr-scrollbar.mobile-only.open {
  transform: translateX(0);
}
#scroll-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  background-color: #3e2b1d;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
#cr-scrollbar.mobile-only {
  transform: translateX(100%);
  transition: transform 0.3s ease;
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  background: #f5deb3; /* your background */
  z-index: 9999;
  overflow-y: auto;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.3);
}

#cr-scrollbar.mobile-only.open {
  transform: translateX(0);
}
/* Hide mobile drawer on desktop */
@media screen and (min-width: 769px) {
  #cr-scrollbar.mobile-only,
  #scroll-toggle {
    display: none !important;
  }
}

/* Hide permanent sidebar on mobile */
@media screen and (max-width: 768px) {
  #cr-scrollbar.desktop-only {
    display: none !important;
  }
}
