/* annotations.css — User highlight marks and annotation tooltip */

/* ============================================================
   HIGHLIGHT MARKS
   ============================================================ */

mark.user-annotation {
    /* Reset browser UA mark color (can be blue on dark system themes) */
    background-color: transparent;
    color: inherit;
    border-radius: 3px;
    padding: 0.18em 0.28em;
    cursor: pointer;
    transition: filter 0.1s ease;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* Double class = specificity (0,2,1), beats UA mark rule and the base reset above */
mark.user-annotation.user-annotation--amber { background-color: rgba(245, 158,  11, 0.32); }
mark.user-annotation.user-annotation--sage  { background-color: rgba(107, 158, 120, 0.34); }
mark.user-annotation.user-annotation--steel { background-color: rgba(112, 150, 184, 0.34); }
mark.user-annotation.user-annotation--rose  { background-color: rgba(200, 116, 116, 0.34); }

mark.user-annotation:hover { filter: brightness(0.80); }

/* Dark mode — slightly more opaque so highlights stay visible */
[data-theme="dark"] mark.user-annotation.user-annotation--amber { background-color: rgba(245, 158,  11, 0.40); }
[data-theme="dark"] mark.user-annotation.user-annotation--sage  { background-color: rgba(107, 158, 120, 0.42); }
[data-theme="dark"] mark.user-annotation.user-annotation--steel { background-color: rgba(112, 150, 184, 0.42); }
[data-theme="dark"] mark.user-annotation.user-annotation--rose  { background-color: rgba(200, 116, 116, 0.42); }

/* ============================================================
   ANNOTATION TOOLTIP
   Appears on hover over a mark. Inverted colours like the
   selection popup (--text bg, --bg text).
   ============================================================ */

.ann-tooltip {
    position: absolute;
    z-index: 750;
    min-width: 8rem;
    max-width: 15rem;
    background: var(--text);
    color: var(--bg);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
    padding: 0.45rem 0.6rem;
    font-family: var(--font-sans);
    font-size: 0.73rem;
    line-height: 1.45;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease, visibility 0.12s ease;
    pointer-events: none;
}

.ann-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ann-tooltip-note {
    margin-bottom: 0.35rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.ann-tooltip-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.ann-tooltip-date {
    opacity: 0.55;
    font-size: 0.68rem;
}

.ann-tooltip-delete {
    background: none;
    border: none;
    color: var(--bg);
    opacity: 0.65;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    padding: 0;
    line-height: 1;
    transition: opacity 0.1s ease;
}

.ann-tooltip-delete:hover { opacity: 1; }

/* ============================================================
   REDUCE MOTION
   ============================================================ */

[data-reduce-motion] mark.user-annotation { transition: none; }
[data-reduce-motion] .ann-tooltip         { transition: none; }
