:root {
  --ql-tray-padding: 16px;
  --ql-tray-gap: 16px;
  --ql-transition-timing: 150ms ease-in-out;
}

body[data-quick-look-open] {
  overflow-y: hidden !important;
}

.quick-look-link:not(.quick-look-link--no-icon)::after {
  content: '';
  display: inline-block;
  margin-left: 0.125em;
  width: 1em;
  height: 1em;
  background-color: currentcolor;
  -webkit-mask: url('../img/quick-look.svg') no-repeat center;
  mask: url('../img/quick-look.svg') no-repeat center;
  vertical-align: -0.125em;
}

.quick-look {
  position: fixed;
  top: var(--drupal-displace-offset-top, 0);
  left: 0;
  z-index: 501;
  overflow: hidden;
  width: 100%;
  height: calc(100vh - var(--drupal-displace-offset-top, 0px));
  visibility: hidden;
  pointer-events: none;
}

@supports (height: 100dvh) {
  .quick-look {
    height: calc(100dvh - var(--drupal-displace-offset-top, 0px));
  }
}

.quick-look::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: rgb(0 0 0 / 0);
  transition: background-color var(--ql-transition-timing);
}

.quick-look--closing {
  visibility: visible;
}

.quick-look--open {
  visibility: visible;
  pointer-events: auto;
}

.quick-look--open::before {
  background-color: rgb(0 0 0 / 0.6);
}

.quick-look__inner {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translate(100%, -50%);
  overflow: hidden;
  border-radius: 10px 0 0 10px;
  width: min(480px, 85%);
  height: min(650px, 90%);
  display: grid;
  grid-template-rows: 72px 1fr;
  transition: transform var(--ql-transition-timing);
  background-color: #fff;
}

.quick-look--open .quick-look__inner {
  transform: translate(0, -50%);
}

.quick-look__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(var(--ql-tray-padding) * 0.5) var(--ql-tray-padding);
}

.quick-look__title {
  font-size: 1.75rem;
  font-weight: 700;
}

.quick-look__close {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 50%;
  height: 80%;
  background-color: #eee;
  cursor: pointer;
}

.quick-look__close-icon {
  width: auto;
  height: 50%;
}

.quick-look__content {
  overflow-y: auto;
}
