/* Empty decorative boxes carry the artwork. Link text, names and tab order stay native. */
:where(a[href], button) {
    --action-image: url("../images/ui-actions/link.png");
}
:where(a[href], button)::before {
    content: "";
    display: inline-block;
    width: 1.18em;
    height: 1.18em;
    margin-inline-end: .36em;
    vertical-align: -.2em;
    background: var(--action-image) center / contain no-repeat;
    pointer-events: none;
}
:where(a:has(> img:only-child), a:has(> picture:only-child))::before { display: none; }

/* CSS uses the destination and native attributes, so generated items and translations
   inherit the same artwork without JS or changes to link targets. */
:where(a[href^="http"]) { --action-image: url("../images/world.png"); }
:where(a[href="/"], a[href="/ar"], a[href="/de"], a[href="/en"], a[href="/fr"], .nav-link[accesskey="1"]) {
    --action-image: url("../images/ui-actions/home.png");
}
:where(a[href*="/rss" i]) { --action-image: url("../images/rss.png"); }
:where(a[href*="/articles" i], .article-list a) { --action-image: url("../images/note_icon.png"); }
a[href*="/articles" i]::before, .directory-file h2 a::before {
    filter: drop-shadow(0 1px 1px #68808d);
}
:where(a[href*="/software" i]) { --action-image: url("../images/screen.png"); }
:where(a[href*="/tutorials" i], a[href*="reaper" i]) { --action-image: url("../images/media-headphones-61x53.png"); }
:where(a[href*="/remixes" i], a[href*="/player" i]) { --action-image: url("../images/multimedia.png"); }
:where(a[href*="/ImportantLinks" i]) { --action-image: url("../images/world.png"); }
:where(a[href*="/faq" i]) { --action-image: url("../images/ui-actions/question.svg"); }
:where(a[href*="/contact" i], a[href^="mailto:" i], a[href*="//groups.io/"]) { --action-image: url("../images/ui-actions/mail.png"); }
:where(a[href*="/about" i]) { --action-image: url("../images/ui-actions/person.png"); }
:where(a[href*="/privacy" i]) { --action-image: url("../images/security.png"); }
:where(a[href*="/search" i], #site-search-submit, button[type="submit"][form="site-search-form"]) { --action-image: url("../images/search.png"); }
:where(a[href*="access4music.com/" i]) { --action-image: url("../images/ui-actions/wave.png"); }
:where(a[href*="youtube.com/" i], a[href*="youtu.be/" i]) { --action-image: url("../images/youtube.png"); }
:where(.directory-folder h2 a, .breadcrumb-item a, a[href*="dropbox.com/"]) { --action-image: url("../images/ui-actions/folder.png"); }
:where(.directory-file h2 a) { --action-image: url("../images/note_icon.png"); }
:where(.directory-file a[href*="/remixes/" i]) { --action-image: url("../images/multimedia.png"); }
:where(a[href*="/software/games" i]) { --action-image: url("../images/ui-actions/game.png"); }
:where(a[href*="/software/programmes" i], a[href*="freedomscientific.com/" i], a[href*="nvaccess.org/" i]) {
    --action-image: url("../images/screen.png");
}
:where(.directory-folder a[href*="/remixes/" i]) { --action-image: url("../images/ui-actions/mix.png"); }
:where(.directory-folder a[href*="megamixes" i], .breadcrumb a[href*="megamixes" i]) {
    --action-image: url("../images/cd.png");
}
:where(.directory-folder a[href*="darubka" i], .directory-folder a[href*="drabuka" i], .directory-folder a[href*="darbooka" i]) {
    --action-image: url("../images/ui-actions/drum.png");
}
:where(.directory-folder a[href*="latino" i]) { --action-image: url("../images/ui-actions/latin.png"); }
:where(.directory-folder a[href*="mahrgan" i], .directory-folder a[href*="mahragan" i], .directory-folder a[href*="mahergan" i]) {
    --action-image: url("../images/ui-actions/mixer.png");
}
:where(.directory-actions a, .audio-chapter-seek, .tutorial-chapter-seek, a[data-seconds], #audio-play, #tutorial-play) {
    --action-image: url("../images/play.png");
}
:where(#audio-play[aria-pressed="true"], #tutorial-play[aria-pressed="true"]) { --action-image: url("../images/pause_h.png"); }
:where(#back-15, #tutorial-back, a[rel~="prev"]) { --action-image: url("../images/ui-actions/backward.png"); }
:where(#forward-15, #tutorial-forward, a[rel~="next"]) { --action-image: url("../images/ui-actions/forward.png"); }
:where(#mute-audio, #tutorial-mute) { --action-image: url("../images/ui-actions/speaker.png"); }
:where(#mute-audio[data-muted="true"], #tutorial-mute[data-muted="true"]) { --action-image: url("../images/ui-actions/mute.png"); }
:where(a[download], a[href$=".zip" i], a[href$=".apk" i], a[href$=".exe" i], a[href$=".msi" i]) {
    --action-image: url("../images/download.png");
}
:where(a[href$=".pdf" i]:not([download])) { --action-image: url("../images/pdf.png"); }
:where(a[rel~="up"], .directory-parent a) { --action-image: url("../images/ui-actions/parent.png"); }
:where(button[data-copy-target]) { --action-image: url("../images/ui-actions/copy.png"); }
:where(.language-toggle, .language-option, button[name="forget_language"]) { --action-image: url("../images/world.png"); }
:where(.language-option[aria-pressed="true"], button[name="action"][value="accept"]) { --action-image: url("../images/accept.png"); }
:where(button[name="action"][value="reject"]) { --action-image: url("../images/cancel.png"); }
:where(#submit) { --action-image: url("../images/ui-actions/send.png"); }
:where(.skip-link) { --action-image: url("../images/note_icon.png"); }

:where(a[href], button, select, input, textarea):focus-visible {
    outline: 3px solid #163e59;
    outline-offset: 3px;
}
body .skip-link:focus-visible {
    color: #123d56;
    outline: 3px solid #153d54;
    border-radius: .4rem;
}

.audio-controls label::before {
    content: "";
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    margin-inline-end: .3em;
    vertical-align: -.18em;
    background: url("../images/clock.png") center / contain no-repeat;
}
.audio-controls label[for$="-volume"]::before { background-image: url("../images/ui-actions/speaker.png"); }
.audio-controls label[for$="-speed"]::before { background-image: url("../images/ui-actions/forward.png"); }
.cookie-preferences {
    box-sizing: border-box;
    width: min(42rem, 100%);
    margin: clamp(1rem, 6vw, 4rem) auto;
    padding: 1.2rem;
    color: #1b3349;
    line-height: 1.65;
}
.cookie-preferences form { display: flex; flex-wrap: wrap; gap: .65rem; }
.cookie-preferences button {
    display: inline-block;
    padding: .55rem .9rem;
    border: 1px solid #7295a8;
    border-radius: .4rem;
    background: white;
    color: #19445d;
    font: inherit;
    cursor: pointer;
}
.cookie-preferences button:hover { background: #edf5f8; }

/* The original square logo remains legible with dark outline on a pale surface. */
header.site-masthead {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.25rem;
    align-items: center;
    justify-content: space-between;
    padding: .6rem clamp(.8rem, 3vw, 2rem);
    margin: .75rem 0 .6rem;
    border: 1px solid #cfdee5;
    border-top: 3px solid #587e94;
    border-radius: .75rem;
    background: linear-gradient(110deg, #f6fafb, #ebf2f6);
    color: #1b3349;
    text-align: start;
}
.site-masthead #branding {
    width: auto;
    flex: none;
    display: flex;
    gap: clamp(.35rem, 1.5vw, 1.05rem);
    align-items: center;
    margin: 0;
    padding: 0;
    background: transparent;
    overflow: visible;
}
.site-masthead #MainLogo {
    width: clamp(4.75rem, 8vw, 6.25rem);
    height: auto;
    margin: 0;
    padding: 0;
}
.site-masthead .site-wordmark {
    color: #1b374b;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.5rem, 3.5vw, 2.65rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.025em;
}
[dir="rtl"] .site-masthead .site-wordmark {
    font-family: Tahoma, Arial, sans-serif;
    letter-spacing: normal;
}
@media (max-width: 410px) {
    header.site-masthead { gap: .5rem; }
    .site-masthead #MainLogo { width: 3.2rem; }
}
.site-masthead .language-controls { align-items: flex-start; }
.site-masthead .language-options { justify-content: flex-start; }
.site-masthead .language-toggle, .site-masthead .language-option {
    min-height: 2.6rem;
    padding: .42rem .75rem;
    border-radius: .45rem;
    border: 1px solid #8ba7b7;
    background: white;
    color: #19445d;
    font-weight: 600;
    line-height: 1.4;
}
.site-masthead .language-option[aria-pressed="true"] {
    border: 2px solid #4f778b;
    background: #eaf4f6;
}
.site-masthead .language-toggle:hover, .site-masthead .language-option:hover {
    color: #14374d;
    background: #f0f7f8;
}
.site-masthead .language-toggle:focus-visible, .site-masthead .language-option:focus-visible {
    outline: 3px solid #103d59;
    outline-offset: 2px;
}

nav.site-primary-nav {
    width: 100%;
    margin: 0 0 1.15rem;
    padding: .45rem 0 .85rem;
    border: 0;
    border-bottom: 1px solid #c9d9e1;
    overflow: visible;
}
.site-primary-nav h2 {
    margin: 0 0 .55rem;
    padding-inline: .15rem;
    color: #2a4659;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: .01em;
    text-align: start;
}
.site-primary-nav ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%),1fr));
    gap: .35rem;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}
.site-primary-nav li, .site-primary-nav li:last-child {
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    float: none;
    text-align: start;
}
.site-primary-nav .nav-link {
    display: flex;
    height: 100%;
    min-height: 2.65rem;
    align-items: center;
    padding: .4rem .6rem;
    border: 1px solid #c9d9e1;
    border-radius: .4rem;
    color: #1d4b65;
    background: #fff;
    font-weight: 600;
    font-size: .94rem;
    line-height: 1.35;
    text-decoration: none;
    text-align: start;
    overflow-wrap: anywhere;
    transition: background-color .12s, border-color .12s;
}
.site-primary-nav .nav-link::before {
    flex: none;
    width: 1.45rem;
    height: 1.45rem;
    margin-inline-end: .5rem;
}
.site-primary-nav .music-nav-link::before {
    width: 3.3rem;
    height: 2.2rem;
    border-radius: .25rem;
    background: url("../images/dance/stage.webp") center / cover no-repeat;
}
.site-primary-nav .nav-link[aria-current] {
    color: #143c50;
    border-color: #7296a8;
    background-color: #e9f2f5;
    box-shadow: inset 0 -2px #527b90;
}
.site-primary-nav .nav-link:hover, .site-primary-nav .nav-link:focus-visible {
    color: #163c52;
    background-color: #eef6f8;
    border-color: #63879a;
    text-decoration: underline;
    text-underline-offset: .18em;
}
.site-primary-nav .nav-link:focus-visible {
    outline: 3px solid #153d54;
    outline-offset: 1px;
}
@media (min-width: 992px) {
    .site-primary-nav ul { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

footer.site-footer {
    width: 100%;
    margin: 1.5rem 0 0;
    padding: 1rem;
    border-radius: .7rem .7rem 0 0;
    background: #203a4c;
    color: #fff;
    text-align: start;
    overflow: visible;
}
.site-footer .footer-navigation {
    width: auto;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1.2rem;
    margin: 0 0 .65rem;
    padding: 0;
    border: 0;
    overflow: visible;
}
.site-footer .footer-navigation a {
    display: inline-block;
    padding: .2rem .35rem;
    color: #fff;
    line-height: 1.6;
    text-decoration: underline;
    text-underline-offset: .15em;
    border-radius: .25rem;
}
.site-footer .footer-navigation a::before {
    height: 1.4em;
    width: 1.4em;
    background-color: #f1f6f8;
    background-size: 82%;
    border-radius: .25rem;
}
.site-footer .footer-navigation a:hover { background: #35546a; }
.site-footer .footer-navigation a:focus-visible { outline-color: #fff; }
.site-footer p { margin: 0; padding: 0 .35rem; color: #edf2f5; }
@media (prefers-reduced-motion: reduce) {
    .site-primary-nav .nav-link { transition: none; }
}
@media (forced-colors: active) {
    /* Names remain visible in OS colors. Decorative pixels need no replacement. */
    :where(a[href], button)::before, .audio-controls label::before { display: none; }
    .site-primary-nav .nav-link[aria-current] { border: 2px solid LinkText; }
    .site-primary-nav .nav-link:focus-visible, :where(a[href], button, select, input, textarea):focus-visible {
        outline-color: Highlight;
    }
}

/* These glyphs accompany existing labels and headings on the information pages. */
.detail-cue::before {
    content: "";
    display: inline-block;
    width: 1.25em;
    height: 1.25em;
    margin-inline-end: .45em;
    vertical-align: -.22em;
    background: var(--detail-image) center / contain no-repeat;
    pointer-events: none;
}
.cue-category { --detail-image: url("../images/category.png"); }
.cue-question { --detail-image: url("../images/ui-actions/question.svg"); }
:lang(ar):where(a[href*="/faq" i], .cue-question)::before,
body[data-topic="faq"]:lang(ar) #main-content h1::after { scale: -1 1; }
.cue-url      { --detail-image: url("../images/ui-actions/link.png"); }
.cue-news     { --detail-image: url("../images/newspaper_add_32.png"); }
.cue-date     { --detail-image: url("../images/Calendar.png"); }
.cue-security { --detail-image: url("../images/security.png"); }
.cue-message  { --detail-image: url("../images/ui-actions/mail.png"); }
.cue-data     { --detail-image: url("../images/db.png"); }

/* Retain the link's single icon while choosing artwork for more library entries. */
:where(.important-link-item a[href*="codefactoryglobal.com/"]) { --action-image: url("../images/ui-actions/speaker.png"); }
:where(.important-link-item a[href*="jieshuo.ltd/"], .important-link-item a[href*="blindandroidusers.com/"]) {
    --action-image: url("../images/mobile.png");
}
:where(.important-link-item a[href*="sws-extension.org/"]) { --action-image: url("../images/screen.png"); }


#faq-category-filter {
    display: block;
    max-width: 100%;
    min-height: 2.65rem;
    padding: .35rem .55rem;
    color: var(--topic-ink);
    background-color: #fff;
    border: 1px solid #819bab;
    border-radius: .35rem;
    font: inherit;
}
#main-content .faq-answer {
    font-size: 1.05rem;
    font-weight: 400;
    line-height: 1.65;
}
#main-content .faq-category {
    display: inline-block;
    margin: .25rem 0 0;
    padding: .18rem .6rem;
    border: 1px solid var(--topic-line);
    border-radius: .4rem;
    color: var(--topic-muted);
    font-size: .9rem;
    line-height: 1.45;
}
#main-content .privacy-section {
    padding: 1rem 1.25rem;
    border-inline-start: .25rem solid #527389;
    background: #f4f7f9;
}
.privacy-section p { max-width: 76ch; line-height: 1.65; }
.privacy-section p:last-child { margin-bottom: 0; }
.rss-subscribe {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .5rem .7rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--topic-line);
    border-radius: .7rem;
    background: var(--topic-paper);
}
.rss-subscribe label, .rss-subscribe .copy-status { grid-column: 1 / -1; margin: 0; }
.rss-subscribe label { font-weight: 600; }
.rss-subscribe .form-control[readonly] { background-color: white; }
.rss-subscribe .copy-status:empty { height: 0; margin-top: -.5rem; }
@media (max-width: 40rem) {
    .rss-subscribe { grid-template-columns: minmax(0, 1fr); }
    .rss-subscribe button { justify-self: start; }
}
@media (forced-colors: active) {
    .detail-cue::before { display: none; }
}

.article-list .article-folder-link { --action-image: url("../images/ui-actions/folder.png"); }
a.file-download-link { --action-image: url("../images/download.png"); }

#main-content a[href] {
    color: #155474;
    text-decoration: underline;
    text-underline-offset: .13em;
}
#main-content a[href]:hover { color: #103e56; }
#site-search-submit, #rssCopyButton {
    color: #174e6a;
    border-color: #47718a;
    background-color: white;
}
#site-search-submit:hover, #rssCopyButton:hover {
    color: #fff;
    background-color: #20546e;
}
#submit.btn-primary {
    color: #fff;
    background-color: #20546e;
    border-color: #17445d;
}
#submit.btn-primary:hover { background-color: #173f56; }
#main-content :is(a, button, input, select, textarea):focus-visible,
#site-search-form :is(input, button):focus-visible {
    outline: 3px solid #163e59;
    outline-offset: 3px;
}
@media (forced-colors: active) {
    #main-content :is(a, button, input, select, textarea):focus-visible,
    #site-search-form :is(input, button):focus-visible { outline-color: Highlight; }
}
