/* =========================================================
 * ETL – Filterbare Tabelle
 * Frontend
 * ======================================================= */


/* ---------------------------------------------------------
 * Basis / Design Tokens
 * ------------------------------------------------------ */

.etl-filter-table {
    --etl-table-primary: var(--primary_color, #00636c);
    --etl-table-primary_light: var(--primary_light_color);
    --etl-table-primary_light-30: color-mix(
        in srgb,
        var(--etl-table-primary_light) 30%,
        transparent
    );

    --etl-table-border: #d5d5d5;
    --etl-table-neutral-light: #f5f5f5;
    --etl-table-neutral-gray: #e5e5e5;

    --etl-table-text: inherit;
    --etl-table-bg: #fff;

    --etl-table-cell-padding-y: 0.75rem;
    --etl-table-cell-padding-x: 1rem;

    width: 100%;
    max-width: 100%;

    margin-inline: auto;
    margin-bottom: 2rem;
}


/* =========================================================
 * Maximale Breite
 * ======================================================= */

.etl-filter-table--width-full {
    max-width: 100%;
}

.etl-filter-table--width-narrow {
    max-width: 960px;
}

.etl-filter-table--width-medium {
    max-width: 1140px;
}

.etl-filter-table--width-wide {
    max-width: 1320px;
}


/* =========================================================
 * Filterwerkzeuge oberhalb der Tabelle
 * ======================================================= */

.etl-filter-table__tools {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;

    margin-bottom: 0.75rem;
}

.etl-filter-table__tools[hidden] {
    display: none;
}

.etl-filter-table__filter-panels {
    flex: 1 1 auto;
}

.etl-filter-table__filter-panel {
    max-width: 360px;
}

.etl-filter-table__filter-panel[hidden] {
    display: none;
}

.etl-filter-table__filter-label {
    display: block;

    margin-bottom: 0.3rem;

    font-weight: 600;
}


/* ---------------------------------------------------------
 * Filterfelder
 * ------------------------------------------------------ */

.etl-filter-table__filter {
    width: 100%;
    min-height: 42px;

    margin: 0;
    padding: 0.45rem 0.75rem;

    font: inherit;
    color: inherit;

    background-color: #fff;

    border: 1px solid var(--etl-table-border);
    border-radius: 0;
}

.etl-filter-table__filter--text {
    min-width: 180px;
}

.etl-filter-table__filter--select {
    min-width: 180px;
}

.etl-filter-table__filter--date {
    min-width: 160px;
}

.etl-filter-table__filter.is-active {
    border-color: var(--etl-table-primary);
}


/* =========================================================
 * Filter zurücksetzen
 * ======================================================= */

.etl-filter-table__reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    min-height: 42px;

    padding: 0.5rem 1rem;

    font: inherit;
    font-weight: 600;

    color: var(--etl-table-primary);
    background: transparent;

    border: 1px solid var(--etl-table-primary);
    border-radius: 0;

    cursor: pointer;
}

.etl-filter-table__reset:hover {
    color: #fff;
    background-color: var(--etl-table-primary);
}

.etl-filter-table__reset[hidden] {
    display: none;
}


/* =========================================================
 * Fokus
 * ======================================================= */

.etl-filter-table__filter:focus-visible,
.etl-filter-table__reset:focus-visible,
.etl-filter-table__sort:focus-visible,
.etl-filter-table__filter-toggle:focus-visible,
.etl-filter-table__scroll:focus-visible {
    outline: 3px solid var(--etl-table-primary);
    outline-offset: 2px;
}


/* =========================================================
 * Scroll-Container
 * ======================================================= */

.etl-filter-table__scroll {
    width: 100%;
    max-width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    -webkit-overflow-scrolling: touch;
}

.etl-filter-table__scroll:focus:not(:focus-visible) {
    outline: none;
}


/* =========================================================
 * Tabelle
 * ======================================================= */

.etl-filter-table__table {
    width: 100%;
    max-width: none;

    margin: 0;

    border-spacing: 0;
    border-collapse: collapse;

    color: var(--etl-table-text);
    background: var(--etl-table-bg);
}


/* =========================================================
 * Spaltenbreiten
 * ======================================================= */


/* ---------------------------------------------------------
 * Automatisch
 * ------------------------------------------------------ */

.etl-filter-table__table--columns-auto {
    table-layout: auto;
}


/* ---------------------------------------------------------
 * Gleichmäßig
 * ------------------------------------------------------ */

.etl-filter-table__table--columns-equal {
    table-layout: fixed;
}

.etl-filter-table__table--columns-equal > colgroup > col {
    width: auto;
}


/* ---------------------------------------------------------
 * Individuell
 * ------------------------------------------------------ */

.etl-filter-table__table--columns-individual {
    table-layout: auto;
}

.etl-filter-table__table--columns-individual
.etl-filter-table__col--xs {
    width: 7rem;
}

.etl-filter-table__table--columns-individual
.etl-filter-table__col--sm {
    width: 11rem;
}

.etl-filter-table__table--columns-individual
.etl-filter-table__col--md {
    width: 17rem;
}

.etl-filter-table__table--columns-individual
.etl-filter-table__col--lg {
    width: 23rem;
}

.etl-filter-table__table--columns-individual
.etl-filter-table__col--xl {
    width: 30rem;
}


/* =========================================================
 * Zellen allgemein
 * ======================================================= */

.etl-filter-table__heading,
.etl-filter-table__cell,
.etl-filter-table__footer-cell {
    padding:
        var(--etl-table-cell-padding-y)
        var(--etl-table-cell-padding-x);

    vertical-align: top;
}


/* =========================================================
 * Ausrichtung
 * ======================================================= */

.etl-filter-table__align--left {
    text-align: left;
}

.etl-filter-table__align--center {
    text-align: center;
}

.etl-filter-table__align--right {
    text-align: right;
}


/* =========================================================
 * Tabellenkopf
 * ======================================================= */

.etl-filter-table__heading {
    font-weight: 700;
    vertical-align: middle;
}


/* ---------------------------------------------------------
 * Headline-Innenlayout
 * ------------------------------------------------------ */

.etl-filter-table__heading-inner {
    display: inline-flex;
    align-items: center;

    gap: 0.55rem;

    width: auto;
    min-height: 28px;

    vertical-align: middle;
    line-height: 1.25;
}

.etl-filter-table__heading.etl-filter-table__align--left {
    text-align: left;
}

.etl-filter-table__heading.etl-filter-table__align--center {
    text-align: center;
}

.etl-filter-table__heading.etl-filter-table__align--right {
    text-align: right;
}

.etl-filter-table__heading-label {
    line-height: 1.25;
}


/* ---------------------------------------------------------
 * Header-Hintergründe
 * ------------------------------------------------------ */

.etl-filter-table__table--header-transparent
.etl-filter-table__heading {
    background-color: transparent;
}

.etl-filter-table__table--header-neutral-gray
.etl-filter-table__heading {
    color: inherit;
    background-color: var(--etl-table-neutral-gray);
}

.etl-filter-table__table--header-primary_light
.etl-filter-table__heading {
    color: inherit;
    background-color: var(--etl-table-primary_light-30);
}

.etl-filter-table__table--header-primary
.etl-filter-table__heading {
    color: #fff;
    background-color: var(--etl-table-primary);
}


/*
 * Primary muss einschließlich aller interaktiven Elemente
 * zuverlässig weiß bleiben.
 */
.etl-filter-table__table--header-primary
.etl-filter-table__heading a,
.etl-filter-table__table--header-primary
.etl-filter-table__heading button,
.etl-filter-table__table--header-primary
.etl-filter-table__heading svg {
    color: #fff;
}


/* =========================================================
 * Sortierbutton
 * ======================================================= */

.etl-filter-table__sort {
    display: inline-flex;
    align-items: center;

    gap: 0.45rem;

    width: auto;
    max-width: 100%;

    margin: 0;
    padding: 0;

    font: inherit;
    font-weight: inherit;
    line-height: 1.25;

    text-align: inherit;

    color: inherit;
    background: transparent;

    border: 0;

    cursor: pointer;
}

.etl-filter-table__sort-label {
    line-height: 1.25;
}


/* =========================================================
 * Sortierindikator
 * ======================================================= */

.etl-filter-table__sort-icon {
    position: relative;

    display: inline-block;

    flex: 0 0 auto;

    width: 0.8rem;
    height: 1rem;
}

.etl-filter-table__sort-icon::before,
.etl-filter-table__sort-icon::after {
    content: "";

    position: absolute;
    left: 50%;

    width: 0;
    height: 0;

    transform: translateX(-50%);

    border-left: 4px solid transparent;
    border-right: 4px solid transparent;

    opacity: 0.35;
}

.etl-filter-table__sort-icon::before {
    top: 1px;

    border-bottom: 5px solid currentColor;
}

.etl-filter-table__sort-icon::after {
    bottom: 1px;

    border-top: 5px solid currentColor;
}


/* ---------------------------------------------------------
 * ASC
 * ------------------------------------------------------ */

.etl-filter-table__heading[aria-sort="ascending"]
.etl-filter-table__sort-icon::before {
    opacity: 1;
}

.etl-filter-table__heading[aria-sort="ascending"]
.etl-filter-table__sort-icon::after {
    opacity: 0.15;
}


/* ---------------------------------------------------------
 * DESC
 * ------------------------------------------------------ */

.etl-filter-table__heading[aria-sort="descending"]
.etl-filter-table__sort-icon::before {
    opacity: 0.15;
}

.etl-filter-table__heading[aria-sort="descending"]
.etl-filter-table__sort-icon::after {
    opacity: 1;
}


/* =========================================================
 * Filterbutton direkt im TH
 * ======================================================= */

.etl-filter-table__filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 28px;
    height: 28px;

    margin: 0;
    padding: 0;

    color: currentColor;
    background: transparent;

    border: 0;
    border-radius: 50%;

    cursor: pointer;

    opacity: 0.7;

    transition:
        opacity 0.15s ease,
        color 0.15s ease,
        background-color 0.15s ease;
}

.etl-filter-table__filter-toggle svg {
    display: block;

    width: 18px;
    height: 18px;
}

.etl-filter-table__filter-toggle:hover,
.etl-filter-table__filter-toggle:focus-visible {
    opacity: 1;
}

.etl-filter-table__filter-toggle.is-active {
    color: #fff;
    background-color: var(--etl-table-primary);
    opacity: 1;
}

.etl-filter-table__filter-toggle[aria-expanded="true"] {
    opacity: 1;
}


/* =========================================================
 * Tabellenstile
 * ======================================================= */


/* ---------------------------------------------------------
 * Standard
 * ------------------------------------------------------ */

.etl-filter-table__table--standard
.etl-filter-table__heading,
.etl-filter-table__table--standard
.etl-filter-table__cell,
.etl-filter-table__table--standard
.etl-filter-table__footer-cell {
    border-bottom: 1px solid var(--etl-table-border);
}


/* ---------------------------------------------------------
 * Klassisch mit Rahmen
 * ------------------------------------------------------ */

.etl-filter-table__table--bordered {
    border: 1px solid var(--etl-table-border);
}

.etl-filter-table__table--bordered
.etl-filter-table__heading,
.etl-filter-table__table--bordered
.etl-filter-table__cell,
.etl-filter-table__table--bordered
.etl-filter-table__footer-cell {
    border: 1px solid var(--etl-table-border);
}


/* ---------------------------------------------------------
 * Nur horizontale Linien
 * ------------------------------------------------------ */

.etl-filter-table__table--horizontal
.etl-filter-table__heading,
.etl-filter-table__table--horizontal
.etl-filter-table__cell,
.etl-filter-table__table--horizontal
.etl-filter-table__footer-cell {
    border-bottom: 1px solid var(--etl-table-border);
}


/* ---------------------------------------------------------
 * Ohne Linien
 * ------------------------------------------------------ */

.etl-filter-table__table--plain
.etl-filter-table__heading,
.etl-filter-table__table--plain
.etl-filter-table__cell,
.etl-filter-table__table--plain
.etl-filter-table__footer-cell {
    border: 0;
}


/* =========================================================
 * Zebra-Färbung
 *
 * Die Klassen is-odd / is-even werden vom JS nach jedem
 * Filtern UND Sortieren anhand der aktuellen DOM-Reihenfolge
 * neu vergeben.
 * ======================================================= */


/* ---------------------------------------------------------
 * Odd
 * ------------------------------------------------------ */

.etl-filter-table__table--rows-striped.etl-filter-table__table--odd-transparent
.etl-filter-table__row.is-odd {
    background-color: transparent;
}

.etl-filter-table__table--rows-striped.etl-filter-table__table--odd-neutral-light
.etl-filter-table__row.is-odd {
    background-color: var(--etl-table-neutral-light);
}

.etl-filter-table__table--rows-striped.etl-filter-table__table--odd-neutral-gray
.etl-filter-table__row.is-odd {
    background-color: var(--etl-table-neutral-gray);
}

.etl-filter-table__table--rows-striped.etl-filter-table__table--odd-primary_light
.etl-filter-table__row.is-odd {
    background-color: var(--etl-table-primary_light-30);
}

.etl-filter-table__table--rows-striped.etl-filter-table__table--odd-primary
.etl-filter-table__row.is-odd {
    color: #fff;
    background-color: var(--etl-table-primary);
}


/* ---------------------------------------------------------
 * Even
 * ------------------------------------------------------ */

.etl-filter-table__table--rows-striped.etl-filter-table__table--even-transparent
.etl-filter-table__row.is-even {
    background-color: transparent;
}

.etl-filter-table__table--rows-striped.etl-filter-table__table--even-neutral-light
.etl-filter-table__row.is-even {
    background-color: var(--etl-table-neutral-light);
}

.etl-filter-table__table--rows-striped.etl-filter-table__table--even-neutral-gray
.etl-filter-table__row.is-even {
    background-color: var(--etl-table-neutral-gray);
}

.etl-filter-table__table--rows-striped.etl-filter-table__table--even-primary_light
.etl-filter-table__row.is-even {
    background-color: var(--etl-table-primary_light-30);
}

.etl-filter-table__table--rows-striped.etl-filter-table__table--even-primary
.etl-filter-table__row.is-even {
    color: #fff;
    background-color: var(--etl-table-primary);
}


/* ---------------------------------------------------------
 * Links auf Primary-Zeilen
 * ------------------------------------------------------ */

.etl-filter-table__table--odd-primary
.etl-filter-table__row.is-odd a,
.etl-filter-table__table--even-primary
.etl-filter-table__row.is-even a {
    color: inherit;
}


/* =========================================================
 * Versteckte Zeilen
 * ======================================================= */

.etl-filter-table__row[hidden] {
    display: none !important;
}


/* =========================================================
 * Zellinhalte
 * ======================================================= */

.etl-filter-table__cell > :first-child {
    margin-top: 0;
}

.etl-filter-table__cell > :last-child {
    margin-bottom: 0;
}

.etl-filter-table__cell p {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.etl-filter-table__cell p:last-child {
    margin-bottom: 0;
}

/*.etl-filter-table__heading,*/ /* nur wenn nötig */
.etl-filter-table__cell,
.etl-filter-table__footer-cell {
    -webkit-hyphens: auto;
    hyphens: auto;

    overflow-wrap: break-word;
    word-break: normal;
}


/* =========================================================
 * Fußzeile
 * ======================================================= */

.etl-filter-table__footer-row {
    font-weight: 600;
}

.etl-filter-table__footer-cell {
    background-color: var(--etl-table-neutral-light);
}


/* =========================================================
 * Caption / Tabellenbeschreibung
 * ======================================================= */

.etl-filter-table__caption {
    width: 100%;
    max-width: none;

    padding: 0.75rem 0;

    text-align: left;
    color: inherit;
}

.etl-filter-table__caption--above {
    caption-side: top;
}

.etl-filter-table__caption--below {
    caption-side: bottom;
}

.etl-filter-table__caption > :first-child {
    margin-top: 0;
}

.etl-filter-table__caption > :last-child {
    margin-bottom: 0;
}


/* =========================================================
 * Horizontal scrollbare Tabelle
 * ======================================================= */

.etl-filter-table--mobile-scroll
.etl-filter-table__table {
    min-width: 680px;
}


/* =========================================================
 * Mobile Filterbereich
 * ======================================================= */

@media (max-width: 767.98px) {

    .etl-filter-table__tools {
        flex-direction: column;
        align-items: stretch;

        gap: 0.75rem;
    }

    .etl-filter-table__filter-panel {
        max-width: none;
    }

    .etl-filter-table__filter {
        width: 100%;
        min-width: 0;
    }

    .etl-filter-table__reset {
        width: 100%;
    }

}


/* =========================================================
 * Mobile Kartenansicht
 * ======================================================= */

@media (max-width: 767.98px) {

    .etl-filter-table--mobile-cards
    .etl-filter-table__scroll {
        overflow: visible;
    }

    .etl-filter-table--mobile-cards
    .etl-filter-table__table {
        min-width: 0;
        border: 0;
    }

    .etl-filter-table--mobile-cards
    .etl-filter-table__table > colgroup,
    .etl-filter-table--mobile-cards
    .etl-filter-table__table > thead {
        display: none;
    }

    .etl-filter-table--mobile-cards
    .etl-filter-table__table,
    .etl-filter-table--mobile-cards
    .etl-filter-table__table > tbody,
    .etl-filter-table--mobile-cards
    .etl-filter-table__row,
    .etl-filter-table--mobile-cards
    .etl-filter-table__cell {
        display: block;
        width: 100%;
    }

    .etl-filter-table--mobile-cards
    .etl-filter-table__row {
        margin-bottom: 1rem;

        border: 1px solid var(--etl-table-border);
    }

    .etl-filter-table--mobile-cards
    .etl-filter-table__cell {
        display: grid;

        grid-template-columns:
            minmax(8rem, 35%)
            minmax(0, 1fr);

        gap: 1rem;

        text-align: left;

        border: 0;
        border-bottom: 1px solid var(--etl-table-border);
    }

    .etl-filter-table--mobile-cards
    .etl-filter-table__cell:last-child {
        border-bottom: 0;
    }

    .etl-filter-table--mobile-cards
    .etl-filter-table__cell::before {
        content: attr(data-label);

        font-weight: 700;
    }

}


/* =========================================================
 * Screenreader
 * ======================================================= */

.etl-filter-table .screen-reader-text {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    padding: 0 !important;
    margin: -1px !important;

    overflow: hidden !important;

    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;

    white-space: nowrap !important;

    border: 0 !important;
}