.qdg,
.qdg * {
  box-sizing: border-box;
}

.qdg {
  --qdg-max-height: 390px;
  --qdg-width-portrait: 310px;
  --qdg-width-compact: 310px;
  --qdg-width-wide: 480px;
  --qdg-width-feature: 444px;
  --qdg-gap: 18px;
  --qdg-radius: 22px;
  --qdg-edge-peek: 70px;

  position: relative;
  width: 100%;
  min-width: 0;
}

.qdg__viewport {
  width: 100%;
  overflow: hidden;
  padding: 0 0 18px;
}

.qdg__track {
  display: flex;
  align-items: flex-end;
  width: max-content;
  margin-inline-start: calc(var(--qdg-edge-peek) * -1);
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.qdg__group {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: var(--qdg-gap);
  width: max-content;
  padding-inline-end: var(--qdg-gap);
}

.qdg__item {
  position: relative;
  flex: 0 0 auto;
  display: block;
  max-height: var(--qdg-max-height);
  margin: 0;
  overflow: hidden;
  border-radius: var(--qdg-radius);
  background: #e8e5e0;
  line-height: 0;
  transform: translateZ(0) scale(1);
  transform-origin: center bottom;
  transition:
    transform 340ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 340ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.qdg__item--portrait {
  width: var(--qdg-width-portrait);
}

.qdg__item--compact {
  width: var(--qdg-width-compact);
}

.qdg__item--wide {
  width: var(--qdg-width-wide);
}

.qdg__item--feature {
  width: var(--qdg-width-feature);
}

.qdg__image {
  display: block;
  width: 100%;
  height: auto;
  max-height: var(--qdg-max-height);
  object-fit: cover;
  object-position: center bottom;
  transform: scale(1.001);
  transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.qdg-admin-notice {
  padding: 12px 16px;
  border-left: 4px solid #d63638;
  background: #fff1f1;
  color: #3c434a;
  font: 14px/1.5 sans-serif;
}

@media (hover: hover) and (pointer: fine) {
  .qdg__item:hover {
    z-index: 20;
    transform: translateZ(0) scale(1.035);
    box-shadow: 0 18px 44px rgba(20, 20, 20, 0.18);
  }

  .qdg__item:hover .qdg__image {
    transform: scale(1.05);
  }
}

@media (max-width: 1024px) {
  .qdg {
    --qdg-max-height: 330px;
    --qdg-width-portrait: 264px;
    --qdg-width-compact: 264px;
    --qdg-width-wide: 408px;
    --qdg-width-feature: 377px;
    --qdg-gap: 15px;
    --qdg-radius: 19px;
    --qdg-edge-peek: 48px;
  }
}

@media (max-width: 767px) {
  .qdg {
    --qdg-max-height: 210px;
    --qdg-width-portrait: 220px;
    --qdg-width-compact: 220px;
    --qdg-width-wide: 320px;
    --qdg-width-feature: 296px;
    --qdg-gap: 12px;
    --qdg-radius: 16px;
    --qdg-edge-peek: 24px;
  }

  .qdg__viewport {
    padding-bottom: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qdg__viewport {
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .qdg__track {
    transform: none !important;
    will-change: auto;
  }

  .qdg__item {
    scroll-snap-align: start;
  }

  .qdg__item,
  .qdg__image {
    transition: none;
  }
}
