/*
 * tab-bar.css — the main areas of the app, at the bottom of a narrow screen.
 *
 * <nav class="app-shell-tabs" aria-label="Bereiche">   (shell.css places it)
 *   <ul class="app-tab-bar" role="list">
 *     <li class="app-tab-bar-entry">
 *       <a class="app-tab-bar-item" href aria-current="page">
 *         <svg class="app-icon" data-size="20">…</svg>
 *         <span class="app-tab-bar-label">Heute</span>
 *       </a>
 *     </li>
 *   </ul>
 * </nav>
 *
 * Two to five areas share the width (up to 120 each), an icon over its name, under the thumb. The last is
 * "Mehr", a page with the rest of the navigation: moving between areas is never an overlay.
 * The current one is marked as the current navigation item is, in the wash of the accent. Below
 * a viewport of 960 it stands in for the navigation; from 960 the navigation's column does, and
 * the tab bar goes (shell.css).
 */
@layer components {
    /* On a phone the areas share the width; on a tablet they keep a thumb's width, centred. */
    .app-tab-bar {
        display: grid;
        grid-auto-columns: minmax(0, var(--app-tab-bar-item-width));
        justify-content: center;
        grid-auto-flow: column;
        gap: var(--app-space-tab-bar);
    }

    .app-tab-bar-entry {
        display: grid;
        min-inline-size: 0;
    }

    .app-tab-bar-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--app-space-tab-bar-label);
        min-inline-size: 0;
        padding: var(--app-space-tab-bar-item-y) var(--app-space-tab-bar);
        border-radius: var(--app-radius-nav-item);
        color: var(--app-color-text-muted);
        font-family: var(--app-font-text);
        font-size: var(--app-text-label-size);
        font-weight: var(--app-text-label-weight);
        line-height: var(--app-text-label-leading);
        text-decoration: none;
        transition:
            background-color var(--app-duration-hover) var(--app-easing),
            color var(--app-duration-hover) var(--app-easing);
    }

    .app-tab-bar-label {
        max-inline-size: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-tab-bar-item[aria-current="page"] {
        background: var(--app-color-nav-current);
        color: var(--app-color-nav-current-text);
    }

    @media (hover: hover) {
        .app-tab-bar-item:hover:not([aria-current="page"]) {
            background: var(--app-color-surface-hover);
            color: var(--app-color-text);
        }
    }

    .app-tab-bar-item:focus-visible {
        outline: var(--app-focus-ring-width) solid var(--app-color-focus);
        outline-offset: calc(-1 * var(--app-focus-ring-width));
    }

    /* Forced colours (a Windows contrast theme): shadows and backgrounds are gone, so frames
       are outlines and a chosen state is the system highlight. */
    @media (forced-colors: active) {
        .app-tab-bar-item[aria-current="page"] {
            forced-color-adjust: none;
            background: var(--app-color-forced-current);
            color: var(--app-color-forced-current-text);
        }
    }
}
