/*
 * HtmlCapture (IDH-1400): read-only and print styles for captured client-authored HTML.
 * .hc-readonly is added by HtmlCapture.renderReadOnly() and restore(..., {readOnly: true}).
 */

/* Controls are disabled; keep them legible (browsers grey disabled controls out) and inert. */
.hc-readonly input:disabled,
.hc-readonly select:disabled,
.hc-readonly textarea:disabled,
.hc-readonly button:disabled {
    opacity: 1;
    color: inherit;
    -webkit-text-fill-color: currentColor;
    cursor: default;
}

.hc-readonly input,
.hc-readonly select,
.hc-readonly textarea,
.hc-readonly button,
.hc-readonly label,
.hc-readonly [aria-disabled="true"] {
    pointer-events: none;
}

.hc-readonly [aria-disabled="true"] {
    cursor: default;
}

/* Frozen canvases (signatures) keep their on-page size but never overflow the container. */
.hc-readonly img {
    max-width: 100%;
    height: auto;
}

@media print {
    .hc-readonly {
        color: #000;
        background: #fff;
    }

    .hc-readonly * {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    .hc-readonly img,
    .hc-readonly table,
    .hc-readonly fieldset,
    .hc-readonly label {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Print checked/selected state in black, not the faded disabled colour. */
    .hc-readonly input:disabled,
    .hc-readonly select:disabled,
    .hc-readonly textarea:disabled {
        color: #000;
        -webkit-text-fill-color: #000;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* IDH-1405: toggles and switches are often styled spans; print their colours as shown. */
    .hc-readonly,
    .hc-readonly * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .hc-print-hide {
        display: none !important;
    }
}
