/* ========================================
   (i) popups inside rich text answers
   Editor: wwwroot/js/richtextInfoEditor.js
   Page:   wwwroot/js/richtextInfo.js
   ======================================== */

/* --- Marked text inside the Quill editor --- */
/* The (i) icon itself comes from the rendered-text rule below. */
.ql-editor .rt-info[data-info] {
    border-bottom: 1px dotted #008180;
    cursor: text;
}

/* --- Rendered text: the marked words open the popup, the icon follows them --- */
.rt-info[data-info] {
    cursor: pointer;
}

.rt-info[data-info]::after {
    /* bootstrap-icons "info-circle", the same icon as the question (i) popups */
    font-family: bootstrap-icons !important;
    content: "\f431";
    font-style: normal;
    font-weight: normal;
    font-size: 0.85em;
    vertical-align: super;
    margin-left: 0.2em;
}

/* --- Dialog for writing the popup text (popup.css) --- */
/* Viewport units, not inset:0: iOS gives <body> a transform (_Host.cshtml). */
.popup-overlay.rt-info-editor-overlay {
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 10060;
}

.rt-info-editor-dialog {
    width: min(560px, calc(100vw - 32px));
}

.rt-info-editor-dialog .rt-info-editor {
    min-height: 140px;
    background: #fff;
}

/* --- Popup on the page --- */
/* Positioning wins over the answering page's .modalblur / .modalblock. */
.modalblur.rt-info-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 10050;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modalblock.rt-info-popup {
    width: 75%;
    max-width: 720px;
    max-height: 80vh;
    max-height: 80dvh;
    overflow-y: auto;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.rt-info-popup .rt-info-popup-text,
.rt-info-popup .rt-info-popup-text a {
    color: #fff;
}

.rt-info-popup .rt-info-popup-ok {
    cursor: pointer;
    text-align: center;
}

/* Fallbacks for pages without the answering page's modal classes: zero
   specificity, so the answering page's own (scaled) values always win. */
:where(.rt-info-popup-overlay) {
    background-color: rgba(0, 0, 0, 0.5);
}

:where(.rt-info-popup) {
    background-color: #373737;
    border-radius: 10px;
    padding: 18px 18px 18px 28px;
}

:where(.rt-info-popup-text) {
    font-family: RobotoCondensedRegular, Arial, sans-serif;
    margin-bottom: 15px;
}

:where(.rt-info-popup-ok) {
    width: 50px;
    background-color: #008180;
    border-radius: 10px;
}

:where(.rt-info-popup-ok-text) {
    font-family: RobotoCondensedRegular, Arial, sans-serif;
    color: #fff;
}
