/* ============================= */
/* ReadSpeaker + Mime type icons */
/* ============================= */
/*
ReadSpeaker injects a second link next to documents: <a class="rspkr_dr_link" ...>.
Some themes add file-type icons via selectors like a[href$=".pdf"]::after,
which can also match the ReadSpeaker link and create duplicate icons.

These styles:
- prevent pseudo-element icons from appearing on ReadSpeaker links
- standardize file-type icons to appear BEFORE the document link text
*/

/* Never show theme pseudo-icons on the ReadSpeaker docReader link */
a.rspkr_dr_link::before,
a.rspkr_dr_link::after {
    content: none !important;
    display: none !important;
}

/* Remove theme-added file icons (before/after) on real document links */
a[href$=".pdf" i]:not(.rspkr_dr_link)::after,
a[href$=".doc" i]:not(.rspkr_dr_link)::after,
a[href$=".docx" i]:not(.rspkr_dr_link)::after,
a[href$=".xls" i]:not(.rspkr_dr_link)::after,
a[href$=".xlsx" i]:not(.rspkr_dr_link)::after,
a[href$=".ppt" i]:not(.rspkr_dr_link)::after,
a[href$=".pptx" i]:not(.rspkr_dr_link)::after,
a[href$=".zip" i]:not(.rspkr_dr_link)::after,
a[href^="mailto:" i]:not(.rspkr_dr_link)::before,
a[href^="mailto:" i]:not(.rspkr_dr_link)::after {
    content: none !important;
    display: none !important;
}

/* general reset/setup styling for icons - needed on all */
.icon::before {
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* Add standardized icons BEFORE link text (font stack shared below) */
a[href$=".pdf" i]:not(.rspkr_dr_link)::before {
    content: "\f1c1" !important;
}

a[href$=".doc" i]:not(.rspkr_dr_link)::before,
a[href$=".docx" i]:not(.rspkr_dr_link)::before {
    content: "\f1c2" !important;
}

a[href$=".xls" i]:not(.rspkr_dr_link)::before,
a[href$=".xlsx" i]:not(.rspkr_dr_link)::before {
    content: "\f1c3" !important;
}

a[href$=".ppt" i]:not(.rspkr_dr_link)::before,
a[href$=".pptx" i]:not(.rspkr_dr_link)::before {
    content: "\f1c4" !important;
}

a[href$=".zip" i]:not(.rspkr_dr_link)::before {
    content: "\f1c6" !important;
}

a[href^="mailto:" i]:not(.rspkr_dr_link)::before {
    content: "\f0e0" !important;
}

a[href$=".pdf" i]:not(.rspkr_dr_link)::before,
a[href$=".doc" i]:not(.rspkr_dr_link)::before,
a[href$=".docx" i]:not(.rspkr_dr_link)::before,
a[href$=".xls" i]:not(.rspkr_dr_link)::before,
a[href$=".xlsx" i]:not(.rspkr_dr_link)::before,
a[href$=".ppt" i]:not(.rspkr_dr_link)::before,
a[href$=".pptx" i]:not(.rspkr_dr_link)::before,
a[href$=".zip" i]:not(.rspkr_dr_link)::before,
a[href^="mailto:" i]:not(.rspkr_dr_link)::before {
    font-family:
        "Font Awesome 5 Pro", "Font Awesome 5 Free", "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
    margin-right: 0.4em !important;
    text-decoration: none !important;
}

/* Adjacent <i>: do not add the automatic PDF/Word/etc. icon in front of the link */
a[href$=".pdf" i]:not(.rspkr_dr_link):has(+ i)::before,
a[href$=".doc" i]:not(.rspkr_dr_link):has(+ i)::before,
a[href$=".docx" i]:not(.rspkr_dr_link):has(+ i)::before,
a[href$=".xls" i]:not(.rspkr_dr_link):has(+ i)::before,
a[href$=".xlsx" i]:not(.rspkr_dr_link):has(+ i)::before,
a[href$=".ppt" i]:not(.rspkr_dr_link):has(+ i)::before,
a[href$=".pptx" i]:not(.rspkr_dr_link):has(+ i)::before,
a[href$=".zip" i]:not(.rspkr_dr_link):has(+ i)::before,
a[href^="mailto:" i]:not(.rspkr_dr_link):has(+ i)::before {
    content: none !important;
    display: none !important;
}

/* <i> inside the <a> (e.g. li > a > i): do not add the automatic PDF/Word/etc. icon in front of the link */
a[href$=".pdf" i]:not(.rspkr_dr_link):has(i)::before,
a[href$=".doc" i]:not(.rspkr_dr_link):has(i)::before,
a[href$=".docx" i]:not(.rspkr_dr_link):has(i)::before,
a[href$=".xls" i]:not(.rspkr_dr_link):has(i)::before,
a[href$=".xlsx" i]:not(.rspkr_dr_link):has(i)::before,
a[href$=".ppt" i]:not(.rspkr_dr_link):has(i)::before,
a[href$=".pptx" i]:not(.rspkr_dr_link):has(i)::before,
a[href$=".zip" i]:not(.rspkr_dr_link):has(i)::before,
a[href^="mailto:" i]:not(.rspkr_dr_link):has(i)::before {
    content: none !important;
    display: none !important;
}

/* External links: icon after text (.extlink + .extlink-show-icon from accessibility.js).
   !important beats earlier a[href$=".pdf"]::after { content: none } in this file. */
a.extlink.extlink-show-icon::after {
    content: "\f35d" !important;
    font-family:
        "Font Awesome 5 Pro", "Font Awesome 5 Free", "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 75% !important;
    display: inline-block !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
    margin-left: 0.4em !important;
    text-decoration: none !important;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
}

/* Image links: Clear pseudo-icons when the link wraps an image. */
a[href$=".pdf" i]:not(.rspkr_dr_link):has(img)::before,
a[href$=".doc" i]:not(.rspkr_dr_link):has(img)::before,
a[href$=".docx" i]:not(.rspkr_dr_link):has(img)::before,
a[href$=".xls" i]:not(.rspkr_dr_link):has(img)::before,
a[href$=".xlsx" i]:not(.rspkr_dr_link):has(img)::before,
a[href$=".ppt" i]:not(.rspkr_dr_link):has(img)::before,
a[href$=".pptx" i]:not(.rspkr_dr_link):has(img)::before,
a[href$=".zip" i]:not(.rspkr_dr_link):has(img)::before,
a[href^="mailto:" i]:not(.rspkr_dr_link):has(img)::before {
    content: none !important;
    display: none !important;
}

a.extlink.extlink-show-icon:has(img)::after {
    content: none !important;
    display: none !important;
}

/* ReadSpeaker image padding */
img.rspkr_dr_img {
    padding-left: 0.25em;
}
/* END ReadSpeaker + Mime type icons */

/* Satisfy 1.4.1 "not color alone" for links while keeping nav/title, icons and toggle button clean. */
a {
    text-decoration: underline !important;
}

.site-title a,
.nav a,
a:has(i),
.toggle-footer-btn,
a.skip-main,
#pmcApp a.info-link {
    text-decoration: none !important;
}
