/*
 * H&S Music Artist Panel – shared contextual media dialogs
 *
 * Used by Motion Art and other media examples. The dialog is intentionally
 * neutral and content-led; feature-specific attention cues live on the trigger.
 */

.hs-media-info-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
}

.hs-media-info-heading-copy {
  min-width: 0;
}

.hs-media-info-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--hs-line);
  border-radius: var(--hs-radius-sm);
  background: transparent;
  color: var(--hs-text-muted);
  box-shadow: none;
  font-family: var(--hs-font-ui);
  font-size: 13px;
  line-height: 1;
  font-weight: var(--hs-weight-semibold);
}

.hs-media-info-button:hover,
.hs-media-info-button:focus-visible {
  border-color: var(--hs-line-strong);
  background: var(--hs-surface-2);
  color: var(--hs-text);
}

.wizard-motion-info-button {
  position: relative;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  overflow: visible;
  padding: 0;
  border-radius: var(--hs-radius-round);
  border-color: var(--hs-brand-line);
  background: transparent;
  color: var(--hs-text);
}

.wizard-motion-info-glyph {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 15px;
  line-height: 1;
  font-weight: var(--hs-weight-bold);
  font-style: normal;
}

.wizard-motion-info-button::before,
.wizard-motion-info-button::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 1px solid var(--hs-brand-400);
  border-radius: var(--hs-radius-round);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  animation: hsMotionInfoWave 2.4s ease-out infinite;
}

.wizard-motion-info-button::after {
  animation-delay: -1.2s;
}

.wizard-motion-info-button:hover,
.wizard-motion-info-button:focus-visible {
  border-color: var(--hs-brand-400);
  background: var(--hs-brand-soft);
  color: var(--hs-text);
}

@keyframes hsMotionInfoWave {
  0% {
    opacity: 0;
    transform: scale(.9);
  }

  18% {
    opacity: .62;
  }

  78%,
  100% {
    opacity: 0;
    transform: scale(1.48);
  }
}

body.hs-media-dialog-open {
  overflow: hidden;
}

.hs-media-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .82);
  animation: hsMediaBackdropIn 150ms var(--hs-ease-standard) both;
}

.hs-media-dialog {
  width: min(880px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--hs-line);
  border-radius: var(--hs-radius-md);
  background: var(--hs-surface-1);
  box-shadow: 0 24px 72px rgba(0, 0, 0, .52);
  animation: hsMediaDialogIn 170ms var(--hs-ease-standard) both;
}

.hs-media-dialog-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--hs-line-subtle);
}

.hs-media-dialog-eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--hs-brand-400);
  font-size: 11px;
  line-height: 1.25;
  font-weight: var(--hs-weight-medium);
  letter-spacing: .02em;
  text-transform: none;
}

.hs-media-dialog-header h2 {
  margin: 0;
  color: var(--hs-text);
  font-size: clamp(23px, 3vw, 30px);
  line-height: 1.16;
  font-weight: var(--hs-weight-semibold);
  letter-spacing: -.02em;
}

.hs-media-dialog-close {
  flex: 0 0 auto;
  align-self: start;
  color: var(--hs-text-muted);
  font-size: 21px;
  line-height: 1;
}

.hs-media-dialog-body {
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 24px;
}

.hs-media-dialog-description {
  max-width: 760px;
  margin: 0;
  color: var(--hs-text-muted);
  font-size: 14px;
  line-height: 1.65;
  font-weight: var(--hs-weight-regular);
}

.hs-media-dialog-grid {
  display: grid;
  grid-template-columns:
    repeat(
      var(--hs-media-columns, 1),
      minmax(0, 1fr)
    );
  gap: 18px;
  align-items: start;
  margin-top: 20px;
}

.hs-media-dialog-media-card {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.hs-media-dialog-media-heading {
  min-height: 24px;
  display: grid;
  align-content: end;
  gap: 4px;
}

.hs-media-dialog-media-heading h3 {
  margin: 0;
  color: var(--hs-text);
  font-size: 14px;
  line-height: 1.35;
  font-weight: var(--hs-weight-semibold);
}

.hs-media-dialog-media-heading p {
  margin: 0;
  color: var(--hs-text-subtle);
  font-size: 12px;
  line-height: 1.45;
}

.hs-media-dialog-media-stage {
  position: relative;
  width: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--hs-line);
  border-radius: var(--hs-radius-sm);
  background: #000;
}

.hs-media-dialog-media-video,
.hs-media-dialog-media-image {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.hs-media-dialog-media-video.is-clickable {
  cursor: pointer;
}

.hs-media-dialog-media-video.is-clickable:focus-visible {
  outline: 2px solid var(--hs-brand-500);
  outline-offset: -3px;
}

.hs-media-dialog-error {
  padding: 24px;
  color: #ffd2d2;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

@keyframes hsMediaBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes hsMediaDialogIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .hs-media-dialog-backdrop {
    align-items: end;
    padding: 0;
  }

  .hs-media-dialog {
    width: 100%;
    max-height: 94dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: var(--hs-radius-md) var(--hs-radius-md) 0 0;
  }

  .hs-media-dialog-header {
    padding: 19px 18px 16px;
  }

  .hs-media-dialog-body {
    padding: 17px 18px calc(22px + env(safe-area-inset-bottom));
  }

  .hs-media-dialog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hs-media-dialog-media-stage {
    width: min(100%, 430px);
    justify-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hs-media-dialog-backdrop,
  .hs-media-dialog {
    animation: none;
  }

  .wizard-motion-info-button::before,
  .wizard-motion-info-button::after {
    display: none;
    animation: none;
  }
}
