/* ================================================================
   FriendsByChance — components/etb-editor.css
   Editable Text Block — editor component
   ================================================================ */

/* ── Outer wrap: editor body + side column ──────────────────────── */
.etb-editor-wrap {
    display:     flex;
    gap:         8px;
    align-items: flex-start;
    max-height:  100vh;
    overflow:    hidden;
}

/* ── Editor body (scrolls if content tall) ──────────────────────── */
.etb-editor-body {
    flex:       1;
    min-width:  0;
    overflow-y: auto;
    /* Padding so content doesn't sit flush against the edge */
    padding:    2px 0;
}

/* ── Label / title input ────────────────────────────────────────── */
.etb-label-input {
    display:      block;
    width:        100%;
    box-sizing:   border-box;
    margin-bottom: 8px;
    padding:      6px 10px;
    border:       1px solid var(--color-divider);
    border-radius: 6px;
    background:   var(--color-input-bg, #fff);
    color:        var(--color-text);
    font-size:    0.95em;
}
.etb-label-input:focus { outline: none; border-color: var(--color-primary); }
.etb-label-input::placeholder { color: var(--color-text-muted); }

/* ── Inline error message ───────────────────────────────────────── */
.etb-error {
    color:        var(--color-danger, #c0392b);
    font-size:    0.85em;
    margin-bottom: 6px;
}

/* ── Quill wrapper ──────────────────────────────────────────────── */
.etb-ql-wrap .ql-container {
    min-height:  100px;
    font-size:   14px;
    border-radius: 0 0 6px 6px;
}
.etb-ql-wrap .ql-toolbar {
    border-radius: 6px 6px 0 0;
}

/* ── Side column ────────────────────────────────────────────────── */
.etb-editor-side-col {
    display:        flex;
    flex-direction: column;
    gap:            6px;
    flex-shrink:    0;
    padding-top:    2px;
}

/* ── Fullscreen overlay (wraps the editor when screen is small) ─── */
.etb-editor-fs-overlay {
    position:        fixed;
    inset:           0;
    z-index:         600;
    background:      var(--color-bg);
    display:         flex;
    flex-direction:  column;
    overflow:        hidden;
}

/* When the editor lives inside the fullscreen overlay it should
   fill the available space and its body should scroll. */
.etb-editor-fs-overlay .etb-editor-wrap {
    flex:       1;
    max-height: none;
    overflow:   hidden;
    padding:    16px;
    gap:        10px;
}
.etb-editor-fs-overlay .etb-editor-body {
    /* fills remaining height; body scrolls */
    flex:       1;
}
.etb-editor-fs-overlay .etb-ql-wrap .ql-container {
    /* uncap height inside fullscreen — body scroll handles length */
    max-height: none;
}

/* ── Quill's words (its pickers', its link tooltip's), in the user's language ──
   For EVERY Quill in the app (see etb-editor.js).  Quill writes them
   with `content:`; i18n sets each from the locale's "css" strings as a
   custom property, and the English stays as the fallback.  Same
   selectors as quill.snow.css, which loads first, so these win. */
.ql-snow .ql-picker.ql-size .ql-picker-label::before,
.ql-snow .ql-picker.ql-size .ql-picker-item::before { content: var(--i18n-ql_size_normal, 'Normal'); }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before { content: var(--i18n-ql_size_small, 'Small'); }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before { content: var(--i18n-ql_size_large, 'Large'); }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { content: var(--i18n-ql_size_huge, 'Huge'); }
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
.ql-snow .ql-picker.ql-font .ql-picker-item::before { content: var(--i18n-ql_font_sans, 'Sans Serif'); }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=serif]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { content: var(--i18n-ql_font_serif, 'Serif'); }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { content: var(--i18n-ql_font_monospace, 'Monospace'); }
/* …and its link tooltip's — a link in the text (pasted: no toolbar
   offers one) pressed shows it. */
.ql-snow .ql-tooltip::before                       { content: var(--i18n-ql_link_visit, 'Visit URL:'); }
.ql-snow .ql-tooltip[data-mode=link]::before       { content: var(--i18n-ql_link_enter, 'Enter link:'); }
.ql-snow .ql-tooltip a.ql-action::after            { content: var(--i18n-ql_link_edit, 'Edit'); }
.ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: var(--i18n-ql_link_save, 'Save'); }
.ql-snow .ql-tooltip a.ql-remove::before           { content: var(--i18n-ql_link_remove, 'Remove'); }
