/* Photography-only image watermark and ordinary-save deterrents.
 * This file must not be merged into the frozen article/book/video watermark.
 */
html.dx-photography-protection .dx-photo-column img,
html.dx-photography-protection .dx-photo-theme-surface img,
html.dx-photography-protection #dxImageViewerModal img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Logged-in photography posts would otherwise also receive the generic
 * article-wide watermark. Photography uses one mark per photograph instead. */
html.dx-photography-protection .dx-photo-theme-surface .riix-content-watermark-layer {
  display: none !important;
}

.dx-photo-protected-media,
.dx-photo-protected-media-link,
.dx-photo-protected-hero {
  position: relative !important;
  isolation: isolate;
}

.dx-photo-protected-media {
  display: block;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  margin: var(--dx-prose-image-margin-y, 18px) auto;
  overflow: hidden;
}

.dx-photo-theme-article .dx-prose .dx-photo-protected-media-link {
  display: block !important;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  margin: var(--dx-prose-image-margin-y, 18px) auto !important;
  overflow: hidden;
  background-image: none !important;
  text-decoration: none !important;
}

html.dx-photography-protection .dx-photo-theme-surface .dx-photo-theme-article .dx-prose .dx-photo-protected-media > img,
html.dx-photography-protection .dx-photo-theme-surface .dx-photo-theme-article .dx-prose .dx-photo-protected-media-link > img {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0 auto !important;
}

.dx-photo-image-watermark,
.dx-photo-viewer-watermark {
  z-index: 4;
  display: block;
  max-width: calc(100% - 36px);
  padding: 4px 8px;
  border: 0;
  border-radius: 0;
  color: rgba(18, 18, 18, .3) !important;
  -webkit-text-fill-color: rgba(18, 18, 18, .3) !important;
  -webkit-text-stroke: 0 transparent;
  background: transparent;
  box-shadow: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: .02em;
  text-align: center;
  white-space: nowrap;
  text-shadow: none;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  mix-blend-mode: normal;
  -webkit-font-smoothing: antialiased;
}

.dx-photo-image-watermark.is-light-on-photo,
.dx-photo-viewer-watermark.is-light-on-photo {
  color: rgba(255, 255, 255, .3) !important;
  -webkit-text-fill-color: rgba(255, 255, 255, .3) !important;
}

.dx-photo-image-watermark.is-dark-on-photo,
.dx-photo-viewer-watermark.is-dark-on-photo {
  color: rgba(18, 18, 18, .3) !important;
  -webkit-text-fill-color: rgba(18, 18, 18, .3) !important;
}

.dx-photo-watermark-owner,
.dx-photo-watermark-visitor {
  display: block;
}

.dx-photo-watermark-visitor {
  margin-top: 2px;
}

.dx-photo-image-watermark {
  position: absolute;
}

/* The global image loader adds its loaded/error class after decode. Because
 * the mark is server-rendered beside the image, both elements now use the
 * same first-paint fade without making the photograph depend on JavaScript. */
@supports selector(.dx-photo-protected-media-server:has(> img)) {
  html.dx-image-fade .dx-photo-protected-media-server > .dx-photo-image-watermark {
    opacity: 0;
    transition: opacity var(--dx-image-load-fade-duration, 520ms) var(--dx-motion-easing, cubic-bezier(.2,.8,.2,1));
  }

  html.dx-image-fade .dx-photo-protected-media-server:has(> img.dx-image-fade-loaded, > img.dx-image-fade-error, > img.dx-image-fade-skip) > .dx-photo-image-watermark {
    opacity: 1;
  }
}

.dx-photo-image-watermark[data-position="center-left"] { left: 34%; top: 54%; transform: translate(-50%,-50%); }
.dx-photo-image-watermark[data-position="center"] { left: 50%; top: 54%; transform: translate(-50%,-50%); }
.dx-photo-image-watermark[data-position="center-right"] { left: 66%; top: 54%; transform: translate(-50%,-50%); }
.dx-photo-image-watermark[data-position="lower-left"] { left: 38%; top: 70%; transform: translate(-50%,-50%); }
.dx-photo-image-watermark[data-position="lower-center"] { left: 50%; top: 70%; transform: translate(-50%,-50%); }
.dx-photo-image-watermark[data-position="lower-right"] { left: 62%; top: 70%; transform: translate(-50%,-50%); }

.dx-photo-article-hero .dx-photo-image-watermark {
  z-index: 3;
}

.dx-photo-viewer-watermark {
  position: fixed;
  z-index: 2147483646;
  visibility: hidden;
  max-width: min(72vw, 720px);
}

.dx-photo-viewer-watermark.is-visible {
  visibility: visible;
}

@media (max-width: 680px) {
  .dx-photo-image-watermark,
  .dx-photo-viewer-watermark {
    max-width: calc(100% - 24px);
    padding: 3px 6px;
    font-size: clamp(7px, 2vw, 8px);
    line-height: 1.35;
    white-space: nowrap;
  }

  .dx-photo-watermark-owner,
  .dx-photo-watermark-visitor {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .dx-photo-watermark-visitor {
    margin-top: 1px;
  }
}

@media print {
  .dx-photo-image-watermark,
  .dx-photo-viewer-watermark {
    visibility: visible !important;
    color: rgba(18, 18, 18, .3) !important;
    -webkit-text-fill-color: rgba(18, 18, 18, .3) !important;
  }
}
