/**
 * Accessibility fixes — buk.gmina.pl (WCAG 2.2 AA).
 * Loaded by inc/a11y.php. Do not edit the Total theme or the plugin instead.
 *
 * 1. Text resize: root scaling (html.umig-fs-NNN set by a11y.js)
 * 2. Theme px font sizes → rem, so they follow the root
 * 3. Layout that adapts to larger text
 * 4. A11y toolbar: level indicator, disabled state
 */

/* 1. Text resize ------------------------------------------------------------ */

html.umig-fs-120 { font-size: 120%; }
html.umig-fs-140 { font-size: 140%; }
html.umig-fs-160 { font-size: 160%; }
html.umig-fs-180 { font-size: 180%; }
html.umig-fs-200 { font-size: 200%; }

/* 2. Theme font sizes in rem (identical at 100 %: 1rem = 16px) -------------- */

html.wpex-classic-style { --wpex-body-font-size: 0.8125rem; }                 /* 13px */
html .main-navigation-ul .link-inner { font-size: 0.9375rem; }                /* 15px, Customizer */
html :is(.single-blog-content, .vcex-post-content-c, .wpb_text_column, body.no-composer .single-content) { font-size: 0.875rem; } /* 14px, Customizer */
html .vcex-button.theme-button { font-size: 1.125rem; }                       /* 18px, tile buttons */
html .wpex-fs-13px { font-size: 0.8125rem; }
html .wpex-fs-14px { font-size: 0.875rem; }
html .wpex-fs-16px { font-size: 1rem; }
html .wpex-fs-18px { font-size: 1.125rem; }
html .wpex-fs-21px { font-size: 1.3125rem; }

/* 3. Layout at enlarged text ------------------------------------------------ */

/* Main menu → theme's mobile menu when it doesn't fit (class set by a11y.js). */
html.umig-force-mm body.has-mobile-menu .hide-at-mm-breakpoint { display: none !important; }
html.umig-force-mm body.has-mobile-menu .show-at-mm-breakpoint { display: flex !important; }
html.umig-force-mm .wpex-mobile-toggle-menu-icon_buttons #site-logo { height: 100%; float: left; text-align: start; }

/* Tiles: no mid-word breaks, reflow to fewer columns instead of squeezing text. */
.vcex-icon-box-heading,
.vcex-blog-entry-title,
.vcex-button-inner {
	word-break: normal;
	overflow-wrap: break-word;
	hyphens: auto;
}
/* Equal-width WPBakery columns (tiles, "Na skróty" buttons): wrap to fewer
   columns as the text grows. 11em follows the body font size. */
html.umig-fs .vc_row:has(> :is(.vc_col-sm-2, .vc_col-sm-3, .vc_col-sm-4)) {
	display: flex;
	flex-wrap: wrap;
}
html.umig-fs .vc_row > .wpb_column:is(.vc_col-sm-2, .vc_col-sm-3, .vc_col-sm-4) {
	float: none;
	width: auto;
	flex: 1 1 11em;
}

/* Long words / URLs in cards and content wrap instead of overflowing. */
.vcex-grid-item,
.wpex-grid > * {
	min-width: 0;
}
.vcex-blog-entry-excerpt,
.vcex-blog-entry-details,
.single-content,
.wpb_text_column {
	overflow-wrap: break-word;
}

/* Fixed widths from pasted Word tables (e.g. <table width="1067">) */
.single-content table[width],
.wpb_text_column table[width] {
	width: auto;
	max-width: 100%;
}
.single-content :is(td, th)[width],
.wpb_text_column :is(td, th)[width] {
	width: auto;
}

/* Previous / next post links */
html.umig-fs .post-pagination {
	flex-wrap: wrap;
	gap: 0.75em;
}
html.umig-fs .post-pagination > li {
	flex: 1 1 15em;
	margin-inline: 0;
}

/* Unitless line-height for text at enlarged sizes (WCAG 1.4.12). */
html.umig-fs body { line-height: 1.6; }

/* 4. Colour contrast (WCAG 1.4.3 text ≥ 4.5:1, 1.4.11 UI/icons ≥ 3:1) ------
   Same hue, darkened just enough. Ratios against the actual background. */

/* Breadcrumbs on #f7f7f7 page header: #757575 4.3 / #9e9e9e 2.5 → 5.8 / 5.0 */
.site-breadcrumbs,
.site-breadcrumbs .breadcrumb-trail > span,
.site-breadcrumbs .breadcrumb_last,
.site-breadcrumbs .sep {
	color: #6b6b6b;
}
.site-breadcrumbs a {
	color: #616161;
}
.site-breadcrumbs a:is(:hover, :focus-visible) {
	color: var(--wpex-accent, #0f5bbd);
}

/* Top bar social icons on white: #9e9e9e 2.7 → #767676 4.5 */
#top-bar-social a.wpex-social-btn {
	color: #767676;
}
#top-bar-social a.wpex-social-btn:is(:hover, :focus-visible) {
	color: var(--wpex-accent, #0f5bbd);
}

/* Share buttons: white on Facebook #1877f2 4.2 → #0d65d9 */
.wpex-social-share__link--facebook {
	background-color: #0d65d9;
}
.wpex-social-share__link--facebook:is(:hover, :focus-visible) {
	background-color: #0a55b8;
}

/* Theme button colour presets with white text (homepage, mobile) */
.theme-button.grey,
.vcex-button.grey {
	background-color: #6b6b6b;  /* #bdbdbd 1.9 → 5.3 */
}
.theme-button.grey:is(:hover, :focus-visible),
.vcex-button.grey:is(:hover, :focus-visible) {
	background-color: #555;
}
.theme-button.orange,
.vcex-button.orange {
	background-color: #c25110;  /* #ee7836 2.8 → 4.7 */
}
.theme-button.orange:is(:hover, :focus-visible),
.vcex-button.orange:is(:hover, :focus-visible) {
	background-color: #a5450d;
}

/* 5. Toolbar contrast modes ("Wysoki kontrast", "Negatywny kontrast") ------ */

/* Transparent PNG logos (site logo, BIP / ePUAP, EU funding bar) vanish on
   the black / grey background: give images a white plate. Photos are opaque
   and unaffected. Specificity beats the plugin's
   `body.pojo-a11y-negative-contrast *:not(#pojo-a11y-toolbar) img{background:black!important}`. */
html body:is(.pojo-a11y-high-contrast, .pojo-a11y-negative-contrast) *:not(#pojo-a11y-toolbar) img {
	background: #fff !important;
	background-color: #fff !important;
}
html body:is(.pojo-a11y-high-contrast, .pojo-a11y-negative-contrast) #site-logo img {
	padding: 4px;
	border-radius: 4px;
}

/* Clearly visible focus on black (plugin default: thin dotted). */
html body:is(.pojo-a11y-high-contrast, .pojo-a11y-negative-contrast) :focus-visible {
	outline: 3px solid #ff0 !important;
	outline-offset: 2px !important;
}

/* 6. A11y toolbar ----------------------------------------------------------- */

#pojo-a11y-toolbar .umig-a11y-level {
	display: block;
	padding: 0.5em 0.625em;
	font-weight: 700;
	white-space: nowrap;
}
#pojo-a11y-toolbar .pojo-a11y-toolbar-link.umig-a11y-disabled {
	opacity: 0.55;
	cursor: not-allowed;
}
