/* Zentrale Schriftregeln der Anwendung. Dokumentinhalt und E-Mail-Inhalt
   behalten ihre eigene Formatierung. Werte nur hier ändern. */
:root {
    --ef-font-family: 'Segoe UI', Arial, sans-serif;
    --ef-font-body: 12px;
    --ef-font-compact: 12px;
    --ef-font-small: 12px;
    --ef-font-caption: 11px;
    --ef-font-page-title: clamp(22px, 2vw, 27px);
    --ef-font-section-title: 18px;
    --ef-font-panel-title: 15px;
    --ef-font-subheading: 14px;
    --ef-font-metric: clamp(20px, 2vw, 29px);
    --ef-font-total: 20px;
    --ef-font-weight-normal: 400;
    --ef-font-weight-medium: 500;
    --ef-font-weight-semibold: 600;
    --ef-font-weight-bold: 700;
    --ef-line-body: 1.5;
    --ef-line-heading: 1.25;
    --ef-line-compact: 1.3;
    --bs-body-font-family: var(--ef-font-family);
    --bs-body-font-size: var(--ef-font-body);
    --bs-body-font-weight: var(--ef-font-weight-normal);
    --bs-body-line-height: var(--ef-line-body);
}

body {
    font-family: var(--ef-font-family);
    font-size: var(--ef-font-body);
    font-weight: var(--ef-font-weight-normal);
    line-height: var(--ef-line-body);
}

/* Dokument- und E-Mail-Inhalte sind von UI-Regeln ausgenommen. */
:is(h1, h2, h3, h4, h5, h6):not(:where(.ProseMirror *, .invoice-positions *, .mail-preview-body *)) {
    font-family: var(--ef-font-family);
    font-weight: var(--ef-font-weight-bold);
    line-height: var(--ef-line-heading);
}
h1:not(:where(.ProseMirror *, .mail-preview-body *)), .ef-page-title { font-size: var(--ef-font-page-title); }
h2:not(:where(.ProseMirror *, .mail-preview-body *)), .ef-section-title { font-size: var(--ef-font-section-title); }
h3:not(:where(.ProseMirror *, .mail-preview-body *)), .ef-panel-title { font-size: var(--ef-font-panel-title); }
:is(h4, h5, h6):not(:where(.ProseMirror *, .mail-preview-body *)), .ef-subheading { font-size: var(--ef-font-subheading); }
:is(strong, b):not(:where(.ProseMirror *, .mail-preview-body *)), .ef-text-bold { font-weight: var(--ef-font-weight-bold); }
small:not(:where(.ProseMirror *, .mail-preview-body *)), .ef-text-small { font-size: var(--ef-font-small); }
.ef-text-body { font-size: var(--ef-font-body); }
.ef-text-compact { font-size: var(--ef-font-compact); }
.ef-text-muted { color: var(--ef-muted, #858ba0); }

.ef-app :where(.form-label, .form-control, .form-select, .btn, .text-library-item, .text-field-item),
.modal-panel :where(.form-label, .form-control, .form-select, .modal-button) {
    line-height: var(--ef-line-compact);
}

/* Fremdkomponenten übernehmen die Schriftfamilie, Iconfonts bleiben erhalten. */
.ef-app :where(.e-control, .e-grid, .e-treegrid, .e-treeview, .e-input, .e-btn),
.modal-panel :where(input, select, textarea, button),
.ef-app :where(input, select, textarea, button) {
    font-family: var(--ef-font-family);
}
.ef-app :where(.e-rowcell, .e-list-text, .e-tbar-btn-text, .e-input, .e-btn) {
    font-size: var(--ef-font-compact);
}
.ef-app :where(.e-headercelldiv) {
    font-size: var(--ef-font-small);
    font-weight: var(--ef-font-weight-semibold);
}
