/**
 * Content protection + dynamic watermark styles.
 * Activated when body/html has .protect-on (ContentProtect JS).
 */

html.protect-on,
body.protect-on {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent;
}

body.protect-on,
body.protect-on * {
  -webkit-user-select: none !important;
  user-select: none !important;
}

body.protect-on input,
body.protect-on textarea,
body.protect-on select,
body.protect-on [contenteditable="true"] {
  -webkit-user-select: text !important;
  user-select: text !important;
}

body.protect-on img,
body.protect-on svg,
body.protect-on picture,
body.protect-on video {
  -webkit-user-drag: none !important;
  user-drag: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  pointer-events: none;
}

body.protect-on a,
body.protect-on button,
body.protect-on .cta,
body.protect-on .catalog-item {
  pointer-events: auto;
  cursor: pointer;
}

/* Module 1 — dynamic identity watermark (single overlay, tiled via background) */
.dynamic-watermark {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  background-repeat: repeat;
  background-size: 420px 220px;
  background-position: 0 0;
}

/* Module 3 — focus / snipping obfuscation */
body.protect-blur main,
body.protect-blur footer,
body.protect-blur .error-page,
body.protect-blur .app-shell,
body.protect-blur .login-shell {
  filter: blur(25px) !important;
  opacity: 0.22 !important;
  pointer-events: none !important;
  transition: filter 0.08s ease, opacity 0.08s ease;
}

body.protect-blur::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(242, 240, 234, 0.62);
  pointer-events: none;
}

body.protect-blur .dynamic-watermark {
  opacity: 0;
}

@media print {
  body.protect-on * {
    visibility: hidden !important;
  }

  body.protect-on::before {
    content: "هذا المحتوى محمي — بيت المقاصد متحف المخطوطات";
    visibility: visible !important;
    display: block;
    text-align: center;
    padding: 4rem 1rem;
    font-family: "Cairo", sans-serif;
    font-size: 1.25rem;
    color: #1c2118;
  }
}
