Error: Online Store Editor Session Can't Be Published - How to Fix?

I’m working on a Custom Liquid section in my Shopify theme, trying to implement a “Read more” feature using Liquid and CSS. However, when I try to publish my changes, I keep receiving the error message:

“Online Store editor session can’t be published.”

Liquid Code:


  
  
  

    {{ collection.description }}
  

  
  

CSS Code:

.collection-description-section #description-content {
  max-height: 60px;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.collection-description-section .read-more-checkbox {
  display: none;
}

.collection-description-section .read-more-checkbox:checked ~ #description-content {
  max-height: 1000px;
}

.collection-description-section .read-more-label::before {
  content: "Read more";
  color: #007bff;
  cursor: pointer;
}

.collection-description-section .read-more-checkbox:checked ~ .read-more-label::before {
  content: "Read less";
}