/* BIP Zespołu Żłobków Miejskich w Chełmie */
:root {
  --tlo: #ffffff;
  --tlo-2: #f3f6f9;
  --tekst: #1d2329;
  --tekst-2: #4a5560;
  --glowny: #0b4f8a;        /* granat z logo – kontrast 8.6:1 na białym */
  --glowny-ciemny: #073a66;
  --akcent: #b3261e;        /* czerwień BIP – kontrast 6.1:1 */
  --ramka: #d3dbe3;
  --fokus: #ffbf47;
  --szer: 1180px;
  --r: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
html.tekst-duzy { font-size: 125%; }
body {
  margin: 0;
  background: var(--tlo);
  color: var(--tekst);
  font: 1rem/1.6 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img { max-width: 100%; height: auto; }
a { color: var(--glowny); text-underline-offset: .15em; }
a:hover { color: var(--glowny-ciemny); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; box-shadow: 0 0 0 5px var(--tekst); }
h1, h2, h3 { line-height: 1.25; color: var(--glowny-ciemny); }
h1 { font-size: 1.9rem; margin: .2em 0 .8em; }
h2 { font-size: 1.35rem; margin: 1.6em 0 .6em; }
h3 { font-size: 1.12rem; margin: 1.4em 0 .5em; }
address { font-style: normal; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--ramka); vertical-align: top; }
th { background: var(--tlo-2); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}
.js-only { display: none; }
html.js .js-only { display: flex; }
html.js p.js-only { display: block; }

.skip {
  position: absolute; left: .5rem; top: -4rem; z-index: 10;
  background: var(--glowny-ciemny); color: #fff; padding: .6rem 1rem; border-radius: var(--r);
  font-weight: 600;
}
.skip:focus { top: .5rem; color: #fff; }

.kontener { max-width: var(--szer); margin: 0 auto; padding: 0 1rem; }

/* Nagłówek */
.naglowek { border-top: 6px solid var(--akcent); }
.naglowek-wnetrze {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: 1rem; padding-bottom: 1rem;
}
.logo-jednostki img { display: block; width: 292px; }
.logo-bip img { display: block; width: 200px; }
.pasek { background: var(--glowny); color: #fff; }
.pasek-wnetrze {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 1.5rem; padding-top: .5rem; padding-bottom: .5rem;
}
.menu-gorne ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.menu-gorne a { color: #fff; font-weight: 600; }
.menu-gorne a[aria-current] { text-decoration-thickness: 3px; }
.narzedzia { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.szukaj-mala { display: flex; }
.szukaj-mala input {
  width: 13rem; max-width: 55vw; padding: .45rem .6rem; font: inherit; font-size: .95rem;
  border: 2px solid #fff; border-radius: var(--r) 0 0 var(--r);
}
button {
  font: inherit; cursor: pointer; border-radius: var(--r);
  border: 2px solid var(--glowny-ciemny); background: var(--glowny-ciemny); color: #fff;
  padding: .45rem .8rem; font-weight: 600;
}
button:hover { background: #052a4b; }
.szukaj-mala button { border-radius: 0 var(--r) var(--r) 0; border-color: #fff; }
.dostepnosc { gap: .35rem; }
.dostepnosc button { background: transparent; border-color: #fff; padding: .35rem .6rem; }
.dostepnosc button[aria-pressed="true"] { background: #fff; color: var(--glowny-ciemny); }

/* Układ */
.uklad {
  display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 2.5rem;
  padding-top: 1.5rem; padding-bottom: 3rem;
}
.menu-boczne h2 {
  font-size: .85rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--tekst-2); margin: 0 0 .5rem;
}
.menu-boczne h2 ~ h2 { margin-top: 1.75rem; }
.menu-boczne ul { list-style: none; margin: 0; padding: 0; }
.menu-boczne li { border-bottom: 1px solid var(--ramka); }
.menu-boczne ul ul li { border: 0; }
.menu-boczne a { display: block; padding: .5rem .6rem; text-decoration: none; font-weight: 600; }
.menu-boczne ul ul a { padding-left: 1.6rem; font-weight: 400; font-size: .95rem; }
.menu-boczne a:hover { background: var(--tlo-2); text-decoration: underline; }
.menu-boczne a[aria-current] {
  background: var(--glowny); color: #fff; border-radius: var(--r);
}
.menu-boczne .w-galezi > a { color: var(--glowny-ciemny); }

main:focus, .menu-boczne:focus { outline: none; }
.okruszki ol { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 1rem; font-size: .9rem; }
.okruszki li + li::before { content: "›"; margin: 0 .5rem; color: var(--tekst-2); }
.okruszki span { color: var(--tekst-2); }

.tresc { max-width: 48rem; }
.tresc address { background: var(--tlo-2); border-left: 4px solid var(--glowny); padding: .9rem 1.1rem; border-radius: 0 var(--r) var(--r) 0; }

.zalaczniki ul { list-style: none; padding: 0; margin: 0; max-width: 48rem; }
.zalaczniki li { padding: .55rem 0 .55rem 1.9rem; border-bottom: 1px solid var(--ramka); position: relative; }
.zalaczniki li::before {
  content: ""; position: absolute; left: .2rem; top: .8rem; width: 1rem; height: 1.2rem;
  border: 2px solid var(--glowny); border-radius: 2px;
}
.zalaczniki a { font-weight: 600; }
.plik-info { color: var(--tekst-2); font-size: .9rem; white-space: nowrap; }

.metryczka {
  margin-top: 3rem; padding: 1rem 1.25rem; background: var(--tlo-2);
  border: 1px solid var(--ramka); border-radius: var(--r); font-size: .9rem; max-width: 48rem;
}
.metryczka h2 { font-size: 1rem; margin: 0 0 .6rem; }
.metryczka dl { margin: 0; display: grid; grid-template-columns: 1fr; }
.metryczka dl div { display: grid; grid-template-columns: 17rem 1fr; gap: 1rem; padding: .25rem 0; border-bottom: 1px dotted var(--ramka); }
.metryczka dt { color: var(--tekst-2); }
.metryczka dd { margin: 0; font-weight: 600; }
.metryczka details { margin-top: .8rem; }
.metryczka summary { cursor: pointer; color: var(--glowny); font-weight: 600; }
.metryczka table { margin-top: .5rem; background: var(--tlo); }
.drukuj { margin-top: 1.5rem; }
.drukuj button { background: transparent; color: var(--glowny); border-color: var(--glowny); }
.drukuj button:hover { background: var(--tlo-2); }

.tabela-przewijana { overflow-x: auto; }
.szukaj-duza { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; margin-bottom: 1.5rem; }
.szukaj-duza label { width: 100%; font-weight: 600; }
.szukaj-duza input { flex: 1 1 16rem; padding: .55rem .7rem; font: inherit; border: 2px solid var(--tekst-2); border-radius: var(--r); }
#wyniki ol { padding-left: 1.4rem; }
#wyniki li { margin-bottom: 1rem; }
#wyniki a { font-weight: 600; font-size: 1.05rem; }
#wyniki p { margin: .2rem 0 0; color: var(--tekst-2); font-size: .95rem; }
#wyniki mark { background: #fff1a8; color: inherit; }

/* Stopka */
.stopka { background: var(--glowny-ciemny); color: #fff; }
.stopka-wnetrze { display: grid; grid-template-columns: 1fr 1.4fr; gap: 1rem 2rem; padding-top: 1.75rem; padding-bottom: 1.75rem; }
.stopka a { color: #fff; }
.stopka nav ul { display: flex; flex-wrap: wrap; gap: .4rem 1.3rem; list-style: none; margin: 0; padding: 0; }
.stopka .aktualizacja { grid-column: 1 / -1; margin: 0; font-size: .9rem; color: #d6e3ef; }

/* Wysoki kontrast */
html.kontrast {
  --tlo: #000; --tlo-2: #000; --tekst: #fff; --tekst-2: #fff; --glowny: #ffff00;
  --glowny-ciemny: #ffff00; --akcent: #ffff00; --ramka: #ffff00; --fokus: #00ffff;
}
html.kontrast .pasek, html.kontrast .stopka { background: #000; border-block: 2px solid #ffff00; }
html.kontrast .pasek a, html.kontrast .stopka a, html.kontrast h1, html.kontrast h2, html.kontrast h3 { color: #ffff00; }
html.kontrast button { background: #000; color: #ffff00; border-color: #ffff00; }
html.kontrast .dostepnosc button[aria-pressed="true"], html.kontrast .menu-boczne a[aria-current] { background: #ffff00; color: #000; }
html.kontrast .logo-jednostki, html.kontrast .logo-bip { background: #fff; padding: .3rem; border-radius: var(--r); }
html.kontrast input { background: #000; color: #fff; border-color: #ffff00; }
html.kontrast #wyniki mark { background: #ffff00; color: #000; }

/* Mobile */
@media (max-width: 860px) {
  .uklad { grid-template-columns: 1fr; gap: 1.5rem; }
  .menu-boczne { order: 2; border-top: 3px solid var(--glowny); padding-top: 1rem; }
  main { order: 1; }
  .metryczka dl div { grid-template-columns: 1fr; gap: 0; }
  .stopka-wnetrze { grid-template-columns: 1fr; }
  h1 { font-size: 1.6rem; }
  .logo-jednostki img { width: 220px; }
  .logo-bip img { width: 150px; }
  .plik-info { white-space: normal; }
}

/* Wydruk */
@media print {
  .skip, .pasek, .menu-boczne, .stopka nav, .drukuj, .okruszki, .logo-bip { display: none !important; }
  .uklad { display: block; padding: 0; }
  body { font-size: 11pt; color: #000; }
  a { color: #000; }
  .zalaczniki a::after { content: " (" attr(href) ")"; font-weight: 400; font-size: 9pt; }
  .metryczka { break-inside: avoid; border: 1px solid #000; }
  .metryczka details > *:not(summary) { display: block; }
  .stopka { background: none; color: #000; border-top: 1px solid #000; }
  .stopka a { color: #000; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
