/* =========================================================
   GLOBAL
   ========================================================= */
body {
  background: #0b0f14 url('/assets/img/bg-forest.jpg') center/cover fixed no-repeat;
}
main { backdrop-filter: blur(2px); }

.card-veil {
  background: rgba(10,14,18,.75);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
}

/* =========================================================
   KAFELKI WOJEWÓDZTW
   ========================================================= */
.voiv-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
}
@media (max-width: 1200px) { .voiv-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 992px)  { .voiv-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 576px)  { .voiv-grid { grid-template-columns: repeat(1, minmax(0,1fr)); } }

.voiv-tile {
  padding: 14px;
  border-radius: 14px;
  background: rgba(20,26,32,.85);
  border: 1px solid rgba(255,255,255,.07);
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
  text-decoration: none;
  color: #e7eef8;
  display: block;
}
.voiv-tile:hover { transform: translateY(-2px); }

/* Kolory intensywności (lvl0–lvl4) */
:root{
  --lvl0-bg: rgba(20,26,32,.85);
  --lvl0-bd: rgba(255,255,255,.07);

  --lvl1-bg: rgba(12, 63, 36, .85);
  --lvl1-bd: rgba(74, 222, 128, .35);

  --lvl2-bg: rgba(82, 46, 14, .85);
  --lvl2-bd: rgba(251, 146, 60, .35);

  --lvl3-bg: rgba(71, 19, 19, .85);
  --lvl3-bd: rgba(248, 113, 113, .35);

  --lvl4-bg: rgba(62, 9, 28, .88);
  --lvl4-bd: rgba(244, 63, 94, .45);
}
.voiv-tile.lvl0 { background: var(--lvl0-bg); border-color: var(--lvl0-bd); }
.voiv-tile.lvl1 { background: var(--lvl1-bg); border-color: var(--lvl1-bd); box-shadow: 0 0 0 1px rgba(74,222,128,.08) inset; }
.voiv-tile.lvl2 { background: var(--lvl2-bg); border-color: var(--lvl2-bd); box-shadow: 0 0 0 1px rgba(251,146,60,.08) inset; }
.voiv-tile.lvl3 { background: var(--lvl3-bg); border-color: var(--lvl3-bd); box-shadow: 0 0 0 1px rgba(248,113,113,.08) inset; }
.voiv-tile.lvl4 { background: var(--lvl4-bg); border-color: var(--lvl4-bd); box-shadow: 0 0 0 1px rgba(244,63,94,.10) inset; }

.voiv-count { color:#9db0c6; font-size:.9rem; }

/* =========================================================
   STARY LIST – Fallback
   ========================================================= */
.post {
  background: rgba(18,22,28,.9);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 12px;
}
.post + .post { margin-top: 12px; }
.post .meta { color:#9db0c6; font-size:.85rem; }
.post .photos img { max-width: 100%; height: auto; border-radius: 8px; }

/* =========================================================
   GRID WPISÓW (woj./miasto)
   ========================================================= */
.posts-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0,1fr));
}
@media (max-width: 1200px) { .posts-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 992px)  { .posts-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 576px)  { .posts-grid { grid-template-columns: repeat(1, minmax(0,1fr)); } }

.post-card{
  background: rgba(18,22,28,.9);
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px; padding:10px;
}
.thumb { width:100%; aspect-ratio:1/1; object-fit:cover; border-radius:8px; display:block; }
.post-meta{ color:#9db0c6; font-size:.85rem; margin-top:6px; }
.post-note{ margin-top:6px; }

/* =========================================================
   LISTA MIAST (chipsy) + kolory
   ========================================================= */
.cities-chips {
  display:flex; flex-wrap:wrap; gap:8px;
  max-height: 140px;
  overflow:auto;
  padding: 6px 2px;
}
.chip {
  display:inline-block; padding:6px 10px; border-radius:999px;
  font-size:.9rem; text-decoration:none; border:1px solid rgba(255,255,255,.08);
  color:#e7eef8; background: rgba(20,26,32,.85);
}
.chip:hover { transform: translateY(-1px); text-decoration:none; }
.chip.lvl0 { background: var(--lvl0-bg); border-color: var(--lvl0-bd); }
.chip.lvl1 { background: var(--lvl1-bg); border-color: var(--lvl1-bd); }
.chip.lvl2 { background: var(--lvl2-bg); border-color: var(--lvl2-bd); }
.chip.lvl3 { background: var(--lvl3-bg); border-color: var(--lvl3-bd); }
.chip.lvl4 { background: var(--lvl4-bg); border-color: var(--lvl4-bd); }
.chip .cnt { color:#9db0c6; margin-left:.25rem; font-size:.85em; }

/* =========================================================
   LEGENDA
   ========================================================= */
.legend .legend-row { display:flex; flex-wrap:wrap; gap:10px; }
.legend .legend-item { display:flex; align-items:center; gap:6px; color:#cbd5e1; }
.legend .dot {
  width:14px; height:14px; border-radius:50%;
  display:inline-block; border:1px solid rgba(255,255,255,.2);
}
.legend .dot.lvl0 { background: var(--lvl0-bg); border-color: var(--lvl0-bd); }
.legend .dot.lvl1 { background: var(--lvl1-bg); border-color: var(--lvl1-bd); }
.legend .dot.lvl2 { background: var(--lvl2-bg); border-color: var(--lvl2-bd); }
.legend .dot.lvl3 { background: var(--lvl3-bg); border-color: var(--lvl3-bd); }
.legend .dot.lvl4 { background: var(--lvl4-bg); border-color: var(--lvl4-bd); }

/* =========================================================
   LIGHTBOX
   ========================================================= */
.modal-content { background: #10151b; overflow: hidden; }
.modal-header { border-bottom: 1px solid rgba(255,255,255,.06); }
.modal-body   { position: relative; z-index: 1; padding: 0; }
.modal-footer { position: relative; z-index: 5; }
.modal .btn, .modal .btn-close { position: relative; z-index: 6; }
.modal-body .carousel { position: relative; width: 100%; }
.modal-body .carousel-item { text-align: center; }
.modal-body .carousel-item img {
  max-height: 75vh; width: 100%; height: auto; object-fit: contain;
  background: #0b0f14; display: block; margin: 0 auto;
}
.modal .carousel-control-prev,
.modal .carousel-control-next {
  top: 50%; transform: translateY(-50%); height: 60%; bottom: auto; z-index: 2;
}

/* =========================================================
   SIDEBAR (desktop) + NAV
   ========================================================= */
@media (min-width: 992px){
  .sidebar{ min-height: 100vh; }
  .sidebar .sidebar-inner{ height: 100vh; overflow: auto; }
}
.sidebar-logo{ display:flex; justify-content:center; align-items:center; margin:20px; }
.sidebar-logo img{ max-width:100%; height:auto; border-radius:8px; }

.sidebar-nav .nav-link{
  color:#e7eef8; padding:10px 12px; border-radius:10px;
  display:flex; align-items:center; gap:8px; text-decoration:none;
  transition:background .15s ease, transform .12s ease; position:relative;
}
.sidebar-nav .nav-link::before{ content:"›"; opacity:.5; margin-right:6px; font-weight:700; }
.sidebar-nav .nav-link:hover{ background:rgba(255,255,255,.06); transform:translateX(2px); }
.sidebar-nav .nav-item + .nav-item{
  border-top:1px solid rgba(255,255,255,.06); margin-top:6px; padding-top:6px;
}

/* =========================================================
   OFFCANVAS – szerokość na mobile
   ========================================================= */
@media (max-width: 991.98px){
  .offcanvas.offcanvas-start{ width: min(86vw, 360px); }
}

/* =========================================================
   PRZYCISK „MENU” (MOBILE, GÓRA EKRANU)
   – prosty pasek pełnej szerokości, bez zaokrągleń
   – nie zasłania treści: dodany padding-top w main
   – ukryty na desktopie
   ========================================================= */

/* Desktop – brak przycisku */
@media (min-width: 992px){
  .mobile-sidebar-toggle{ display:none !important; }
}

@media (max-width: 991.98px){
  body {
    padding-top: 56px; /* wysokość paska menu */
  }
}


/* Mobile – pasek u góry */
@media (max-width: 991.98px){
  /* miejsce pod paskiem, aby nie zasłaniał treści */
  main{ padding-top: 56px !important; } /* wysokość paska (48) + zapas */

  .mobile-sidebar-toggle{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;                 /* pełna szerokość */
    height: 48px;
    padding: 0 16px;
    border-radius: 0;         /* bez zaokrągleń */
    display: flex;
    align-items: center;
    justify-content: center;  /* napis pośrodku */
    z-index: 1055;
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
  }

  /* chowamy ikonę hamburgera, zostawiamy sam napis „Menu” */
  .mobile-sidebar-toggle .hamburger{ display:none !important; }
  .mobile-sidebar-toggle .label{
    font-weight: 700;
    letter-spacing: .2px;
    text-transform: none;
  }
}

/* --- LIGHTBOX: obraz ma się zawsze mieścić w oknie --- */
.modal-body { padding: 0; }

.modal .carousel-item {
  text-align: center;
  background: #0b0f14; /* miłe tło pod obrazem */
}

/* kluczowe: wysokość obrazka zależna od wysokości okna (dvh = mobile-safe) */
.modal .carousel-item img{
  display: block;
  margin: 0 auto;
  max-width: 100%;
  width: auto;                 /* nie wymuszamy 100% szerokości — lepszy portret */
  height: auto;
  max-height: calc(100dvh - 160px);  /* header + footer + margines */
  object-fit: contain;               /* nigdy nie wychodź poza ramkę */
}

@media (max-width: 576px){
  .modal .carousel-item img{
    max-height: calc(100dvh - 130px); /* na telefonach nieco wyższe okno */
  }
}

/* --- Strzałki zawsze widoczne i większe (desktop i mobile) --- */
.modal .carousel-control-prev,
.modal .carousel-control-next{
  opacity: 1;                /* nie chowaj */
  width: 8%;
}

.modal .carousel-control-prev-icon,
.modal .carousel-control-next-icon{
  filter: invert(1) drop-shadow(0 0 2px rgba(0,0,0,.9));
  transform: scale(1.1);
}
