/* ============================================================
   PrepYodha — Notes content protection
   Loaded into every /notes/ page by build_notes.py.
   Pairs with _gate.js. CSS is the "fail-closed" layer:
   gated chapter pages start with <html class="pynote-lock">
   (set by an inline head script) so content is hidden until
   _gate.js confirms a Pro user and removes the class.
   ============================================================ */

/* ---- discourage selection / copy / drag everywhere ---- */
body, .wrap, .topbar, footer {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
body img, body svg, body figure { -webkit-user-drag: none; user-drag: none; pointer-events: none; }
/* keep interactive controls clickable despite the blanket pointer rule above */
.tools, .tools *, .quiz, .quiz *, .head, .head *, a, button { pointer-events: auto; }

/* ---- fail-closed: hide gated content until unlocked ---- */
html.pynote-lock body > *:not(#pynote-ov):not(#pynote-wm) {
  visibility: hidden !important;
}
html.pynote-lock { overflow: hidden; }

/* ---- the lock / upsell overlay (built by _gate.js) ---- */
#pynote-ov {
  position: fixed; inset: 0; z-index: 2147483600;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(900px 500px at 50% -10%, #1f2a52, #0e1430 70%);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
#pynote-ov .card {
  max-width: 460px; width: 100%; text-align: center;
  background: #fff; border-radius: 20px; padding: 38px 30px;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.6);
}
#pynote-ov .lk { font-size: 42px; line-height: 1; margin-bottom: 12px; }
#pynote-ov h2 { font-family: 'Fraunces', Georgia, serif; font-size: 25px; color: #1a2233; margin: 0 0 10px; }
#pynote-ov p { color: #54607a; font-size: 15px; line-height: 1.6; margin: 0 0 22px; }
#pynote-ov .btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
#pynote-ov a.b {
  display: inline-block; text-decoration: none; font-weight: 700; font-size: 14.5px;
  padding: 12px 22px; border-radius: 12px; transition: .15s;
}
#pynote-ov a.b.primary { background: linear-gradient(135deg, #e09a2b, #c47e16); color: #1a1407; }
#pynote-ov a.b.primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
#pynote-ov a.b.ghost { background: #f1f3f8; color: #2a3350; border: 1px solid #e1e6f0; }
#pynote-ov a.b.ghost:hover { border-color: #c3ccdd; }
#pynote-ov .fine { margin: 18px 0 0; font-size: 12px; color: #8a94a8; }

/* ---- identity watermark (built by _gate.js for Pro viewers) ---- */
#pynote-wm {
  position: fixed; inset: 0; z-index: 2147483000;
  pointer-events: none; overflow: hidden;
  opacity: .05; mix-blend-mode: multiply;
}
#pynote-wm .wmtxt {
  position: absolute; white-space: nowrap;
  font: 600 13px 'Plus Jakarta Sans', sans-serif; letter-spacing: .04em; color: #3b5bdb;
  transform: rotate(-28deg); transform-origin: 0 0;
}
/* blur the page when the tab/window loses focus (screenshot-app deterrent) */
html.pynote-away body > *:not(#pynote-wm) { filter: blur(11px) !important; transition: filter .12s; }

/* ---- block printing / "Save as PDF" entirely ---- */
@media print {
  html, body { background: #fff !important; }
  body * { visibility: hidden !important; }
  body::before {
    content: "Printing is disabled — these are PrepYodha Pro notes. © PrepYodha.";
    visibility: visible !important;
    position: fixed; top: 44%; left: 0; right: 0; text-align: center;
    font: 700 18px 'Plus Jakarta Sans', system-ui, sans-serif; color: #1a2233;
  }
}
