/* ============================================================
   ARCHIWUM RODZINY GŁUCHOWSKICH — security.css
   © 2026 Marek Skonieczny / archiwumgluchowskich.pl
   ============================================================ */

/* Disable text selection globally (except form fields) */
body, .content, article, section, h1, h2, h3, h4, h5, h6, p, li, td, th,
.card, .hero, .doc-showcase, .doc-content, .qa, .say, .verdict {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* Allow selection only in form fields */
input, textarea, [contenteditable="true"], .selectable {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Disable image dragging & saving (browser-level) */
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: auto; /* keep clickable for lightbox */
  user-select: none;
}

/* For non-lightbox images, disable pointer events completely */
img.protected-strict {
  pointer-events: none;
}

/* Watermark overlay using ::after pseudo-element */
.watermark-protected {
  position: relative;
  display: inline-block;
}

.watermark-protected::after {
  content: 'ARCHIWUM GŁUCHOWSKICH · archiwumgluchowskich.pl';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  color: rgba(255, 255, 255, 0.18);
  font-size: 14pt;
  font-weight: 700;
  font-family: Georgia, serif;
  letter-spacing: 2px;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  z-index: 10;
  user-select: none;
}

/* Transparent overlay over images — blocks right-click save */
.img-overlay-wrapper {
  position: relative;
  display: inline-block;
}

.img-overlay-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 5;
  pointer-events: auto;
  cursor: default;
}

/* Print stylesheet — practically block printing */
@media print {
  body {
    display: none !important;
  }
  body::after {
    content: 'ARCHIWUM RODZINY GŁUCHOWSKICH — drukowanie zablokowane. © 2026 Marek Skonieczny. archiwumgluchowskich.pl';
    display: block !important;
    padding: 100px;
    font-size: 24pt;
    text-align: center;
    color: #8b0000;
    font-family: Georgia, serif;
  }

  /* Show only the copyright notice */
  html::before {
    content: '⚠️ Drukowanie zawartości Archiwum Głuchowskich jest zabronione bez pisemnej zgody. © 2026 archiwumgluchowskich.pl';
    display: block;
    padding: 80px 40px;
    font-size: 18pt;
    color: #8b0000;
    text-align: center;
    font-family: Georgia, serif;
    page-break-after: always;
  }

  /* Hide images completely from print */
  img, picture, video, canvas, svg {
    display: none !important;
    visibility: hidden !important;
  }
}

/* Disable image saving via long-press on mobile */
@media (hover: none) {
  img {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
  }
}

/* Watermark badge in bottom corner of every page */
.arg-copyright-badge {
  position: fixed;
  bottom: 12px;
  right: 12px;
  background: rgba(26, 20, 16, 0.85);
  color: #b8860b;
  padding: 6px 12px;
  font-size: 9pt;
  font-family: 'Courier New', monospace;
  border-radius: 4px;
  z-index: 9998;
  pointer-events: none;
  letter-spacing: 0.5px;
  border-left: 2px solid #b8860b;
  user-select: none;
}

.arg-copyright-badge::before {
  content: '© ';
}
