/*
 * WIW Opole – style wspólne wszystkich koncepcji.
 * Kolory i kroje definiuje style.css koncepcji (zmienne --wiw-*).
 */

:root {
	--wiw-accent: #1E5631;
	--wiw-accent-dark: #163F24;
	--wiw-accent-soft: #EEF4EF;
	--wiw-link: var(--wiw-accent);
	--wiw-text: #1A1A1A;
	--wiw-muted: #4B5563;
	--wiw-border: #D5DED7;
	--wiw-bg: #FFFFFF;
	--wiw-soft: #F4F6F5;
	--wiw-font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--wiw-font-head: var(--wiw-font);
	--wiw-radius: 6px;
	--wiw-max: 75rem;
	--wiw-alert-bg: #FFF4E5;
	--wiw-alert-fg: #7C2D12;
	--wiw-alert-border: #E8B77A;
	--wiw-zone1-bg: #DCEBFA;
	--wiw-zone1-fg: #1E4E8C;
	--wiw-zone1-border: #9CC2EC;
	--wiw-zone2-bg: #FBE3EE;
	--wiw-zone2-fg: #8A1F4C;
	--wiw-zone2-border: #E7A9C4;
}

html { font-size: 100%; -webkit-text-size-adjust: 100%; }
html[data-wiw-font="1"] { font-size: 112.5%; }
html[data-wiw-font="2"] { font-size: 125%; }

*, *::before, *::after { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--wiw-bg);
	color: var(--wiw-text);
	font-family: var(--wiw-font);
	font-size: 1rem;
	line-height: 1.6;
	overflow-wrap: break-word;
}

img, svg, video { max-width: 100%; height: auto; }
.wiw-icon { flex: none; vertical-align: middle; }

a { color: var(--wiw-link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3, h4, h5, h6 { font-family: var(--wiw-font-head); line-height: 1.25; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }

:focus-visible {
	outline: 2px solid #111111;
	outline-offset: 2px;
	box-shadow: 0 0 0 5px #FFDD00;
}

button, input, select, textarea { font: inherit; color: inherit; }

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.wiw-skip {
	position: absolute;
	left: 1rem;
	top: -10rem;
	z-index: 1000;
	background: #FFDD00;
	color: #111111;
	font-weight: 700;
	padding: 0.75rem 1rem;
	text-decoration: none;
}
.wiw-skip:focus { top: 1rem; }

.wiw-container { max-width: var(--wiw-max); margin: 0 auto; padding-inline: 1.5rem; }
.wiw-break { word-break: break-all; }

.wiw-menu, .wiw-linklist { list-style: none; margin: 0; padding: 0; }

/* Marka */
.wiw-brand { display: inline-flex; align-items: center; gap: 1rem; color: inherit; text-decoration: none; }
.wiw-brand__logo { display: block; width: 5rem; height: auto; }
.wiw-brand__text { display: flex; flex-direction: column; }
.wiw-brand__name { font-family: var(--wiw-font-head); font-weight: 700; line-height: 1.2; }
.wiw-brand--two-line .wiw-brand__name1, .wiw-brand--two-line .wiw-brand__name2 { display: block; }
.wiw-brand--stacked { flex-direction: column; text-align: center; }
.wiw-brand__tagline { font-size: 0.875rem; font-weight: 400; }

/* Wyszukiwarka */
.wiw-search { display: flex; min-width: 0; }
.wiw-search__input {
	flex: 1;
	min-width: 0;
	height: 2.875rem;
	padding: 0 0.875rem;
	border: 1px solid #8A9A8E;
	border-right: 0;
	border-radius: var(--wiw-radius) 0 0 var(--wiw-radius);
	background: #FFFFFF;
	color: #1A1A1A;
}
.wiw-search__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-width: 3rem;
	height: 2.875rem;
	padding: 0 1rem;
	border: 0;
	border-radius: 0 var(--wiw-radius) var(--wiw-radius) 0;
	background: var(--wiw-accent);
	color: #FFFFFF;
	font-weight: 700;
	cursor: pointer;
}
.wiw-search--page { max-width: 40rem; margin-bottom: 2rem; }

/* Przełączniki dostępności */
.wiw-a11y { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
.wiw-a11y__sizes { display: flex; gap: 0.25rem; }
.wiw-a11y__btn {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	min-width: 2rem;
	min-height: 2rem;
	padding: 0 0.6rem;
	border: 1px solid currentColor;
	border-radius: 4px;
	background: transparent;
	font-size: 0.8125rem;
	line-height: 1;
	cursor: pointer;
}
.wiw-a11y__btn--s1 { font-size: 0.9375rem; }
.wiw-a11y__btn--s2 { font-size: 1.0625rem; }
.wiw-a11y__btn[aria-pressed="true"] { font-weight: 700; box-shadow: inset 0 -3px 0 currentColor; }

/* Komunikat */
.wiw-alert { background: var(--wiw-alert-bg); color: var(--wiw-alert-fg); border-top: 1px solid var(--wiw-alert-border); border-bottom: 1px solid var(--wiw-alert-border); }
.wiw-alert__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding-block: 0.875rem; }
.wiw-alert__text { flex: 1 1 28rem; margin: 0; }
.wiw-alert__link { color: inherit; font-weight: 700; }
.wiw-alert a { color: inherit; }

/* Menu główne – wspólne zachowanie */
.wiw-nav-toggle {
	display: none;
	align-items: center;
	gap: 0.5rem;
	min-height: 2.75rem;
	padding: 0 1rem;
	border: 1px solid currentColor;
	border-radius: var(--wiw-radius);
	background: transparent;
	font-weight: 700;
	cursor: pointer;
}
.wiw-primary-nav .wiw-menu { display: flex; flex-wrap: wrap; }
.wiw-primary-nav .menu-item { position: relative; }
.wiw-primary-nav .sub-menu {
	display: none;
	position: absolute;
	left: 0;
	top: 100%;
	z-index: 50;
	min-width: 16rem;
	margin: 0;
	padding: 0.5rem 0;
	list-style: none;
	background: #FFFFFF;
	border: 1px solid var(--wiw-border);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.wiw-primary-nav .sub-menu a { display: block; padding: 0.5rem 1rem; color: var(--wiw-text) !important; background: none !important; }
.wiw-primary-nav .menu-item:hover > .sub-menu,
.wiw-primary-nav .menu-item:focus-within > .sub-menu { display: block; }

@media (max-width: 56.25em) {
	.wiw-nav-toggle { display: inline-flex; }
	.wiw-primary-nav:not(.is-open) { display: none !important; }
	.wiw-primary-nav .wiw-menu { flex-direction: column; width: 100%; }
	.wiw-primary-nav .sub-menu { position: static; display: block; box-shadow: none; border: 0; padding-left: 1rem; background: transparent; }
}

/* Układ podstron */
.wiw-page { padding-block: 1.5rem 4rem; }
.wiw-layout { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 2.5rem; align-items: start; }
@media (max-width: 56.25em) { .wiw-layout { grid-template-columns: minmax(0, 1fr); } }
.wiw-page__header { margin-bottom: 1.5rem; }
.wiw-page__title { font-size: 2rem; margin: 0 0 0.5rem; }
.wiw-page__lead { color: var(--wiw-muted); font-size: 1.125rem; }
.wiw-entry__meta { color: var(--wiw-muted); font-size: 0.9375rem; margin-bottom: 0.5rem; }
.wiw-entry__cat { font-weight: 600; }
.wiw-entry__thumb { margin: 0 0 1.5rem; }
.wiw-entry__footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--wiw-border); }
.wiw-entry__updated { color: var(--wiw-muted); font-size: 0.9375rem; }
.wiw-empty { color: var(--wiw-muted); }

.wiw-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; list-style: none; margin: 0 0 1.5rem; padding: 0; font-size: 0.875rem; color: var(--wiw-muted); }
.wiw-breadcrumbs li + li::before { content: "/"; margin-right: 0.5rem; color: var(--wiw-muted); }

/* Boks i listy linków */
.wiw-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.wiw-box { border: 1px solid var(--wiw-border); border-radius: var(--wiw-radius); padding: 1.5rem; }
.wiw-box--soft { background: var(--wiw-accent-soft); border-color: transparent; }
.wiw-box__title, .wiw-contact__heading { font-size: 1.25rem; margin: 0 0 0.75rem; }
.wiw-linklist li { border-bottom: 1px solid var(--wiw-border); }
.wiw-linklist li:last-child { border-bottom: 0; }
.wiw-linklist a { display: block; padding: 0.7rem 0; font-weight: 600; text-decoration: none; }
.wiw-linklist a:hover { text-decoration: underline; }

/* Menu działu (np. ZHW) w panelu bocznym */
.wiw-box--section { border-top: 4px solid var(--wiw-accent); }
.wiw-section-menu .sub-menu { list-style: none; margin: 0; padding: 0 0 0.5rem; }
.wiw-section-menu .sub-menu li { border-bottom: 0; }
.wiw-section-menu .sub-menu a { padding: 0.35rem 0 0.35rem 0.875rem; }
.wiw-section-menu__label { display: block; padding: 0.875rem 0 0.25rem; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--wiw-muted); }
.wiw-linklist.wiw-section-menu .current-menu-item > a { color: var(--wiw-text); box-shadow: inset 3px 0 0 var(--wiw-accent); padding-left: 0.75rem; }
.wiw-linklist.wiw-section-menu .sub-menu .current-menu-item > a { padding-left: 1.125rem; }

/* Kontakt */
.wiw-contact p { margin: 0 0 0.75rem; }
.wiw-contact__small { font-size: 0.9375rem; color: var(--wiw-muted); }
.wiw-contact__label { font-size: 0.875rem; color: var(--wiw-muted); margin-bottom: 0.25rem !important; }
.wiw-contact a { font-weight: 600; }
.wiw-contact--grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 2rem; }

/* Aktualności */
.wiw-news__title { font-size: 1.375rem; margin: 0 0 0.5rem; }
.wiw-news__title a { color: var(--wiw-text); text-decoration: none; }
.wiw-news__title a:hover { text-decoration: underline; }
.wiw-news__meta { color: var(--wiw-muted); font-size: 0.9375rem; margin: 0 0 0.375rem; }
.wiw-news__cat { font-weight: 600; color: var(--wiw-accent); }
.wiw-news__excerpt { margin: 0; }
.wiw-news--article { padding: 1.375rem 0; border-top: 1px solid var(--wiw-border); }
.wiw-list .wiw-news--article:last-child { border-bottom: 1px solid var(--wiw-border); }
.wiw-news--row { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--wiw-border); list-style: none; }
.wiw-news--row .wiw-news__date { color: var(--wiw-muted); font-size: 0.9375rem; }
.wiw-news--row .wiw-news__link { color: var(--wiw-text); font-weight: 600; text-decoration: none; }
.wiw-news--row .wiw-news__link:hover { text-decoration: underline; }
.wiw-news--compact { padding: 0.75rem 0; border-bottom: 1px solid var(--wiw-border); list-style: none; }
.wiw-news--compact .wiw-news__meta { font-size: 0.875rem; margin: 0; }
.wiw-news--compact .wiw-news__link { color: var(--wiw-text); font-weight: 600; text-decoration: none; }
.wiw-news--compact .wiw-news__link:hover { text-decoration: underline; }
.wiw-news--datebox { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1.25rem; padding: 1.125rem 0; border-top: 1px solid var(--wiw-border); }
.wiw-news__datebox { text-align: center; border: 1px solid var(--wiw-border); border-radius: 4px; padding: 0.375rem 0; align-self: start; }
.wiw-news__day { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.wiw-news__month { display: block; font-size: 0.8125rem; color: var(--wiw-muted); }
.wiw-news--datebox .wiw-news__title { font-size: 1.125rem; }
.wiw-news--card { border: 1px solid var(--wiw-border); border-radius: var(--wiw-radius); padding: 1.375rem; background: #FFFFFF; }
.wiw-news--card .wiw-news__title { font-size: 1.125rem; line-height: 1.35; margin: 0; }
.wiw-news__tag { display: inline-block; padding: 0 0.5rem; border-radius: 3px; background: var(--wiw-accent-soft); color: var(--wiw-accent); font-weight: 600; }
.wiw-news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr)); gap: 1.25rem; }
.wiw-news-rows { list-style: none; margin: 0; padding: 0; }
.wiw-news-rows .wiw-news--row:last-child { border-bottom: 1px solid var(--wiw-border); }

/* Przyciski */
.wiw-button, .wp-block-button__link, .wp-block-file .wp-block-file__button {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.25rem;
	border: 2px solid var(--wiw-accent);
	border-radius: var(--wiw-radius);
	background: var(--wiw-accent);
	color: #FFFFFF;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}
.wiw-button--outline { background: transparent; color: var(--wiw-accent); }
.wiw-button:hover, .wp-block-button__link:hover { text-decoration: underline; }

/* Powiatowe inspektoraty */
.wiw-piw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1.25rem; margin: 1.5rem 0; }
.wiw-piw { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.375rem; border: 1px solid var(--wiw-border); border-radius: var(--wiw-radius); background: #FFFFFF; }
.wiw-piw--zhw { background: var(--wiw-soft); }
.wiw-piw__name a { color: inherit; }
/* Karty PIW zbudowane z bloków w treści strony (edytowalne w edytorze) */
.wp-block-group.wiw-piw-grid > .wp-block-group__inner-container,
.wp-block-group.wiw-piw > .wp-block-group__inner-container { display: contents; }
.entry-content .wiw-piw-grid { margin: 1.5rem 0 2rem; }
.entry-content .wiw-piw p, .entry-content .wiw-piw h2, .entry-content .wiw-piw h3 { margin: 0; }
.entry-content .wiw-piw .wiw-piw__name { font-size: 1.25rem; }
.wiw-piw__meta { font-size: 0.9375rem; line-height: 1.6; }
.wiw-piw__plw { padding-top: 0.625rem; border-top: 1px solid var(--wiw-border); font-size: 0.9375rem; }
.wiw-piw a { overflow-wrap: anywhere; }
.wiw-piw[id] { scroll-margin-top: 1rem; }
.entry-content ul.wiw-jump { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0.75rem 0 0; }
.entry-content ul.wiw-jump li { margin: 0; }
.wiw-jump a { display: inline-block; padding: 0.375rem 0.875rem; border: 1px solid var(--wiw-border); border-radius: 999px; font-weight: 600; font-size: 0.9375rem; text-decoration: none; }
.wiw-jump a:hover, .wiw-jump a:focus { background: var(--wiw-accent-soft); text-decoration: underline; }
.wiw-piw__name { font-size: 1.1875rem; margin: 0; color: var(--wiw-accent); }
.wiw-piw__addr { margin: 0; font-size: 0.9375rem; }
.wiw-piw__gminy { margin: 0; font-size: 0.875rem; color: var(--wiw-muted); }
.wiw-piw__link { font-weight: 700; font-size: 0.9375rem; margin-top: auto; }

/* ASF */
.wiw-asf__zones { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem; }
.wiw-asf__zone ul { margin: 0; padding-left: 1.125rem; font-size: 0.9375rem; }
.wiw-asf__zone li { margin-bottom: 0.25rem; }
.wiw-asf__chip { display: inline-block; margin: 0 0 0.625rem; padding: 0.125rem 0.625rem; border-radius: 3px; font-size: 0.875rem; font-weight: 700; }
.wiw-asf__chip--1 { background: var(--wiw-zone1-bg); color: var(--wiw-zone1-fg); border: 1px solid var(--wiw-zone1-border); }
.wiw-asf__chip--2 { background: var(--wiw-zone2-bg); color: var(--wiw-zone2-fg); border: 1px solid var(--wiw-zone2-border); }
.wiw-asf__links { display: flex; flex-wrap: wrap; gap: 0.625rem 1.5rem; margin: 1.375rem 0 0; padding-top: 1.125rem; border-top: 1px solid var(--wiw-border); font-size: 0.9375rem; }
.wiw-asf__links a { display: inline-flex; align-items: center; gap: 0.375rem; font-weight: 600; }

/* Treść wpisów i stron (edytor bloków) */
.entry-content > * { max-width: 100%; }
.entry-content h2 { font-size: 1.5rem; margin-top: 2rem; }
.entry-content h3 { font-size: 1.25rem; margin-top: 1.5rem; }
.entry-content ul, .entry-content ol { padding-left: 1.5rem; margin: 0 0 1em; }
.entry-content li { margin-bottom: 0.25rem; }
.entry-content table, .wp-block-table table { width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; font-size: 0.9375rem; }
.entry-content th, .entry-content td { border: 1px solid var(--wiw-border); padding: 0.625rem 0.75rem; text-align: left; vertical-align: top; }
.entry-content th { background: var(--wiw-soft); }
.wp-block-table { overflow-x: auto; }
.entry-content blockquote { margin: 1.5rem 0; padding: 0.25rem 0 0.25rem 1.25rem; border-left: 4px solid var(--wiw-accent); }
.entry-content figcaption, .wp-element-caption { font-size: 0.875rem; color: var(--wiw-muted); }
.wp-block-file { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; padding: 1rem 1.25rem; border: 1px solid var(--wiw-border); border-radius: var(--wiw-radius); background: var(--wiw-soft); }
.wp-block-file:not(.wp-element-button) { font-size: 1rem; }
.wp-block-file > a:first-child { font-weight: 600; }
.wp-block-file .wp-block-file__button { margin: 0; padding: 0.5rem 1rem; font-size: 0.9375rem; }
.wp-block-separator { border: 0; border-top: 1px solid var(--wiw-border); margin: 2rem 0; }
.alignwide, .alignfull { max-width: 100%; }

/* Stronicowanie */
.navigation.pagination { margin-top: 2rem; }
.navigation.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; }
.navigation.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.75rem;
	border: 1px solid var(--wiw-border);
	border-radius: 4px;
	color: var(--wiw-text);
	text-decoration: none;
}
.navigation.pagination .page-numbers.current { background: var(--wiw-accent); border-color: var(--wiw-accent); color: #FFFFFF; font-weight: 700; }
.navigation.pagination .page-numbers.dots { border: 0; }

/* Wersja kontrastowa */
html.wiw-contrast body,
html.wiw-contrast body *:not(svg):not(path):not(circle):not(rect) {
	background-color: #000000 !important;
	background-image: none !important;
	color: #FFFFFF !important;
	border-color: #FFFFFF !important;
	box-shadow: none !important;
	text-shadow: none !important;
}
html.wiw-contrast a, html.wiw-contrast a * { color: #FFFF00 !important; text-decoration: underline !important; }
html.wiw-contrast button, html.wiw-contrast input, html.wiw-contrast select { border: 1px solid #FFFFFF !important; }
html.wiw-contrast :focus-visible { outline: 3px solid #FFFF00 !important; }
html.wiw-contrast .wiw-brand__logo { background: transparent !important; }

/* Ograniczenie animacji */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Wydruk */
@media print {
	.wiw-utility, .wiw-primary-nav, .wiw-nav-toggle, .wiw-alert, .wiw-search, .wiw-sidebar, .wiw-footer, .wiw-a11y { display: none !important; }
	.wiw-layout { display: block; }
	a { color: #000000; }
}
.wiw-piw--active { border: 2px solid var(--wiw-accent); box-shadow: 0 0 0 3px var(--wiw-accent-soft); }
