/* Accessibility fixes on top of Solo 1.0.0.
   Loaded after built/screen.css, so nothing here needs a rebuild.
   Numbers refer to solo-accessibility-audit.md. */

:root {
    --focus-ring-color: #15171a;
}

:root.has-light-text {
    --focus-ring-color: #ffffff;
}

/* 3. Skip link: off-screen until it receives focus */
.gh-skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 4000000;
    padding: 12px 16px;
    font-size: 1.6rem;
    font-weight: 700;
    color: #15171a;
    text-decoration: none;
    background-color: #ffffff;
    border-radius: 4px;
}

.gh-skip-link:focus {
    top: 16px;
}

/* The skip-link target takes focus without showing a ring around the whole page */
#main-content:focus {
    outline: none;
}

/* Home: the intro now sits inside main, which must keep filling the page */
main.gh-home {
    display: flex;
    flex-grow: 1;
    flex-direction: column;
}

/* 2 and 10. One focus ring everywhere, including the buttons Solo strips it from */
:focus-visible,
.gh-icon-btn:focus-visible,
.gh-text-btn:focus-visible,
.pswp__button:focus-visible {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: 3px;
}

.pswp :focus-visible {
    outline-color: #ffffff;
}

/* 1. Subscribe button in the homepage intro (replaces the fake email field) */
.gh-about-subscribe {
    align-self: flex-start;
    padding: 14px 22px;
    margin-top: 40px;
    font-size: 1.7rem;
}

/* 7. On a dark background the accent colour is too dark for text */
.has-light-text .gh-content a,
.has-light-text .gh-head-btn:not(.gh-btn),
.has-light-text :not(pre) > code {
    color: #ffffff;
}

.has-light-text .gh-content a {
    text-underline-offset: 3px;
}

/* 8. ... and too dark for a button to stand out */
.has-light-text .gh-primary-btn,
.has-light-text .gh-content .kg-btn-accent {
    color: #15171a;
    background-color: #ffffff;
}

/* 5. Wide tables scroll inside a wrapper that the keyboard can reach,
      and the table keeps its table semantics */
.gh-table-scroll {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.gh-content .gh-table-scroll > table:not(.gist table) {
    display: table;
    max-width: none;
    overflow: visible;
}

/* Tables on a dark background: no white fade at the edges, no white header cells */
.has-light-text .gh-content table:not(.gist table) td:first-child,
.has-light-text .gh-content table:not(.gist table) td:last-child {
    background-image: none;
}

.has-light-text .gh-content table:not(.gist table) th {
    color: inherit;
    background-color: transparent;
}
