﻿/* ===== CommandBar =====
   Befehlsleiste wie das vereinfachte Menüband von Outlook. command-bar.js misst, ob die Befehle in die Zeile passen, und setzt
   data-oo-command-bar-stufe (1 = ohne Beschriftung der Zusatzbefehle, 2 = nur noch Priority High mit Text). Die Leiste ist außerdem
   ihr eigener Container (Name je Instanz, inline gesetzt): Feste Grenzen (CompactBreakpoint, IconOnlyBreakpoint) schreibt die
   Komponente als Container-Abfragen in ein eigenes style-Element, weil sie Parameter sind.

   CSS-Variablen:
     --oo-command-bar-background   Fläche, Standard --oo-color-surface
     --oo-command-bar-radius       Ecken, Standard --oo-radius-lg
     --oo-command-bar-shadow       leichter Schatten wie eine Karte
   ====================== */

.oo-command-bar {
    --oo-command-bar-background: var(--oo-color-surface);
    --oo-command-bar-radius: var(--oo-radius-lg);
    --oo-command-bar-shadow: 0 0 0.125rem rgb(0 0 0 / 0.12), 0 0.0625rem 0.125rem rgb(0 0 0 / 0.14);
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: var(--oo-space-1) var(--oo-space-2);
    border-radius: var(--oo-command-bar-radius);
    background: var(--oo-command-bar-background);
    box-shadow: var(--oo-command-bar-shadow);
}

.oo-command-bar--plain {
    --oo-command-bar-background: transparent;
    --oo-command-bar-shadow: none;
    padding-inline: 0;
}

/* Eine Zeile; was nicht passt, wird abgeschnitten (Menüs und Tooltips liegen fest bzw. im Top Layer darüber). Etwas Rand für Fokusringe. */
.oo-command-bar__items {
    display: flex;
    align-items: center;
    gap: var(--oo-space-1);
    min-width: 0;
    overflow: clip;
    overflow-clip-margin: 0.25rem;
}

.oo-command-bar__end {
    display: flex;
    align-items: center;
    gap: var(--oo-space-1);
    flex-shrink: 0;
    margin-left: auto;
}

/* Hülle ohne eigenes Kästchen: Ihre Befehle stehen direkt in der Zeile. */
.oo-command-bar__item {
    display: contents;
}

/* Befehle schrumpfen nicht; ein Titel dazwischen darf schrumpfen und kürzt mit „…“. */
:is(.oo-command-bar__items, .oo-command-bar__end, .oo-command-bar__item) > :is(.oo-btn, .oo-cm, .oo-toggle-btn-group, .oo-split-btn) {
    flex-shrink: 0;
}

/* Gemessene Stufen: Die Beschriftung bleibt für Screenreader, sichtbar ist nur das Symbol. Texte in ToggleButtonGroup und Menüs bleiben. */
.oo-command-bar[data-oo-command-bar-stufe="1"] .oo-command-bar__item--low .oo-btn__text:not(:is(.oo-toggle-btn-group, .oo-cm__panel) *),
.oo-command-bar[data-oo-command-bar-stufe="2"] .oo-btn__text:not(:is(.oo-toggle-btn-group, .oo-command-bar__item--high, .oo-cm__panel) *) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

.oo-command-bar__separator.oo-divider--vertical {
    align-self: stretch;
    margin: var(--oo-space-1);
}
