/* textedit.css -- the Custom Text panel.
 *
 * IT SITS ABOVE THE CATALOGUE, like the inspector and for the same reason: a
 * customer adding a second line must not have to press Add again to get back to
 * the grid. Order in the panel is mount order, and app.js mounts it there.
 *
 * NOTHING HERE HIDES A CONTROL. The font menu disables the faces that cannot
 * draw Greek rather than removing them, so this file has to make "disabled"
 * read as a control that is off rather than as an empty row -- which is the
 * half of the rule the reorder arrow taught: fade the glyph, never the control.
 */

#cs-textedit {
    border-bottom: 1px solid var(--cs-hairline);
    padding: 14px;
}

.cs-te-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cs-te-title {
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    color: var(--cs-ink);
}

.cs-te-text {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--cs-line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.3;
    color: var(--cs-ink);
    resize: vertical;
}

.cs-te-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cs-te-label {
    flex: 0 0 92px;
    font-size: 11px;
    font-weight: 700;
    color: var(--cs-muted);
}

.cs-te-row input[type="range"] { flex: 1; cursor: pointer; }

.cs-te-font {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid var(--cs-line);
    border-radius: 8px;
    background: var(--cs-white);
    font-size: 14px;
    color: var(--cs-ink);
    cursor: pointer;
}

/* A DISABLED FACE IS STILL A FACE. Greyed and struck through, not gone: a
   customer who used Bangers yesterday must be able to see that it is still
   there and merely unusable for what they have typed. Browsers style a disabled
   <option> themselves and inconsistently, so the colour is stated. */
.cs-te-font option:disabled {
    color: var(--cs-muted);
    text-decoration: line-through;
}

.cs-te-note {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 8px 10px;
}

.cs-te-marks,
.cs-te-aligns {
    display: flex;
    gap: 6px;
}

.cs-te-toggle,
.cs-te-align {
    flex: 1;
    padding: 7px 4px;
    border: 1px solid var(--cs-line);
    border-radius: 8px;
    background: var(--cs-white);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--cs-ink);
    cursor: pointer;
}

.cs-te-toggle[data-cs-te="bold"] { font-weight: 900; }
.cs-te-toggle[data-cs-te="italic"] { font-style: italic; }
.cs-te-toggle[data-cs-te="underline"] { text-decoration: underline; }

/* PRESSED IS AN ATTRIBUTE THE BROWSER ALREADY HAS. aria-pressed is what a
   screen reader reads and what a test asserts, so the stylesheet reads the same
   thing rather than a class kept in step by hand. */
.cs-te-toggle[aria-pressed="true"],
.cs-te-align[aria-pressed="true"] {
    border-color: var(--cs-accent);
    background: #eff4ff;
    color: var(--cs-accent);
}
