/* Dostępność (WCAG 2.2) */
:root {
    --a11y-fs: 1;
}

html {
    font-size: calc(100% * var(--a11y-fs));
    scroll-padding-top: 1rem;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

footer {
    font-size: calc(14px * var(--a11y-fs));
}

/* Link do pominięcia nawigacji (2.4.1) */
.skip-link {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1100;
    padding: .75rem 1.25rem;
    background: #000;
    color: #fff;
    font-weight: 700;
    transform: translateY(-120%);
}
.skip-link:focus {
    transform: translateY(0);
}

/* Widoczny fokus (2.4.7, 2.4.11, 2.4.13) - podwójny kontur działa na jasnym i ciemnym tle */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #ffbf47 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px #000 !important;
}
main:focus {
    outline: none;
}

/* Linki w treści odróżnialne nie tylko kolorem (1.4.1) */
footer a {
    text-decoration: underline;
    text-underline-offset: .15em;
}
footer a:hover {
    text-decoration-thickness: 2px;
}
footer .link a,
footer .border-top a {
    display: inline-block;
    min-height: 24px;
    line-height: 24px;
}
.btn .opacity-75 {
    opacity: 1 !important;
}

/* Pasek narzędzi dostępności */
.a11y-bar {
    position: relative;
    z-index: 1;
    background: #fff;
    color: #001430;
    border-bottom: 1px solid #d0d5dd;
    font-size: 13px;
}
.a11y-bar .container {
    --bs-gutter-x: 24px;
    gap: 8px !important;
    padding-top: 4px;
    padding-bottom: 4px;
}
.a11y-bar-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.a11y-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.a11y-value {
    min-width: 46px;
    text-align: center;
}
.a11y-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4em;
    min-width: 32px;
    min-height: 32px;
    padding: 2px 10px;
    border: 2px solid #001430;
    border-radius: 8px;
    background: transparent;
    color: #001430;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}
.a11y-btn:hover {
    background: #001430;
    color: #fff;
    text-decoration: none;
}
.a11y-btn[aria-pressed="true"] {
    background: #001430;
    color: #fff;
}
.a11y-btn[aria-disabled="true"] {
    opacity: .5;
    cursor: not-allowed;
}
.a11y-logos {
    gap: 8px;
    margin-left: 8px;
}
.a11y-btn[aria-disabled="true"]:hover {
    background: transparent;
    color: #001430;
}
@media screen and (max-width: 575px) {
    .a11y-bar .container {
        justify-content: center !important;
    }
}

/* Strony podrzędne bez baneru */
body.page-plain {
    padding-top: 0;
}
body.page-plain > header {
    position: static;
    box-shadow: none;
    background-color: var(--bg-dark);
}
body.school-landing > header {
    z-index: 5;
}
body.school-landing > main > section.banner.bigger {
    min-height: 100vh;
    min-height: 100dvh;
}
body.school-landing > header .a11y-bar {
    background: #fff;
}

/* Podkreślenie linków (opcja użytkownika) */
html.a11y-underline a,
html.a11y-underline a:hover,
html.a11y-underline a:focus {
    text-decoration: underline !important;
    text-underline-offset: .15em;
}

/* Wysoki kontrast */
html.a11y-contrast,
html.a11y-contrast body {
    background: #000 !important;
    color: #fff !important;
}
html.a11y-contrast *,
html.a11y-contrast *::before,
html.a11y-contrast *::after {
    text-shadow: none !important;
}
html.a11y-contrast header,
html.a11y-contrast .a11y-bar,
html.a11y-contrast footer,
html.a11y-contrast main,
html.a11y-contrast section {
    background: #000 !important;
    color: #fff !important;
    box-shadow: none !important;
}
html.a11y-contrast section.banner {
    background-image: none !important;
}
html.a11y-contrast section.banner::before,
html.a11y-contrast section.banner::after,
html.a11y-contrast .image-banner::before {
    display: none;
}
html.a11y-contrast a,
html.a11y-contrast a:hover,
html.a11y-contrast a *,
html.a11y-contrast footer a,
html.a11y-contrast footer .nav-link,
html.a11y-contrast .text-primary {
    color: #ff0 !important;
    text-decoration: underline !important;
}
html.a11y-contrast .btn,
html.a11y-contrast .btn:hover {
    background: #000 !important;
    border: 3px solid #ff0 !important;
    color: #ff0 !important;
    box-shadow: none !important;
}
html.a11y-contrast .btn:hover {
    background: #ff0 !important;
}
html.a11y-contrast .btn:hover,
html.a11y-contrast .btn:hover * {
    color: #000 !important;
}
html.a11y-contrast .a11y-btn,
html.a11y-contrast .a11y-btn:hover {
    border-color: #ff0 !important;
    color: #ff0 !important;
    background: #000 !important;
}
html.a11y-contrast .a11y-btn:hover,
html.a11y-contrast .a11y-btn[aria-pressed="true"] {
    background: #ff0 !important;
    color: #000 !important;
}
html.a11y-contrast .a11y-btn:hover *,
html.a11y-contrast .a11y-btn[aria-pressed="true"] * {
    color: #000 !important;
}
html.a11y-contrast .border-top,
html.a11y-contrast footer .border-top {
    border-color: #ff0 !important;
}
html.a11y-contrast .skip-link {
    background: #ff0;
    color: #000 !important;
}
html.a11y-contrast .a11y-logos img {
    background: #fff;
    padding: 2px 4px;
    border-radius: 4px;
}
html.a11y-contrast .icon-bip {
    filter: invert(1);
}
html.a11y-contrast :focus-visible {
    outline-color: #0ff !important;
    box-shadow: 0 0 0 6px #000 !important;
}
