/* ==========================================================================
   editor.css — the Default FWRE design's AUTONOMOUS rich-text-editor skin.

   Forked from the shared demo-editor.css floor and retokenized to speak ONLY this
   design's own --fwre-* tokens (design-tokens.css) — ZERO --demo-* (the outer
   demo/website theme's vocabulary). Styles the editor component (.demo-editor-*
   markup emitted by demo-editor.js). Loaded for `default` via the front layout's
   fwre_design_owns_skin('editor') guard; agency keeps the demo-editor.css floor.
   Tracked (selector portability, like product.css): the .demo-editor-* component
   class namespace is unchanged this phase.
   ========================================================================== */

.demo-editor-wrap {
    border: 1px solid var(--fwre-grey-border);
    border-radius: var(--fwre-radius);
    background: var(--fwre-white);
    overflow: hidden;
}
.demo-editor-wrap:focus-within {
    border-color: var(--fwre-green);
}

/* Toolbar — always single-line; horizontal scroll if it overflows. */
.demo-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--fwre-grey-border);
    background: var(--fwre-grey-light);
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.demo-editor-toolbar::-webkit-scrollbar {
    height: 6px;
}
.demo-editor-toolbar::-webkit-scrollbar-thumb {
    background: var(--fwre-grey);
    border-radius: 3px;
}
.demo-editor-toolbar > * { flex-shrink: 0; }

.demo-editor-toolbar button {
    min-width: 34px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--fwre-black);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 7px;
}
.demo-editor-toolbar button:hover {
    background: var(--fwre-white);
    color: var(--fwre-green);
}
.demo-editor-toolbar button svg { max-width: none; display: block; }

.demo-editor-sep {
    width: 1px;
    height: 22px;
    background: var(--fwre-grey-border);
    margin: 0 4px;
}

/* Editable content area. */
.demo-editor-content {
    min-height: 140px;
    max-height: none;
    overflow-y: auto;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.6;
    outline: none;
    color: var(--fwre-black);
    background: var(--fwre-white);
}
.demo-editor-content:empty::before {
    content: attr(data-placeholder);
    color: var(--fwre-grey-dark-deep);
    pointer-events: none;
}
.demo-editor-content blockquote {
    border-left: 3px solid var(--fwre-grey);
    margin: 8px 0;
    padding: 4px 12px;
    color: var(--fwre-black);
}
.demo-editor-content pre {
    background: var(--fwre-white);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    overflow-x: auto;
}
.demo-editor-content :first-child { margin-top: 0; }

/* HTML-source view: the textarea is hidden by default; the toggle swaps them. */
.demo-editor-source {
    display: none;
    width: 100%;
    min-height: 140px;
    border: none;
    outline: none;
    resize: vertical;
    padding: 12px 14px;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--fwre-black);
    background: var(--fwre-white);
}
.demo-editor-source.is-visible { display: block; }
.demo-editor-content.is-hidden { display: none; }

/* Drag-to-resize grip. */
.demo-editor-resize-grip {
    height: 8px;
    cursor: ns-resize;
    background: var(--fwre-grey-light);
    border-top: 1px solid var(--fwre-grey-border);
    display: flex;
    align-items: center;
    justify-content: center;
}
.demo-editor-resize-grip::after {
    content: '';
    width: 30px;
    height: 3px;
    border-top: 1px solid var(--fwre-grey);
    border-bottom: 1px solid var(--fwre-grey);
}
