/* Tabs that link between related pages (components/tabs.html.twig). */

.tabs {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 0.125rem solid var(--border);
}

.tabs__tab {
    margin-bottom: -0.125rem;
    padding: 0.5rem 1.25rem;
    border: 0.125rem solid var(--border);
    font-weight: 700;
    text-decoration: none;
}

.tabs__tab:hover,
.tabs__tab:focus-visible {
    background-color: var(--row-stripe);
}

.tabs__tab.is-active {
    border-bottom-color: var(--tertiary);
    background-color: var(--tertiary);
    color: var(--black);
}

/* Tabs within a tabbed page: smaller pills, no underline. */
.tabs--minor {
    gap: 0.375rem;
    border-bottom: 0;
}

.tabs--minor .tabs__tab {
    margin-bottom: 0;
    padding: 0.2rem 0.75rem;
    font-size: 0.875rem;
}

.tabs--minor .tabs__tab.is-active {
    border-color: var(--black);
}

/*
 * Phones (docs/adr/0038): one row that scrolls sideways, edge to edge,
 * rather than wrapping onto several (the tabs controller scrolls the
 * current tab into view). The line under the tabs is a shadow here, as the
 * scrolling box would clip tabs that overlap a border.
 */
@media (max-width: 47.99rem) {
    .tabs {
        flex-wrap: nowrap;
        margin-right: -1rem;
        margin-left: -1rem;
        padding-right: 1rem;
        padding-left: 1rem;
        overflow-x: auto;
        border-bottom: 0;
        box-shadow: inset 0 -0.125rem 0 var(--border);
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tabs__tab {
        flex: 0 0 auto;
        margin-bottom: 0;
        white-space: nowrap;
    }

    .tabs--minor {
        box-shadow: none;
    }
}
