/* ============================================================
   protect.css — copy + screenshot deterrents (client-side only).

   HONEST LIMITS (read before relying on this):
   • Copy protection here is STRONG against ordinary visitors, but a
     developer with DevTools / "View source" / curl can still read the
     delivered HTML. Nothing served to a browser can be made unreadable.
   • Screenshots CANNOT be blocked by any website on Windows, macOS,
     Linux, Android or iOS — the capture is handled by the operating
     system and the page never receives the event. All we do here is
     DETER: blur the page when the window loses focus. Determined
     capture always succeeds.

   Form fields, the footer contact block, and anything marked .selectable
   stay fully usable.
   ============================================================ */

/* ---- Copy / selection deterrents ---- */
html, body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;   /* no press-and-hold copy menu on iOS/Android */
  -webkit-tap-highlight-color: transparent;
}

/* Keep inputs/selects usable so forms (search, login, signup…) still work.
   Also whitelist the footer contact block and anything marked .selectable
   (e.g. contact-page address / phone / email) so visitors can copy them. */
input, textarea, select,
[contenteditable="true"],
.footer-contact, .footer-contact *,
.selectable, .selectable * {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* CRITICAL for touch devices: iOS Safari has a bug where an ancestor with
   `-webkit-user-select: none` swallows tap/click events on descendant links
   and buttons — making every link, the category dropdown and nav unresponsive.
   Re-enabling user-select on interactive elements restores tapping. */
a, button, select, label, summary, [role="button"], [onclick], [tabindex] {
  -webkit-user-select: auto;
  -moz-user-select: auto;
  -ms-user-select: auto;
  user-select: auto;
}

/* Kill the selection highlight everywhere else (belt-and-braces with the JS). */
::selection      { background: transparent; }
::-moz-selection { background: transparent; }
input::selection, textarea::selection,
.selectable ::selection, .footer-contact ::selection { background: #b3d4fc; }

/* Images can't be dragged out to the desktop / another tab */
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

/* ---- Screenshot deterrent: blur when the window loses focus ----
   Many capture / screen-share tools steal focus; blurring on blur means
   a hasty grab catches an unreadable page. Restored the instant focus
   returns. (Legitimate tab-switching is only briefly affected.) */
body.ebn-blur * {
  filter: blur(11px) !important;
  transition: filter .08s ease;
}
body.ebn-blur #ebn-guard {
  filter: none !important;
}

/* Full-screen guard shown while blurred / on a screenshot attempt. */
#ebn-guard {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  pointer-events: none;   /* passive banner — must NEVER swallow taps/clicks,
                             even if the blur state ever sticks (mobile select) */
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font: 600 18px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  background: #0f172a;
}
body.ebn-blur #ebn-guard,
body.ebn-shot  #ebn-guard { display: flex; }

/* ---- Print / "Save as PDF" deterrent ---- */
@media print {
  body * { display: none !important; }
  body::before {
    display: block !important;
    content: "Printing is disabled on this site. This content is protected.";
    font: 600 16px/1.6 system-ui, sans-serif;
    padding: 40px;
    text-align: center;
  }
}
