.media-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 520px);
  height: 230px;
  margin: 14px auto 0;
  background: #111;
  cursor: zoom-in;
}
.media-thumb img,
.media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.media-thumb[data-media="image"] {
  height: auto;
  min-height: 180px;
  max-height: 320px;
  padding: 8px;
  background: #f7f4f0;
}
.media-thumb[data-media="image"] img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain !important;
}
.media-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 8px 12px;
  border-radius: 99px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  pointer-events: none;
}
.media-modal {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8,7,7,.92);
}
.media-modal[hidden] { display: none; }
.media-modal-content {
  position: absolute;
  inset: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.media-modal img,
.media-modal video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.media-modal video { width: min(1200px, 100%); }
.media-close {
  position: fixed;
  z-index: 2;
  top: 18px;
  right: 22px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #171313;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}
body.media-open { overflow: hidden; }
@media (max-width: 760px) {
  .media-thumb { height: 190px; }
  .media-thumb[data-media="image"] { height: auto; max-height: 280px; }
  .media-thumb[data-media="image"] img { max-height: 260px; }
  .media-modal { padding: 12px; }
  .media-modal-content { inset: 58px 10px 10px; }
  .media-close { top: 10px; right: 10px; }
}
