/*
 * catalog.css — an item's prices over time (Patterns/Katalog): the table's first cell says from
 * when a price stands, and the row takes its mark from it.
 *
 * <td class="app-table-cell" data-role="title">
 *   <span class="app-catalog-from" data-when="planned | now | past">
 *     <span class="app-catalog-day">01.07.2026</span>
 *     <span class="app-catalog-when">gilt</span>   (planned: geplant; past: none)
 *   </span>
 * </td>
 *
 * The price in force is the one place the table shows the accent: the selected rows' tint,
 * its day in the accent's text at strong weight, and the word "gilt", so it reads without the
 * colour too. A planned price is named "geplant" and otherwise plain; a past one is muted.
 * The marks come from the cell, so AppTable needs no state of its own for a row. In forced
 * colours the tint and the accent are gone and the word stays.
 */
@layer components {
    .app-catalog-from {
        display: inline-flex;
        align-items: baseline;
        gap: var(--app-space-inline);
    }

    .app-catalog-when {
        color: var(--app-color-text-muted);
        font-size: var(--app-text-help-size);
        font-weight: var(--app-text-body-weight);
        line-height: var(--app-text-help-leading);
    }

    .app-table-row:not([data-loading]):has(.app-catalog-from[data-when="now"]) > * {
        background: var(--app-color-row-selected);
    }

    .app-catalog-from[data-when="now"] > .app-catalog-day {
        color: var(--app-color-accent-text);
        font-weight: var(--app-text-strong-weight);
    }

    .app-table-row:has(.app-catalog-from[data-when="past"]) > * {
        color: var(--app-color-text-muted);
    }

    /* As a list row, the tint is the row's, as table.css does for a chosen one. */
    @container app-region (width < 560px) {
        .app-table-row:not([data-loading]):has(.app-catalog-from[data-when="now"]) {
            background: var(--app-color-row-selected);
        }

        .app-table-row:not([data-loading]):has(.app-catalog-from[data-when="now"]) > * {
            background: none;
        }
    }
}
