/* Globalne podstawy dostępności */
.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 10000;
    transform: translateY(-160%);
    padding: 11px 16px;
    border: 3px solid #ffffff;
    border-radius: 10px;
    background: #06243d;
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
    transition: transform .15s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

:focus-visible {
    outline: 3px solid #ff7a12 !important;
    outline-offset: 3px !important;
}

html.a11y-strong-focus :focus-visible {
    outline: 5px solid #ffeb3b !important;
    outline-offset: 4px !important;
    box-shadow: 0 0 0 7px #111 !important;
}

html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

html[data-a11y-font="-1"] body { font-size: 92%; }
html[data-a11y-font="1"] body { font-size: 112%; }
html[data-a11y-font="2"] body { font-size: 125%; }

html[data-a11y-font="1"] :is(input, select, textarea, button),
html[data-a11y-font="2"] :is(input, select, textarea, button) {
    font-size: 1em;
}

html.a11y-readable-font body,
html.a11y-readable-font input,
html.a11y-readable-font button,
html.a11y-readable-font select,
html.a11y-readable-font textarea {
    font-family: Arial, Verdana, Tahoma, sans-serif !important;
}

html.a11y-underline-links a:not(.btn):not(.a11y-toggle) {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px !important;
}

html.a11y-line-spacing body,
html.a11y-line-spacing p,
html.a11y-line-spacing li,
html.a11y-line-spacing label,
html.a11y-line-spacing td,
html.a11y-line-spacing th {
    line-height: 1.9 !important;
}

html.a11y-letter-spacing body,
html.a11y-letter-spacing input,
html.a11y-letter-spacing button,
html.a11y-letter-spacing select,
html.a11y-letter-spacing textarea {
    letter-spacing: .08em !important;
    word-spacing: .12em !important;
}

html.a11y-highlight-headings h1,
html.a11y-highlight-headings h2,
html.a11y-highlight-headings h3,
html.a11y-highlight-headings h4,
html.a11y-highlight-headings h5,
html.a11y-highlight-headings h6 {
    background: #fff59d !important;
    color: #111111 !important;
    outline: 2px solid #111111 !important;
    padding: .14em .24em !important;
}

html.a11y-grayscale body {
    filter: grayscale(1) !important;
}

html.a11y-high-contrast body,
html.a11y-high-contrast main,
html.a11y-high-contrast section,
html.a11y-high-contrast article,
html.a11y-high-contrast aside,
html.a11y-high-contrast header,
html.a11y-high-contrast footer,
html.a11y-high-contrast nav,
html.a11y-high-contrast div:not(.a11y-widget):not(.a11y-panel):not(.a11y-panel *) {
    background-color: #000000 !important;
    background-image: none !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

html.a11y-high-contrast :is(h1,h2,h3,h4,h5,h6,p,span,small,strong,li,dt,dd,label,td,th) {
    color: #ffffff !important;
}

html.a11y-high-contrast a {
    color: #ffeb3b !important;
    text-decoration: underline !important;
}

html.a11y-high-contrast :is(input,select,textarea,button) {
    border: 2px solid #ffffff !important;
    background: #000000 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

html.a11y-high-contrast img {
    outline: 2px solid #ffffff;
}

html.a11y-large-cursor,
html.a11y-large-cursor body,
html.a11y-large-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M3 2v29l8-8 6 14 6-3-6-13h12z' fill='white' stroke='black' stroke-width='2'/%3E%3C/svg%3E") 3 2, auto !important;
}

html.a11y-large-cursor a,
html.a11y-large-cursor button,
html.a11y-large-cursor [role="button"] {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M12 37V19c0-2 3-3 4-1v-9c0-3 4-3 4 0v8-11c0-3 4-3 4 0v11-8c0-3 4-3 4 0v11-5c0-3 4-3 4 0v12c0 7-5 10-10 10z' fill='white' stroke='black' stroke-width='2'/%3E%3C/svg%3E") 12 4, pointer !important;
}

/* Panel dostępności */
.a11y-widget {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9998;
    font-size: 16px !important;
    line-height: 1.4 !important;
    letter-spacing: normal !important;
    filter: none !important;
}

.a11y-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 10px 15px;
    border: 2px solid #ffffff;
    border-radius: 14px;
    background: #0a2f4d;
    color: #ffffff;
    box-shadow: 0 8px 28px rgba(6, 36, 61, .28);
    font: 800 14px/1.2 Arial, sans-serif !important;
    cursor: pointer;
}

.a11y-toggle-icon {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 50%;
    background: #ff7a12;
    color: #ffffff;
}

.a11y-panel {
    position: absolute;
    right: 0;
    bottom: 60px;
    width: min(390px, calc(100vw - 28px));
    max-height: min(720px, calc(100vh - 100px));
    overflow-y: auto;
    border: 1px solid #cbd8e3;
    border-radius: 18px;
    background: #ffffff !important;
    color: #172536 !important;
    box-shadow: 0 20px 60px rgba(6, 36, 61, .28);
    filter: none !important;
}

.a11y-panel[hidden] { display: none !important; }

.a11y-panel-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 18px;
    border-bottom: 1px solid #dbe4ec;
    background: #ffffff !important;
    color: #172536 !important;
}

.a11y-panel-kicker {
    color: #f0640a !important;
    font: 900 11px/1.2 Arial, sans-serif !important;
    letter-spacing: .12em !important;
}

.a11y-panel h2 {
    margin: 4px 0 0 !important;
    padding: 0 !important;
    background: transparent !important;
    outline: 0 !important;
    color: #06243d !important;
    font: 900 24px/1.1 Arial, sans-serif !important;
    letter-spacing: normal !important;
}

.a11y-close {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid #cbd8e3 !important;
    border-radius: 10px;
    background: #f7fafc !important;
    color: #06243d !important;
    font: 700 26px/1 Arial, sans-serif !important;
}

.a11y-panel-content {
    padding: 16px;
    background: #ffffff !important;
    color: #172536 !important;
}

.a11y-control-group + .a11y-control-group {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e4ebf1;
}

.a11y-control-group h3 {
    margin: 0 0 10px !important;
    padding: 0 !important;
    background: transparent !important;
    outline: 0 !important;
    color: #17364e !important;
    font: 800 14px/1.2 Arial, sans-serif !important;
    letter-spacing: normal !important;
}

.a11y-control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.a11y-control-grid-3 { grid-template-columns: repeat(3, 1fr); }

.a11y-control-grid button,
.a11y-reset {
    min-height: 45px;
    padding: 8px 10px;
    border: 1px solid #cbd8e3 !important;
    border-radius: 11px;
    background: #f7fafc !important;
    color: #17364e !important;
    box-shadow: none !important;
    font: 700 13px/1.25 Arial, sans-serif !important;
    letter-spacing: normal !important;
    text-align: center;
}

.a11y-control-grid button:hover,
.a11y-control-grid button.is-active,
.a11y-control-grid button[aria-pressed="true"] {
    border-color: #f0640a !important;
    background: #fff0e5 !important;
    color: #8f3a00 !important;
}

.a11y-panel-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e4ebf1;
}

.a11y-panel-actions a {
    display: flex;
    min-height: 45px;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border: 1px solid #0a2f4d;
    border-radius: 11px;
    background: #0a2f4d !important;
    color: #ffffff !important;
    font: 700 13px/1.25 Arial, sans-serif !important;
    text-decoration: none !important;
}

.a11y-panel-note {
    margin: 13px 0 0 !important;
    color: #66788b !important;
    font: 400 12px/1.5 Arial, sans-serif !important;
    letter-spacing: normal !important;
}

.accessibility-declaration {
    max-width: 920px;
    margin-inline: auto;
}

.accessibility-declaration h1 { margin-bottom: 18px; }
.accessibility-declaration h2 { margin-top: 38px; }
.accessibility-declaration h3 { margin-top: 26px; }
.accessibility-declaration li { margin-bottom: 8px; }
.accessibility-declaration .declaration-meta {
    padding: 18px;
    border-left: 4px solid #f0640a;
    border-radius: 10px;
    background: #f7fafc;
}
.accessibility-declaration .declaration-warning {
    padding: 16px;
    border: 1px solid #f2c76f;
    border-radius: 12px;
    background: #fff8e1;
    color: #6d4c00;
}

@media (max-width: 640px) {
    .a11y-widget { right: 10px; bottom: 10px; }
    .a11y-toggle-text { display: none; }
    .a11y-panel { width: calc(100vw - 20px); bottom: 58px; }
    .a11y-control-grid { grid-template-columns: 1fr; }
    .a11y-control-grid-3 { grid-template-columns: repeat(3, 1fr); }
    .a11y-panel-actions { grid-template-columns: 1fr; }
}

@media print {
    .a11y-widget,
    .skip-link { display: none !important; }
}

/* Dodatkowe skalowanie tekstów z rozmiarem ustawionym w px w starszych widokach. */
html[data-a11y-font="1"] :is(p, li, dt, dd, label, td, th, input, select, textarea, button, .help),
html[data-a11y-font="1"] :is(h1, h2, h3, h4, h5, h6) {
    font-size: 1.08em !important;
}

html[data-a11y-font="2"] :is(p, li, dt, dd, label, td, th, input, select, textarea, button, .help),
html[data-a11y-font="2"] :is(h1, h2, h3, h4, h5, h6) {
    font-size: 1.16em !important;
}

html[data-a11y-font="-1"] :is(p, li, dt, dd, label, td, th, input, select, textarea, button, .help) {
    font-size: .94em !important;
}

/* ========================================================================
   WCAG / WAVE — poprawki kontrastu, czytelności i obsługi klawiatury
   2026-08-19
   Ładowane po app.css, więc nadpisują paletę bez przebudowy Vite.
   ======================================================================== */

:root {
    /*
     * Kolory tekstowe i akcentowe dobrane tak, by zwykły tekst osiągał
     * co najmniej 4.5:1 na bieli i jasnych tłach używanych w serwisie.
     */
    --orange-500: #b94b00;
    --orange-600: #a94300;
    --blue-600: #0f5ca8;
    --green-600: #117a46;
    --muted: #52667a;
    --line-strong: #7c91a5;
}

/* Tekst na jasnym tle — jasny pomarańczowy był za słaby. */
.section .eyebrow,
.page-hero .eyebrow,
.panel-main .eyebrow,
.panel-kicker,
.a11y-panel-kicker {
    color: #a94300 !important;
}

/* W hero jasny pomarańczowy zostaje, ponieważ ma bardzo dobry kontrast
   na granatowym tle. */
.hero .eyebrow {
    color: #ffb36e !important;
}

/* Pomarańczowe i niebieskie etykiety/badge. */
.course-badge {
    color: #0f5ca8 !important;
    background: #eaf4ff !important;
}

.trust-icon {
    color: #a94300 !important;
    background: #fff0e5 !important;
}

/* Przycisk dostępności: biały symbol na ciemniejszym pomarańczowym. */
.a11y-toggle-icon {
    background: #a94300 !important;
    color: #ffffff !important;
}

/* Przyciski główne — biały tekst musi mieć min. 4.5:1. */
.btn-primary {
    color: #ffffff !important;
    background: linear-gradient(135deg, #b94b00, #a94300) !important;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    color: #ffffff !important;
    background: #963b00 !important;
}

.btn-admin {
    color: #a94300 !important;
    background: #fff0e5 !important;
    border-color: #b47a51 !important;
}

/* Teksty pomocnicze na białym i jasnoniebieskim tle. */
.section-heading p,
.course-card p,
.post-meta,
.help,
.brand-copy small,
.dashboard-stat-card small,
.admin-stat-card small,
.quick-actions-card small,
.dashboard-card-heading small,
.dashboard-empty-state p,
.material-list-copy p,
.admin-alert-strip a,
.audit-user small,
.audit-action small,
.audit-row time,
.moderation-row small,
.moderation-row span,
.enquiry-row span:not(.avatar):not(.status),
.enquiry-row small,
.enquiry-summary {
    color: #52667a !important;
}

/* Zielone statusy/liczniki na jasnym tle. */
.status-success,
.status-completed,
.status-submitted,
.text-success,
.admin-stat-card .success,
.dashboard-stat-card .success {
    color: #117a46 !important;
}

/* Awatary z białym tekstem — wcześniejsze pomarańczowy/zielony/żółty
   miały zbyt mały kontrast. */
.avatar-2 { background: #a94300 !important; }
.avatar-4 { background: #117a46 !important; }
.avatar-5 { background: #7a5a00 !important; }

/* Minimalny rozmiar drobnego tekstu. WAVE wskazywał Very small text. */
.course-badge,
.status,
.panel-sidebar-eyebrow,
.panel-kicker,
.dashboard-stat-card small,
.admin-stat-card small,
.quick-actions-card small,
.dashboard-card-heading small,
.dashboard-card-heading a,
.dashboard-empty-state p,
.material-list-copy p,
th,
.admin-alert-strip a,
.audit-user strong,
.audit-action strong,
.audit-user small,
.audit-action small,
.audit-row time,
.moderation-row small,
.moderation-row strong,
.moderation-row span,
.enquiry-row strong,
.enquiry-row span:not(.avatar):not(.status),
.enquiry-row small,
.enquiry-summary,
.footer-brand p,
.footer-motto,
.site-footer a,
.site-footer p,
.footer-bottom {
    font-size: 12px !important;
}

.brand-copy small {
    font-size: 13px !important;
}

/* Pola formularzy i kontrolki muszą być wyraźnie odróżnialne od tła. */
input,
select,
textarea,
.header-icon-button,
.header-menu-button,
.btn-light,
.icon-action,
.a11y-close,
.a11y-control-grid button,
.a11y-reset {
    border-color: #7c91a5 !important;
}

input::placeholder,
textarea::placeholder {
    color: #52667a !important;
    opacity: 1 !important;
}

/* Fokus klawiatury: ciemny obrys jest wyraźny na białych i jasnych tłach. */
:focus-visible {
    outline: 3px solid #0a2f4d !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px #ffd09c !important;
}

/* Linki w treści nie mogą być rozpoznawalne wyłącznie kolorem. */
#main-content p a:not(.btn),
#main-content li a:not(.btn),
.accessibility-declaration a:not(.btn) {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

/* Czytelność przy powiększaniu tekstu i odstępów. */
p,
li,
label,
td,
th,
a,
button {
    overflow-wrap: anywhere;
}

/* Użytkownicy systemowego trybu wysokiego kontrastu. */
@media (forced-colors: active) {
    .btn,
    .a11y-toggle,
    .a11y-control-grid button,
    input,
    select,
    textarea {
        border: 2px solid ButtonText !important;
        forced-color-adjust: auto;
    }

    :focus-visible {
        outline: 3px solid Highlight !important;
        box-shadow: none !important;
    }
}

/* ========================================================================
   WAVE HARD FIX v2 — wymuszenie konkretnych stylów + odporność na Vite
   ======================================================================== */

/* 1. Cztery kafle paska korzyści */
body .trust-strip .trust-grid .trust-item .trust-icon,
body .trust-item .trust-icon {
    color: #873700 !important;
    background: #fff1e6 !important;
    border: 1px solid #b47a51 !important;
}

/* 2. Etykiety sekcji, np. OFERTA / WIEDZA / SPOŁECZNOŚĆ */
body #main-content .section .section-heading .eyebrow,
body #main-content .section .eyebrow,
body #main-content .page-hero .eyebrow,
body #main-content .panel-kicker {
    color: #873700 !important;
    background: transparent !important;
    font-size: 12px !important;
}

/* Etykieta w ciemnym hero zachowuje jasny wariant o wysokim kontraście. */
body #main-content .hero .eyebrow {
    color: #ffcf9f !important;
}

/* 3. Badge ONLINE / HYBRYDOWE */
body #main-content .course-card .course-badge,
body #main-content .course-badge {
    color: #0b4f8a !important;
    background: #eaf4ff !important;
    border: 1px solid #7fa5c7 !important;
    font-size: 12px !important;
}

/* 4. Przycisk dostępności — pomarańczowa ikonka miała słaby kontrast. */
body .a11y-widget .a11y-toggle-icon {
    color: #ffffff !important;
    background: #873700 !important;
    border: 1px solid #ffffff !important;
}

body .a11y-widget .a11y-toggle {
    color: #ffffff !important;
    background: #082f4d !important;
    border-color: #ffffff !important;
}

/* 5. Pomarańczowe przyciski i aktywne linki na jasnym tle. */
body .btn-primary,
body a.btn-primary,
body button.btn-primary {
    color: #ffffff !important;
    background: #a94300 !important;
    background-image: none !important;
    border: 1px solid #873700 !important;
}

body .btn-primary:hover,
body .btn-primary:focus-visible {
    color: #ffffff !important;
    background: #873700 !important;
}

body .main-nav a:hover,
body .main-nav a.active,
body .btn-admin {
    color: #873700 !important;
    background: #fff1e6 !important;
}

/* 6. Szare teksty opisowe — minimum 4.5:1 na bieli i jasnych tłach. */
body .section-heading p,
body .course-card p,
body .post-card p,
body .post-meta,
body .brand-copy small,
body .help,
body .page-hero p,
body .card small,
body .card .muted,
body [class*="-meta"],
body [class*="-hint"] {
    color: #4c6175 !important;
}

/* 7. WAVE "Very small text" — nie dotykamy .sr-only, aby nie zepsuć tekstów ukrytych. */
body small:not(.sr-only),
body .footer-bottom,
body .footer-brand p,
body .footer-motto,
body .site-footer a,
body .site-footer p,
body .course-badge,
body .status,
body .eyebrow,
body .panel-kicker,
body .panel-sidebar-eyebrow,
body th {
    font-size: 12px !important;
    line-height: 1.4 !important;
}

/* 8. Obramowania i fokus — kontrast elementów nietekstowych. */
body input,
body select,
body textarea,
body .btn-light,
body .header-icon-button,
body .header-menu-button,
body .icon-action {
    border-color: #71879b !important;
}

body :focus-visible {
    outline: 3px solid #06243d !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px #ffd09c !important;
}

/* 9. Panel dostępności — pozostałe pomarańczowe elementy. */
body .a11y-panel-kicker {
    color: #873700 !important;
    font-size: 12px !important;
}

body .a11y-control-grid button:hover,
body .a11y-control-grid button.is-active,
body .a11y-control-grid button[aria-pressed="true"] {
    border-color: #873700 !important;
    color: #713000 !important;
    background: #fff1e6 !important;
}

body .a11y-panel-note {
    color: #4c6175 !important;
    font-size: 12px !important;
}

/* 10. Stopka */
body .site-footer {
    color: #dce8f1 !important;
}

body .site-footer a,
body .site-footer p,
body .footer-bottom {
    color: #dce8f1 !important;
}

body .footer-motto span {
    color: #ffcf9f !important;
}
