/* Clip rather than display:none — the element must stay in the accessibility tree. */
.xui-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip links: hidden until a keyboard user tabs to them. */
.xui-visually-hidden--focusable:focus,
.xui-visually-hidden--focusable:focus-within {
    position: static;
    width: auto;
    height: auto;
    padding: var(--xui-space-sm) var(--xui-space-md);
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--xui-surface);
    border: 1px solid var(--xui-focus);
    border-radius: var(--xui-radius-md);
}

.xui-separator {
    flex-shrink: 0;
    background: var(--xui-border);
    /* Border, not height: a 1px height rounds to 0 on some fractional device pixel ratios
       and the rule disappears entirely. */
    block-size: 1px;
    inline-size: 100%;
}

.xui-separator--vertical {
    block-size: auto;
    inline-size: 1px;
    align-self: stretch;
}

.xui-spacer {
    flex: 1 1 auto;
}

.xui-aspect-ratio {
    position: relative;
    inline-size: 100%;
    overflow: hidden;
}

/* Media fills the box rather than dictating its size. */
.xui-aspect-ratio > :only-child {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
}
