/* VF Review — custom styles */

[x-cloak] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

/* Inline pin-references in comment text */
.comment-preview .pin-ref {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4em;
  height: 1.4em;
  margin: 0 0.1em;
  background: #D22E89;
  color: white;
  border-radius: 999px;
  font-size: 0.75em;
  font-weight: 700;
  font-family: "Inter", system-ui, sans-serif;
  font-style: normal;
  line-height: 1;
  vertical-align: -0.15em;
}

.comment-preview {
  white-space: pre-wrap;
  word-wrap: break-word;
}

img {
  -webkit-user-drag: none;
}

/* Better focus rings */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #D22E89;
  outline-offset: 2px;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Spread-frame: subtle inner highlight to suggest paper */
.spread-frame {
  background: linear-gradient(180deg, #ffffff 0%, #fdfcfb 100%);
}

/* Center fold shadow for inner spreads — only the last ~2cm of each page near the spine */
.fold-shadow {
  background:
    linear-gradient(
      to right,
      transparent 85%,
      rgba(0, 0, 0, 0.08) 94%,
      rgba(0, 0, 0, 0.30) 100%
    ) left center / 50% 100% no-repeat,
    linear-gradient(
      to left,
      transparent 85%,
      rgba(0, 0, 0, 0.08) 94%,
      rgba(0, 0, 0, 0.30) 100%
    ) right center / 50% 100% no-repeat;
  mix-blend-mode: multiply;
}

/* Draft-pin: clickable, draggable */
.draft-pin {
  cursor: pointer;
  z-index: 5;
}

/* Right rail max-height when sticky on desktop */
@media (min-width: 1280px) {
  aside.xl\:sticky {
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    /* Hide scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
  }
  aside.xl\:sticky::-webkit-scrollbar {
    width: 6px;
  }
  aside.xl\:sticky::-webkit-scrollbar-track {
    background: transparent;
  }
  aside.xl\:sticky::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 999px;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print */
@media print {
  header,
  footer,
  aside,
  button,
  nav {
    display: none !important;
  }
  .spread-frame {
    box-shadow: none !important;
    page-break-after: always;
  }
}
