/*
 * PodhaleInfo.pl - strona glowna, wersja 2 (/?wersja=2).
 * Samodzielny arkusz: main.css NIE jest tu ladowany. Selektory dwg-* to znaczniki
 * wspolnych szablonow (template-parts) i skryptow, v2-* to uklad z front-page-v2.php.
 */

/* ------------------------------------------------------------------ */
/* 1. Zmienne                                                           */
/* ------------------------------------------------------------------ */
:root,
html[data-dwg-theme="light"] {
  color-scheme: light;
  --v2-bg: #f3f5f8;
  --v2-surface: #ffffff;
  --v2-soft: #edf0f5;
  --v2-ink: #0f1826;
  --v2-ink-2: #36435a;
  --v2-muted: #66738a;
  --v2-visited: #7a8496;
  --v2-line: #e1e6ed;
  --v2-line-strong: #c6cfdb;
  --v2-brand: #123b7c;
  --v2-brand-strong: #0b2b5e;
  --v2-brand-soft: #e7eefb;
  --v2-on-brand: #ffffff;
  --v2-accent: #cf1f2e;
  --v2-accent-soft: #fdebed;
  --v2-amber: #d98200;
  --v2-seg-active: #ffffff;
  --v2-header-bg: rgba(255, 255, 255, 0.88);
  --v2-ring: rgba(18, 59, 124, 0.2);
  --v2-shadow-sm: 0 1px 2px rgba(15, 24, 38, 0.05);
  --v2-shadow-md: 0 10px 28px rgba(15, 24, 38, 0.1);
  --v2-shadow-lg: 0 28px 70px rgba(8, 14, 24, 0.32);
  --v2-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%2336435a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  /* Zmienne dotychczasowego motywu - uzywa ich baner instalacji aplikacji wstrzykiwany w stopce. */
  --dwg-bg: var(--v2-bg);
  --dwg-surface: var(--v2-surface);
  --dwg-text: var(--v2-ink);
  --dwg-muted: var(--v2-muted);
  --dwg-border-strong: var(--v2-line-strong);
  --dwg-navy: var(--v2-brand);
}

/* Wymiary i kroje trzymamy w osobnym `:root` (bez selektora motywu), zeby media
   query nizej mogly je nadpisywac - `html[data-dwg-theme="light"]` wygralby z `:root`. */
:root {
  --v2-radius: 16px;
  --v2-radius-sm: 10px;
  --v2-header-h: 68px;
  /* Miniatura w widoku listy ma staly rozmiar - to ona wyznacza stala wysokosc
     kazdej karty (karty bez zdjecia dostaja puste pole tej samej wielkosci). */
  --v2-thumb-w: 220px;
  --v2-thumb-h: 144px;
  --v2-card-related-h: 40px;
  --v2-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --v2-display: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

html[data-dwg-theme="dark"] {
  color-scheme: dark;
  --v2-bg: #0b1017;
  --v2-surface: #131a24;
  --v2-soft: #1b2430;
  --v2-ink: #eef2f7;
  --v2-ink-2: #c5cedb;
  --v2-muted: #93a0b3;
  --v2-visited: #8590a3;
  --v2-line: #232e3c;
  --v2-line-strong: #364456;
  --v2-brand: #8ab6ff;
  --v2-brand-strong: #a9c9ff;
  --v2-brand-soft: #1a2a45;
  --v2-on-brand: #0b1017;
  --v2-accent: #ff6b77;
  --v2-accent-soft: #3a1b22;
  --v2-amber: #f0a63a;
  --v2-seg-active: #2b3747;
  --v2-header-bg: rgba(13, 18, 26, 0.86);
  --v2-ring: rgba(138, 182, 255, 0.28);
  --v2-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --v2-shadow-md: 0 12px 30px rgba(0, 0, 0, 0.42);
  --v2-shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.6);
  --v2-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23c5cedb' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ */
/* 2. Podstawa                                                          */
/* ------------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--v2-header-h) + 16px);
}

body.v2 {
  margin: 0;
  background: var(--v2-bg);
  color: var(--v2-ink);
  font-family: var(--v2-font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

body.v2.dwg-menu-open { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
h1, h2, p { margin: 0; }

[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--v2-brand);
  outline-offset: 2px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.v2-wrap {
  width: min(100% - 32px, 1180px);
  margin-inline: auto;
}

.v2-skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--v2-brand);
  color: var(--v2-on-brand);
  font-weight: 600;
}
.v2-skip:focus { top: 12px; }

.v2-iconbtn {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--v2-line);
  border-radius: 50%;
  background: var(--v2-surface);
  color: var(--v2-ink-2);
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.v2-iconbtn:hover {
  border-color: var(--v2-line-strong);
  color: var(--v2-ink);
}

/* ------------------------------------------------------------------ */
/* 3. Naglowek                                                          */
/* ------------------------------------------------------------------ */
.v2-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--v2-header-bg);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--v2-line);
}
.admin-bar .v2-header { top: 32px; }

.v2-header__in {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--v2-header-h);
}

.v2-brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.v2-brand a { display: block; line-height: 0; border-radius: 10px; }
.v2-brand img {
  width: auto;
  height: 54px;
  max-width: 190px;
  object-fit: contain;
  object-position: left center;
}
.v2-brand .dwg-brand__logo--text {
  line-height: 1.1;
  font-family: var(--v2-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
/* Logo ma granatowe litery - w trybie ciemnym dostaje jasna podkladke, zeby bylo czytelne. */
html[data-dwg-theme="dark"] .v2-brand a:not(.dwg-brand__logo--text) {
  padding: 2px 10px;
  background: #ffffff;
}
.v2-brand__tagline {
  max-width: 22ch;
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--v2-muted);
}

.v2-nav { flex: 1 1 auto; min-width: 0; }
.v2-nav .dwg-menu,
.v2-nav .sub-menu {
  margin: 0;
  padding: 0;
  list-style: none;
}
.v2-nav .dwg-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--v2-ink-2);
  transition: background-color 0.15s, color 0.15s;
}
.v2-nav .dwg-menu a:hover {
  background: var(--v2-soft);
  color: var(--v2-ink);
}
.v2-nav .dwg-menu > .current-menu-item > a,
.v2-nav .dwg-menu > .current-menu-ancestor > a {
  background: var(--v2-brand-soft);
  color: var(--v2-brand);
}

.dwg-submenu-toggle {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--v2-muted);
}
.dwg-submenu-toggle span {
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s;
}
.is-submenu-open > .dwg-submenu-toggle span {
  margin-top: 3px;
  transform: rotate(-135deg);
}

.v2-nav__search { display: none; }

.v2-tools {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.v2-search {
  position: relative;
  width: 230px;
  height: 40px;
}
.v2-search input {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 40px;
  padding: 0 42px 0 16px;
  border: 1px solid var(--v2-line);
  border-radius: 999px;
  background: var(--v2-soft);
  font-size: 0.9rem;
  -webkit-appearance: none;
  appearance: none;
  transition: width 0.2s, background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.v2-search input::placeholder { color: var(--v2-muted); opacity: 1; }
.v2-search input:focus {
  outline: none;
  border-color: var(--v2-brand);
  background: var(--v2-surface);
  box-shadow: 0 0 0 3px var(--v2-ring);
}
.v2-search button {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--v2-muted);
}
.v2-search button:hover { color: var(--v2-ink); background: var(--v2-line); }

.dwg-theme-toggle__icon { display: none; line-height: 0; }
html:not([data-dwg-theme="dark"]) .dwg-theme-toggle__icon--moon { display: block; }
html[data-dwg-theme="dark"] .dwg-theme-toggle__icon--sun { display: block; }

.dwg-menu-toggle { display: none; }
.v2-menu-icon--close { display: none; }
.dwg-menu-toggle[aria-expanded="true"] .v2-menu-icon--open { display: none; }
.dwg-menu-toggle[aria-expanded="true"] .v2-menu-icon--close { display: inline; }

/* Menu poziome z rozwijanym podmenu (tablet od 861 px i pulpit) */
@media (min-width: 861px) {
  .v2-nav .dwg-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* menu przy ikonach wyszukiwania i motywu */
    gap: 2px;
  }
  .v2-nav .dwg-menu > li {
    position: relative;
    display: flex;
    align-items: center;
  }
  .v2-nav .dwg-menu > li > a { white-space: nowrap; }
  .v2-nav .dwg-submenu-toggle { margin-left: -6px; }
  .v2-nav .sub-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 5;
    min-width: 250px;
    padding: 6px;
    border: 1px solid var(--v2-line);
    border-radius: 14px;
    background: var(--v2-surface);
    box-shadow: var(--v2-shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  }
  .v2-nav .sub-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    height: 12px;
  }
  .v2-nav .sub-menu a { border-radius: 10px; padding: 9px 12px; }
  .v2-nav .menu-item-has-children:hover > .sub-menu,
  .v2-nav .menu-item-has-children:focus-within > .sub-menu,
  .v2-nav .is-submenu-open > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
}

/* Tablet i waski pulpit: pole szukania zwija sie do ikony i rozwija nad menu po kliknieciu. */
@media (min-width: 861px) and (max-width: 1239px) {
  .v2-header__in { gap: 12px; }
  .v2-nav .dwg-menu a { padding: 8px 10px; font-size: 0.9rem; }
  .v2-search { width: 40px; }
  .v2-search input {
    padding: 0;
    color: transparent;
    cursor: pointer;
  }
  .v2-search input::placeholder { color: transparent; }
  .v2-search button { pointer-events: none; }
  .v2-search:focus-within input {
    z-index: 6;
    width: 260px;
    padding: 0 42px 0 16px;
    color: inherit;
    cursor: text;
  }
  .v2-search:focus-within input::placeholder { color: var(--v2-muted); }
  .v2-search:focus-within button { z-index: 7; pointer-events: auto; }
}

/* Tablet (861-980 px): menu poziome, ale zageszczone, zeby zakladki sie miescily. */
@media (min-width: 861px) and (max-width: 980px) {
  :root { --v2-header-h: 60px; }
  .v2-header__in { gap: 8px; }
  .v2-brand img { height: 40px; max-width: 120px; }
  .v2-brand__tagline { display: none; }
  .v2-nav .dwg-menu { gap: 0; }
  .v2-nav .dwg-menu a { padding: 7px 8px; font-size: 0.84rem; }
  .v2-nav .dwg-submenu-toggle { margin-left: -8px; }
}

/* Telefon: menu jako rozwijany panel pod naglowkiem */
@media (max-width: 860px) {
  :root { --v2-header-h: 60px; }
  .v2-brand img { height: 42px; max-width: 150px; }
  .v2-brand__tagline { display: none; }
  .v2-search { display: none; }
  .dwg-menu-toggle { display: inline-grid; }

  .v2-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--v2-header-h));
    max-height: calc(100dvh - var(--v2-header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    border-bottom: 1px solid var(--v2-line);
    background: var(--v2-surface);
    box-shadow: var(--v2-shadow-md);
  }
  .v2-nav.is-open { display: block; }
  .v2-nav .dwg-menu > li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    border-bottom: 1px solid var(--v2-line);
  }
  .v2-nav .dwg-menu > li > a {
    flex: 1 1 0;
    padding: 13px 4px;
    border-radius: 8px;
    font-size: 1rem;
  }
  .v2-nav .dwg-menu > .current-menu-item > a,
  .v2-nav .dwg-menu > .current-menu-ancestor > a { background: transparent; }
  .v2-nav .dwg-submenu-toggle { width: 40px; height: 40px; }
  .v2-nav .sub-menu {
    display: none;
    flex: 0 0 100%;
    padding: 0 0 8px 12px;
  }
  .v2-nav .is-submenu-open > .sub-menu { display: block; }
  .v2-nav .sub-menu a {
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 500;
  }

  .v2-nav__search { display: block; padding-top: 14px; }
  .dwg-search { display: flex; gap: 8px; }
  .dwg-search__field {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
  }
  .dwg-search__icon {
    position: absolute;
    left: 13px;
    line-height: 0;
    color: var(--v2-muted);
    pointer-events: none;
  }
  .dwg-search input[type="search"] {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 40px;
    border: 1px solid var(--v2-line);
    border-radius: 12px;
    background: var(--v2-soft);
    font-size: 1rem;
    -webkit-appearance: none;
    appearance: none;
  }
  .dwg-search input[type="search"]:focus {
    outline: none;
    border-color: var(--v2-brand);
    box-shadow: 0 0 0 3px var(--v2-ring);
  }
  .dwg-search button {
    flex: 0 0 auto;
    height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    background: var(--v2-brand);
    color: var(--v2-on-brand);
    font-weight: 600;
  }
}

@media (max-width: 782px) { .admin-bar .v2-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .v2-header { top: 0; } }

/* ------------------------------------------------------------------ */
/* 4. Wstep i uklad strony                                              */
/* ------------------------------------------------------------------ */
.v2-intro { padding: 30px 0 24px; }

.v2-intro__date {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--v2-muted);
}
.v2-intro__date::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--v2-accent);
}

/* Bez limitu szerokosci: gdy tekst miesci sie w jednej linii, nie jest zawijany; gdy nie - balance dzieli go rowno. */
.v2-intro__title {
  max-width: none;
  font-family: var(--v2-display);
  font-size: clamp(1.1rem, 0.85rem + 1.1vw, 1.6rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

/* Podstrony (region/gmina/miasto/miejscowosc/kategoria): wstep pod H1 i lista miejscowosci gminy. */
.v2-intro__lead {
  margin: 8px 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--v2-muted);
}
.v2-intro__lead a { color: var(--v2-brand); font-weight: 600; text-decoration: none; }
.v2-intro__lead a:hover,
.v2-intro__lead a:focus-visible { text-decoration: underline; }
.v2-intro__places {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  font-weight: 600;
}
.v2-intro__places a {
  color: var(--v2-brand);
  text-decoration: none;
}
.v2-intro__places a:hover,
.v2-intro__places a:focus-visible { text-decoration: underline; }

/* Strona glowna: regiony pod H1 - dyskretne pigulki (cienka ramka, wyciszony tekst, akcent dopiero po najechaniu). */
.v2-intro__regions ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.v2-intro__regions a {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--v2-line);
  border-radius: 999px;
  color: var(--v2-muted);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.v2-intro__regions a:hover,
.v2-intro__regions a:focus-visible {
  border-color: var(--v2-brand);
  background: var(--v2-brand-soft);
  color: var(--v2-brand);
  outline: none;
}
@media (max-width: 600px) {
  .v2-intro__regions ul { margin-top: 10px; gap: 5px; }
  .v2-intro__regions a { padding: 3px 10px; font-size: 0.78rem; }
}
/* Telefon w pionie: 6 regionow w dwoch rzedach po 3, rownej szerokosci. */
@media (max-width: 600px) and (orientation: portrait) {
  .v2-intro__regions ul { display: grid; grid-template-columns: repeat(3, 1fr); }
  .v2-intro__regions a { display: block; text-align: center; padding: 4px 6px; }
}

/* Okruszki podstron (w miejscu daty). */
.v2-crumbs { margin-bottom: 10px; }
.v2-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--v2-muted);
}
.v2-crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.v2-crumbs li + li::before {
  content: "›";
  margin: 0 7px;
  color: var(--v2-muted);
}
.v2-crumbs a { color: var(--v2-brand); text-decoration: none; }
.v2-crumbs a:hover,
.v2-crumbs a:focus-visible { text-decoration: underline; }

/* Powiazane strony (region / gmina / miasto). */
.v2-intro__related {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin: 8px 0 0;
  font-size: 0.88rem;
  font-weight: 600;
}
.v2-intro__related-label { color: var(--v2-muted); font-weight: 500; }
.v2-intro__related-sep { color: var(--v2-muted); }
.v2-intro__related a { color: var(--v2-brand); text-decoration: none; }
.v2-intro__related a:hover,
.v2-intro__related a:focus-visible { text-decoration: underline; }

.v2-layout {
  display: grid;
  gap: 20px;
  padding-bottom: 56px;
}
.v2-aside,
.v2-panels {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.v2-feed { min-width: 0; }
.v2-panel { display: flex; min-width: 0; }
.v2-panel > .dwg-card { flex: 1 1 auto; }
.v2-weather { container: v2w / inline-size; } /* nazwany kontener: kafelek pogody sam nie moze stylowac siebie przez @container */
.v2-weather:empty,
.v2-panel:empty { display: none; }

/* Telefon: kafelki jeden pod drugim, w kolejnosci z szablonu (podsumowanie dnia, wydarzenia, na zywo). */
@media (max-width: 700px) {
  .v2-intro { padding: 20px 0 16px; }
  .v2-layout { gap: 16px; padding-bottom: 40px; }
  .v2-aside { gap: 12px; }
  .v2-panels { gap: 12px; }
}

/* Tablet i PC: pogoda i kafelki w dwoch kolumnach nad lista. */
@media (min-width: 701px) {
  .v2-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v2-panels { display: contents; }
  .v2-aside--odd .v2-weather { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------ */
/* 5. Przelaczniki segmentowe (sortowanie, okres, pogoda)               */
/* ------------------------------------------------------------------ */
.dwg-ranking__segments {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--v2-soft);
}
.dwg-ranking__segments > a,
.dwg-ranking__segments > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--v2-ink-2);
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.dwg-ranking__segments > a:hover,
.dwg-ranking__segments > button:not(:disabled):hover { color: var(--v2-ink); }
.dwg-ranking__segments > .is-active {
  background: var(--v2-seg-active);
  color: var(--v2-ink);
  box-shadow: var(--v2-shadow-sm);
}
.dwg-ranking__segments > button:disabled { opacity: 0.45; cursor: default; }
.dwg-ranking__segments svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------------ */
/* 6. Pogoda                                                            */
/* ------------------------------------------------------------------ */
.dwg-weather__panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title seg"
    "main main"
    "astro astro"
    "source source";
  align-items: center;
  gap: 14px 12px;
  padding: 18px;
  border: 1px solid var(--v2-line);
  border-radius: var(--v2-radius);
  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-sm);
}
.dwg-weather__mobile-head,
.dwg-weather__corner-toggle,
.dwg-weather__expand { display: none; }
.dwg-weather__controls { display: contents; }

/* baseline: "POGODA" i nazwa regionu stoja na tej samej linii tekstu (przy center region byl ok. 2 px wyzej). */
.dwg-weather__control-titles { grid-area: title; display: flex; align-items: baseline; gap: 8px; min-width: 0; line-height: 1.3; }
/* Wybor regionu pogody: mala "pigulka" obok slowa POGODA (ikona pinezki, nazwa regionu, strzalka). */
.dwg-weather__region {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  padding: 0;
  border: 1px solid var(--v2-line);
  border-radius: 999px;
  background: transparent;
  /* Nazwa regionu w tym samym kroju, rozmiarze i kolorze co "POGODA"; delikatna ramka pokazuje, ze to wybor. */
  color: var(--v2-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.dwg-weather__region svg { display: none; }
/* Strzalka lezy NAD lista (bez klikania) - klikniecie w nazwe lub strzalke trafia w <select> i otwiera liste. */
.dwg-weather__region select {
  margin: 0;
  padding: 3px 27px 3px 11px; /* odstep od ramki jest w <select>, wiec klik w cala pigulke otwiera liste; z zapasem na wersaliki z rozstrzeleniem */
  min-width: 9.6em; /* "PODHALE" (najdluzsze w wersalikach z rozstrzeleniem) musi sie zmiescic z zapasem */
  border: 0;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: inherit; /* przegladarka domyslnie zeruje rozstrzelenie w <select> */
  line-height: inherit;
  background: transparent;
  color: inherit;
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  outline: none;
}
.dwg-weather__region option { background: var(--v2-surface); color: var(--v2-ink); letter-spacing: normal; text-transform: none; font-weight: 600; }
.dwg-weather__region::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 9px;
  width: 5px;
  height: 5px;
  margin-top: -4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  pointer-events: none;
}
.dwg-weather__region:hover { color: var(--v2-ink); border-color: var(--v2-line-strong); }
.dwg-weather__region:focus-within { color: var(--v2-ink); border-color: var(--v2-brand); box-shadow: 0 0 0 3px var(--v2-ring); }
/* Podczas wczytywania innego regionu dane lekko przygaszone. */
.dwg-weather__inner,
.dwg-weather__week,
.dwg-weather__astro { transition: opacity 0.15s; }
.dwg-weather.is-loading .dwg-weather__inner,
.dwg-weather.is-loading .dwg-weather__week,
.dwg-weather.is-loading .dwg-weather__astro { opacity: 0.5; }
/* Waski telefon: brak miejsca na "POGODA" + wybor regionu + Open-Meteo w jednym wierszu - slowo POGODA tylko dla czytnikow ekranu. */
@media (max-width: 480px) {
  .dwg-weather__control-titles > [data-weather-heading] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
.dwg-weather__control-titles strong {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--v2-muted);
}
.dwg-weather__segments { grid-area: seg; }
.dwg-weather__segments > button { min-height: 28px; padding: 0 11px; font-size: 0.8rem; }

.dwg-weather__control-source {
  grid-area: source;
  justify-self: end;
  font-size: 0.72rem;
  color: var(--v2-muted);
}
.dwg-weather__control-source:hover { color: var(--v2-brand); text-decoration: underline; }

.dwg-weather__inner,
.dwg-weather__week { grid-area: main; min-width: 0; }

.dwg-weather__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: center;
  gap: 14px 24px;
}

.dwg-weather__date {
  display: none; /* data w boxie pogody ukryta */
  order: -1;
  grid-column: 1 / -1;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 5px;
  font-size: 0.86rem;
  color: var(--v2-ink-2);
}
.dwg-weather__day { font-weight: 600; }
.dwg-weather__day::after { content: ","; }

.dwg-weather__summary {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  column-gap: 14px;
  row-gap: 2px;
}
.dwg-weather__icon {
  grid-column: 1;
  grid-row: 1 / span 3;
  width: 64px;
  height: 64px;
}
.dwg-weather__icon svg { display: block; width: 100%; height: 100%; }
/* Tablet i PC: ikona pogody i opis wysrodkowane w swojej czesci kafelka. */
@media (min-width: 701px) {
  .dwg-weather__summary { justify-content: center; justify-items: center; text-align: center; grid-template-columns: auto auto; }
  .dwg-weather__main-text, .dwg-weather__temperature strong, .dwg-weather__temperature span { text-align: center; }
}
.dwg-weather__temperature { display: contents; }
.dwg-weather__temperature strong {
  grid-column: 2;
  grid-row: 1;
  font-family: var(--v2-display);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}
.dwg-weather__main-text {
  grid-column: 2;
  grid-row: 2;
  margin-top: 4px;
  font-size: 0.96rem;
  line-height: 1.3;
}
.dwg-weather__main-text strong { font-weight: 600; }
.dwg-weather__temperature span {
  grid-column: 2;
  grid-row: 3;
  font-size: 0.84rem;
  color: var(--v2-muted);
}

/* Pola z danymi: ikonka + etykieta nad wartoscia, bez tla; kolumny rozdzielone cienka kreska. */
.dwg-weather__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 0;
}
.dwg-weather__item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-content: center;
  align-items: center;
  column-gap: 10px;
  min-width: 0;
  padding: 2px 14px;
}
.dwg-weather__stats > .dwg-weather__item:nth-child(odd) { padding-left: 0; }
.dwg-weather__stats > .dwg-weather__item:nth-child(even) { border-left: 1px solid var(--v2-line); }
.dwg-weather__item-icon {
  grid-row: 1 / -1;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--v2-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dwg-weather__item-label { font-size: 0.72rem; font-weight: 500; line-height: 1.3; color: var(--v2-muted); }
.dwg-weather__item strong { font-size: 0.92rem; font-weight: 700; line-height: 1.3; }
/* Szansa opadow: na waskim kafelku pod wartoscia, na szerszym (od 600 px) obok niej. */
.dwg-weather__item-note { display: block; margin-left: 0; font-size: 0.74rem; font-weight: 500; color: var(--v2-muted); white-space: nowrap; }

/* Delikatny odcien kafelka zalezny od pogody (ustawia menu.js w data-weather-mood). */
.dwg-weather[data-weather-mood] .dwg-weather__panel {
  background: linear-gradient(135deg, color-mix(in srgb, var(--dwg-weather-tint) 11%, var(--v2-surface)) 0%, var(--v2-surface) 65%);
}
.dwg-weather[data-weather-mood="sun"] { --dwg-weather-tint: #f3a900; }
.dwg-weather[data-weather-mood="partly"] { --dwg-weather-tint: #e8b93a; }
.dwg-weather[data-weather-mood="rain"] { --dwg-weather-tint: #3293e6; }
.dwg-weather[data-weather-mood="snow"] { --dwg-weather-tint: #59b6f2; }
.dwg-weather[data-weather-mood="storm"] { --dwg-weather-tint: #7a6cf0; }
.dwg-weather[data-weather-mood="fog"],
.dwg-weather[data-weather-mood="cloud"] { --dwg-weather-tint: #8fa3b3; }

.dwg-weather__astro {
  grid-area: astro;
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* wyśrodkowane na kazdej szerokosci */
  gap: 8px 22px;
  padding-top: 13px;
  border-top: 1px solid var(--v2-line);
}
.dwg-weather__astro-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1px;
  font-size: 0.72rem;
  color: var(--v2-muted);
}
.dwg-weather__astro-item strong { font-size: 0.86rem; font-weight: 600; color: var(--v2-ink); }

.dwg-weather__forecast { display: grid; }
.dwg-weather-day {
  display: grid;
  grid-template-columns: 62px 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--v2-line);
}
.dwg-weather-day:first-child { padding-top: 0; border-top: 0; }
.dwg-weather-day:last-child { padding-bottom: 0; }
.dwg-weather-day__head { display: flex; flex-direction: column; line-height: 1.25; }
.dwg-weather-day__head strong { font-size: 0.86rem; font-weight: 600; text-transform: capitalize; }
.dwg-weather-day__head span { font-size: 0.72rem; color: var(--v2-muted); }
.dwg-weather-day__icon svg { display: block; width: 28px; height: 28px; }
.dwg-weather-day__condition {
  overflow: hidden;
  font-size: 0.82rem;
  color: var(--v2-ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dwg-weather-day__temperature { display: flex; gap: 8px; font-size: 0.9rem; }
.dwg-weather-day__temperature strong { font-weight: 700; }
.dwg-weather-day__temperature span { color: var(--v2-muted); }

/* Tablet i pulpit: podsumowanie po lewej, cztery pola informacyjne po prawej (bez pustych miejsc). */
@media (min-width: 701px) {
  .dwg-weather__panel { container-type: inline-size; }
  .dwg-weather__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
    align-items: center;
    gap: 14px 18px;
  }
}
/* Waski kafelek (kolumna boczna): ikona, temperatura i opis jeden pod drugim, pola jako wiersze. */
@media (min-width: 701px) {
  @container (max-width: 470px) {
    .dwg-weather__summary {
      grid-template-columns: minmax(0, 1fr);
      row-gap: 3px;
    }
    .dwg-weather__icon { grid-column: 1; grid-row: 1; width: 50px; height: 50px; }
    .dwg-weather__temperature strong { grid-column: 1; grid-row: 2; font-size: 2.2rem; }
    .dwg-weather__main-text { grid-column: 1; grid-row: 3; margin-top: 2px; }
    .dwg-weather__temperature span { grid-column: 1; grid-row: 4; }
    .dwg-weather__stats { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .dwg-weather__stats > .dwg-weather__item { padding: 0; border-left: 0; }
  }
}

/* Tablet i PC: niski kafelek pogody (okolo polowy dawnej wysokosci), wszystkie elementy zostaja.
   Pierwszy wiersz: tytul, zrodlo, przelacznik Dzis/7 dni. Drugi: podsumowanie i cztery pola. */
/* Od 600 px kafelka (wczesniej 720 - na tablecie ok. 700-750 px okna pogoda robila sie bardzo wysoka).
   Tylko od 701 px okna: ponizej dziala zwijany uklad telefonu (przy oknie 630-700 px kafelek tez ma 600+ px). */
@media (min-width: 701px) {
@container v2w (min-width: 600px) {
  .dwg-weather__panel {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "title title seg"
      "main main main"
      "astro astro source";
    gap: 12px 16px;
    padding: 14px 18px;
  }
  /* Zrodlo danych male i blade w prawym dolnym rogu (wczesniej przy przelaczniku wygladalo jak przycisk). */
  .dwg-weather__control-source { justify-self: end; align-self: end; font-size: 0.68rem; opacity: 0.75; }
  .dwg-weather__segments { justify-self: end; }
  .dwg-weather__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 10px 20px; }
  /* Podsumowanie wyrownane do lewej: ikona | temperatura | opis i odczuwalna. */
  .dwg-weather__summary {
    grid-template-columns: auto auto minmax(0, 1fr);
    justify-content: start;
    justify-items: start;
    text-align: left;
    column-gap: 12px;
    row-gap: 1px;
  }
  .dwg-weather__icon { grid-column: 1; grid-row: 1 / span 2; width: 52px; height: 52px; }
  .dwg-weather__temperature strong { grid-column: 2; grid-row: 1 / span 2; font-size: 2.1rem; text-align: left; }
  .dwg-weather__main-text { grid-column: 3; grid-row: 1; align-self: end; margin-top: 0; font-size: 0.92rem; line-height: 1.25; text-align: left; }
  .dwg-weather__temperature span { grid-column: 3; grid-row: 2; align-self: start; font-size: 0.8rem; line-height: 1.25; text-align: left; }
  .dwg-weather__item-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dwg-weather__item strong { min-width: 0; }
  .dwg-weather__item-note { display: inline-block; margin-left: 6px; }
  /* Dane o sloncu i ksiezycu w jednym, wysrodkowanym rzedzie, rozdzielone kreskami. */
  .dwg-weather__astro { justify-content: center; padding-top: 10px; gap: 4px 0; }
  .dwg-weather__astro-item { flex-direction: row; align-items: baseline; gap: 6px; padding: 0 12px; border-left: 1px solid var(--v2-line); white-space: nowrap; }
  .dwg-weather__astro-item:first-child { padding-left: 0; border-left: 0; }
}
/* 600-819 px: dane o sloncu potrzebuja calej szerokosci, wiec zrodlo stoi w naglowku, wysrodkowane. */
@container v2w (min-width: 600px) and (max-width: 819px) {
  .dwg-weather__panel {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas:
      "title source seg"
      "main main main"
      "astro astro astro";
  }
  .dwg-weather__control-source { justify-self: center; align-self: center; }
}
/* Szerszy kafelek: cztery pola w jednym rzedzie, etykieta nad wartoscia. */
@container v2w (min-width: 820px) {
  .dwg-weather__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .dwg-weather__stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dwg-weather__stats > .dwg-weather__item:nth-child(n) { padding-left: 14px; border-left: 1px solid var(--v2-line); }
  .dwg-weather__stats > .dwg-weather__item:first-child { padding-left: 0; border-left: 0; }
}
} /* koniec @media (min-width: 701px) */
/* Dane o sloncu i ksiezycu na kazdej szerokosci w jednym rzedzie pod reszta (bez osobnej siatki 2x2 po prawej). */

/* Telefon: zwinieta pogoda to jedna linia, szczegoly po rozwinieciu (prog 700px = prog w menu.js). */
@media (max-width: 700px) {
  /* Naglowek: "POGODA" | Open-Meteo (wysrodkowane) | strzalka rozwijania. */
  .dwg-weather__panel {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas:
      "title source expand"
      "main main main";
    gap: 10px 12px;
    padding: 14px 16px;
  }
  .dwg-weather__control-source { justify-self: center; align-self: center; font-size: 0.7rem; opacity: 0.75; }
  .dwg-weather__expand { display: block; grid-area: expand; justify-self: end; }
  .dwg-weather__expand-source { display: none; }
  .dwg-weather__expand-button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--v2-line);
    border-radius: 50%;
    background: var(--v2-surface);
    color: var(--v2-ink-2);
  }
  .dwg-weather__expand-icon {
    width: 8px;
    height: 8px;
    margin-top: -3px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
  }
  .dwg-weather.is-expanded .dwg-weather__expand-icon { margin-top: 3px; transform: rotate(-135deg); }

  .dwg-weather__summary { grid-template-columns: 44px auto; column-gap: 12px; justify-content: center; }
  .dwg-weather__main-text, .dwg-weather__temperature strong, .dwg-weather__temperature span { text-align: left; }
  .dwg-weather__icon { width: 44px; height: 44px; grid-row: 1 / span 2; }
  .dwg-weather__temperature strong { font-size: 1.7rem; }
  .dwg-weather__main-text {
    grid-column: 2;
    grid-row: 2;
    margin-top: 2px;
    font-size: 0.9rem;
  }
  .dwg-weather__temperature span { grid-row: 3; }

  .dwg-weather:not(.is-expanded) .dwg-weather__segments,
  .dwg-weather:not(.is-expanded) .dwg-weather__date,
  .dwg-weather:not(.is-expanded) .dwg-weather__stats,
  .dwg-weather:not(.is-expanded) .dwg-weather__astro,
  .dwg-weather:not(.is-expanded) .dwg-weather__temperature span { display: none; }

  .dwg-weather.is-expanded .dwg-weather__panel {
    grid-template-areas:
      "title source expand"
      "seg seg seg"
      "main main main"
      "astro astro astro";
  }
  .dwg-weather.is-expanded .dwg-weather__segments { justify-self: start; }
}

/* ------------------------------------------------------------------ */
/* 7. Kafelki: podsumowanie dnia, wydarzenia, przeslane przez mieszkancow */
/* ------------------------------------------------------------------ */
.dwg-card--homepage-panel {
  --v2-panel-dot: var(--v2-brand);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--v2-line);
  border-radius: var(--v2-radius);
  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-sm);
}

.dwg-card--homepage-panel__head {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 30px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.08em;
  color: var(--v2-muted);
}
.dwg-card--homepage-panel__head::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--v2-panel-dot);
}
.dwg-card--homepage-panel__head:hover { color: var(--v2-ink); }

.dwg-card--homepage-panel .dwg-card__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dwg-card--summary__row { display: flex; flex-direction: column; gap: 8px; }

.dwg-card--homepage-panel .dwg-card__title {
  font-family: var(--v2-font);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}
.dwg-card--homepage-panel .dwg-card__title a:hover { text-decoration: underline; text-underline-offset: 3px; }

.dwg-card--summary__slide {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  min-height: calc(1.45em * 4);
  overflow: hidden;
}

/* Strzalki nastepny/poprzedni: prawy dolny rog kafelka, w jednej linii z linkiem "Pelne podsumowanie" / "Wszystkie wydarzenia". */
.dwg-card--summary__nav {
  position: absolute;
  bottom: 18px;
  right: 18px;
  display: flex;
  gap: 6px;
}
.dwg-card--summary__nav-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--v2-line);
  border-radius: 50%;
  background: var(--v2-surface);
  color: var(--v2-ink-2);
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.dwg-card--summary__nav-btn:hover { border-color: var(--v2-line-strong); color: var(--v2-ink); }
.dwg-card--summary__nav-btn svg { width: 16px; height: 16px; }

.dwg-events-slidemeta { display: block; min-height: 1.5em; line-height: 1.5; }
.dwg-events-slidemeta__item {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--v2-muted);
}
.dwg-events-slidemeta__item::before {
  content: "";
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 3px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 22s7-6.2 7-12a7 7 0 1 0-14 0c0 5.800 7 12 7 12Zm0-9.500a2.500 2.500 0 1 0 0-5 2.500 2.500 0 0 0 0 5Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 22s7-6.2 7-12a7 7 0 1 0-14 0c0 5.800 7 12 7 12Zm0-9.500a2.500 2.500 0 1 0 0-5 2.500 2.500 0 0 0 0 5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.dwg-events-slidemeta__item:hover { color: var(--v2-ink); }

.dwg-home-panels__add {
  display: flex;
  align-items: center;
  min-height: 30px;
  margin-top: auto;
  padding-right: 80px; /* miejsce na strzalki w prawym dolnym rogu */
}
.dwg-home-panels__add a {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--v2-brand);
}
.dwg-home-panels__add svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s;
}
.dwg-home-panels__add a:hover svg { transform: translateX(3px); }

/* Podsumowanie dnia - kafelek wyrozniony: jasnoniebieski w trybie jasnym, granat w ciemnym. */
.v2-panel--summary .dwg-card--homepage-panel {
  --v2-panel-dot: var(--v2-accent);
  border-color: #c6d8f1;
  background: linear-gradient(150deg, #eaf2fd 0%, #d7e6fa 100%);
  box-shadow: var(--v2-shadow-sm);
}
.v2-panel--summary .dwg-card--homepage-panel__head { color: #2c4f86; }
.v2-panel--summary .dwg-card--homepage-panel__head:hover { color: var(--v2-ink); }
.v2-panel--summary .dwg-card--summary__nav-btn { border-color: #bcd0ec; background: rgba(255, 255, 255, 0.65); }
.v2-panel--summary .dwg-events-slidemeta__item { color: #35547f; }
html[data-dwg-theme="dark"] .v2-panel--summary .dwg-card--homepage-panel {
  --v2-panel-dot: #ff6b77;
  border-color: rgba(255, 255, 255, 0.08);
  background: linear-gradient(150deg, #173a74 0%, #0d2147 100%);
  color: #ffffff;
  box-shadow: none;
}
html[data-dwg-theme="dark"] .v2-panel--summary .dwg-card--homepage-panel__head { color: rgba(255, 255, 255, 0.74); }
html[data-dwg-theme="dark"] .v2-panel--summary .dwg-card--homepage-panel__head:hover { color: #ffffff; }
html[data-dwg-theme="dark"] .v2-panel--summary .dwg-card--summary__nav-btn {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}
html[data-dwg-theme="dark"] .v2-panel--summary .dwg-card--summary__nav-btn:hover { background: rgba(255, 255, 255, 0.26); }
html[data-dwg-theme="dark"] .v2-panel--summary .dwg-events-slidemeta__item { color: rgba(255, 255, 255, 0.76); }
html[data-dwg-theme="dark"] .v2-panel--summary .dwg-events-slidemeta__item:hover { color: #ffffff; }
html[data-dwg-theme="dark"] .v2-panel--summary .dwg-home-panels__add a { color: #ffffff; }
html[data-dwg-theme="dark"] .v2-panel--summary :focus-visible { outline-color: #ffffff; }

/* Wydarzenia - cieple, piaskowe tlo (dopelnia granat podsumowania i biel reszty strony). */
.v2-panel--events .dwg-card--homepage-panel {
  --v2-panel-dot: var(--v2-amber);
  border-color: #f0d9a8;
  background: linear-gradient(150deg, #fff7e6 0%, #ffedc9 100%);
}
.v2-panel--events .dwg-card--homepage-panel__head { color: #7a5a1c; }
.v2-panel--events .dwg-card--homepage-panel__head:hover { color: var(--v2-ink); }
.v2-panel--events .dwg-card--summary__nav-btn { border-color: #ecd49c; background: rgba(255, 255, 255, 0.6); }
.v2-panel--events .dwg-events-slidemeta__item { color: #6b5320; }
html[data-dwg-theme="dark"] .v2-panel--events .dwg-card--homepage-panel {
  border-color: #4a3a1a;
  background: linear-gradient(150deg, #2b2314 0%, #211b10 100%);
}
html[data-dwg-theme="dark"] .v2-panel--events .dwg-card--homepage-panel__head { color: #d9b46a; }
html[data-dwg-theme="dark"] .v2-panel--events .dwg-card--summary__nav-btn { border-color: #5a4724; background: rgba(255, 255, 255, 0.06); }
html[data-dwg-theme="dark"] .v2-panel--events .dwg-events-slidemeta__item { color: #c9ab6b; }

.v2-panel--live .dwg-card--homepage-panel { --v2-panel-dot: var(--v2-accent); }
.v2-panel--live .dwg-card--homepage-panel__head::before { animation: v2-pulse 2s ease-out infinite; }
.v2-panel--live .dwg-home-panels__add a {
  flex-direction: row;
  padding: 8px 14px 8px 11px;
  border-radius: 999px;
  background: var(--v2-accent-soft);
  color: var(--v2-accent);
}
.v2-panel--live .dwg-home-panels__add a:hover svg { transform: none; }

@keyframes v2-pulse {
  0% { box-shadow: 0 0 0 0 rgba(207, 31, 46, 0.45); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(207, 31, 46, 0); }
}

/* ------------------------------------------------------------------ */
/* 8. Pasek sortowania nad lista                                        */
/* ------------------------------------------------------------------ */
/* Box z wyborem miejscowosci i kategorii + dwa osobne, okragle przyciski obok niego:
   "bez miniatur" (przekreslone zdjecie) i uklad lista/siatka (kolejnosc: box, bez miniatur, uklad). */
.dwg-ranking-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.dwg-ranking-wrap > .dwg-ranking { flex: 1 1 0; min-width: 0; }
.dwg-ranking__left { display: none; }
/* "Wyczysc filtry" pod boxem (tylko gdy jest wlaczony filtr kategorii lub miejscowosci). */
.dwg-ranking-wrap:has(+ .dwg-ranking-clear) { margin-bottom: 8px; }
.dwg-ranking-clear { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.dwg-ranking-clear a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--v2-line);
  border-radius: 999px;
  background: var(--v2-surface);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--v2-ink-2);
  transition: border-color 0.15s, color 0.15s;
}
.dwg-ranking-clear a:hover { border-color: var(--v2-accent); color: var(--v2-accent); }
@media (max-width: 700px) {
  .dwg-ranking-clear { justify-content: center; }
}
/* Wersja "Wyczysc filtry" w boxie (po prawej od pol) - tylko gdy miesci sie w jednym wierszu bez zwezania pol:
   waski uklad (pola do 190 px, bez podpisow) od ok. 710 px kontenera, szeroki (pola do 230 px + podpisy) od 900 px. */
.dwg-ranking__clear { display: none; }
.dwg-ranking__clear {
  align-items: center;
  gap: 6px;
  flex: none;
  white-space: nowrap;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--v2-line);
  border-radius: 999px;
  background: var(--v2-surface);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--v2-ink-2);
  transition: border-color 0.15s, color 0.15s;
}
.dwg-ranking__clear:hover { border-color: var(--v2-accent); color: var(--v2-accent); }
@media (min-width: 701px) {
  @container (min-width: 710px) and (max-width: 799px), (min-width: 900px) {
    .dwg-ranking.dwg-ranking--has-clear {
      grid-template-columns: minmax(0, 1fr) auto auto auto;
      grid-template-areas: ". loc cat clr";
    }
    .dwg-ranking--has-clear .dwg-ranking__clear { display: inline-flex; grid-area: clr; }
    .dwg-ranking-clear { display: none; }
    .dwg-ranking-wrap:has(+ .dwg-ranking-clear) { margin-bottom: 14px; }
  }
}

/* Dwa wiersze: sortowanie, pod spodem kategoria (przy prawej krawedzi boxa).
   Gdy kolumna listy jest dosc szeroka (zapytanie kontenerowe nizej) - wszystko w jednym wierszu.
   Przycisk "Dodaj link" jest pod paginacja (.v2-addlink), a przycisk ukladu stoi poza boxem. */
.v2-feed { container-type: inline-size; }

.dwg-ranking {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: ". loc cat";
  align-items: center;
  gap: 10px 12px;
  padding: 12px 14px;
  border: 1px solid var(--v2-line);
  border-radius: var(--v2-radius);
  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-sm);
}

/* TYMCZASOWO: sortowanie (najnowsze / odslony / polubienia) ukryte. Aby je przywrocic, usun ta regule
   i przywroc uklad "sort cat" (PC od 860 px kontenera) lub "sort" / "cat" (waskie ekrany) w .dwg-ranking. */
.dwg-ranking .dwg-ranking__sort-row { display: none; }

.dwg-ranking__sort-row {
  grid-area: sort;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px 18px;
  min-width: 0;
}
.dwg-ranking__group {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.dwg-ranking__label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--v2-muted);
  white-space: nowrap;
}

.dwg-ranking__group--category { grid-area: cat; justify-self: end; }
.dwg-ranking__group--location { grid-area: loc; justify-self: end; }
/* Pole wylaczone (np. brak miejscowosci z artykulami). */
.dwg-ranking__select:disabled { opacity: 0.55; cursor: not-allowed; }
.dwg-ranking__select:disabled:hover { border-color: var(--v2-line); }
/* Waska kolumna listy (wezszy tablet, maly pulpit): wezsze pola i bez podpisow "Lokalizacja" / "Kategoria",
   zeby oba pola zmiescily sie w jednym wierszu. Na telefonie podpisu lokalizacji nie ma w ogole. */
.dwg-ranking__group--location .dwg-ranking__label { display: none; }
@media (min-width: 701px) {
  .dwg-ranking__group--location .dwg-ranking__label { display: inline; }
  @container (max-width: 799px) {
    .dwg-ranking__select { max-width: 190px; }
    .dwg-ranking__group--location .dwg-ranking__label,
    .dwg-ranking__group--category .dwg-ranking__label { display: none; }
  }
}
.dwg-ranking__select {
  height: 38px;
  max-width: 230px;
  padding: 0 36px 0 14px;
  border: 1px solid var(--v2-line);
  border-radius: 999px;
  background-color: var(--v2-surface);
  background-image: var(--v2-chevron);
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 13px;
  font-size: 0.86rem;
  font-weight: 600;
  text-overflow: ellipsis;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dwg-ranking__select:hover { border-color: var(--v2-line-strong); }
/* Pole miejscowosci z podpowiedziami - wyglada jak przycisk wyboru, ale przyjmuje tekst. */
.dwg-locality-combo { position: relative; display: inline-flex; min-width: 0; }
.dwg-locality-combo__input.dwg-ranking__select { width: 230px; padding-right: 14px; background-image: none; color: inherit; font-family: inherit; cursor: text; }
.dwg-locality-combo__input::placeholder { color: inherit; opacity: 0.55; font-weight: 500; }
.dwg-locality-combo__input.dwg-ranking__select:not(:placeholder-shown) { padding-right: 34px; }
.dwg-locality-combo__clear {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: inherit; opacity: 0.6; cursor: pointer;
}
.dwg-locality-combo__clear[hidden] { display: none; }
.dwg-locality-combo__clear:hover { opacity: 1; background: var(--v2-ring); }
/* Kategoria: "x" przywracajacy domyslny widok, obok strzalki listy (strzalka zostaje). */
.dwg-category-combo { position: relative; display: inline-flex; min-width: 0; }
.dwg-category-combo.has-value .dwg-ranking__select { padding-right: 58px; background-position: right 13px center; }
.dwg-category-combo__clear {
  position: absolute; top: 50%; right: 32px; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; color: inherit; opacity: 0.6; text-decoration: none;
}
.dwg-category-combo__clear:hover { opacity: 1; background: var(--v2-ring); }
.dwg-locality-combo__list {
  position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; right: 0;
  max-height: 280px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
  background: var(--v2-surface); border: 1px solid var(--v2-line); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
}
.dwg-locality-combo__list li { padding: 8px 12px; border-radius: 9px; font-size: 0.86rem; font-weight: 600; cursor: pointer; }
.dwg-locality-combo__list li:hover,
.dwg-locality-combo__list li.is-active { background: var(--v2-ring); }
.dwg-locality-combo__list li.is-empty { cursor: default; opacity: 0.6; font-weight: 500; background: none; }
.dwg-locality-combo__hint { margin-left: 6px; font-size: 0.74rem; font-weight: 500; color: var(--v2-muted); }
.dwg-ranking__select:focus-visible {
  outline: none;
  border-color: var(--v2-brand);
  box-shadow: 0 0 0 3px var(--v2-ring);
}

.dwg-layout-toggle,
.dwg-images-toggle {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--v2-line);
  border-radius: 50%;
  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-sm);
  color: var(--v2-brand);
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.dwg-layout-toggle:hover,
.dwg-images-toggle:hover { border-color: var(--v2-brand); background: var(--v2-brand-soft); color: var(--v2-brand-strong); }
.dwg-layout-toggle:focus-visible,
.dwg-images-toggle:focus-visible { outline: none; border-color: var(--v2-brand); box-shadow: 0 0 0 3px var(--v2-ring); }
/* Tryb "bez miniatur" wlaczony: przycisk podswietlony, a pole na miniature (takze puste pole kart bez zdjecia)
   znika w calosci - tekst karty zajmuje cala jej szerokosc. */
.dwg-images-toggle[aria-pressed="true"] { border-color: var(--v2-brand); background: var(--v2-brand-soft); }
/* Ikona pokazuje, co zrobi klik: zdjecia widoczne = przekreslone (ukryj), zdjecia ukryte = bez przekreslenia (pokaz). */
.dwg-images-toggle[aria-pressed="true"] .dwg-images-toggle__slash { display: none; }
/* Bez miniatur karta moze byc wyzsza - tytul pokazujemy dluzej (do 6 linii zamiast 3). */
html[data-dwg-lap-images="off"] .v2-feed .dwg-card--lap .dwg-card__title a { -webkit-line-clamp: 6; }
html[data-dwg-lap-images="off"] .v2-feed .dwg-card__image--lap,
html[data-dwg-lap-images="off"] .v2-feed .dwg-card--lap.dwg-card--text-only::before { display: none; }
/* Ikona pokazuje uklad, na ktory przycisk przelaczy. */
.dwg-layout-toggle__icon { display: none; line-height: 0; }
html[data-dwg-lap-layout="list"] .dwg-layout-toggle__icon--grid,
html[data-dwg-lap-layout="grid"] .dwg-layout-toggle__icon--list { display: block; }

/* "Dodaj link" z paska sortowania jest ukryty - osobny przycisk stoi pod paginacja. */
.dwg-ranking__add { display: none; }

.v2-addlink {
  display: flex;
  justify-content: center;
  margin-top: 22px;
  clear: both;
}
.v2-addlink__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px 0 16px;
  border-radius: 999px;
  background: var(--v2-brand);
  color: var(--v2-on-brand);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background-color 0.15s;
}
.v2-addlink__btn:hover { background: var(--v2-brand-strong); color: var(--v2-on-brand); }
.v2-addlink__btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

@media (max-width: 700px) {
  /* Telefon: dwa takie same boxy jeden pod drugim - kategoria + uklad, miejscowosc + "bez miniatur". */
  .dwg-ranking-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "cat layout"
      "loc images";
    gap: 8px;
  }
  .dwg-ranking { display: contents; }
  .dwg-ranking__group--category,
  .dwg-ranking__group--location {
    justify-self: stretch;
    padding: 10px;
    border: 1px solid var(--v2-line);
    border-radius: var(--v2-radius);
    background: var(--v2-surface);
    box-shadow: var(--v2-shadow-sm);
  }
  .dwg-layout-toggle,
  .dwg-images-toggle { width: 42px; height: 42px; }
  .dwg-layout-toggle { grid-area: layout; }
  .dwg-images-toggle { grid-area: images; }
  .dwg-ranking__sort-row { gap: 10px; }
  .dwg-ranking__group--metric,
  .dwg-ranking__group--period {
    flex: 1 1 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }
  .dwg-ranking__group--metric .dwg-ranking__segments,
  .dwg-ranking__group--period .dwg-ranking__segments { display: flex; }
  .dwg-ranking__group--metric .dwg-ranking__segments > a,
  .dwg-ranking__group--period .dwg-ranking__segments > a { flex: 1 1 0; padding: 0 8px; }
  .dwg-ranking__group--category,
  .dwg-ranking__group--location { flex: 1 1 0; justify-self: stretch; }
  .dwg-ranking__select { flex: 1 1 0; width: 100%; min-width: 0; max-width: none; }
  .dwg-locality-combo,
  .dwg-category-combo { flex: 1 1 0; width: 100%; }
}
@media (max-width: 400px) {
  .dwg-ranking__group--metric .dwg-ranking__segments svg { display: none; }
  .dwg-ranking__group--category .dwg-ranking__label { display: none; }
}

/* ------------------------------------------------------------------ */
/* 9. Karty artykulow                                                   */
/* ------------------------------------------------------------------ */
.dwg-grid { display: grid; gap: 12px; }

.dwg-card--lap {
  position: relative;
  display: flex;
  gap: 16px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--v2-line);
  border-radius: var(--v2-radius);
  background: var(--v2-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dwg-card--lap:hover {
  border-color: var(--v2-line-strong);
  box-shadow: var(--v2-shadow-md);
}

/* Miniatura i puste pole w jej miejscu (karta bez zdjecia) maja ten sam rozmiar. */
.dwg-card__image--lap,
.dwg-card--lap.dwg-card--text-only::before {
  flex: 0 0 var(--v2-thumb-w);
  align-self: flex-start;
  height: var(--v2-thumb-h);
  border-radius: var(--v2-radius-sm);
  background: var(--v2-soft);
}
.dwg-card--lap.dwg-card--text-only::before { content: ""; }
.dwg-card__image--lap {
  position: relative;
  overflow: hidden;
}
.dwg-card__image--lap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.dwg-card__image--lap img:not([src]) { visibility: hidden; }
.dwg-card--lap:hover .dwg-card__image--lap img { transform: scale(1.03); }

.dwg-card--lap .dwg-card__body {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 2px 2px 2px 0;
}

.dwg-label {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 76px);
  min-height: 28px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--v2-muted);
  white-space: nowrap;
}
.dwg-label__logo {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  object-fit: contain;
}
.dwg-label__link {
  position: relative;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dwg-label__link:hover { color: var(--v2-brand); text-decoration: underline; text-underline-offset: 2px; }

/* Wiersz zrodla: zrodlo po lewej, miejscowosc(i) artykulu po prawej - ta sama czcionka, kolor marki. */
.dwg-card__source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
  font-size: 0.76rem;
  font-weight: 600;
}
/* Za malo miejsca (telefon): zrodlo nigdy nie jest skracane - wielokropek dostaje tylko miejscowosc. */
.dwg-card--lap .dwg-card__source .dwg-label { flex: 0 0 auto; min-width: auto; max-width: none; }
.dwg-card--lap .dwg-card__source .dwg-label__link { overflow: visible; text-overflow: clip; }
.dwg-card__localities {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  color: var(--v2-brand);
  white-space: nowrap;
}
.dwg-card__locality-sep { flex: 0 0 auto; color: var(--v2-muted); }
.dwg-card__locality {
  flex: 0 1 auto;
  min-width: 0;
  position: relative;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
  text-decoration: none;
}
.dwg-card__locality:hover, .dwg-card__locality:focus-visible { text-decoration: underline; text-underline-offset: 2px; }
/* Administrator: kosz w prawym gornym rogu karty (lista / karta bez zdjecia) - miejscowosc nie wchodzi pod niego. */
.dwg-card__admin-delete ~ .dwg-card__body .dwg-card__source { padding-right: 36px; }
html[data-dwg-lap-layout="grid"] .v2-feed .dwg-card__admin-delete ~ .dwg-card__body .dwg-card__source { padding-right: 0; }

.dwg-card--lap .dwg-card__title {
  /* Tytul wysrodkowany w pionie miedzy zrodlem (u gory) a data (na dole); data zostaje przy dolnej krawedzi. */
  margin-top: auto;
  margin-bottom: auto;
  font-family: var(--v2-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.36;
  letter-spacing: -0.008em;
}
.dwg-card--lap .dwg-card__title a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
/* Cala karta otwiera artykul; przyciski i link zrodla leza nad ta warstwa. */
.dwg-card--lap .dwg-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--v2-radius);
}
.dwg-card--lap .dwg-card__title a:visited { color: var(--v2-visited); }
.dwg-card--lap:hover .dwg-card__title a { color: var(--v2-brand); }

.dwg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 10px;
  min-height: 26px;
  margin-top: auto;
  padding-top: 4px;
  font-size: 0.78rem;
  color: var(--v2-muted);
}
.dwg-meta time { order: 1; }
.dwg-card--lap .dwg-card__title + .dwg-meta { margin-top: 0; }
/* Data: telefon "16 listopada", tablet i PC "poniedzialek 16 listopada". */
.dwg-date-short { display: none; }
@media (max-width: 700px) {
  .dwg-date-short { display: inline; }
  .dwg-date-long { display: none; }
}
/* Telefon w trybie bez miniatur albo w siatce (karta na cala szerokosc): data z nazwa dnia tygodnia. */
html[data-dwg-lap-images="off"] .v2-feed .dwg-date-short,
html[data-dwg-lap-layout="grid"] .v2-feed .dwg-date-short { display: none; }
html[data-dwg-lap-images="off"] .v2-feed .dwg-date-long,
html[data-dwg-lap-layout="grid"] .v2-feed .dwg-date-long { display: inline; }
.dwg-meta > span ~ time::before { content: "\00b7"; margin-right: 10px; }

.dwg-related__toggle {
  order: 2;
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 4px 0 10px;
  /* delikatne tlo w kolorze marki (z wlasnego koloru motywu, wiec pasuje do jasnego i ciemnego trybu) */
  border: 1px solid color-mix(in srgb, var(--v2-brand) 22%, var(--v2-line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--v2-brand) 9%, var(--v2-surface));
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--v2-brand);
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.dwg-related__toggle:hover {
  border-color: var(--v2-brand);
  background: color-mix(in srgb, var(--v2-brand) 16%, var(--v2-surface));
  color: var(--v2-brand);
}
.dwg-related__toggle-full { display: none; }
.dwg-related__toggle-short { display: inline-flex; align-items: center; gap: 7px; }
.dwg-related__toggle-short::after { content: ""; flex: none; width: 6px; height: 6px; margin: -3px 1px 0 1px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.dwg-related__toggle-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--v2-surface);
  color: var(--v2-brand);
  font-size: 0.7rem;
  font-weight: 700;
}
/* Data i czas dodania przy prawej krawedzi karty; w widoku listy na tablecie/PC przycisk
   "Powiazane artykuly" jest jeszcze dalej na prawo, za data. */
html[data-dwg-lap-layout="list"] .v2-feed .dwg-meta .dwg-related__toggle--meta { margin-left: 4px; }

/* Widok siatki (kazda szerokosc): przycisk "Powiazane artykuly" w osobnym pasku pod trescia,
   wysrodkowany, bez linii nad nim (przycisk z wiersza daty jest wtedy ukryty). */
html[data-dwg-lap-layout="grid"] .v2-feed .dwg-card__related {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--v2-card-related-h);
  border-top: 0;
}
html[data-dwg-lap-layout="grid"] .v2-feed .dwg-meta .dwg-related__toggle--meta { display: none; }

/* Pasek z przyciskiem "Powiazane artykuly" pod trescia karty - wlaczany na telefonie
   (nizej), na szerszym ekranie przycisk zostaje w wierszu z data. */
.dwg-card__related { display: none; }

.dwg-card__like {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--v2-line);
  border-radius: 999px;
  background: var(--v2-surface);
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--v2-ink-2);
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.dwg-card__like svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}
.dwg-card__like:hover { border-color: var(--v2-accent); color: var(--v2-accent); }
.dwg-card__like[aria-pressed="true"] {
  border-color: transparent;
  background: var(--v2-accent-soft);
  color: var(--v2-accent);
}
.dwg-card__like[aria-pressed="true"] svg { fill: currentColor; }
.dwg-card__like:disabled { opacity: 0.6; cursor: default; }
/* TYMCZASOWO: ikona polubien ukryta na wszystkich kartach. Aby ja przywrocic, usun ponizsza regule. */
.dwg-card__like { display: none !important; }

/* Elementy widoczne tylko dla administratora */
.dwg-card__admin-delete {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  margin: 0;
}
.dwg-card__admin-delete button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--v2-line);
  border-radius: 50%;
  background: var(--v2-surface);
  color: var(--v2-accent);
}
.dwg-card__admin-delete .dashicons { width: 16px; height: 16px; font-size: 16px; }
.dwg-card__admin-delete ~ .dwg-card__like { right: 46px; }
.dwg-card__admin-delete ~ .dwg-card__body .dwg-label { max-width: calc(100% - 110px); }

.dwg-card__opens {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--v2-muted);
}
.dwg-card__opens svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.dwg-card__image--lap .dwg-card__opens {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(8, 14, 24, 0.72);
  color: #ffffff;
}

/* Link sponsorowany */
.dwg-card--sponsored { border-style: dashed; border-color: var(--v2-line-strong); }
.dwg-card--sponsored .dwg-label { max-width: 100%; }
.dwg-card__sponsored-label {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--v2-soft);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--v2-muted);
}

/* Uklad siatki (przelacznik w pasku sortowania) */
html[data-dwg-lap-layout="grid"] .v2-feed .dwg-grid {
  /* maksymalnie 3 kolumny (12 artykulow na strone = 4 rzedy); wezszy ekran - mniej kolumn */
  grid-template-columns: repeat(auto-fill, minmax(max(250px, calc((100% - 32px) / 3)), 1fr));
  gap: 16px;
}
html[data-dwg-lap-layout="grid"] .v2-feed .dwg-card--lap { flex-direction: column; gap: 10px; }
html[data-dwg-lap-layout="grid"] .v2-feed .dwg-card__image--lap,
html[data-dwg-lap-layout="grid"] .v2-feed .dwg-card--lap.dwg-card--text-only::before {
  flex: 0 0 auto;
  align-self: stretch;
  height: auto;
  aspect-ratio: 16 / 9;
}
html[data-dwg-lap-layout="grid"] .v2-feed .dwg-card--lap .dwg-card__body { flex: 1 1 auto; padding: 0 4px 4px; }
html[data-dwg-lap-layout="grid"] .v2-feed .dwg-card--lap:not(.dwg-card--text-only) .dwg-label { max-width: 100%; }
html[data-dwg-lap-layout="grid"] .v2-feed .dwg-card--lap:not(.dwg-card--text-only) .dwg-card__like { top: 20px; right: 20px; border-color: transparent; box-shadow: var(--v2-shadow-sm); }
html[data-dwg-lap-layout="grid"] .v2-feed .dwg-card--lap:not(.dwg-card--text-only) .dwg-card__admin-delete { top: 20px; right: 20px; }
html[data-dwg-lap-layout="grid"] .v2-feed .dwg-card--lap:not(.dwg-card--text-only) .dwg-card__admin-delete ~ .dwg-card__like { right: 54px; }
/* Siatka: zdjecie powiekszone o 20% w ramce (przyciete boki), sama miniatura bez zmiany rozmiaru. */
html[data-dwg-lap-layout="grid"] .v2-feed .dwg-card__image--lap img { transform: scale(1.2); }
html[data-dwg-lap-layout="grid"] .v2-feed .dwg-card--lap:hover .dwg-card__image--lap img { transform: scale(1.23); }
/* Stala wysokosc kafelka w siatce: tytul zawsze zajmuje miejsce trzech linii. */
html[data-dwg-lap-layout="grid"] .v2-feed .dwg-card--lap .dwg-card__title { min-height: calc(3 * 1.36em); }

@media (max-width: 600px) {
  :root {
    --v2-thumb-w: 92px;
    --v2-thumb-h: 126px;
  }
  .dwg-grid { gap: 10px; }
  .dwg-card--lap { column-gap: 12px; row-gap: 0; padding: 10px; }
  .dwg-card--lap .dwg-card__body { gap: 4px; }
  .dwg-card--lap .dwg-card__title { font-size: 0.96rem; line-height: 1.34; }
  .dwg-meta { min-height: 0; }
  .dwg-card__like { top: 10px; right: 10px; }
  .dwg-card__admin-delete { top: 10px; right: 10px; }
  .dwg-card__admin-delete ~ .dwg-card__like { right: 44px; }

  /* Telefon: "Powiazane artykuly" schodzi pod tresc karty, w to samo obramowanie
     (przycisk z wiersza daty jest wtedy ukryty). */
  .dwg-card__related {
    display: flex;
    align-items: center;
    height: var(--v2-card-related-h);
    margin: 0 -10px -10px;
    padding: 0 10px;
    border-top: 1px solid var(--v2-line);
  }
  .dwg-meta .dwg-related__toggle--meta { display: none; }
  html[data-dwg-lap-layout="list"] .v2-feed .dwg-card--has-related { flex-wrap: wrap; }
  html[data-dwg-lap-layout="list"] .v2-feed .dwg-card__related {
    flex: 0 0 calc(100% + 20px);
    justify-content: center;
    border-top: 0;
  }

  /* Lista na telefonie: mniejsze zrodlo i ciasniejsze odstepy gora/dol, zeby tytul mial 4 linie
     przy tej samej wysokosci karty (miniatura 126px). */
  html[data-dwg-lap-layout="list"] .v2-feed .dwg-card--lap .dwg-card__body { gap: 3px; padding-top: 0; padding-bottom: 0; }
  html[data-dwg-lap-layout="list"] .v2-feed .dwg-card--lap .dwg-label { min-height: 0; font-size: 0.7rem; line-height: 1.2; }
  html[data-dwg-lap-layout="list"] .v2-feed .dwg-card--lap .dwg-card__localities { font-size: 0.7rem; line-height: 1.2; }
  html[data-dwg-lap-layout="list"] .v2-feed .dwg-card--lap .dwg-label__logo { width: 14px; height: 14px; }
  html[data-dwg-lap-layout="list"]:not([data-dwg-lap-images="off"]) .v2-feed .dwg-card--lap .dwg-card__title a { -webkit-line-clamp: 4; }
  html[data-dwg-lap-layout="list"] .v2-feed .dwg-card--lap .dwg-meta { padding-top: 0; line-height: 1.3; }

  /* Siatka na telefonie: jedna kolumna (zdjecie na pelna szerokosc nad tytulem). */
  html[data-dwg-lap-layout="grid"] .v2-feed .dwg-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  html[data-dwg-lap-layout="grid"] .v2-feed .dwg-card--lap .dwg-card__title { font-size: 1rem; }
  html[data-dwg-lap-layout="grid"] .v2-feed .dwg-card--lap:not(.dwg-card--text-only) .dwg-card__like { top: 18px; right: 18px; }
  html[data-dwg-lap-layout="grid"] .v2-feed .dwg-card--lap:not(.dwg-card--text-only) .dwg-card__admin-delete { top: 18px; right: 18px; }
  html[data-dwg-lap-layout="grid"] .v2-feed .dwg-card--lap:not(.dwg-card--text-only) .dwg-card__admin-delete ~ .dwg-card__like { right: 52px; }
}

/* ------------------------------------------------------------------ */
/* 10. Paginacja i pusty wynik                                          */
/* ------------------------------------------------------------------ */
.dwg-pagination { margin-top: 28px; }
.dwg-pagination ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dwg-pagination li > .page-numbers {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--v2-line);
  border-radius: 999px;
  background: var(--v2-surface);
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--v2-ink-2);
  transition: border-color 0.15s, color 0.15s;
}
.dwg-pagination li > a.page-numbers:hover { border-color: var(--v2-brand); color: var(--v2-brand); }
.dwg-pagination li > .page-numbers.current {
  border-color: var(--v2-brand);
  background: var(--v2-brand);
  color: var(--v2-on-brand);
}
.dwg-pagination li > .page-numbers.dots {
  min-width: 20px;
  padding: 0;
  border-color: transparent;
  background: transparent;
}

.v2-empty {
  padding: 48px 24px;
  border: 1px dashed var(--v2-line-strong);
  border-radius: var(--v2-radius);
  background: var(--v2-surface);
  text-align: center;
}
.v2-empty h2 {
  margin-bottom: 6px;
  font-family: var(--v2-display);
  font-size: 1.2rem;
  font-weight: 800;
}
.v2-empty p { color: var(--v2-muted); }

/* ------------------------------------------------------------------ */
/* 11. Okno powiazanych artykulow (related-articles.js)                 */
/* ------------------------------------------------------------------ */
.dwg-related-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 16px;
}
.dwg-related-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 14, 24, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.dwg-related-modal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 720px);
  max-height: min(86vh, 780px);
  overflow: hidden;
  border-radius: 20px;
  background: var(--v2-bg);
  box-shadow: var(--v2-shadow-lg);
  outline: none;
  animation: v2-modal-in 0.2s ease-out;
}
.dwg-related-modal__header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 14px 20px;
  border-bottom: 1px solid var(--v2-line);
  background: var(--v2-surface);
}
.dwg-related-modal__title {
  font-family: var(--v2-display);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.dwg-related-modal__close {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--v2-line);
  border-radius: 50%;
  background: var(--v2-surface);
  color: var(--v2-ink-2);
}
.dwg-related-modal__close:hover { border-color: var(--v2-line-strong); color: var(--v2-ink); }
.dwg-related-modal__close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.dwg-related-modal__content {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  outline: none;
  -webkit-overflow-scrolling: touch;
}
.dwg-related-modal__status {
  padding: 28px 16px;
  color: var(--v2-muted);
  text-align: center;
}
.dwg-related-modal__error { color: var(--v2-accent); }

@keyframes v2-modal-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 600px) {
  /* Na telefonie okienko tez na srodku ekranu (w pionie), nie przyklejone do dolu. */
  .dwg-related-modal { padding: 12px; }
  .dwg-related-modal__dialog {
    width: 100%;
    max-height: 84vh;
    max-height: 84dvh;
  }
  .dwg-related-modal__header { padding: 12px 12px 12px 16px; }
  .dwg-related-modal__content { padding: 12px; }
}

/* ------------------------------------------------------------------ */
/* 12. Stopka                                                           */
/* ------------------------------------------------------------------ */
.v2-footer {
  border-top: 1px solid var(--v2-line);
  background: var(--v2-surface);
}
.v2-footer__top {
  display: grid;
  gap: 24px;
  padding: 36px 0 28px;
}
.v2-footer__about {
  max-width: 70ch;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--v2-ink-2);
}
.dwg-footer-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dwg-footer-menu a { font-size: 0.9rem; font-weight: 600; color: var(--v2-ink); }
.dwg-footer-menu a:hover { color: var(--v2-brand); text-decoration: underline; text-underline-offset: 3px; }

/* Stopka: linki do regionow, miast, gmin i kategorii. */
.v2-footer__places {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 24px;
  padding: 24px 0 28px;
  border-top: 1px solid var(--v2-line);
}
.v2-footer__group-title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--v2-muted);
}
.v2-footer__group ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.v2-footer__group a { font-size: 0.86rem; font-weight: 600; color: var(--v2-ink); }
.v2-footer__group a:hover { color: var(--v2-brand); text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 860px) {
  .v2-footer__places { grid-template-columns: 1fr 1fr 2fr 2fr; }
}

.v2-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  padding: 16px 0 calc(20px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--v2-line);
  font-size: 0.82rem;
  color: var(--v2-muted);
}
.dwg-uv-counter { display: inline-flex; align-items: center; gap: 6px; }
.dwg-uv-counter svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.dwg-cookie-settings {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.dwg-cookie-settings:hover { color: var(--v2-ink); }

@media (min-width: 860px) {
  .v2-footer__top {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    align-items: start;
    gap: 56px;
  }
  .dwg-footer-menu { flex-direction: column; gap: 10px; }
  .v2-footer__nav { justify-self: end; }
}

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

@media print {
  .v2-header,
  .v2-aside,
  .dwg-ranking-wrap,
  .dwg-card__like,
  .dwg-pagination,
  .v2-footer { display: none !important; }
}

/* Tryb "bez miniatur": wiekszy tytul i wyzszy kafelek (na koncu pliku, zeby wygrac z regulami siatki/listy i mobile). */
html[data-dwg-lap-images="off"] .v2-feed .dwg-card--lap { min-height: 150px; padding-top: 16px; padding-bottom: 16px; }
html[data-dwg-lap-images="off"] .v2-feed .dwg-card--lap .dwg-card__title { font-size: 1.22rem; line-height: 1.34; min-height: calc(3 * 1.34em); }
@media (max-width: 600px) {
  html[data-dwg-lap-images="off"] .v2-feed .dwg-card--lap { min-height: 120px; padding-top: 12px; padding-bottom: 12px; }
  html[data-dwg-lap-images="off"] .v2-feed .dwg-card--lap .dwg-card__title { font-size: 1.1rem; }
}

.dwg-card__locality-form{position:relative;display:inline-flex;align-items:center;width:13px;height:13px;margin:0;vertical-align:middle;cursor:pointer;color:#c0392b}
.dwg-card__locality-form svg{width:12px;height:12px;fill:currentColor;pointer-events:none}
.dwg-card__locality-form select{position:absolute;inset:0;width:100%;height:100%;max-width:none;padding:0;opacity:0;cursor:pointer}
.dwg-card__locality-form{z-index:3}
.dwg-card__locality-form{width:18px;height:18px}
.dwg-card__locality-form svg{width:17px;height:17px}
.dwg-card__localities + .dwg-card__locality-form{margin-left:6px}
.dwg-card__link-btn{position:relative;z-index:3;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin:0 0 0 4px;padding:0;border:0;background:none;cursor:pointer;color:#c0392b;vertical-align:middle}
.dwg-card__link-btn svg{width:17px;height:17px;fill:currentColor}
.dwg-link-pop{position:fixed;z-index:100000;top:18%;left:50%;transform:translateX(-50%);width:min(92vw,440px);box-sizing:border-box;padding:12px;border:1px solid rgba(128,128,128,.4);border-radius:12px;background:var(--v2-surface,#fff);color:var(--v2-text,#111);box-shadow:0 12px 40px rgba(0,0,0,.3);font-size:14px}
.dwg-link-pop__head{margin-bottom:8px;font-weight:600}
.dwg-link-pop input{width:100%;box-sizing:border-box;padding:8px;font:inherit;border:1px solid rgba(128,128,128,.5);border-radius:8px;background:transparent;color:inherit}
.dwg-link-pop__list{margin:8px 0 0;padding:0;list-style:none;max-height:50vh;overflow:auto}
.dwg-link-pop__list button{display:block;width:100%;padding:8px;border:0;border-bottom:1px solid rgba(128,128,128,.25);background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}
.dwg-link-pop__list button:hover{background:rgba(128,128,128,.15)}
.dwg-link-pop__title{display:block}
.dwg-link-pop__meta{display:block;font-size:12px;opacity:.65}
.dwg-link-pop__note{margin-top:6px;font-size:13px;opacity:.75}

.dwg-card__admin-bar{position:relative;z-index:3;display:flex;align-items:center;gap:20px;margin:8px 0 0;padding-top:6px;border-top:1px solid rgba(128,128,128,.25)}
.dwg-card__admin-bar .dwg-card__admin-del{position:static;margin:0}
.dwg-card__admin-bar .dwg-card__admin-del button{display:grid;place-items:center;width:22px;height:22px;padding:0;border:0;background:none;color:#c0392b;cursor:pointer}
.dwg-card__admin-bar .dwg-card__admin-del .dashicons{width:18px;height:18px;font-size:18px}
.dwg-card__admin-bar .dwg-card__locality-form,.dwg-card__admin-bar .dwg-card__link-btn{margin:0}
.dwg-card__unlink-btn{position:relative;z-index:3;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin:0;padding:0;border:0;background:none;cursor:pointer;color:#c0392b}
.dwg-card__unlink-btn svg{width:17px;height:17px;fill:currentColor}
.dwg-link-pop__close{position:absolute;top:6px;right:8px;width:30px;height:30px;padding:0;border:0;background:none;color:inherit;font-size:24px;line-height:1;cursor:pointer;opacity:.7}
.dwg-link-pop__close:hover{opacity:1}
.dwg-link-pop__head{padding-right:32px}
