/*
 * Sferahost - poprawki dostępności (WCAG 2.2 AA).
 *
 * Arkusz Tailwinda (style.css) jest skompilowany i przycięty do użytych klas,
 * dlatego reguły dostępności, które mają działać na całej stronie, są tutaj.
 * Ładowany po style.css (functions.php, uchwyt sferahost-a11y).
 */

/* Link "Przejdź do treści": niewidoczny, pokazuje się po najechaniu klawiaturą. */
.sfera-skip{position:absolute;left:1rem;top:-6rem;z-index:100000;padding:.75rem 1.25rem;border-radius:.5rem;background:#111827;color:#fff;font-weight:700;font-size:1rem;text-decoration:none}
.sfera-skip:focus{top:1rem}
#tresc{display:block;height:0;overflow:hidden}
#tresc:focus{outline:none!important}

/* Widoczny fokus klawiatury. Część elementów ma w szablonach focus:outline-none,
   dlatego reguła ma !important. Obrys pokazuje się tylko przy klawiaturze (:focus-visible). */
:where(a,button,input,select,textarea,summary,[tabindex]:not([tabindex="-1"]),[role="button"]):focus-visible{
    outline:3px solid #2563eb!important;
    outline-offset:2px!important
}
/* Na niebieskim i ciemnym tle niebieski obrys byłby słabo widoczny. */
:where(.bg-blue-600,.bg-blue-700,.bg-\[\#070816\],#sfera-bw .bw-hero,#sfera-bwb .bwb-card,footer .bg-gray-900) :where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{
    outline-color:#fff!important
}

/* Krawędź pól formularzy: kontrast co najmniej 3:1 z tłem (WCAG 1.4.11).
   Pola z ramką gray-300 dostają ciemniejszą ramkę, pola bez ramki (szare tło) cienki obrys. */
:is(input:not([type=checkbox],[type=radio],[type=hidden],[type=submit],[type=button],[type=range]),select,textarea).border-gray-300{border-color:#858b97}
:is(input:not([type=checkbox],[type=radio],[type=hidden],[type=submit],[type=button],[type=range]),textarea).bg-gray-50:not([class*="border"]){box-shadow:inset 0 0 0 1px #858b97}

/* Tekst zastępczy w polach formularzy: kontrast co najmniej 4,5:1. */
::placeholder{color:#6a7282!important;opacity:1}

/* Osoby, które w systemie wyłączyły animacje, nie dostają ruchu na stronie. */
@media (prefers-reduced-motion:reduce){
    *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}

/* ------------------------------------------------------------------
 * Panel dostępności (template-parts/a11y-panel.php)
 * ---------------------------------------------------------------- */
#sfa{position:fixed;left:1.25rem;bottom:1.25rem;z-index:120;font-size:.875rem;line-height:1.4}
@media (min-width:1280px){#sfa{left:1rem;bottom:1rem}}
#sfa .sfa-toggle{display:inline-flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:.5rem;background:#111827;color:#fff;font-size:1.375rem;cursor:pointer;transition:background-color .15s}
#sfa .sfa-toggle:hover{background:#374151}
#sfa .sfa-panel{position:absolute;left:0;bottom:3.75rem;width:18.5rem;max-width:calc(100vw - 2.5rem);max-height:calc(100vh - 6rem);overflow:auto;padding:1rem;border:1px solid #d1d5dc;border-radius:.5rem;background:#fff;color:#111827;box-shadow:0 10px 30px -10px rgba(0,0,0,.25)}
#sfa .sfa-panel[hidden]{display:none}
#sfa .sfa-head{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.75rem}
#sfa .sfa-title{font-size:1rem;font-weight:800;letter-spacing:-.01em}
#sfa .sfa-close{display:inline-flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;border-radius:.375rem;color:#374151;cursor:pointer}
#sfa .sfa-close:hover{background:#f3f4f6}
#sfa .sfa-label{margin-bottom:.375rem;color:#4a5565;font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em}
#sfa .sfa-sizes{display:grid;grid-template-columns:repeat(4,1fr);gap:.25rem;margin-bottom:.875rem}
#sfa .sfa-size{padding:.5rem 0;border:1px solid #858b97;border-radius:.375rem;font-weight:700;cursor:pointer}
#sfa .sfa-size:hover{background:#f3f4f6}
#sfa .sfa-size[aria-pressed="true"]{border-color:#2563eb;background:#2563eb;color:#fff}
#sfa .sfa-options{display:grid;gap:.25rem}
#sfa .sfa-option{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;padding:.625rem .5rem;border-radius:.375rem;text-align:left;font-weight:600;cursor:pointer}
#sfa .sfa-option:hover{background:#f3f4f6}
#sfa .sfa-switch{position:relative;flex:none;width:2.5rem;height:1.375rem;border:1px solid #858b97;border-radius:9999px;background:#e5e7eb;transition:background-color .15s}
#sfa .sfa-switch::after{content:"";position:absolute;top:.125rem;left:.125rem;width:1rem;height:1rem;border-radius:9999px;background:#fff;box-shadow:0 0 0 1px #858b97;transition:transform .15s}
#sfa .sfa-option[aria-pressed="true"] .sfa-switch{border-color:#2563eb;background:#2563eb}
#sfa .sfa-option[aria-pressed="true"] .sfa-switch::after{transform:translateX(1.125rem);box-shadow:none}
#sfa .sfa-reset{width:100%;margin-top:.75rem;padding:.625rem;border:1px solid #858b97;border-radius:.375rem;font-weight:700;cursor:pointer}
#sfa .sfa-reset:hover{background:#f3f4f6}

/* Wysoki kontrast: biały tekst na czarnym tle, linki na żółto. */
html.sfa-contrast body,
html.sfa-contrast body *:not(img):not(svg):not(svg *):not(video):not(canvas):not(iframe){
    background-color:#000!important;background-image:none!important;color:#fff!important;
    border-color:#fff!important;box-shadow:none!important;text-shadow:none!important
}
html.sfa-contrast body a,html.sfa-contrast body a *{color:#ff0!important}
html.sfa-contrast body button,html.sfa-contrast body input,html.sfa-contrast body select,html.sfa-contrast body textarea{border:1px solid #fff!important}
html.sfa-contrast body svg{color:#fff}
html.sfa-contrast header img,html.sfa-contrast footer img{filter:invert(1) hue-rotate(180deg)}
html.sfa-contrast ::placeholder{color:#d1d5dc!important}
html.sfa-contrast #sfa .sfa-size[aria-pressed="true"],html.sfa-contrast #sfa .sfa-option[aria-pressed="true"]{outline:2px solid #ff0!important;outline-offset:-2px}
html.sfa-contrast #sfa .sfa-option[aria-pressed="true"] .sfa-switch::after{background:#ff0}
html.sfa-contrast :where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline-color:#ff0!important}

/* Podkreślone linki. */
html.sfa-links body a{text-decoration:underline!important;text-underline-offset:3px!important}
html.sfa-links #sfa a{text-decoration:none!important}

/* Większe odstępy w tekście (WCAG 1.4.12). */
html.sfa-spacing body :is(p,li,dd,dt,td,th,blockquote,label,a,span,h1,h2,h3,h4,h5,h6){line-height:1.75!important;letter-spacing:.06em!important;word-spacing:.16em!important}
html.sfa-spacing body p{margin-bottom:1em}
html.sfa-spacing #sfa *{letter-spacing:normal!important;word-spacing:normal!important}

/* Wyłączone animacje (tak samo jak przy systemowym ograniczeniu ruchu). */
html.sfa-motion *,html.sfa-motion *::before,html.sfa-motion *::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}

/* ------------------------------------------------------------------
 * Przełącznik języka z flagami (inc/i18n.php, sferahost_language_switcher)
 * Telefon: tylko flaga drugiego języka. Od 640 px: obie flagi, bieżąca wyróżniona.
 * ---------------------------------------------------------------- */
.sfl{display:inline-flex;align-items:center}
.sfl-item{display:inline-flex;align-items:center;justify-content:center;width:2.75rem;height:2.75rem;border-radius:.5rem;color:#111827;font-size:.875rem;font-weight:600;transition:background-color .15s}
.sfl-item:hover{background:#f3f4f6}
.sfl-item.is-current{display:none}
.sfl-flag{display:block;width:1.375rem;height:.9375rem;border-radius:2px;box-shadow:0 0 0 1px rgba(17,24,39,.18)}
@media (min-width:640px){
    .sfl{gap:2px;margin-right:.25rem;padding:3px;border-radius:.625rem;background:#f3f4f6}
    .sfl-item,.sfl-item.is-current{display:inline-flex;width:2.25rem;height:2.25rem;border-radius:.4375rem}
    .sfl-item:hover{background:#e5e7eb}
    .sfl-item.is-current{background:#fff;box-shadow:0 1px 2px rgba(17,24,39,.12),0 0 0 1px rgba(17,24,39,.06);cursor:default}
}
html.sfa-contrast .sfl-item.is-current{outline:2px solid #ff0!important;outline-offset:-2px}
