/* Content protection for public pages. static/js/content-protect.js adds
   html.cp-on, so switching the script off switches all of this off too. */
html.cp-on:not(.cp-select-ok) body {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
html.cp-on input,
html.cp-on textarea,
html.cp-on select,
html.cp-on [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
html.cp-on img { -webkit-user-drag: none; }

.cp-cover {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2147483000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 10, 10, 0.82);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: #ffffff;
  font-family: var(--sans);
  text-align: center;
  cursor: pointer;
}
.cp-cover.is-on { display: flex; }
.cp-cover.is-black {
  background: #000000;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.cp-cover-msg {
  max-width: 420px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}
.cp-cover-msg strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
/* Keep protection toasts above the cover. */
html.cp-on .nt-toast { z-index: 2147483600; }

@media print {
  html.cp-on body { display: none !important; }
  html.cp-on::before {
    content: "Printing is disabled on Navtraq.";
    display: block;
    padding: 48px;
    font-family: Archivo, Helvetica, Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #000000;
  }
}

/* Hold to read (content-protect.js, CONFIG.holdToRead): [data-hold-read]
   blocks blur until pressed and held. Only active once the script marks the
   block .hr-ready, so without JavaScript the text stays readable. */
html.cp-on [data-hold-read].hr-ready {
  position: relative;
  touch-action: pan-y pinch-zoom;
}
html.cp-on [data-hold-read].hr-ready:focus { outline: none; }
html.cp-on [data-hold-read].hr-ready:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.hr-veil { display: none; }
html.cp-on .hr-ready > .hr-veil {
  position: absolute;
  top: -4px;
  right: -4px;
  bottom: -4px;
  left: -4px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
html.cp-on .hr-ready.is-holding > .hr-veil { display: none; }
/* Long blocks: hint near the top, following the reader down the block. */
html.cp-on .hr-ready[data-hold-read="long"] > .hr-veil { align-items: flex-start; }
html.cp-on .hr-ready[data-hold-read="long"] .hr-hint {
  position: sticky;
  top: 110px;
  margin-top: 18px;
}
/* Table: blur the values only; labels and layout stay as they are. */
html.cp-on .hr-ready[data-hold-read="cells"]:not(.is-holding) td { filter: blur(5px); }
/* Horoscope grid excerpts: opacity on the paragraph turns it into a backdrop
   root and weakens the veil blur, so use the same tone as a solid colour. */
html.cp-on .sign-cell p.hr-ready { opacity: 1; color: #4f4f4f; }
html.cp-on .sign-cell:hover p.hr-ready { color: #b8b8b8; }

.hr-hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px 6px 8px;
  background: #0a0a0a;
  border-left: 2px solid var(--accent);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  color: #ffffff;
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hr-hint svg {
  flex: none;
  width: 14px;
  height: 14px;
  fill: var(--accent);
}
.hr-hint.is-inline {
  float: right;
  margin: 2px 0 0 12px;
  font-size: 9px;
}
html.cp-on .hr-ready.is-holding .hr-hint.is-inline { visibility: hidden; }

/* Browsers without backdrop-filter: blur the block itself. */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  html.cp-on .hr-ready:not([data-hold-read="cells"]):not(.is-holding) { filter: blur(6px); }
}

/* Focus to read (content-protect.js, CONFIG.focusRead): inside a
   [data-focus-read-group] one [data-focus-read] paragraph is clear at a time
   (under the mouse, or nearest mid-screen on touch). Blurring is instant;
   clearing fades in quickly. Only active once the script marks the group
   .fr-ready, so without JavaScript the text stays readable. */
html.cp-on .fr-ready [data-focus-read]:not(.is-focus) { filter: blur(6px); }
html.cp-on .fr-ready [data-focus-read].is-focus { transition: filter 0.12s ease-out; }
html.cp-on .fr-ready [data-focus-read]:focus { outline: none; }
html.cp-on .fr-ready [data-focus-read]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.fr-hint { margin: 0 0 14px; }
@media (prefers-reduced-motion: reduce) {
  html.cp-on .fr-ready [data-focus-read].is-focus { transition: none; }
}
