/* Accessibility overrides for the vendored AddToCalendar widget (atc-style-blue.css).
   State classes are toggled by atc-a11y.js. Load this after atc-style-blue.css. */

/* Every addtocalendar.load() call appends another copy of the list to each widget; only the newest one is used,
   so take the stale copies out of view and out of the tab order */
.addtocalendar ul.atcb-list:not(:last-of-type) {
    display: none !important;
}

/* Keep the list open while focus is anywhere inside the widget (the vendor only shows it while the button itself has focus) */
.addtocalendar.atcb-open .atcb-list {
    visibility: visible;
}

/* Escape closes the list even though the button still has focus */
.addtocalendar.atcb-collapsed .atcb-list {
    visibility: hidden;
}

/* The vendor CSS removes every focus outline; restore a visible indicator for keyboard users */
.addtocalendar .atcb-link:focus-visible,
.addtocalendar .atcb-item-link:focus-visible {
    outline: 2px solid #1a5fb4 !important;
    outline-offset: 2px;
}

.addtocalendar .atcb-item-link:focus-visible {
    outline-offset: -2px;
}

/* The vendor CSS turns focused option text white but only adds the blue background on hover,
   which leaves a keyboard-focused option as white-on-white */
.atc-style-blue .atcb-item-link:focus {
    background: rgb(66,129,244);
    color: #fff;
}
