/* Content protection for paid research surfaces — the parts that are safe for ANY
 * viewer of a research page, signed in or not.
 *
 * The rule that depends on there being a named licensee — the print block, whose
 * notice names them — is emitted per request in web/watermark.screen_style() and only
 * for a signed-in user, because blanking the print of a page we publish for search
 * engines is self-harm. Keeping the split there means "protection applies to the
 * licensed view, not the public one" is a fact of the markup rather than a decision
 * made in JavaScript.
 *
 * Nothing here paints anything over the content. There is no on-screen watermark by
 * design — see watermark.screen_style()'s docstring.
 *
 * None of this is DRM, and none of it stops someone determined with devtools. It
 * removes the frictionless paths and makes sure whatever does get out carries a name.
 * The layers that hold against a real actor are server-side: the export ledger, the
 * burst cap, and the watermark baked into the PDF bytes.
 */

/* --- selection + drag ----------------------------------------------------- */

/* Deny-by-default, under the "block" copy policy (the default; FDB_COPY_POLICY=
   attribute relaxes it). protect.js puts .pq-noselect on <html> for a signed-in
   viewer; everything below follows from that one class.

   This replaced an allow-list of research containers, which silently missed
   #view-overview — the tab carrying the flash thesis and most of the prose — and so
   left the main reading surface fully copyable. An allow-list fails OPEN every time a
   view is added; this fails closed. */
html.pq-noselect body,
html.pq-noselect body * {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* The exempt list, mirroring EXEMPT in protect.js — keep the two in step. Anything
   the user types into (their words, and a selection block breaks the field outright),
   their own portfolio (their data, not ours), and anything explicitly marked. */
html.pq-noselect input,
html.pq-noselect textarea,
html.pq-noselect select,
html.pq-noselect [contenteditable="true"],
html.pq-noselect #view-portfolio,
html.pq-noselect #view-portfolio *,
html.pq-noselect .pq-allow,
html.pq-noselect .pq-allow *,
html.pq-noselect [data-allow-copy],
html.pq-noselect [data-allow-copy] * {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

/* Dragging an image or a selection straight into another app is a copy path that
   never fires a `copy` event. */
html.pq-noselect img,
html.pq-noselect svg,
html.pq-noselect canvas {
  -webkit-user-drag: none;
  user-drag: none;
}

/* --- the toast ------------------------------------------------------------ */

.pq-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(8px);
  z-index: 2147483600;
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 10px;
  background: #16202b;
  color: #f3f1ec;
  font: 500 13px/1.5 "Hanken Grotesk", -apple-system, system-ui, sans-serif;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .34);
  opacity: 0;
  transition: opacity .16s ease, transform .16s ease;
}
.pq-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.pq-toast a { color: #7fb2ff; text-decoration: underline; }
.pq-toast .pq-toast-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: #b9c2cd;
}
@media print { .pq-toast { display: none !important; } }
