/**
 * Veyra accessibility hardening.
 */

.screen-reader-text,
.wp-block-navigation__responsive-dialog .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

.screen-reader-text:focus,
.skip-link:focus {
    z-index: 100000;
    top: 0.75rem;
    left: 0.75rem;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0.75rem 1rem;
    overflow: visible;
    clip: auto !important;
    clip-path: none;
    border: 2px solid currentColor;
    border-radius: var(--wp--custom--radius--small);
    color: var(--wp--preset--color--base);
    background: var(--wp--preset--color--contrast);
    box-shadow: var(--wp--preset--shadow--elevated);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: normal;
}

:where(
    a,
    button,
    input,
    select,
    textarea,
    summary,
    [tabindex]:not([tabindex="-1"])
):focus-visible {
    outline: 3px solid var(--wp--preset--color--primary);
    outline-offset: 3px;
    box-shadow: none;
}

:where(
    .wp-element-button,
    .wp-block-navigation-item__content,
    .wp-block-navigation__responsive-container-open,
    .wp-block-navigation__responsive-container-close
) {
    min-height: 44px;
}

:where(
    .wp-block-navigation__responsive-container-open,
    .wp-block-navigation__responsive-container-close
) {
    min-width: 44px;
    align-items: center;
    justify-content: center;
}

.wp-block-post-content :where(a:not(.wp-element-button)) {
    text-decoration: underline;
    text-decoration-thickness: 0.09em;
    text-underline-offset: 0.18em;
}

.wp-block-post-content :where(a:not(.wp-element-button)):hover {
    text-decoration-thickness: 0.14em;
}

:where(abbr[title], acronym[title]) {
    text-decoration: underline dotted;
    text-underline-offset: 0.18em;
    cursor: help;
}

:where(code, kbd, samp) {
    overflow-wrap: anywhere;
}

:where(pre) {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre;
}

:where(table) {
    max-width: 100%;
}

@media (prefers-contrast: more) {
    :root {
        --veyra-transition: 0ms;
    }

    :where(
        .veyra-card,
        .wp-block-group.is-style-veyra-card,
        .veyra-surface,
        .wp-block-group.is-style-veyra-surface,
        .veyra-author-box,
        .veyra-post-navigation a
    ) {
        border-width: 2px;
        box-shadow: none;
    }

    :where(a, button, input, select, textarea):focus-visible {
        outline-width: 4px;
    }
}

@media (forced-colors: active) {
    :where(
        .wp-element-button,
        button,
        input,
        select,
        textarea,
        .veyra-card,
        .veyra-surface
    ) {
        border: 1px solid ButtonText;
    }

    :where(
        .wp-block-navigation__responsive-container,
        .veyra-header,
        .veyra-footer
    ) {
        forced-color-adjust: auto;
    }
}

@media (prefers-reduced-transparency: reduce) {
    :where(
        .veyra-version-card,
        .wp-block-navigation__responsive-container
    ) {
        backdrop-filter: none;
    }
}
