.td-link-container i {
    color: var(--td-shortcode-icon, #1170e0);
    margin-right: 5px;
}

/* Visible keyboard focus on every visitor control: 2px primary, which is
   4.75:1 on white with the default colours */
.td-dialog a:focus-visible,
.td-dialog button:focus-visible,
.td-dialog input:focus-visible,
.td-link-container a:focus-visible,
.td-category-files-container a:focus-visible {
    outline: 2px solid var(--td-primary, #1170e0);
    outline-offset: 2px;
}

/* ====================================
   CATEGORY MODAL (front/dialog.js)
   The modal is a <dialog>: a transparent layer over the whole window that
   centres its own box (.td-dialog__box); ::backdrop dims the page.
   ==================================== */

dialog.td-dialog {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 16px;
    border: 0;
    background: transparent;
    color: inherit;
    box-sizing: border-box;
    overflow: auto;
}

dialog.td-dialog[open] {
    display: flex;
}

dialog.td-dialog:not([open]) {
    display: none;
}

dialog.td-dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

/* Focus is put on the dialog itself only to announce it; its controls show their own ring */
dialog.td-dialog:focus {
    outline: none;
}

/* Browsers without <dialog>: the layer dims the page itself */
dialog.td-dialog.td-dialog--fallback {
    z-index: 100000;
    background: rgba(0, 0, 0, 0.5);
}

.td-dialog__box {
    position: relative;
    margin: auto;
}

.td-dialog__close {
    position: absolute !important;
    top: 6px;
    right: 6px;
    z-index: 1;
    width: 36px;
    height: 36px;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #666666 !important;
    font-size: 28px !important;
    line-height: 36px !important;
    text-align: center;
    cursor: pointer;
}

.td-dialog__close:hover {
    color: #000000 !important;
}

/* Read by screen readers, not shown */
.td-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
