/*
 * The accessibility settings: the effects that are the same in every Bootstrap 5 theme, each a
 * class on <body>, and a plain look for the panel, which a theme restyles as it likes. Contrast
 * and the simple layout are the theme's, as only it knows its colours and layout. A theme links
 * this file in its <head>.
 */

/* Atkinson Hyperlegible (Braille Institute, SIL Open Font License, fonts/OFL.txt), from
   fontsource 5.2.8. A browser fetches a face only once the readable font is switched on, and
   only the subsets the page's text needs: latin-ext carries the Croatian letters. */
@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/atkinson-hyperlegible-latin-400-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/atkinson-hyperlegible-latin-ext-400-italic.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/atkinson-hyperlegible-latin-400-italic.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(fonts/atkinson-hyperlegible-latin-700-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: italic;
    font-weight: 700;
    font-display: swap;
    src: url(fonts/atkinson-hyperlegible-latin-ext-700-italic.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: italic;
    font-weight: 700;
    font-display: swap;
    src: url(fonts/atkinson-hyperlegible-latin-700-italic.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Text size: Bootstrap 5 sizes in rem, so the root's size scales the page */
html:has(> body.textsize-big) {
    font-size: 125%;
}

html:has(> body.textsize-bigger) {
    font-size: 150%;
}

/* Underlined links, so a link does not rest on its colour alone. A link drawn as a button stays
   as it is, but not one that only borrows the class and reads as text: .btn-link, and
   .btn-toggle, the side navigation's links */
body.a11y-links a:not(.btn),
body.a11y-links a.btn-link,
body.a11y-links a.btn-toggle {
    text-decoration: underline !important;
    text-underline-offset: .15em;
}

/* Text spacing: the values WCAG 1.4.12 asks a page to bear */
body.a11y-spacing,
body.a11y-spacing * {
    line-height: 1.5 !important;
    letter-spacing: .12em !important;
    word-spacing: .16em !important;
}

body.a11y-spacing p {
    margin-bottom: 2em !important;
}

/* The readable font, everywhere but in icon fonts and code */
body.a11y-font,
body.a11y-font :not(code, kbd, pre, samp, .bi, [class^="bi-"], [class*=" bi-"], .fa, .fas, .far, .fab, .fal, [class^="fa-"], [class*=" fa-"]) {
    font-family: 'Atkinson Hyperlegible', sans-serif !important;
}

/* No transitions or CSS animations; the script stops carousels and video that plays by itself */
html:has(> body.a11y-motion) {
    scroll-behavior: auto !important;
}

body.a11y-motion *,
body.a11y-motion *::before,
body.a11y-motion *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
}

/* The panel */
.cms-a11y-toggle {
    position: relative;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: 1.75rem;
    line-height: 1;
}

/* While anything differs from the defaults (a11y-active), the button carries a check in its
   corner, and its name says so; a theme sets the colours through the three variables */
body.a11y-active .cms-a11y-toggle::after {
    content: "\f633";
    position: absolute;
    right: -.25rem;
    bottom: -.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: .875rem;
    height: .875rem;
    border-radius: 50%;
    background: var(--cms-a11y-active-bg, #ffd400);
    box-shadow: 0 0 0 2px var(--cms-a11y-active-ring, #fff);
    color: var(--cms-a11y-active-color, #000);
    font-family: bootstrap-icons;
    font-size: .625rem;
    line-height: 1;
}

body:not(.a11y-active) .cms-a11y-state {
    display: none;
}

/* The panel is a Bootstrap offcanvas from the right; with the largest text on a phone it fills
   the screen and scrolls */
.cms-a11y-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.cms-a11y-panel .offcanvas-body {
    padding-top: 0;
}

.cms-a11y-group {
    padding: .5rem 0;
    border-top: 1px solid var(--bs-border-color);
}

.cms-a11y-group legend {
    float: none;
    margin-bottom: .25rem;
    font-size: 1rem;
    font-weight: 700;
}

.cms-a11y-sizes {
    display: flex;
    align-items: flex-end;
    gap: .375rem;
}

.cms-a11y-size {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.cms-a11y-size-1 {
    font-size: .875rem;
}

.cms-a11y-size-2 {
    font-size: 1.125rem;
}

.cms-a11y-size-3 {
    font-size: 1.375rem;
}

.btn-check:checked + .cms-a11y-size {
    border-color: var(--bs-primary);
    background: var(--bs-primary);
    color: #fff;
}

.btn-check:focus-visible + .cms-a11y-size {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

.cms-a11y-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1rem;
    padding-top: .75rem;
    border-top: 1px solid var(--bs-border-color);
}

/* The reset is a button and looks like one, the theme's; the links in the panel are underlined
   whatever the theme does with links, hover included */
.cms-a11y-panel .cms-a11y-reset {
    display: inline-flex;
    align-items: center;
    gap: .375em;
}

.cms-a11y-panel a,
.cms-a11y-panel a:hover {
    text-decoration: underline;
}

/* The statement opens in a new tab: a small mark after it */
.cms-a11y-statement .bi {
    margin-left: .3em;
    font-size: .8em;
}

/* Where the settings are kept: smaller, and muted like Bootstrap's secondary text - but not under
   high contrast, which asks for the opposite; there it keeps the panel's colour, which a theme's
   contrast modes set */
.cms-a11y-note {
    margin: .75rem 0 0;
    font-size: .875em;
}

body:not(.highcontrast-normal, .highcontrast-inverted) .cms-a11y-note {
    color: var(--bs-secondary-color);
}
