/* Keep photo-saving gestures separate from normal text, links and QR codes. */
[data-photo-protection] img:not([data-photo-download="allow"]):not([data-photo-download="allow"] img) {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Source labels stay out of the accessibility tree and never intercept photo taps. */
.photo-watermark { display: none; }
[data-photo-protection] .photo-watermark {
  display: grid;
  justify-items: end;
  gap: 4px;
  position: absolute;
  z-index: 2;
  right: 18px;
  bottom: 16px;
  max-width: calc(100% - 36px);
  color: rgb(255 255 255 / 88%);
  text-shadow: 0 1px 6px rgb(0 0 0 / 50%), 0 0 1px rgb(0 0 0 / 40%);
  text-align: right;
  pointer-events: none;
  user-select: none;
}
[data-photo-protection] .photo-watermark-name {
  font: 400 18px/1.2 var(--serif, var(--font-editorial, serif));
  letter-spacing: .18em;
  margin-right: -.18em;
}
[data-photo-protection] .photo-watermark-name::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 1px;
  margin-right: 9px;
  vertical-align: middle;
  background: currentColor;
  opacity: .55;
}
[data-photo-protection] .photo-watermark-domain {
  font: 400 9px/1.4 var(--sans, var(--font-sans-tc, sans-serif));
  letter-spacing: .055em;
  opacity: .8;
}
[data-photo-protection] .photo-watermark-compact { right: 6px; bottom: 6px; max-width: calc(100% - 12px); }
[data-photo-protection] .photo-watermark-compact .photo-watermark-name { font-size: 12px; letter-spacing: .08em; margin-right: -.08em; }
[data-photo-protection] .photo-watermark-compact .photo-watermark-name::before,
[data-photo-protection] .photo-watermark-compact .photo-watermark-domain { display: none; }
[data-photo-protection] :is(.hero-photo, .detail-protected-photo, .advisor-portrait, .notes-author-photo) { position: relative; }
.hero-photo { overflow: hidden; }
/* Keep gallery controls clear of the lower-right signature. */
[data-photo-protection] :is(.photo-arrow, .property-open) { top: 16px; bottom: auto; }
[data-photo-protection] .all-photos-button { top: 20px; bottom: auto; z-index: 3; }
/* Show the complete photo without letting portrait images exceed the visible screen. */
.detail-protected-photo { background: #e9ece5; }
.detail-protected-photo > img {
  width: 100%;
  height: auto;
  max-height: min(52svh, 420px);
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
}
@media (max-width: 600px) {
  [data-photo-protection] .photo-watermark:not(.photo-watermark-compact) { right: 12px; bottom: 12px; }
  [data-photo-protection] .photo-watermark:not(.photo-watermark-compact) .photo-watermark-name { font-size: 16px; }
}
