/**
 * @file
 * Style dla wysokiego kontrastu zgodnie z WCAG 2.1
 * Bazowane na: https://www.webimpuls.pl/wpis/20,wysoki-kontrast-dla-wcag-2-1
 */

/* ===================================================================
   PODSTAWOWY SZABLON: Czarne tło + Żółty tekst (zalecany dla WCAG)
   =================================================================== */

body.high-contrast {
    /* Podstawowa kolorystyka */
    background-color: #000000 !important;
    color: #FFFF00 !important;

    /* Usuń obrazy w tle */
    background-image: none !important;

    /* Uproszczenie układu */
    font-family: Arial, Helvetica, sans-serif !important;
    line-height: 1.6 !important;
}

/* Wszystkie elementy - reset tła i kolorów */
body.high-contrast *,
body.high-contrast *::before,
body.high-contrast *::after {
    background-image: none !important;
    background-color: transparent !important;
    color: inherit !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

/* Elementy blokowe i kontenery */
body.high-contrast div,
body.high-contrast section,
body.high-contrast article,
body.high-contrast aside,
body.high-contrast nav,
body.high-contrast header,
body.high-contrast footer,
body.high-contrast main {
    background-color: #000000 !important;
    color: #FFFF00 !important;
    border-color: #FFFF00 !important;
}

/* ===================================================================
   NAGŁÓWKI
   =================================================================== */

body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast h4,
body.high-contrast h5,
body.high-contrast h6 {
    color: #FFFF00 !important;
    background-color: transparent !important;
    font-weight: bold !important;
    margin-top: 1.5em !important;
    margin-bottom: 0.75em !important;
}

/* ===================================================================
   LINKI I NAWIGACJA
   =================================================================== */

/* Wszystkie linki muszą być podkreślone */
body.high-contrast a,
body.high-contrast a *,
body.high-contrast .button,
body.high-contrast button a,
body.high-contrast h1 a,
body.high-contrast h2 a,
body.high-contrast h3 a,
body.high-contrast h4 a,
body.high-contrast h5 a,
body.high-contrast h6 a,
body.high-contrast p a {
    color: #FFFF00 !important;
    background-color: transparent !important;
    text-decoration: underline !important;
    border: 2px solid #FFFF00 !important;
    padding: 0.25em 0.5em !important;
    display: inline-block !important;
    margin: 0.25em !important;
    font-weight: bold !important;
}

/* Wyłączenie efektów hover - mogą uniemożliwić odczytanie */
body.high-contrast a:hover,
body.high-contrast a:focus,
body.high-contrast button:hover,
body.high-contrast button:focus,
body.high-contrast .button:hover,
body.high-contrast .button:focus {
    color: #000000 !important;
    background-color: #FFFF00 !important;
    text-decoration: underline !important;
    outline: 3px solid #FFFF00 !important;
}

/* Przyciski */
body.high-contrast button,
body.high-contrast input[type="submit"],
body.high-contrast input[type="button"],
body.high-contrast input[type="reset"],
body.high-contrast .button {
    background-color: #000000 !important;
    color: #FFFF00 !important;
    border: 2px solid #FFFF00 !important;
    padding: 0.5em 1em !important;
    margin: 0.5em !important;
    font-weight: bold !important;
    cursor: pointer !important;
    /* Usuń gradienty i ozdobniki */
    background-image: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    border-radius: 0 !important;
}

/* Menu nawigacyjne */
body.high-contrast nav ul,
body.high-contrast nav ol {
    list-style: none !important;
    padding: 0 !important;
    margin: 1em 0 !important;
}

body.high-contrast nav li {
    margin: 0.75em 0 !important;
    padding: 0.5em !important;
    border-bottom: 1px solid #FFFF00 !important;
}

/* ===================================================================
   FORMULARZE
   =================================================================== */

body.high-contrast input,
body.high-contrast textarea,
body.high-contrast select {
    background-color: #000000 !important;
    color: #FFFF00 !important;
    border: 2px solid #FFFF00 !important;
    padding: 0.5em !important;
    margin: 0.25em 0 !important;
    font-size: 1em !important;
}

body.high-contrast input:focus,
body.high-contrast textarea:focus,
body.high-contrast select:focus {
    outline: 3px solid #FFFF00 !important;
    outline-offset: 2px !important;
}

body.high-contrast label {
    color: #FFFF00 !important;
    font-weight: bold !important;
    display: block !important;
    margin-top: 1em !important;
    margin-bottom: 0.25em !important;
}

/* ===================================================================
   OBRAZY I MULTIMEDIA
   =================================================================== */

/* Grafiki ozdobne i tła - ukryj */
body.high-contrast .secondary,
body.high-contrast .banner,
body.high-contrast .advertisement,
body.high-contrast .decorative,
body.high-contrast [role="presentation"] {
    display: none !important;
}

/* Obrazy treściowe - filtr sepia dla lepszej harmonii z żółtym */
body.high-contrast img:not([alt=""]):not([role="presentation"]) {
    filter: sepia(100%) !important;
    border: 2px solid #FFFF00 !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 1em 0 !important;
}

/* Całkowite ukrycie ikon i grafik dekoracyjnych */
body.high-contrast .icon,
body.high-contrast .logo-icon,
body.high-contrast [class*="icon-"],
body.high-contrast svg:not([role="img"]) {
    display: none !important;
}

/* ===================================================================
   TABELE
   =================================================================== */

body.high-contrast table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 1.5em 0 !important;
    background-color: #000000 !important;
}

body.high-contrast th,
body.high-contrast td {
    border: 2px solid #FFFF00 !important;
    padding: 0.75em !important;
    text-align: left !important;
    color: #FFFF00 !important;
    background-color: #000000 !important;
}

body.high-contrast th {
    font-weight: bold !important;
    background-color: #1a1a1a !important;
}

body.high-contrast tr:nth-child(even) td {
    background-color: #0d0d0d !important;
}

/* ===================================================================
   LISTY
   =================================================================== */

body.high-contrast ul,
body.high-contrast ol {
    margin: 1em 0 !important;
    padding-left: 2em !important;
    color: #FFFF00 !important;
}

body.high-contrast li {
    margin: 0.5em 0 !important;
    color: #FFFF00 !important;
}

/* ===================================================================
   CYTATY I BLOKI TEKSTOWE
   =================================================================== */

body.high-contrast blockquote,
body.high-contrast q {
    border-left: 4px solid #FFFF00 !important;
    padding-left: 1em !important;
    margin: 1.5em 0 !important;
    font-style: italic !important;
    color: #FFFF00 !important;
}

body.high-contrast pre,
body.high-contrast code {
    background-color: #1a1a1a !important;
    color: #FFFF00 !important;
    border: 1px solid #FFFF00 !important;
    padding: 0.5em !important;
    font-family: monospace !important;
    overflow-x: auto !important;
}

/* ===================================================================
   SEPARATORY I LINIE
   =================================================================== */

body.high-contrast hr {
    border: 0 !important;
    border-top: 2px solid #FFFF00 !important;
    margin: 2em 0 !important;
}

/* ===================================================================
   UKŁAD I ODSTĘPY
   =================================================================== */

/* Większe marginesy między sekcjami */
body.high-contrast section,
body.high-contrast article {
    margin: 2em 0 !important;
    padding: 1.5em !important;
    border: 2px solid #FFFF00 !important;
}

/* Linie odseparowujące sekcje */
body.high-contrast section+section::before,
body.high-contrast article+article::before {
    content: '' !important;
    display: block !important;
    border-top: 3px solid #FFFF00 !important;
    margin: 2em 0 !important;
}

/* Ukryj elementy boczne na bardzo rozbudowanych portalach */
body.high-contrast aside:not(.main-content aside),
body.high-contrast .sidebar,
body.high-contrast .widget:not(.essential) {
    display: none !important;
}

/* ===================================================================
   BREADCRUMB (Ścieżka nawigacji)
   =================================================================== */

body.high-contrast .breadcrumb,
body.high-contrast nav.breadcrumb,
body.high-contrast [aria-label="breadcrumb"] {
    margin: 1em 0 !important;
    padding: 0.75em !important;
    border: 1px solid #FFFF00 !important;
}

body.high-contrast .breadcrumb a {
    margin: 0 0.5em !important;
}

/* ===================================================================
   FOCUS I DOSTĘPNOŚĆ KLAWIATURY
   =================================================================== */

body.high-contrast *:focus {
    outline: 3px solid #FFFF00 !important;
    outline-offset: 3px !important;
}

/* ===================================================================
   WARIANTY WYSOKIEGO KONTRASTU (opcjonalne)
   =================================================================== */

/* WARIANT 2: Czarne tło + Białe napisy */
body.high-contrast.contrast-white {
    background-color: #000000 !important;
    color: #FFFFFF !important;
}

body.high-contrast.contrast-white *,
body.high-contrast.contrast-white h1,
body.high-contrast.contrast-white h2,
body.high-contrast.contrast-white h3,
body.high-contrast.contrast-white h4,
body.high-contrast.contrast-white h5,
body.high-contrast.contrast-white h6,
body.high-contrast.contrast-white a,
body.high-contrast.contrast-white p,
body.high-contrast.contrast-white span,
body.high-contrast.contrast-white li,
body.high-contrast.contrast-white td,
body.high-contrast.contrast-white th {
    color: #FFFFFF !important;
    border-color: #FFFFFF !important;
}

body.high-contrast.contrast-white img:not([alt=""]):not([role="presentation"]) {
    filter: grayscale(100%) contrast(1.5) !important;
}

/* WARIANT 3: Białe tło + Czarne napisy (odwrócona kolorystyka) */
body.high-contrast.contrast-inverted {
    background-color: #FFFFFF !important;
    color: #000000 !important;
}

body.high-contrast.contrast-inverted *,
body.high-contrast.contrast-inverted h1,
body.high-contrast.contrast-inverted h2,
body.high-contrast.contrast-inverted h3,
body.high-contrast.contrast-inverted h4,
body.high-contrast.contrast-inverted h5,
body.high-contrast.contrast-inverted h6,
body.high-contrast.contrast-inverted a,
body.high-contrast.contrast-inverted p,
body.high-contrast.contrast-inverted span,
body.high-contrast.contrast-inverted li {
    color: #000000 !important;
    border-color: #000000 !important;
}

body.high-contrast.contrast-inverted div,
body.high-contrast.contrast-inverted section,
body.high-contrast.contrast-inverted article,
body.high-contrast.contrast-inverted aside,
body.high-contrast.contrast-inverted nav,
body.high-contrast.contrast-inverted header,
body.high-contrast.contrast-inverted footer,
body.high-contrast.contrast-inverted main {
    background-color: #FFFFFF !important;
}

body.high-contrast.contrast-inverted input,
body.high-contrast.contrast-inverted textarea,
body.high-contrast.contrast-inverted select,
body.high-contrast.contrast-inverted button {
    background-color: #FFFFFF !important;
    color: #000000 !important;
    border-color: #000000 !important;
}

body.high-contrast.contrast-inverted a:hover,
body.high-contrast.contrast-inverted button:hover {
    background-color: #000000 !important;
    color: #FFFFFF !important;
}

body.high-contrast.contrast-inverted img:not([alt=""]):not([role="presentation"]) {
    filter: grayscale(100%) contrast(1.3) !important;
}

/* ===================================================================
   MEDIA QUERIES - Responsywność
   =================================================================== */

/* Na urządzeniach mobilnych - jeszcze większe uproszczenie */
@media (max-width: 768px) {
    body.high-contrast {
        font-size: 110% !important;
    }

    body.high-contrast section,
    body.high-contrast article {
        padding: 1em !important;
        margin: 1em 0 !important;
    }

    body.high-contrast nav li {
        display: block !important;
        width: 100% !important;
    }
}

/* ===================================================================
   DRUKOWANIE
   =================================================================== */

@media print {
    body.high-contrast {
        background-color: #FFFFFF !important;
        color: #000000 !important;
    }

    body.high-contrast * {
        background-color: transparent !important;
        color: #000000 !important;
        border-color: #000000 !important;
    }
}

/* ===================================================================
   DODATKOWE OPTYMALIZACJE
   =================================================================== */

/* Ukryj wszystkie animacje i przejścia */
body.high-contrast *,
body.high-contrast *::before,
body.high-contrast *::after {
    animation: none !important;
    transition: none !important;
}

/* Wymuszenie jednolitych marginesów */
body.high-contrast p {
    margin: 1em 0 !important;
    line-height: 1.6 !important;
}

/* Wyraźne oddzielenie stopki */
body.high-contrast footer {
    margin-top: 3em !important;
    padding-top: 2em !important;
    border-top: 3px solid #FFFF00 !important;
}

/* Zapewnienie czytelności tekstów alternatywnych */
body.high-contrast [aria-label],
body.high-contrast [title] {
    position: relative !important;
}

/* Ukrycie zbędnych elementów dekoracyjnych */
body.high-contrast .watermark,
body.high-contrast .background-image,
body.high-contrast .decoration {
    display: none !important;
}