/* AF Dostępność – style. Kolory marki: bordo #591213, krem #FCF4DE, grafit #1C1D1E, żółty #FFDA00. */

/* ---------- Narzędzia ---------- */
.af-visually-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* ---------- 2.4.7 Widoczny fokus (dwukolorowy: widoczny na jasnym i ciemnym tle) ---------- */
:where(a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"]), [role="button"], video[controls]):focus-visible {
	outline: 3px solid #FFDA00 !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 2px #1C1D1E !important;
	border-radius: 2px;
}
/* Elementor wyłącza obrys pól formularza i zostawia 1px cienia 10% – niewidoczne. */
.elementor-field-group .elementor-field-textual:focus-visible,
.skch-form .skch-input:focus-visible {
	outline: 3px solid #FFDA00 !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 2px #1C1D1E !important;
}
/* Cel „Przejdź do treści”: obszar main nie jest kontrolką, obrys całej treści tylko by przeszkadzał. */
.af-main:focus { outline: none; }

/* Link „Przejdź do treści”: wyraźny i ponad nagłówkiem. */
.skip-link.screen-reader-text:focus {
	z-index: 100000 !important;
	background: #1C1D1E !important;
	color: #fff !important;
	font-size: 1rem !important;
	padding: 12px 20px !important;
	text-decoration: underline;
}

/* ---------- Animacje wejścia Elementora (2.1.1, 1.3.2, 2.3.3) ----------
 * Elementor ukrywa elementy przez visibility:hidden aż do przewinięcia myszą, więc klawiatura
 * i czytnik ekranu ich nie widzą. Zostawiamy niewidoczność wizualną (opacity), nie ukrywamy przed
 * technologiami wspierającymi; fokus wewnątrz od razu odsłania element. */
.elementor-invisible {
	visibility: visible !important;
	opacity: 0;
}
.elementor-invisible:focus-within { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto !important; }
	.elementor-invisible { opacity: 1 !important; }
	.animated, .elementor-motion-effects-element, [class*="e-animation-"] {
		animation: none !important;
		transition: none !important;
		transform: none !important;
	}
}
html.af-no-motion { scroll-behavior: auto !important; }
html.af-no-motion .elementor-invisible { opacity: 1 !important; }
html.af-no-motion *, html.af-no-motion *::before, html.af-no-motion *::after {
	animation-duration: 0.001ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.001ms !important;
	scroll-behavior: auto !important;
}
html.af-no-motion .elementor-countdown-item:has(.elementor-countdown-seconds) { display: none !important; }

/* ---------- 1.4.3 Kontrast tekstu (domyślne kolory widżetów Elementora Pro) ---------- */
.elementor-posts .elementor-post__excerpt p,
.elementor-posts .elementor-post__excerpt { color: #595959; }
.elementor-posts .elementor-post__meta-data,
.elementor-posts .elementor-post__meta-data span { color: #595959; }

/* ---------- Baner cookies SKCh ---------- */
#skch-cookies-small-banner p { color: #1C1D1E !important; }
#skch-cookies-small-banner p a { color: #1C1D1E !important; text-decoration: underline; }
#skch-cookies-small-banner .af-cookie-h { font-size: 1.125rem; line-height: 1.3; }
#skch-cookies-banner .text-black\/50 { color: #4a4a4a !important; }
/* Przełączniki: fokus na niewidocznym checkboxie przenosimy na wizualny przełącznik. */
.skch-toggle input:focus-visible + div {
	outline: 3px solid #FFDA00;
	outline-offset: 2px;
	box-shadow: 0 0 0 2px #1C1D1E;
}

/* ---------- Formularz SKCh: wybór kwoty i pakietu (2.1.1, 4.1.2) ----------
 * Wtyczka ukrywa przyciski opcji przez display:none, więc nie da się ich wybrać klawiaturą.
 * Zostają w drzewie dostępności i w kolejności Tab, ukryte tylko wizualnie. */
.skch-radio [type="radio"] {
	display: inline-block !important;
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	border: 0 !important;
	opacity: 0;
}
.skch-radio label, .skch-radio .custom-amount { position: relative; min-height: 44px; }
.skch-radio label:has(input:focus-visible),
.skch-radio .custom-amount:has(input[type="radio"]:focus-visible) {
	outline: 3px solid #FFDA00;
	outline-offset: 2px;
	box-shadow: 0 0 0 2px #1C1D1E;
}
/* Wybrana opcja rozpoznawalna nie tylko kolorem (1.4.1): pogrubienie i obramowanie. */
.skch-radio label:has(input:checked), .skch-radio .selected {
	font-weight: 700;
	box-shadow: inset 0 0 0 2px #1D5912;
}
.skch-radio label:has(input:checked) span::before { content: "✓ "; }
.af-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.af-fieldset > legend { padding: 0; margin: 0 0 .25rem; float: left; width: 100%; }
.af-fieldset > legend + * { clear: both; }
.af-form-note { margin: 0 0 .5rem; font-size: .9375rem; }
.af-form-errors { margin: 0 0 .75rem; padding: .75rem 1rem; border: 2px solid #8B0000; background: #fff4f4; color: #1C1D1E; }
.af-form-errors ul { margin: .25rem 0 0 1.25rem; padding: 0; }
.af-form-errors a { color: #8B0000; text-decoration: underline; }
.skch-form .just-validate-error-label { font-weight: 600; }
.skch-form .just-validate-error-label::before { content: "Błąd: "; }
/* Błędne pole oznaczone nie tylko kolorem (1.4.1): przerywana, grubsza ramka w kolorze formularza. */
.skch-form [aria-invalid="true"]:not([type="radio"]) { border-width: 2px !important; border-style: dashed !important; }

/* ---------- 2.4.11 Fokus niezasłonięty ---------- */
/* Przycisk panelu jest przyklejony do lewego dolnego rogu: przewijanie do fokusu zostawia pod nim miejsce. */
html { scroll-padding-top: 16px; scroll-padding-bottom: 80px; }

/* ---------- Panel dostępności ---------- */
.af-panel {
	position: fixed;
	left: 12px;
	bottom: calc(12px + var(--af-cookie-offset, 0px));
	z-index: 9990;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.4;
	color: #1C1D1E;
}
.af-panel .af-panel__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 48px;
	min-width: 48px;
	padding: 8px 14px;
	border: 2px solid #FCF4DE;
	border-radius: 999px;
	background: #591213;
	color: #fff;
	font-family: inherit; font-weight: 600; font-size: 15px; line-height: 1.2;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.af-panel .af-panel__toggle:hover, .af-panel .af-panel__toggle:focus { background: #3f0c0d; color: #fff; }
@media (max-width: 600px) {
	.af-panel__toggle-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
	.af-panel__toggle { padding: 10px; }
}
.af-panel__box {
	position: absolute;
	left: 0;
	bottom: 60px;
	width: min(340px, calc(100vw - 24px));
	max-height: calc(100vh - 100px);
	overflow: auto;
	padding: 18px 18px 14px;
	background: #fff;
	border: 2px solid #591213;
	border-radius: 12px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, .3);
}
.af-panel__box[hidden] { display: none; }
.af-panel .af-panel__title { margin: 0 0 12px; font-family: inherit; font-size: 1.125rem; font-weight: 700; line-height: 1.3; color: #591213; }
.af-panel__group { border: 0; margin: 0 0 12px; padding: 0; }
.af-panel__group legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.af-panel__seg { display: flex; gap: 6px; }
.af-panel__seg label { flex: 1; position: relative; }
.af-panel__seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.af-panel__seg span {
	display: flex; align-items: center; justify-content: center;
	min-height: 44px; padding: 4px 6px;
	border: 2px solid #591213; border-radius: 8px;
	text-align: center; font-size: 14px; cursor: pointer;
}
.af-panel__seg input:checked + span { background: #591213; color: #fff; font-weight: 700; }
.af-panel__seg input:checked + span::before { content: "✓ "; }
.af-panel__seg input:focus-visible + span { outline: 3px solid #FFDA00; outline-offset: 2px; box-shadow: 0 0 0 2px #1C1D1E; }
.af-panel__check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.af-panel__check input { width: 22px; height: 22px; margin: 0; accent-color: #591213; flex: none; }
.af-panel__hint { font-size: 13px; color: #4a4a4a; margin: 4px 0 12px; }
.af-panel__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.af-panel .af-panel__btn {
	flex: 1; min-height: 44px; padding: 8px 12px;
	border: 2px solid #591213; border-radius: 8px;
	background: #fff; color: #591213; font-family: inherit; font-weight: 600; font-size: 14px; line-height: 1.2; cursor: pointer;
}
.af-panel .af-panel__btn--primary { background: #591213; color: #fff; }
.af-panel .af-panel__btn:hover { background: #FCF4DE; color: #591213; }

/* ---------- Ustawienia panelu ---------- */
/* Wielkość tekstu: powiększamy treść strony (zoom zachowuje układ i przelicza zawijanie), bez panelu. */
html.af-text-l body > :not(.af-panel):not(#skch-cookies-small-banner):not(#skch-cookies-banner) { zoom: 1.15; }
html.af-text-xl body > :not(.af-panel):not(#skch-cookies-small-banner):not(#skch-cookies-banner) { zoom: 1.3; }

/* Wyższy kontrast: ciemniejsze szarości i tekst, wyraźne pola i linki. Tła i zdjęcia bez zmian. */
html.af-contrast {
	--e-global-color-809cd89: #2b2b2b;
	--e-global-color-75d72b5: #4a4a4a;
	--e-global-color-text: #000;
	--e-global-color-primary: #000;
}
/* Tekst dobierany do tła przez skrypt (af-kj: ciemny na jasnym, af-kc: jasny na ciemnym,
 * af-kz-*: zdjęcie w tle, kolor bez zmian, wyraźny cień odcinający litery od obrazu). */
html.af-contrast .af-kj { color: #000 !important; }
html.af-contrast .af-kc { color: #fff !important; text-shadow: 0 0 2px #000, 0 0 6px rgba(0,0,0,.9) !important; }
html.af-contrast .af-kz-c { text-shadow: 0 0 2px #000, 0 0 6px #000, 0 0 12px rgba(0,0,0,.85) !important; }
html.af-contrast .af-kz-j { text-shadow: 0 0 2px #fff, 0 0 6px #fff, 0 0 12px rgba(255,255,255,.85) !important; }
html.af-contrast main a:not(.elementor-button) { text-decoration: underline !important; text-underline-offset: 2px; }
/* Pola formularzy: grubsza ramka w kolorze tekstu pola (działa i na jasnym, i na bordowym tle). */
html.af-contrast :where(input:not([type="radio"]):not([type="checkbox"]), select, textarea) { border: 2px solid currentColor !important; }
html.af-contrast ::placeholder { opacity: 1 !important; }

/* Podkreślone linki (1.4.1 – nie tylko kolor). */
html.af-links a[href]:not(.elementor-button):not(.af-panel a) { text-decoration: underline !important; text-underline-offset: 3px; text-decoration-thickness: 2px; }

/* Większe odstępy (wartości z WCAG 1.4.12). */
html.af-spacing body :where(p, li, dd, dt, td, th, label, blockquote, h1, h2, h3, h4, h5, h6, .elementor-heading-title) {
	line-height: 1.5 !important;
	letter-spacing: 0.12em !important;
	word-spacing: 0.16em !important;
}
html.af-spacing body :where(p) { margin-bottom: 2em !important; }

@media print { .af-panel { display: none !important; } }

/* ---------- Zachowanie wyglądu po poprawie poziomów nagłówków (1.3.1) ----------
 * Zmieniono znacznik (np. H1 → H2, H4 → H2, wers pieśni H4 → akapit), wygląd zostaje jak wcześniej.
 * Wartości z zestawu stylów Elementora (Kit Styles: Sanat) i resetu motywu Hello. */
:is(.af-wyglad-h1 .elementor-heading-title, .elementor-widget-text-editor .af-wyglad-h1) { font-family: "Muli", sans-serif; font-size: 40px; font-weight: 800; line-height: 50px; color: #1C1D1E; }
:is(.af-wyglad-h2 .elementor-heading-title, .elementor-widget-text-editor .af-wyglad-h2) { font-family: "Muli", sans-serif; font-size: 32px; font-weight: 800; line-height: 42px; color: #1C1D1E; }
:is(.af-wyglad-h3 .elementor-heading-title, .elementor-widget-text-editor .af-wyglad-h3) { font-family: "Muli", sans-serif; font-size: 28px; font-weight: 800; line-height: 36px; color: var(--e-global-color-primary); }
:is(.af-wyglad-h4 .elementor-heading-title, .elementor-widget-text-editor .af-wyglad-h4) { font-family: var(--e-global-typography-primary-font-family), sans-serif; font-size: 1.5rem; font-weight: var(--e-global-typography-primary-font-weight); line-height: 1.2; color: var(--e-global-color-primary); }
:is(.af-wyglad-h5 .elementor-heading-title, .elementor-widget-text-editor .af-wyglad-h5) { font-family: var(--e-global-typography-primary-font-family), sans-serif; font-size: 1.25rem; font-weight: var(--e-global-typography-primary-font-weight); line-height: 1.2; color: var(--e-global-color-primary); }
.elementor-widget-text-editor :is(.af-wyglad-h1, .af-wyglad-h2, .af-wyglad-h3, .af-wyglad-h4, .af-wyglad-h5) { margin-block-start: .5rem; margin-block-end: 1rem; }
/* Tytuły wpisów zmienione z H3 na H2: interlinia jak dotąd (zestaw stylów H3). */
.af-tytuly-wpisow .elementor-post__title { line-height: 36px; }
/* Notka o polach wymaganych dziedziczy kolor etykiet formularza (formularz bywa na ciemnym tle). */

/* „Zmień zgodę cookies” jako przycisk: czytelny na każdym tle, cel ≥ 24 px (2.5.8). */
button.af-change-consent {
	min-height: 32px; padding: 4px 12px !important; border: 1px solid #1C1D1E !important; border-radius: 999px !important;
	background: #fff !important; color: #1C1D1E !important; font-size: 13px !important; font-weight: 500 !important; line-height: 1.2 !important; text-transform: none !important;
	box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
button.af-change-consent:hover { background: #FCF4DE !important; }
