/*!
 * Kripanov Anticopia - Protection styles
 *
 * @package KripanovAnticopia
 * @since   1.0.0
 */

/* Disable text selection. */
body.anticopia-no-select,
body.anticopia-no-select * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow selection inside form fields. */
body.anticopia-no-select input,
body.anticopia-no-select textarea,
body.anticopia-no-select select,
body.anticopia-no-select [contenteditable="true"],
body.anticopia-no-select [contenteditable="true"] * {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

/* Disable image dragging. */
body.anticopia-no-drag img,
body.anticopia-no-drag picture,
body.anticopia-no-drag svg {
    -webkit-user-drag: none;
    user-drag: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Extra image protection layer. */
body.anticopia-protect-images img,
body.anticopia-protect-images picture img {
    -webkit-touch-callout: none;
    pointer-events: auto;
}

body.anticopia-protect-images figure {
    position: relative;
}

/* Soft overlay on figures to hinder casual save-as. */
body.anticopia-protect-images figure::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: transparent;
    pointer-events: auto;
}

body.anticopia-protect-images figure a,
body.anticopia-protect-images figure button,
body.anticopia-protect-images figure figcaption {
    position: relative;
    z-index: 2;
}

/* Mobile long-press / callout. */
body.anticopia-no-touchcallout,
body.anticopia-no-touchcallout * {
    -webkit-touch-callout: none;
}

body.anticopia-no-touchcallout input,
body.anticopia-no-touchcallout textarea,
body.anticopia-no-touchcallout select,
body.anticopia-no-touchcallout [contenteditable="true"] {
    -webkit-touch-callout: default;
}

/* Hide content when printing. */
@media print {
    body.anticopia-no-print {
        display: none !important;
    }
    body.anticopia-no-print::before {
        content: "Protected content. Printing is not allowed.";
        display: block !important;
        font-size: 20px;
        text-align: center;
        padding: 40px;
    }
}

/* Floating notice. */
.anticopia-notice {
    position: fixed;
    left: 50%;
    bottom: 30px;
    transform: translate(-50%, 20px);
    background: rgba(20, 20, 20, 0.92);
    color: #fff;
    padding: 12px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    z-index: 2147483647;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    max-width: 90vw;
    text-align: center;
}

.anticopia-notice.anticopia-show {
    opacity: 1;
    transform: translate(-50%, 0);
}
