/* =============================================
   LEAGUE MEMO
   What is left of the message board's sheet: the league memo's modal, its
   author line, and the rich-text editor it is written in (lexical-editor.js).
   The board itself is gone; chat has its own sheet, league-chat.css.
   ============================================= */

.mb-new-topic-modal {
    width: min(560px, 100%);
    max-height: var(--modal-max-height);
    overflow: auto;
    padding: 18px;
    box-sizing: border-box;
    background: var(--c-s1);
    border-radius: var(--r2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.mb-new-topic-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.mb-new-topic-modal-title {
    font-family: var(--ff2);
    font-size: 14pt;
    font-weight: var(--fw1);
    color: var(--c1);
}

.mb-form-group {
    margin: 0 0 10px 0;
}

.mb-form-group:last-of-type {
    margin-bottom: 16px;
}

.mb-input {
    width: 100%;
    font-family: var(--ff1);
    font-size: var(--fs-body);
    padding: 11px 14px;
    border: 1px solid var(--c1-a2);
    border-radius: var(--r2);
    background: var(--c-page-background);
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    color: #333;
}

.mb-input::placeholder {
    color: #999;
}

.mb-field-error {
    font-size: 9pt;
    color: #842029;
    margin-top: 6px;
}

.mb-compose-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.mb-message-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: oklch(var(--avatar-lightness) var(--avatar-chroma) var(--avatar-hue, 0));
    color: var(--c-s1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
    overflow: hidden;
    font-family: var(--ff1);
    font-size: 9pt;
    font-weight: var(--fw3);
    line-height: 1;
    text-align: center;
    text-decoration: none;
    text-shadow: none;
    text-indent: 1px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.mb-author-avatar--image {
    background: transparent;
    border: 0;
    box-shadow: none;
    outline: 0;
}

.mb-message-author-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 50%;
    box-shadow: none;
    object-fit: cover;
    outline: 0;
}

.mb-author-name {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mb-message-author {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    --mb-author-profile-link-gap: 7px;
    font-size: var(--fs-small1);
    font-weight: var(--fw3);
    line-height: 1;
    color: #1a1a1a;
    min-width: 0;
    max-width: min(220px, 100%);
    white-space: nowrap;
}

.mb-message-time {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    font-size: var(--fs-small1);
    line-height: 1;
    color: #555;
    flex: 0 0 auto;
    margin-left: 16px;
    white-space: nowrap;
}

/* ---------- @mentions ---------- */

/* A reference to a league member reads blue, a reference to an entry green,
   both in a posted memo and while it is still being typed. lexical-editor.js
   classes each mention by what it names. */
.pcf-lexical-mention {
    font-weight: var(--fw3);
}

.pcf-lexical-mention--user {
    color: var(--c2-a2);
}

.pcf-lexical-mention--entry {
    color: var(--c-green);
}

/* The dropdown the names are picked from. It is positioned against the caret by
   script and lives on <body>, clear of the editor's own overflow. */
.pcf-lexical-mention-menu {
    background: var(--c-s1);
    border: 1px solid var(--c1-a2);
    border-radius: var(--r2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    box-sizing: border-box;
    max-height: 260px;
    max-width: calc(100vw - 16px);
    min-width: 220px;
    overflow-y: auto;
    padding: 4px;
    position: fixed;
    text-align: left;
    z-index: 4000;
}

.pcf-lexical-mention-menu[hidden] {
    display: none;
}

.pcf-lexical-mention-option {
    align-items: baseline;
    background: transparent;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    font-family: var(--ff1);
    font-size: var(--fs-small1);
    gap: var(--g2);
    justify-content: space-between;
    padding: 6px 8px;
    text-align: left;
    width: 100%;
}

.pcf-lexical-mention-option.is-active,
.pcf-lexical-mention-option:hover {
    background: var(--c1-a1);
}

.pcf-lexical-mention-option--user .pcf-lexical-mention-option-name {
    color: var(--c2-a2);
}

.pcf-lexical-mention-option--entry .pcf-lexical-mention-option-name {
    color: var(--c-green);
}

.pcf-lexical-mention-option-name {
    font-weight: var(--fw3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pcf-lexical-mention-option-kind {
    color: var(--c1-a4);
    flex: none;
    font-size: var(--fs-small3);
    letter-spacing: var(--ls1);
    text-transform: uppercase;
}

/* ---------- Lexical editor ---------- */

.pcf-lexical-editor {
    background: var(--c-s1);
    border: 1px solid var(--c1-a2);
    border-radius: var(--r2);
    box-sizing: border-box;
    color: #222;
    overflow: hidden;
    text-align: left;
    width: 100%;
}

.pcf-lexical-editor.is-uploading {
    cursor: progress;
}

.pcf-lexical-toolbar {
    align-items: center;
    background: var(--c1-a1);
    border-bottom: 1px solid var(--c1-a2);
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    min-height: 38px;
    padding: 5px 6px;
}

.pcf-lexical-toolbar-button {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--c1);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 28px;
    height: 28px;
    justify-content: center;
    padding: 0;
    width: 28px;
}

.pcf-lexical-toolbar-button:hover,
.pcf-lexical-toolbar-button:focus-visible,
.pcf-lexical-toolbar-button.is-active {
    background: var(--c-s1);
    border-color: var(--c1-a2);
    outline: none;
}

.pcf-lexical-toolbar-separator {
    align-self: stretch;
    background: var(--c1-a2);
    flex: 0 0 1px;
    margin: 4px 5px;
}

.pcf-lexical-surface-wrap {
    background: var(--c-s1);
    box-sizing: border-box;
    position: relative;
}

.pcf-lexical-surface {
    box-sizing: border-box;
    font-family: var(--ff1);
    font-size: var(--fs-body);
    line-height: 1.45;
    min-height: 200px;
    outline: none;
    overflow-y: auto;
    padding: 12px;
    position: relative;
    text-align: left;
    width: 100%;
}

.pcf-lexical-surface:empty::before,
.pcf-lexical-editor.is-empty .pcf-lexical-surface::before {
    color: #777;
    content: attr(data-placeholder);
    left: 12px;
    pointer-events: none;
    position: absolute;
    top: 12px;
}

.pcf-lexical-paragraph {
    margin: 0 0 0.75em;
    text-align: left;
}

.pcf-lexical-paragraph:last-child {
    margin-bottom: 0;
}

.pcf-lexical-text-bold {
    font-weight: var(--fw3);
}

.pcf-lexical-text-italic {
    font-style: italic;
}

.pcf-lexical-text-underline {
    text-decoration: underline;
}

.pcf-lexical-text-strikethrough {
    text-decoration: line-through;
}

.pcf-lexical-list-ul,
.pcf-lexical-list-ol {
    margin: 0 0 0.75em 1.3em;
    padding-left: 1em;
    text-align: left;
}

.pcf-lexical-list-item {
    margin: 0.2em 0;
}

.pcf-lexical-image {
    border-radius: var(--r2);
    display: block;
    height: auto;
    margin: 10px 0;
    max-width: 100%;
}
