/* Article image preview: deliberately quiet so the image remains the focus. */
.hy-image-preview {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 64px);
  background: rgba(9, 14, 25, 0.88);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.hy-image-preview.is-open {
  opacity: 1;
  visibility: visible;
}

.hy-image-preview__frame {
  position: relative;
  display: grid;
  place-items: center;
  max-width: 100%;
  max-height: 100%;
}

.hy-image-preview__image {
  display: block;
  max-width: min(94vw, 1600px);
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  transform: scale(0.975);
  transition: transform 180ms ease;
}

.hy-image-preview.is-open .hy-image-preview__image {
  transform: scale(1);
}

.hy-image-preview__label {
  position: fixed;
  top: 20px;
  left: 24px;
  color: rgba(255, 255, 255, 0.72);
  font: 700 10px/1.2 var(--global-font-family, system-ui, sans-serif);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  pointer-events: none;
}

.hy-image-preview__close {
  position: fixed;
  top: 14px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font: 400 25px/34px system-ui, sans-serif;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.hy-image-preview__close:hover,
.hy-image-preview__close:focus-visible {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.18);
  transform: rotate(8deg);
  outline: none;
}

html.hy-image-preview-open,
body.hy-image-preview-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .hy-image-preview {
    padding: 54px 12px 42px;
  }

  .hy-image-preview__image {
    max-width: 96vw;
    max-height: 82vh;
    border-radius: 6px;
  }

  .hy-image-preview__label {
    top: 18px;
    left: 15px;
  }

  .hy-image-preview__close {
    top: 10px;
    right: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hy-image-preview,
  .hy-image-preview__image,
  .hy-image-preview__close {
    transition: none;
  }
}
