/*==========================================================
  NEXIA CORE UI
  File: nx-forum.css
  Purpose: Native Nexia styling for bbPress.

  bbPress owns the markup and functionality. This file only
  supplies the Nexia visual layer and consumes global tokens.
==========================================================*/

/*==========================================================
  BBPRESS PAGE HEADING

  Keep the WordPress block-theme heading, but align it with
  the forum content and remove the excessive top whitespace.
==========================================================*/

body.bbpress main{
    margin-top:0 !important;
}

body.bbpress main > .wp-block-group{
    padding-top:0 !important;
}

body.bbpress main .wp-block-post-title{
    width:min(1200px,92%);
    margin:12px auto 8px !important;
    padding-top:0 !important;
    font-size:clamp(2rem,4vw,2.8rem) !important;
    line-height:1.15;
}

/*==========================================================
  FORUM SURFACE
==========================================================*/

#bbpress-forums{
    width:min(1200px,92%);
    margin:0 auto 32px;
    overflow:visible;
    clear:both;
    font-family:var(--nx-font);
    font-size:var(--nx-font-size-sm);
    line-height:1.6;
    color:var(--nx-text);
}

#bbpress-forums a{
    box-shadow:none;
    border:0;
    transition:
        color var(--nx-transition),
        background var(--nx-transition),
        border-color var(--nx-transition),
        box-shadow var(--nx-transition);
}

#bbpress-forums a:hover{
    color:var(--nx-link-hover);
}

#bbpress-forums ul.bbp-forums,
#bbpress-forums ul.bbp-topics,
#bbpress-forums ul.bbp-replies,
#bbpress-forums ul.bbp-lead-topic,
#bbpress-forums ul.bbp-search-results{
    margin:0 0 var(--nx-space-lg);
    padding:0;
    overflow:hidden;
    background:var(--nx-surface);
    color:var(--nx-text);
    border:1px solid var(--nx-border);
    border-radius:var(--nx-radius-lg);
    box-shadow:var(--nx-shadow-sm);
}

/*==========================================================
  SEARCH
==========================================================*/

.bbp-search-form{
    width:min(1200px,92%);
    margin:0 auto var(--nx-space-md);
}

#bbp-search-form > div{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:var(--nx-space-sm);
}

#bbp-search-form #bbp_search{
    width:min(360px,100%);
    min-height:42px;
    padding:10px 14px;
    background:var(--nx-input-bg);
    color:var(--nx-input-text);
    border:1px solid var(--nx-input-border);
    border-radius:var(--nx-radius-sm);
    font:inherit;
    box-shadow:none;
    transition:
        border-color var(--nx-transition),
        box-shadow var(--nx-transition),
        background var(--nx-transition);
}

#bbp-search-form #bbp_search::placeholder{
    color:var(--nx-placeholder);
}

#bbp-search-form #bbp_search:focus{
    border-color:var(--nx-border-focus);
    outline:none;
    box-shadow:var(--nx-focus-ring);
}

#bbp-search-form #bbp_search_submit{
    min-height:42px;
    padding:10px 18px;
    border:1px solid var(--nx-primary);
    border-radius:var(--nx-radius-sm);
    background:var(--nx-primary);
    color:#fff;
    font:inherit;
    font-weight:var(--nx-weight-bold);
    cursor:pointer;
    transition:
        background var(--nx-transition),
        border-color var(--nx-transition),
        box-shadow var(--nx-transition),
        transform var(--nx-transition);
}

#bbp-search-form #bbp_search_submit:hover{
    background:var(--nx-primary-hover);
    border-color:var(--nx-primary-hover);
    color:#fff;
    transform:translateY(-1px);
    box-shadow:var(--nx-button-shadow-hover);
}

/*
  USER PROFILE SEARCH FORMS
  These are the small searches used by Topics Started, Replies,
  Engagements, Favorites, and Subscriptions. bbPress floats these
  forms by default, which conflicts with the Nexia profile layout.
  Keep the fix scoped to #bbp-user-body so the main forum search is
  left untouched.
*/
#bbpress-forums #bbp-user-body .bbp-search-form{
    float:none;
    width:100%;
    max-width:none;
    margin:0 0 var(--nx-space-md);
}

#bbpress-forums #bbp-user-body .bbp-search-form form{
    width:100%;
    margin:0;
}

#bbpress-forums #bbp-user-body .bbp-search-form form > div{
    display:flex;
    align-items:center;
    gap:var(--nx-space-sm);
    width:100%;
}

#bbpress-forums #bbp-user-body .bbp-search-form input[type="text"]{
    flex:1 1 auto;
    min-width:0;
    width:auto;
    min-height:42px;
    padding:10px 14px;
    margin:0;
    background:var(--nx-input-bg) !important;
    color:var(--nx-input-text) !important;
    border:1px solid var(--nx-input-border) !important;
    border-radius:var(--nx-radius-sm);
    font:inherit;
    box-sizing:border-box;
    box-shadow:none;
}

#bbpress-forums #bbp-user-body .bbp-search-form input[type="text"]::placeholder{
    color:var(--nx-placeholder) !important;
    opacity:1;
}

#bbpress-forums #bbp-user-body .bbp-search-form input[type="text"]:focus{
    border-color:var(--nx-border-focus) !important;
    outline:none;
    box-shadow:var(--nx-focus-ring);
}

#bbpress-forums #bbp-user-body .bbp-search-form input[type="submit"]{
    flex:0 0 auto;
    width:auto;
    min-height:42px;
    padding:10px 18px;
    margin:0;
    border:1px solid var(--nx-primary);
    border-radius:var(--nx-radius-sm);
    background:var(--nx-primary);
    color:#fff;
    font:inherit;
    font-weight:var(--nx-weight-bold);
    cursor:pointer;
    box-sizing:border-box;
    transition:
        background var(--nx-transition),
        border-color var(--nx-transition),
        box-shadow var(--nx-transition),
        transform var(--nx-transition);
}

#bbpress-forums #bbp-user-body .bbp-search-form input[type="submit"]:hover,
#bbpress-forums #bbp-user-body .bbp-search-form input[type="submit"]:focus-visible{
    background:var(--nx-primary-hover);
    border-color:var(--nx-primary-hover);
    color:#fff;
    box-shadow:var(--nx-button-shadow-hover);
}

/* Keep each profile section heading above its search/results area. */
#bbpress-forums #bbp-user-body > div > h2.entry-title{
    float:none;
    clear:none;
    margin:0 0 var(--nx-space-sm);
    padding:0;
    color:var(--nx-heading);
}

/* Profile navigation: retain the existing light-mode appearance,
   but give the active item a readable dark-mode surface/text. */
html.nx-dark-mode #bbpress-forums #bbp-user-navigation li.current > span > a{
    background:var(--nx-surface-hover) !important;
    color:var(--nx-primary) !important;
}

html.nx-dark-mode #bbpress-forums #bbp-user-navigation li.current > span > a:hover,
html.nx-dark-mode #bbpress-forums #bbp-user-navigation li.current > span > a:focus-visible{
    background:var(--nx-surface-secondary) !important;
    color:var(--nx-primary) !important;
}

/*==========================================================
  TABLE HEADERS
==========================================================*/

#bbpress-forums li.bbp-header,
#bbpress-forums li.bbp-footer{
    margin:0;
    padding:12px 16px;
    background:var(--nx-surface-secondary);
    color:var(--nx-text-muted);
    border:0;
    font-size:var(--nx-font-size-xs);
    font-weight:var(--nx-weight-medium);
    letter-spacing:.01em;
}

#bbpress-forums li.bbp-header{
    border-bottom:1px solid var(--nx-border);
    text-align:initial;
}

#bbpress-forums li.bbp-footer{
    display:none;
}

#bbpress-forums li.bbp-header ul{
    overflow:hidden;
}

/*==========================================================
  FORUM / TOPIC ROWS
==========================================================*/

#bbpress-forums li.bbp-body{
    background:var(--nx-surface);
}

#bbpress-forums li.bbp-body ul.forum,
#bbpress-forums li.bbp-body ul.topic{
    margin:0;
    padding:16px;
    overflow:hidden;
    background:var(--nx-surface);
    color:var(--nx-text);
    border:0;
    border-top:1px solid var(--nx-border-light);
    transition:
        background var(--nx-transition),
        border-color var(--nx-transition);
}

#bbpress-forums li.bbp-body ul.forum:first-child,
#bbpress-forums li.bbp-body ul.topic:first-child{
    border-top:0;
}

#bbpress-forums li.bbp-body ul.forum:hover,
#bbpress-forums li.bbp-body ul.topic:hover{
    background:var(--nx-surface-hover);
}

#bbpress-forums li.bbp-body ul.forum > li,
#bbpress-forums li.bbp-body ul.topic > li{
    color:var(--nx-text);
}

/*==========================================================
  FORUM / TOPIC TITLES
==========================================================*/

#bbpress-forums li.bbp-forum-info,
#bbpress-forums li.bbp-topic-title{
    text-align:initial;
}

#bbpress-forums a.bbp-forum-title,
#bbpress-forums a.bbp-topic-permalink{
    display:inline;
    color:var(--nx-heading);
    font-size:var(--nx-font-size-md);
    font-weight:var(--nx-weight-medium);
    line-height:1.35;
}

#bbpress-forums a.bbp-forum-title:hover,
#bbpress-forums a.bbp-topic-permalink:hover{
    color:var(--nx-primary);
}

#bbpress-forums .bbp-forum-content,
#bbpress-forums .bbp-topic-meta{
    margin:5px 0 0;
    padding:0;
    color:var(--nx-text-muted);
    font-size:var(--nx-font-size-xs);
    line-height:1.55;
}

#bbpress-forums .bbp-topic-meta a,
#bbpress-forums .bbp-topic-freshness-author a{
    color:var(--nx-text-muted);
}

#bbpress-forums .bbp-topic-meta a:hover,
#bbpress-forums .bbp-topic-freshness-author a:hover{
    color:var(--nx-primary);
}

/*==========================================================
  COUNTS / FRESHNESS
==========================================================*/

#bbpress-forums li.bbp-forum-topic-count,
#bbpress-forums li.bbp-forum-reply-count,
#bbpress-forums li.bbp-topic-voice-count,
#bbpress-forums li.bbp-topic-reply-count,
#bbpress-forums li.bbp-forum-freshness,
#bbpress-forums li.bbp-topic-freshness{
    color:var(--nx-text-muted);
}

#bbpress-forums li.bbp-forum-freshness a,
#bbpress-forums li.bbp-topic-freshness a{
    color:var(--nx-text-light);
}

#bbpress-forums li.bbp-forum-freshness a:hover,
#bbpress-forums li.bbp-topic-freshness a:hover{
    color:var(--nx-primary);
}

/*==========================================================
  SUB-FORUMS
==========================================================*/

#bbpress-forums .bbp-forums-list{
    margin:8px 0 0;
    padding:0;
    border:0;
    color:var(--nx-text-muted);
}

#bbpress-forums .bbp-forums-list .bbp-forum{
    font-size:var(--nx-font-size-xs);
}

#bbpress-forums .bbp-forums-list a{
    color:var(--nx-text-muted);
}

#bbpress-forums .bbp-forums-list a:hover{
    color:var(--nx-primary);
}

/*==========================================================
  TOPIC / FORUM ACTIONS
==========================================================*/

#bbpress-forums .bbp-row-actions{
    color:var(--nx-text-muted);
}

#bbpress-forums .bbp-row-actions a{
    color:var(--nx-primary);
}

/*==========================================================
  REPLIES
==========================================================*/

#bbpress-forums div.bbp-reply-header,
#bbpress-forums div.bbp-topic-header,
#bbpress-forums div.bbp-forum-header{
    padding:12px 16px;
    background:var(--nx-surface-secondary);
    color:var(--nx-text-muted);
    border-top:1px solid var(--nx-border);
}

#bbpress-forums div.reply,
#bbpress-forums li.bbp-body div.hentry{
    background:var(--nx-surface);
    color:var(--nx-text);
}

#bbpress-forums div.reply{
    border-top:1px solid var(--nx-border-light);
}

#bbpress-forums div.bbp-reply-author,
#bbpress-forums div.bbp-topic-author{
    color:var(--nx-text);
}

#bbpress-forums div.bbp-reply-author img.avatar,
#bbpress-forums div.bbp-topic-author img.avatar{
    border:1px solid var(--nx-border);
    border-radius:50%;
}

#bbpress-forums div.bbp-reply-content,
#bbpress-forums div.bbp-topic-content{
    color:var(--nx-text);
}

#bbpress-forums div.bbp-reply-content p:last-child,
#bbpress-forums div.bbp-topic-content p:last-child{
    margin-bottom:0;
}

#bbpress-forums .bbp-meta,
#bbpress-forums .bbp-meta a,
#bbpress-forums .bbp-reply-post-date{
    color:var(--nx-text-muted);
    font-size:var(--nx-font-size-xs);
}

#bbpress-forums .bbp-reply-permalink{
    color:var(--nx-text-muted);
}

#bbpress-forums .bbp-reply-permalink:hover{
    color:var(--nx-primary);
}

/*==========================================================
  FORMS / EDITORS
==========================================================*/

#bbpress-forums fieldset.bbp-form,
#bbpress-forums fieldset{
    margin:0 0 var(--nx-space-lg);
    padding:var(--nx-space-lg);
    background:var(--nx-surface);
    color:var(--nx-text);
    border:1px solid var(--nx-border);
    border-radius:var(--nx-radius-lg);
}

#bbpress-forums fieldset.bbp-form legend{
    padding:0 var(--nx-space-sm);
    color:var(--nx-heading);
    font-size:var(--nx-font-size-lg);
    font-weight:var(--nx-weight-semibold);
}

#bbpress-forums input[type="text"],
#bbpress-forums input[type="email"],
#bbpress-forums input[type="url"],
#bbpress-forums input[type="password"],
#bbpress-forums select,
#bbpress-forums textarea{
    width:100%;
    max-width:100%;
    padding:10px 12px;
    background:var(--nx-input-bg);
    color:var(--nx-input-text);
    border:1px solid var(--nx-input-border);
    border-radius:var(--nx-radius-sm);
    font:inherit;
    box-shadow:none;
    transition:
        border-color var(--nx-transition),
        box-shadow var(--nx-transition),
        background var(--nx-transition);
}

#bbpress-forums textarea{
    min-height:180px;
    resize:vertical;
    line-height:1.6;
    white-space:pre-wrap;
    overflow-wrap:break-word;
}

#bbpress-forums input:focus,
#bbpress-forums select:focus,
#bbpress-forums textarea:focus{
    border-color:var(--nx-border-focus);
    outline:none;
    box-shadow:var(--nx-focus-ring);
}

#bbpress-forums .bbp-submit-wrapper .button,
#bbpress-forums button,
#bbpress-forums input[type="submit"]{
    min-height:40px;
    padding:10px 18px;
    background:var(--nx-primary);
    color:#fff;
    border:1px solid var(--nx-primary);
    border-radius:var(--nx-radius-sm);
    font:inherit;
    font-weight:var(--nx-weight-bold);
    cursor:pointer;
    transition:
        background var(--nx-transition),
        border-color var(--nx-transition),
        box-shadow var(--nx-transition),
        transform var(--nx-transition);
}

#bbpress-forums .bbp-submit-wrapper .button:hover,
#bbpress-forums button:hover,
#bbpress-forums input[type="submit"]:hover{
    background:var(--nx-primary-hover);
    border-color:var(--nx-primary-hover);
    color:#fff;
    transform:translateY(-1px);
    box-shadow:var(--nx-button-shadow-hover);
}

/*==========================================================
  NOTICES / PAGINATION
==========================================================*/

#bbpress-forums .bbp-template-notice,
#bbpress-forums .bbp-topic-pagination,
#bbpress-forums .bbp-pagination{
    color:var(--nx-text-muted);
}

#bbpress-forums .bbp-template-notice{
    margin:0 0 var(--nx-space-lg);
    padding:12px 16px;
    background:var(--nx-surface-secondary);
    border:1px solid var(--nx-border);
    border-radius:var(--nx-radius-md);
}

#bbpress-forums .bbp-pagination-links a,
#bbpress-forums .bbp-pagination-links span{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:36px;
    min-height:36px;
    padding:6px 10px;
    margin:0 3px;
    background:var(--nx-surface);
    color:var(--nx-text-muted);
    border:1px solid var(--nx-border);
    border-radius:var(--nx-radius-sm);
}

#bbpress-forums .bbp-pagination-links span.current,
#bbpress-forums .bbp-pagination-links a:hover{
    background:var(--nx-primary);
    color:#fff;
    border-color:var(--nx-primary);
}

/*==========================================================
  MOBILE
==========================================================*/

@media (max-width:700px){

    #bbpress-forums #bbp-user-body .bbp-search-form form > div{
        flex-direction:column;
        align-items:stretch;
    }

    #bbpress-forums #bbp-user-body .bbp-search-form input[type="text"],
    #bbpress-forums #bbp-user-body .bbp-search-form input[type="submit"]{
        width:100%;
    }

    #bbpress-forums,
    .bbp-search-form{
        width:min(100% - 24px,1200px);
    }

    #bbp-search-form > div{
        justify-content:stretch;
    }

    #bbp-search-form #bbp_search{
        flex:1 1 auto;
        min-width:0;
    }

    #bbpress-forums li.bbp-header{
        display:none;
    }

    #bbpress-forums li.bbp-body ul.forum,
    #bbpress-forums li.bbp-body ul.topic{
        display:grid;
        grid-template-columns:minmax(0,1fr) auto;
        gap:10px 14px;
        padding:16px;
    }

    #bbpress-forums li.bbp-forum-info,
    #bbpress-forums li.bbp-topic-title{
        float:none;
        width:auto;
        grid-column:1 / -1;
        text-align:initial;
    }

    #bbpress-forums li.bbp-forum-topic-count,
    #bbpress-forums li.bbp-forum-reply-count,
    #bbpress-forums li.bbp-topic-voice-count,
    #bbpress-forums li.bbp-topic-reply-count,
    #bbpress-forums li.bbp-forum-freshness,
    #bbpress-forums li.bbp-topic-freshness{
        float:none;
        width:auto;
        text-align:initial;
    }

    #bbpress-forums li.bbp-forum-topic-count,
    #bbpress-forums li.bbp-topic-voice-count{
        grid-column:1;
    }

    #bbpress-forums li.bbp-forum-reply-count,
    #bbpress-forums li.bbp-topic-reply-count{
        grid-column:2;
        text-align:right;
    }

    #bbpress-forums li.bbp-forum-freshness,
    #bbpress-forums li.bbp-topic-freshness{
        grid-column:1 / -1;
        padding-top:4px;
        border-top:1px solid var(--nx-border-light);
        text-align:initial;
    }

    #bbpress-forums div.bbp-reply-author,
    #bbpress-forums div.bbp-topic-author{
        float:none;
        width:auto;
        text-align:initial;
    }

    #bbpress-forums div.bbp-reply-content,
    #bbpress-forums div.bbp-topic-content{
        margin:0;
        padding:12px 0;
        text-align:initial;
    }

    #bbpress-forums fieldset.bbp-form,
    #bbpress-forums fieldset{
        padding:16px;
        border-radius:var(--nx-radius-md);
    }

}

@media (max-width:480px){

    .bbp-search-form{
        margin-bottom:12px;
    }

    #bbp-search-form > div{
        flex-direction:column;
        align-items:stretch;
    }

    #bbp-search-form #bbp_search,
    #bbp-search-form #bbp_search_submit{
        width:100%;
    }

}

/*==========================================================
  REDUCED MOTION
==========================================================*/

@media (prefers-reduced-motion:reduce){

    #bbpress-forums a,
    #bbpress-forums li.bbp-body ul.forum,
    #bbpress-forums li.bbp-body ul.topic,
    #bbp-search-form #bbp_search,
    #bbp-search-form #bbp_search_submit,
    #bbpress-forums input,
    #bbpress-forums select,
    #bbpress-forums textarea,
    #bbpress-forums button{
        transition:none;
    }

}


/*==========================================================
  FORUM AUTHENTICATION PROMPT
==========================================================*/

#bbpress-forums .nx-bbp-login-prompt{
    margin:0 0 var(--nx-space-lg);
}

#bbpress-forums .nx-bbp-login-prompt .bbp-form{
    margin:0;
    padding:var(--nx-space-lg);
    background:var(--nx-surface);
    color:var(--nx-text);
    border:1px solid var(--nx-border);
    border-radius:var(--nx-radius-lg);
    box-shadow:var(--nx-shadow-sm);
}

#bbpress-forums .nx-bbp-login-message{
    margin:0 0 var(--nx-space-md);
    color:var(--nx-text-muted);
}

#bbpress-forums .nx-bbp-login-prompt .nx-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    text-decoration:none;
}

/*==========================================================
  BBPRESS USER PROFILE EDIT FORM

  bbPress uses WordPress-style .regular-text controls here.
  Keep the form on the Nexia design tokens so entered text,
  disabled fields, selects, and textareas remain readable in
  both themes without affecting other WordPress forms.
==========================================================*/

#bbpress-forums #bbp-your-profile input[type="text"],
#bbpress-forums #bbp-your-profile input[type="email"],
#bbpress-forums #bbp-your-profile input[type="url"],
#bbpress-forums #bbp-your-profile input[type="password"],
#bbpress-forums #bbp-your-profile select,
#bbpress-forums #bbp-your-profile textarea{
    background:var(--nx-input-bg) !important;
    color:var(--nx-input-text) !important;
    border:1px solid var(--nx-input-border) !important;
    border-radius:var(--nx-radius-sm);
    box-shadow:none;
}

#bbpress-forums #bbp-your-profile input[type="text"]:focus,
#bbpress-forums #bbp-your-profile input[type="email"]:focus,
#bbpress-forums #bbp-your-profile input[type="url"]:focus,
#bbpress-forums #bbp-your-profile input[type="password"]:focus,
#bbpress-forums #bbp-your-profile select:focus,
#bbpress-forums #bbp-your-profile textarea:focus{
    border-color:var(--nx-border-focus) !important;
    box-shadow:0 0 0 2px var(--nx-focus-ring) !important;
    outline:none;
}

#bbpress-forums #bbp-your-profile input::placeholder,
#bbpress-forums #bbp-your-profile textarea::placeholder{
    color:var(--nx-placeholder) !important;
    opacity:1;
}

#bbpress-forums #bbp-your-profile input:disabled,
#bbpress-forums #bbp-your-profile select:disabled,
#bbpress-forums #bbp-your-profile textarea:disabled{
    background:var(--nx-surface-secondary) !important;
    color:var(--nx-text-muted) !important;
    border-color:var(--nx-border) !important;
    opacity:1;
}

html.nx-dark-mode #bbpress-forums #bbp-your-profile input,
html.nx-dark-mode #bbpress-forums #bbp-your-profile select,
html.nx-dark-mode #bbpress-forums #bbp-your-profile textarea,
body.nx-dark-mode #bbpress-forums #bbp-your-profile input,
body.nx-dark-mode #bbpress-forums #bbp-your-profile select,
body.nx-dark-mode #bbpress-forums #bbp-your-profile textarea{
    background:var(--nx-input-bg) !important;
    color:var(--nx-input-text) !important;
    border-color:var(--nx-input-border) !important;
    color-scheme:dark;
}

html.nx-dark-mode #bbpress-forums #bbp-your-profile input:disabled,
html.nx-dark-mode #bbpress-forums #bbp-your-profile select:disabled,
html.nx-dark-mode #bbpress-forums #bbp-your-profile textarea:disabled,
body.nx-dark-mode #bbpress-forums #bbp-your-profile input:disabled,
body.nx-dark-mode #bbpress-forums #bbp-your-profile select:disabled,
body.nx-dark-mode #bbpress-forums #bbp-your-profile textarea:disabled{
    background:var(--nx-surface-secondary) !important;
    color:var(--nx-text-muted) !important;
    border-color:var(--nx-border) !important;
}

#bbpress-forums #bbp-your-profile .submit .user-submit{
    background:var(--nx-primary) !important;
    color:#fff !important;
    border:1px solid var(--nx-primary) !important;
    border-radius:var(--nx-radius-sm);
}

#bbpress-forums #bbp-your-profile .submit .user-submit:hover,
#bbpress-forums #bbp-your-profile .submit .user-submit:focus{
    background:var(--nx-primary-hover) !important;
    border-color:var(--nx-primary-hover) !important;
    color:#fff !important;
}

/*==========================================================
  WORDPRESS CLASSIC LINK MODAL

  bbPress' front-end editor uses WordPress' classic wpLink
  dialog. The dialog is appended directly to <body>, so it
  must be styled at document scope rather than beneath
  #bbpress-forums.
==========================================================*/

#wp-link-backdrop {
    background: rgba(0, 0, 0, .72);
}

#wp-link-wrap {
    color: var(--nx-text);
    font-family: var(--nx-font);
}

#wp-link {
    background: var(--nx-surface) !important;
    color: var(--nx-text);
    border: 1px solid var(--nx-border) !important;
    border-radius: 0 !important;
    box-shadow: var(--nx-shadow-lg);
    overflow: hidden;
}

#wp-link #link-modal-title {
    background: var(--nx-surface-secondary);
    color: var(--nx-heading);
    border-bottom: 1px solid var(--nx-border);
}

#wp-link #wp-link-close {
    color: var(--nx-text-muted);
}

#wp-link #wp-link-close:hover,
#wp-link #wp-link-close:focus {
    color: var(--nx-heading);
}

#wp-link .howto,
#wp-link label,
#wp-link .link-target,
#wp-link .link-search-wrapper {
    color: var(--nx-text);
}

#wp-link input[type="text"],
#wp-link input[type="search"] {
    background: var(--nx-input-bg);
    color: var(--nx-input-text);
    border: 1px solid var(--nx-input-border);
    border-radius: var(--nx-radius-sm);
}

#wp-link input[type="text"]:focus,
#wp-link input[type="search"]:focus {
    border-color: var(--nx-primary);
    box-shadow: 0 0 0 1px var(--nx-primary);
    outline: none;
}

#wp-link input::placeholder {
    color: var(--nx-placeholder);
}

#wp-link #search-results,
#wp-link #most-recent-results,
#wp-link .query-results {
    background: var(--nx-surface);
    border-color: var(--nx-border);
}

#wp-link #search-results li,
#wp-link #most-recent-results li,
#wp-link .query-results li {
    background: var(--nx-surface);
    color: var(--nx-text);
    border-color: var(--nx-border-light);
}

#wp-link #search-results li:hover,
#wp-link #search-results li.selected,
#wp-link #most-recent-results li:hover,
#wp-link #most-recent-results li.selected,
#wp-link .query-results li:hover,
#wp-link .query-results li.selected {
    background: var(--nx-surface-hover);
    color: var(--nx-heading);
}

#wp-link #search-results li .item-info,
#wp-link #most-recent-results li .item-info,
#wp-link .query-results li .item-info {
    color: var(--nx-text-muted);
}

#wp-link .submitbox {
    background: var(--nx-surface-secondary) !important;
    border-top: 1px solid var(--nx-border) !important;
}

#wp-link #wp-link-cancel {
    color: var(--nx-primary);
    border-color: var(--nx-primary);
    background: transparent;
}

#wp-link #wp-link-cancel:hover,
#wp-link #wp-link-cancel:focus {
    background: var(--nx-surface-hover);
}

#wp-link #wp-link-update {
    background: var(--nx-primary);
    border-color: var(--nx-primary);
    color: #fff;
    border-radius: var(--nx-radius-sm);
}

#wp-link #wp-link-update:hover,
#wp-link #wp-link-update:focus {
    background: var(--nx-primary-hover);
    border-color: var(--nx-primary-hover);
}

html.nx-dark-mode #wp-link-wrap,
body.nx-dark-mode #wp-link-wrap {
    color-scheme: dark;
}

html.nx-dark-mode #wp-link-backdrop,
body.nx-dark-mode #wp-link-backdrop {
    background: rgba(0, 0, 0, .78);
}

@media (max-width: 600px) {
    #wp-link-wrap {
        width: min(92vw, 560px);
        margin-left: 0;
    }

    #wp-link {
        border-radius: 0 !important;
    }
}
