/* ==========================================================================
   Collapse — show and hide a section with a smooth height animation.

   <button class="btn" data-moey-collapse="#more">Show details</button>
   <div class="collapse" id="more" hidden>…</div>

   moey.js toggles it, animates the height, and keeps aria-expanded on the button.
   Closed sections use hidden="until-found" where supported, so the browser's
   find-in-page (Ctrl+F) still finds text inside and opens the section.
   ========================================================================== */

.collapse { overflow: clip; overflow-clip-margin: .5rem; }   /* focus rings stay visible while it animates */

/* A chevron in the button turns when open: <i class="mi mi-chevron-down collapse-chevron"></i> */
.collapse-chevron { transition: rotate .2s ease; }
[aria-expanded="true"] > .collapse-chevron { rotate: 180deg; }
@media (prefers-reduced-motion: reduce) { .collapse-chevron { transition: none; } }

/* "Show more" text: a clamped preview that opens fully (.collapse-preview + data-moey-collapse) */
.collapse-preview:not(.is-open) {
  max-height: var(--mo-collapse-preview, 6rem);
  overflow: hidden;
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
