/* Shared defaults for navigation, record and download links in both UI shells.
 * Keep specificity at zero so existing primary/danger buttons, cards and tabs
 * retain their layout and colours. Django's icon widgets keep their own sizing.
 */
:root {
    --link-button-min-height: 32px;
}

:where(a[href]:not(
    .brand-link,
    .admin-brand,
    .related-widget-wrapper-link,
    .sortoptions a,
    .selector a,
    .calendarbox a,
    .clockbox a,
    .skip-to-content-link
)) {
    display: inline-block;
    box-sizing: border-box;
    min-height: var(--link-button-min-height);
    max-width: 100%;
    padding: 5px 10px;
    border: 1px solid #c7ced9;
    border-radius: 6px;
    background-color: #ffffff;
    color: #24415f;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
}

/* The few older hover rules must not restore the text-link appearance. */
a[href],
a[href]:hover,
a[href]:focus {
    text-decoration: none !important;
}

:where(a[href]:not(
    .brand-link,
    .admin-brand,
    .related-widget-wrapper-link,
    .sortoptions a,
    .selector a,
    .calendarbox a,
    .clockbox a,
    .skip-to-content-link
):hover) {
    border-color: #2868bd;
    background-color: #f2f7fb;
}

:where(a[href] + a[href]) {
    margin-inline-start: 4px;
}

a[href]:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible {
    outline: 2px solid #2868bd;
    outline-offset: 2px;
}

/* Breadcrumbs can now be taller and must wrap on narrow screens. */
.page-breadcrumb {
    flex-wrap: wrap;
    min-width: 0;
}

@media (max-width: 720px) {
    :root {
        --link-button-min-height: 36px;
    }
}

/* Plain document links should not gain UI button chrome when printed. */
@media print {
    :where(a[href]) {
        min-height: 0;
        padding: 0;
        border: 0;
        background-color: transparent;
        color: inherit;
        font-weight: inherit;
        text-align: inherit;
        vertical-align: baseline;
    }

    :where(a[href] + a[href]) {
        margin-inline-start: 0;
    }
}
