﻿/* ===== MasterDetailLayout =====
   Seitengerüst wie Outlook im Web: Kopf (Befehlsleiste) über die ganze Breite, darunter Navigation | Liste | Detail.
   Graue Fläche, Navigation direkt darauf, Liste weiß und Detail grau in einer Karte mit runden Ecken; zweiteilig ist der Inhalt die Karte.
   Die Stufen nach der eigenen Breite (Drawer, eine Spalte) schreibt die Komponente als Container-Abfragen in ein eigenes style-Element.
   Kindkombinatoren ab dem Rahmen, damit Splitter und Layouts im Inhalt unberührt bleiben.

   CSS-Variablen:
     --oo-mdl-height        Höhe; Standard: Inhaltshöhe von RailLayout, SidebarLayout bzw. TopNavLayout, sonst 100 %
     --oo-mdl-card-shadow   Schatten der Karte
   ============================== */

/* Die Höhe steht an der Wurzel: Ein Prozentwert (etwa --oo-rl-content-height: 100%) bezieht sich so auf den Inhaltsbereich des App-Layouts */
.oo-mdl {
    --oo-mdl-card-shadow: 0 0 0.125rem rgb(0 0 0 / 0.12), 0 0.0625rem 0.125rem rgb(0 0 0 / 0.14);
    --oo-mdl-h: var(--oo-mdl-height, var(--oo-rl-content-height, var(--oo-sbl-content-height, var(--oo-tnl-content-height, 100%))));
    box-sizing: border-box;
    height: var(--oo-mdl-h);
    min-width: 0;
}

.oo-mdl__frame {
    display: flex;
    flex-direction: column;
    gap: var(--oo-space-2);
    box-sizing: border-box;
    height: 100%;
    min-height: 0;
    padding: var(--oo-space-2);
    background: var(--oo-color-background);
}

.oo-mdl__header {
    flex-shrink: 0;
    min-width: 0;
}

.oo-mdl__body {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
}

.oo-mdl__body > :is(.oo-mdl__outer, .oo-mdl__panes, .oo-mdl__content) {
    flex: 1 1 auto;
}

.oo-mdl__outer,
.oo-mdl__panes {
    min-width: 0;
    min-height: 0;
}

.oo-mdl__main-pane {
    display: flex;
}

.oo-mdl__main-pane > :is(.oo-mdl__panes, .oo-mdl__content) {
    flex: 1 1 auto;
}

/* Navigation | Bereich: Trenner unsichtbar bis zum Überfahren, dann eine Linie in der Primärfarbe */
.oo-mdl__outer > .oo-splitter-handle {
    width: 0.5rem;
    background: transparent;
}

.oo-mdl__outer > .oo-splitter-handle:hover,
.oo-mdl__outer > .oo-splitter-handle.oo-splitter-handle--dragging {
    background: linear-gradient(to right, transparent 0.1875rem, var(--oo-primary) 0.1875rem, var(--oo-primary) 0.3125rem, transparent 0.3125rem);
    opacity: 1;
}

.oo-mdl__nav {
    box-sizing: border-box;
    height: 100%;
    min-width: 0;
    overflow-y: auto;
    padding-right: var(--oo-space-1);
}

/* Liste | Detail bzw. Inhalt als Karte */
.oo-mdl__panes,
.oo-mdl__content {
    overflow: hidden;
    border-radius: var(--oo-radius-lg);
    box-shadow: var(--oo-mdl-card-shadow);
}

.oo-mdl__content {
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    background: var(--oo-color-surface);
}

/* Liste | Detail: eine feine Linie, beim Überfahren breiter und in der Primärfarbe */
.oo-mdl__panes > .oo-splitter-handle {
    width: 0.3125rem;
    margin-inline: -0.125rem;
    background: transparent;
    background-image: linear-gradient(to right, transparent 0.125rem, var(--oo-color-border) 0.125rem, var(--oo-color-border) calc(0.125rem + 1px), transparent calc(0.125rem + 1px));
}

.oo-mdl__panes > .oo-splitter-handle:hover,
.oo-mdl__panes > .oo-splitter-handle.oo-splitter-handle--dragging {
    background: var(--oo-primary);
    opacity: 0.6;
}

:is(.oo-mdl__outer, .oo-mdl__panes) > .oo-splitter-handle .oo-splitter-handle__grip {
    display: none;
}

.oo-mdl__list-pane,
.oo-mdl__detail-pane {
    display: flex;
}

.oo-mdl__list,
.oo-mdl__detail {
    flex: 1 1 auto;
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
}

/* Liste weiß, Detail grau (Inhalt darin etwa als Card); beide Container für eigene Abfragen (Liste als Tabelle, schmales Detail) */
.oo-mdl__list {
    display: flex;
    flex-direction: column;
    background: var(--oo-color-surface);
    container: oo-mdl-list / inline-size;
}

.oo-mdl__detail {
    background: var(--oo-color-background);
    container: oo-mdl-detail / inline-size;
}

/* „Detail aus“: nur die Liste über die ganze Breite, ein geöffnetes Detail statt der Liste */
.oo-mdl__frame--detail-off > .oo-mdl__body > .oo-mdl__panes > .oo-splitter-handle,
.oo-mdl__frame--detail-off > .oo-mdl__body > .oo-mdl__outer > .oo-mdl__main-pane > .oo-mdl__panes > .oo-splitter-handle,
.oo-mdl__frame--detail-off:not(.oo-mdl__frame--detail-open) > .oo-mdl__body > .oo-mdl__panes > .oo-mdl__detail-pane,
.oo-mdl__frame--detail-off:not(.oo-mdl__frame--detail-open) > .oo-mdl__body > .oo-mdl__outer > .oo-mdl__main-pane > .oo-mdl__panes > .oo-mdl__detail-pane,
.oo-mdl__frame--detail-off.oo-mdl__frame--detail-open > .oo-mdl__body > .oo-mdl__panes > .oo-mdl__list-pane,
.oo-mdl__frame--detail-off.oo-mdl__frame--detail-open > .oo-mdl__body > .oo-mdl__outer > .oo-mdl__main-pane > .oo-mdl__panes > .oo-mdl__list-pane {
    display: none;
}

.oo-mdl__frame--detail-off > .oo-mdl__body > .oo-mdl__panes > .oo-splitter-pane,
.oo-mdl__frame--detail-off > .oo-mdl__body > .oo-mdl__outer > .oo-mdl__main-pane > .oo-mdl__panes > .oo-splitter-pane {
    flex: 1 1 auto !important;
}

/* Drawer der Navigation: Inhalt ohne Ränder des Drawers */
.oo-mdl__drawer .oo-drawer__body {
    padding-inline: var(--oo-space-2);
}
