/* ============================================================================
   EDITOR LINK STYLES (AutoLink)
   Styles anchor elements created inside contenteditable editors.
   Cmd+Click (Mac) / Ctrl+Click (Windows) opens the link.
   ============================================================================ */

[contenteditable] a[href] {
    color: #4A90D9;
    text-decoration: underline;
    cursor: text; /* preserve editing cursor — Cmd+Click opens the link */
    word-break: break-all; /* prevent long URLs from overflowing */
}

[contenteditable] a[href]:hover {
    color: #357ABD;
}

/* Dark-mode link ink, in the two halves the theme mechanism requires.
   `:root:not([data-theme="light"])` is a GUARD, not a dark-mode test — on its
   own it matches every 'system' user, light OS included, and 'system' is the
   default. Outside a media block it painted #6BB0F0 on white (2.31:1) on every
   note and task editor link. The guard only means "dark, unless the user asked
   for light", so it has to live inside the media query that supplies "dark".
   Both halves must declare the SAME properties: the system half is (0,3,0) to
   the explicit half's (0,2,0), so it wins wherever both match. */
[data-theme="dark"] [contenteditable] a[href] {
    color: #6BB0F0;
}

[data-theme="dark"] [contenteditable] a[href]:hover {
    color: #4A90D9;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) [contenteditable] a[href] {
        color: #6BB0F0;
    }

    :root:not([data-theme="light"]) [contenteditable] a[href]:hover {
        color: #4A90D9;
    }
}

/* ============================================================================
   END EDITOR LINK STYLES
   ============================================================================ */
