/* Accessibility toolbar (text size and background colour) and the background colour schemes.
   Loaded last; remove this file and assets/js/a11y-toolbar.js to switch the feature off. */

.a11y-toolbar {
    background: #f4f5f9;
    border-bottom: 1px solid #e3e6f0;
    font-family: Arial, sans-serif;
}
.a11y-toolbar-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 6px 18px;
    padding-top: 6px;
    padding-bottom: 6px;
}
.a11y-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.a11y-label {
    margin-right: 2px;
    font-size: 13px;
    color: #333;
}
.a11y-btn {
    min-width: 34px;
    min-height: 32px;
    padding: 4px 10px;
    border: 1px solid #b8bccb;
    border-radius: 4px;
    background: #fff;
    color: #1f2a44;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}
.a11y-btn:hover {
    background: #eef0f7;
}
.a11y-btn[aria-pressed="true"] {
    background: #000080;
    border-color: #000080;
    color: #fff;
}
.a11y-btn[aria-disabled="true"] {
    border-style: dashed;
    color: #5f6577;
    cursor: default;
}
.a11y-swatch {
    position: relative;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
}
/* Each swatch keeps its own colour whichever background is chosen. */
.a11y-toolbar .a11y-swatch-default {
    background-color: #fff !important;
}
.a11y-toolbar .a11y-swatch-yellow {
    background-color: #fff59d !important;
}
.a11y-toolbar .a11y-swatch-peach {
    background-color: #ffccbc !important;
}
.a11y-toolbar .a11y-swatch-turquoise {
    background-color: #b2ebf2 !important;
}
.a11y-toolbar .a11y-swatch-black {
    background-color: #000 !important;
}
/* The chosen swatch gets a thick ring and a tick, so the choice doesn't rely on colour alone. */
.a11y-toolbar .a11y-swatch[aria-pressed="true"] {
    border: 3px solid var(--a11y-accent, #000080) !important;
}
.a11y-swatch[aria-pressed="true"]:after {
    content: "";
    position: absolute;
    top: 45%;
    left: 50%;
    width: 7px;
    height: 12px;
    border: solid #000;
    border-width: 0 3px 3px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}
.a11y-swatch-black[aria-pressed="true"]:after {
    border-color: #fff;
}

/* At 130% text on a narrow phone, long words such as "Queries/Grievances/Complaints" are wider than
   the screen; let them wrap instead of making the page scroll sideways. */
main {
    overflow-wrap: break-word;
}
/* The site fixes form rows at 54px and fields at 38px; with larger text they grow with it. */
html[data-a11y-text] .form-group,
html[data-a11y-text] .form-control:not(textarea) {
    height: auto;
}
/* On wide screens the menu only just fits beside the logo at normal size. With larger text the menu
   items sit a little closer, so the larger menu still fits beside the logo in the normal column; it
   moves under the logo only where there is no room. (Below 1200px it is in the slide-out panel.) */
@media (min-width: 1200px) {
    html[data-a11y-text] .navbar-expand-lg {
        flex-wrap: wrap;
    }
    html[data-a11y-text] .navbar-expand-lg .navbar-collapse {
        flex-grow: 1;
    }
    html[data-a11y-text] .navbar .navbar-nav li {
        padding: 0 4px;
    }
    html[data-a11y-text] .navbar .navbar-nav .login .nav-link {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    html[data-a11y-text] header .navbar-brand {
        margin-right: 8px;
    }
}
/* At 1200-1365px the normal column is too narrow for the menu at 130%, so the header and the bar above
   it use the screen width there. Everywhere else they keep the normal column, so nothing moves. */
@media (min-width: 1200px) and (max-width: 1365.98px) {
    html[data-a11y-text="2"] header .container,
    html[data-a11y-text="2"] .a11y-toolbar .container {
        max-width: none;
    }
}

/* ---------- Background colours ----------
   Each choice paints every surface one colour and sets text, links and lines to colours that pass
   WCAG AA on it: text 14:1 or more, links 11:1, error messages 5.5:1. (The old toolbar coloured only
   the page body, which most sections cover, and its tomato colour failed contrast with grey text.) */
html[data-a11y-bg="yellow"],
html[data-a11y-bg="peach"],
html[data-a11y-bg="turquoise"] {
    --a11y-fg: #000;
    --a11y-link: #000080;
    --a11y-line: #333;
    --a11y-hint: #444;
    --a11y-error: #a31515;
    --a11y-accent: #000080;
    --a11y-on-accent: #fff;
}
html[data-a11y-bg="yellow"] {
    --a11y-bg: #fff59d;
}
html[data-a11y-bg="peach"] {
    --a11y-bg: #ffccbc;
}
html[data-a11y-bg="turquoise"] {
    --a11y-bg: #b2ebf2;
}
/* Black is the high-contrast choice: white text, yellow links (17:1 and more). */
html[data-a11y-bg="black"] {
    --a11y-bg: #000;
    --a11y-fg: #fff;
    --a11y-link: #ffeb3b;
    --a11y-line: #fff;
    --a11y-hint: #ccc;
    --a11y-error: #ff8a80;
    --a11y-accent: #ffeb3b;
    --a11y-on-accent: #000;
}

/* Kept at low specificity on purpose, so the more specific rules below (links, active tabs) win. */
html[data-a11y-bg],
html[data-a11y-bg] body,
html[data-a11y-bg] body * {
    background-color: var(--a11y-bg) !important;
    color: var(--a11y-fg) !important;
    border-color: var(--a11y-line) !important;
    box-shadow: none !important;
    text-shadow: none !important;
}
html[data-a11y-bg] img {
    background-color: transparent !important;
}
/* The phone menu dims the page behind it instead of covering it, and gets an edge. */
html[data-a11y-bg] .body-overlay {
    background-color: rgba(0, 0, 0, 0.7) !important;
}
@media (max-width: 1199.98px) {
    html[data-a11y-bg] .navbar-collapse {
        border-right: 2px solid var(--a11y-line) !important;
    }
}
html[data-a11y-bg] .static-banner,
html[data-a11y-bg] .home-banner {
    background-image: none !important;
}
html[data-a11y-bg] a,
html[data-a11y-bg] a * {
    color: var(--a11y-link) !important;
}
html[data-a11y-bg] a:hover,
html[data-a11y-bg] a:focus {
    text-decoration: underline !important;
}
html[data-a11y-bg] ::placeholder {
    color: var(--a11y-hint) !important;
}
html[data-a11y-bg] span.error,
html[data-a11y-bg] .form-list span.error {
    color: var(--a11y-error) !important;
}
html[data-a11y-bg] .tabs-1 a.active,
html[data-a11y-bg] .navbar-collapse .nav-link.active {
    color: var(--a11y-link) !important;
}
html[data-a11y-bg] .tabs-1 a.active:after,
html[data-a11y-bg] .navbar-collapse .nav-item.active:after,
html[data-a11y-bg] .navbar-collapse .nav-link.active:after,
html[data-a11y-bg] .section-heading span:first-child:after,
html[data-a11y-bg] .section-heading-1:after {
    background-color: var(--a11y-accent) !important;
}
html[data-a11y-bg] .li-left-border li:before {
    background-color: var(--a11y-fg) !important;
}
/* The site's own !important rules that outrank the general ones above. */
html[data-a11y-bg] .navbar .navbar-nav .login .nav-link {
    border-color: var(--a11y-line) !important;
}
html[data-a11y-bg] header a.nav-link[href*="investors/login"] {
    color: var(--a11y-link) !important;
}
html[data-a11y-bg] .btn-bg-3:hover,
html[data-a11y-bg] .btn-bg-3:focus,
html[data-a11y-bg] .btn-bg-3:active {
    background-color: var(--a11y-bg) !important;
}
html[data-a11y-bg] a:focus-visible,
html[data-a11y-bg] button:focus-visible,
html[data-a11y-bg] input:focus-visible,
html[data-a11y-bg] select:focus-visible,
html[data-a11y-bg] textarea:focus-visible,
html[data-a11y-bg] [tabindex]:focus-visible {
    outline-color: var(--a11y-accent) !important;
}
html[data-a11y-bg] .a11y-btn[aria-pressed="true"],
html[data-a11y-bg] .a11y-btn[aria-pressed="true"] * {
    background-color: var(--a11y-accent) !important;
    border-color: var(--a11y-accent) !important;
    color: var(--a11y-on-accent) !important;
}
/* The footer's exchange logos are white: black on the light backgrounds. */
html[data-a11y-bg="yellow"] .footer-icons,
html[data-a11y-bg="peach"] .footer-icons,
html[data-a11y-bg="turquoise"] .footer-icons {
    background-color: transparent !important;
    filter: invert(1);
}
/* On black, the dark grey logo goes on a white disc and the phone menu icon is drawn in white. */
html[data-a11y-bg="black"] .navbar-brand img {
    background-color: #fff !important;
    border-radius: 50%;
}
html[data-a11y-bg="black"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
}
