/*
Theme Name: Elkman
Description: Motyw strony elkman.pl – sieć szerokopasmowa aglomeracji Miasta Ełku.
Version: 0.1.0
Text Domain: elkman
*/

:root {
  --blue: #0580c5;
  --blue-dark: #04639b;
  --blue-deep: #0a3b5c;
  --green: #adcc1f;
  --green-dark: #6f8a0a;
  --ink: #1b2b36;
  --muted: #55646f;
  --line: #dbe5ec;
  --bg: #ffffff;
  --bg-soft: #f2f7fb;
  --danger: #b3261e;
  --warn: #8a5a00;
  --radius: 10px;
  --maxw: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--blue-dark); text-underline-offset: 2px; }
a:hover { color: var(--blue-deep); }
:focus-visible { outline: 3px solid #ffb300; outline-offset: 2px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: 10px 14px; z-index: 100; }
.skip-link:focus { left: 10px; top: 10px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ----- pasek alarmowy ----- */
.alert-bar { font-size: 16px; line-height: 1.4; }
.alert-bar .wrap { padding-top: 10px; padding-bottom: 10px; }
.alert-bar a { color: inherit; font-weight: 600; }
.alert-krytyczny { background: var(--danger); color: #fff; }
.alert-ostrzezenie { background: #ffd54a; color: #3b2a00; }
.alert-info { background: var(--blue-deep); color: #fff; }

/* ----- nagłówek ----- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 56px; width: auto; display: block; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font: inherit; cursor: pointer; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a { display: block; padding: 10px 11px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 500; }
.main-nav a:hover { background: var(--bg-soft); }
.main-nav .current-menu-item > a, .main-nav .current_page_item > a { color: var(--blue-dark); box-shadow: inset 0 -3px 0 var(--green); border-radius: 0; }
.main-nav .menu-cta > a { background: var(--blue); color: #fff; }
.main-nav .menu-cta > a:hover { background: var(--blue-dark); }

/* ----- wyszukiwarka ----- */
.site-search { display: flex; margin-left: auto; }
.site-search input { width: 150px; padding: 8px 12px; font: inherit; font-size: 15px; border: 1px solid #9fb3c1; border-right: 0; border-radius: 8px 0 0 8px; background: #fff; }
.site-search button { padding: 0 12px; border: 1px solid var(--blue); background: var(--blue); color: #fff; border-radius: 0 8px 8px 0; cursor: pointer; }
.site-search button:hover { background: var(--blue-dark); }

/* ----- hero ----- */
.hero { background: linear-gradient(135deg, var(--blue-deep), var(--blue) 70%); color: #fff; position: relative; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; padding-top: 64px; padding-bottom: 64px; }
.hero h1 { font-size: clamp(30px, 4.5vw, 48px); line-height: 1.15; margin: 0 0 16px; }
.hero p { font-size: 19px; max-width: 56ch; margin: 0 0 24px; color: #e6f2fa; }
.hero-mark { justify-self: center; width: min(320px, 70%); opacity: .95; }
.btn { display: inline-block; background: var(--green); color: #1e2a00; font-weight: 700; padding: 12px 22px; border: 0; border-radius: 8px; text-decoration: none; cursor: pointer; font-size: 17px; }
.btn:hover { background: #c0e03a; color: #1e2a00; }
.btn-ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.7); margin-left: 8px; }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ----- sekcje ----- */
.section { padding: 56px 0; }
.section.soft { background: var(--bg-soft); }
.section h2 { font-size: 28px; margin: 0 0 24px; }
.section h2::after { content: ""; display: block; width: 56px; height: 4px; background: var(--green); margin-top: 8px; border-radius: 2px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; text-decoration: none; color: inherit; display: block; transition: box-shadow .15s, transform .15s; }
a.card:hover { box-shadow: 0 6px 20px rgba(5,128,197,.15); transform: translateY(-2px); }
.card h3 { margin: 0 0 8px; font-size: 20px; color: var(--blue-dark); }
.card p { margin: 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; text-align: center; }
.stat b { display: block; font-size: 40px; color: var(--blue); line-height: 1.1; }
.stat span { color: var(--muted); font-size: 15px; }

/* ----- aktualności ----- */
.post-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.post-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; }
.post-item h3 { margin: 4px 0 6px; font-size: 20px; }
.post-item h3 a { text-decoration: none; }
.post-item h3 a:hover { text-decoration: underline; }
.meta { color: var(--muted); font-size: 14px; }
.tag { display: inline-block; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 99px; background: var(--bg-soft); color: var(--blue-dark); text-decoration: none; margin-right: 6px; }
.tag.cat-awarie { background: #fde7e5; color: var(--danger); }
.tag.cat-prace-planowane { background: #fff1c2; color: var(--warn); }
.cat-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.cat-filter a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; color: var(--ink); font-size: 15px; }
.cat-filter a.on, .cat-filter a:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ----- treść ----- */
.page-head { background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: 36px 0 28px; }
.page-head h1 { margin: 0; font-size: 34px; line-height: 1.2; }
.page-head .meta { margin-top: 8px; }
.content { padding: 40px 0 64px; }
.content .entry { max-width: 78ch; }
.content .entry h2 { margin-top: 1.8em; }
.content .entry h2, .content .entry h3 { line-height: 1.3; }
.entry table { border-collapse: collapse; width: 100%; }
.entry th, .entry td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.entry th { background: var(--bg-soft); }
.entry details { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 10px 0; }
.entry summary { cursor: pointer; font-weight: 600; }

/* uczestnicy */
.uczestnik-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; padding: 0; list-style: none; }
.uczestnik { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; background: #fff; }
.uczestnik h3 { margin: 0 0 4px; font-size: 18px; }
.uczestnik .meta { margin: 0; }

/* formularz */
.zgloszenie { max-width: 640px; }
.zgloszenie label { display: block; font-weight: 600; margin-bottom: 4px; }
.zgloszenie input, .zgloszenie select, .zgloszenie textarea { width: 100%; padding: 10px 12px; font: inherit; border: 1px solid #9fb3c1; border-radius: 8px; background: #fff; }
.zgloszenie .hint { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.zgloszenie .hp { position: absolute; left: -9999px; }
.zgloszenie .btn { background: var(--blue); color: #fff; }
.zgloszenie .btn:hover { background: var(--blue-dark); }
.notice { padding: 14px 18px; border-radius: 8px; margin: 0 0 20px; }
.notice.ok { background: #e6f4d0; border: 1px solid #b6d97a; }
.notice.err { background: #fde7e5; border: 1px solid #f0aaa5; }

.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.pager { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ----- stopka ----- */
.site-footer { background: var(--blue-deep); color: #cfe3f1; padding: 40px 0 28px; font-size: 15px; }
.site-footer a { color: #fff; }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; }
.site-footer h2 { color: #fff; font-size: 16px; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.site-footer .legal { border-top: 1px solid rgba(255,255,255,.2); margin-top: 28px; padding-top: 16px; }
.site-footer .legal p { margin: 0 0 10px; }
.gov-links { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 0; margin: 0 0 12px; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 40px; }
  .hero-mark { display: none; }
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; padding: 8px 20px 16px; }
  .site-header .wrap { position: relative; }
  .brand img { height: 46px; }
  .site-search { order: 3; width: 100%; margin: 0 0 10px; }
  .site-search input { flex: 1; width: auto; }
  .site-header .wrap { flex-wrap: wrap; padding-top: 8px; }
  .nav-toggle { margin-left: auto; }
  .site-search { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .alert-stack, .site-footer, .nav-toggle { display: none; } }

/* ----- stan sieci: semafor, mapa, tabela ----- */
.semafor { display: flex; gap: 20px; align-items: center; background: #fff; border: 1px solid var(--line); border-left-width: 8px; border-radius: var(--radius); padding: 18px 22px; margin-bottom: 24px; }
.semafor-dots { display: flex; gap: 8px; }
.semafor-dots span { width: 26px; height: 26px; border-radius: 50%; display: block; }
.semafor-t { font-size: 24px; }
.elkman-map { height: 520px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; z-index: 0; }
.mk-wrap { background: none; border: 0; }
.mk { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); color: #fff; font-weight: 700; font-size: 13px; }
.leaflet-tooltip.mk-label { font-size: 12px; font-weight: 600; color: #1b2b36; border: 0; background: rgba(255,255,255,.92); box-shadow: 0 1px 3px rgba(0,0,0,.3); padding: 2px 6px; }
.stan-tabela { width: 100%; border-collapse: collapse; margin-top: 12px; }
.stan-tabela th, .stan-tabela td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.stan-tabela .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
@media (max-width: 860px) { .elkman-map { height: 380px; } .semafor { flex-direction: column; align-items: flex-start; } }

/* strony szerokie (Stan sieci, Strefa uczestnika): pełna szerokość kontenera zamiast kolumny tekstu */
.content .entry.entry-wide { max-width: none; }
.entry-wide .elkman-map { height: clamp(520px, 72vh, 860px); }
.entry-wide .zgloszenie { max-width: 760px; }
.entry-wide .stan-tabela td:last-child { white-space: nowrap; }

.stan-tabela th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
.stan-tabela th[data-sort]:hover { background: #e6eff6; }
.stan-tabela .sort-ind { display: inline-flex; flex-direction: column; margin-left: 8px; vertical-align: middle; line-height: .8; }
.stan-tabela .sort-ind i { font-style: normal; font-size: 10px; color: #a9b8c4; }
.stan-tabela th[aria-sort="ascending"] .sort-ind .up, .stan-tabela th[aria-sort="descending"] .sort-ind .dn { color: var(--blue-dark); }
.stan-narzedzia { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; margin: 8px 0 12px; }
.stan-pole { font-weight: 600; font-size: 14px; }
.stan-pole input, .stan-pole select { min-width: 260px; padding: 8px 10px; font: inherit; border: 1px solid #9fb3c1; border-radius: 8px; background: #fff; margin-top: 4px; }
.stan-pole select { min-width: 220px; }
.btn-link { background: none; border: 0; color: var(--blue-dark); text-decoration: underline; cursor: pointer; font: inherit; padding: 8px 4px; }
.stan-narzedzia .meta { flex-basis: 100%; margin: 0; }
tr[hidden] { display: none; }

/* Edytor harmonogramu powiadomień (Strefa uczestnika): wiersz = dni tygodnia w jednej linii, pod nimi godziny i „Usuń” */
.zgloszenie table.elkman-harm, .zgloszenie .elkman-harm tbody { display: block; width: 100%; margin: 4px 0 8px; }
.zgloszenie .elkman-harm tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.zgloszenie .elkman-harm td { display: block; border: 0; padding: 0; white-space: nowrap; }
.zgloszenie .elkman-harm td:first-child { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.zgloszenie .elkman-harm td:nth-child(3) { margin-left: auto; }
.zgloszenie .elkman-harm label { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-weight: 400; }
.zgloszenie .elkman-harm input[type=checkbox], .zgloszenie input[type=radio] { width: auto; padding: 0; }
.zgloszenie .elkman-harm input[type=time] { width: 8.5em; padding: 6px 8px; margin: 0 6px 0 4px; }
.zgloszenie .button, .zgloszenie button.elkman-harm-dodaj { font: inherit; font-size: 14px; padding: 6px 12px; border: 1px solid #9fb3c1; border-radius: 8px; background: #fff; color: var(--text, #1d2b36); cursor: pointer; }
.zgloszenie .button:hover { background: var(--bg-soft); }
.zgloszenie .elkman-harm + p .description { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; }

/* ----- pasek górny + Strefa uczestnika ----- */
.topbar { background: var(--blue-deep); color: #fff; font-size: 15px; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; }
.topbar a { color: #fff; }
.topbar-tel a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.strefa-menu { position: relative; margin-left: auto; }
.strefa-btn { display: inline-flex; align-items: center; gap: 8px; background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.85); border-radius: 999px; padding: 7px 18px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.strefa-btn:hover, .strefa-btn:focus-visible, .strefa-btn[aria-expanded="true"] { background: #fff; color: var(--blue-deep); }
.strefa-lista { position: absolute; right: 0; top: calc(100% + 10px); min-width: 270px; margin: 0; padding: 8px; list-style: none; background: #fff; color: var(--ink); border-radius: 14px; box-shadow: 0 14px 36px rgba(5,60,100,.28); z-index: 60; }
.strefa-lista[hidden] { display: none; }
.strefa-lista a { display: block; padding: 10px 14px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
.strefa-lista a:hover, .strefa-lista a:focus-visible { background: var(--bg-soft); color: var(--blue-dark); }
.strefa-kto { padding: 8px 14px 10px; font-size: 14px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.strefa-wyloguj { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
@media (max-width: 600px) { .topbar-tel { font-size: 13px; } .topbar-tel span { display: none; } .strefa-btn { padding: 6px 14px; } .strefa-lista { position: fixed; left: 12px; right: 12px; top: 56px; min-width: 0; } }
.strefa-wersja { padding: 6px 14px 2px; font-size: 12px; color: var(--muted); }
