/* Stile condiviso dell'evidenziatore di testo generico (assets/text-highlights.js).
   Riusa gli stessi colori del lettore Bibbia/Catechismo, per coerenza in
   tutto il sito. Non dipende da variabili di pagina: valori fissi. */

.pv-text-highlight {
  padding: 0; color: inherit; border-radius: 2px; cursor: pointer;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  /* Su telefono, un tocco su testo selezionabile può far scattare la
     selezione nativa invece di un tocco semplice, impedendo l'apertura
     del popover di rimozione. */
  user-select: none; -webkit-user-select: none;
}
.pv-text-highlight-yellow { background: rgba(217, 169, 74, 0.30); }
.pv-text-highlight-red { background: rgba(176, 74, 58, 0.20); }
.pv-text-highlight-green { background: rgba(107, 138, 100, 0.24); }

.pv-text-highlight-toolbar,
.pv-text-highlight-remove-popover {
  position: fixed; z-index: 1000; display: flex; align-items: center;
  gap: 8px; max-width: calc(100vw - 24px); padding: 9px 10px;
  border: 1px solid #D5C9BA; border-radius: 12px; background: #FCFBF8;
  box-shadow: 0 12px 32px rgba(47, 42, 38, 0.18);
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.pv-text-highlight-toolbar[hidden],
.pv-text-highlight-remove-popover[hidden] { display: none; }
.pv-text-highlight-color {
  width: 34px; height: 34px; padding: 0; border: 1px solid rgba(47, 42, 38, 0.12);
  border-radius: 50%; cursor: pointer;
}
.pv-text-highlight-color-yellow { background: #E6C778; }
.pv-text-highlight-color-red { background: #CD8275; }
.pv-text-highlight-color-green { background: #91AD8B; }
.pv-text-highlight-divider { width: 1px; height: 27px; background: #E1D9CC; }
.pv-text-highlight-cancel {
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: transparent; color: #756E67; font-size: 22px; line-height: 1; cursor: pointer;
}
.pv-text-highlight-cancel:hover { background: rgba(47, 42, 38, 0.06); }
.pv-text-highlight-journal {
  min-height: 34px; padding: 6px 10px; border: 0; background: transparent;
  color: #8A6748; font-weight: 600; font-size: 12px; cursor: pointer;
  white-space: nowrap;
}
.pv-text-highlight-journal:hover { text-decoration: underline; }
.pv-text-highlight-feedback {
  max-width: 190px; font-size: 11px; line-height: 1.35; color: #6B1B26;
}
.pv-text-highlight-remove {
  min-height: 34px; padding: 6px 11px; border: 0; background: transparent;
  color: #6B1B26; font-weight: 600; font-size: 12px; cursor: pointer;
}

/* Pulsante "Evidenzia" da mostrare su mobile per attivare il trascinamento
   col dito (facoltativo: solo se la pagina include gli elementi con gli id
   passati come mobileToggleId/mobileHelpId a PVTextHighlights.init). */
.pv-mobile-highlight-controls {
  display: none; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 18px;
}
.pv-mobile-highlight-toggle {
  min-height: 42px; padding: 8px 16px; border: 1px solid #8A6748;
  border-radius: 999px; background: #FCFBF8; color: #6B1B26;
  font-weight: 600; font-size: 13px;
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
}
.pv-mobile-highlight-toggle[aria-pressed="true"] {
  background: #6B1B26; border-color: #6B1B26; color: #fff;
}
.pv-mobile-highlight-help {
  font-size: 12px; line-height: 1.4; color: #756E67;
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (max-width: 640px) {
  .pv-mobile-highlight-controls { display: flex; }
  .pv-mobile-highlight-active [data-reader-text] {
    cursor: crosshair; touch-action: none; -webkit-touch-callout: none;
    user-select: text; -webkit-user-select: text;
  }
  .pv-text-highlight-toolbar { bottom: 14px !important; top: auto !important; }
}
