/* The same controls work with a mouse, keyboard, or a single tap on a cover. */
button.cover-tap-toggle[type=button] { display: none }
.editable-cover-actions {
 position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
 flex-wrap: wrap; gap: 8px; background: #0004; opacity: 0; pointer-events: none;
 transition: opacity 140ms;
}
:is(.ls-cover-desktop,.ls-cover-mobile,.space-cover-preview):is(:hover,:focus-within) > .editable-cover-actions { opacity: 1; pointer-events: auto }
.editable-cover-actions button.is-danger { background: #e32222; border-color: #e32222; color: #fff }
.space-cover-preview,.ls-cover-desktop,.ls-cover-mobile { position: relative }
.learning-space-image-preview { display: grid; gap: 10px }

@media (hover:none) {
 .cc-cover,.learning-space-image-preview { position: relative }
 button.cover-tap-toggle[type=button][aria-expanded] {
  position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%;
  margin: 0; padding: 0; border: 0; border-radius: inherit; background: transparent;
  box-shadow: none; color: inherit; touch-action: manipulation;
 }
 button.cover-tap-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: -3px }
 /* The explicit state also overrides sticky :hover on touch browsers. */
 button.cover-tap-toggle[type=button][aria-expanded] + div {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center;
  align-content: center; justify-content: center; flex-wrap: wrap; gap: 6px;
  box-sizing: border-box; margin: 0; border-radius: inherit; background: #0004;
  opacity: 0; visibility: hidden; pointer-events: none;
 }
 button.cover-tap-toggle[type=button][aria-expanded=true] + div {
  opacity: 1; visibility: visible; pointer-events: auto;
 }
 .cc-cover:has(> .cover-tap-toggle) { padding: 0 }
 .learning-space-image-preview { gap: 0 }
}
@media (prefers-reduced-motion:reduce) {
 .editable-cover-actions { transition: none }
}
