.gallery-thumbs {
  column-count: 3;
  column-gap: 10px;
}
@media (max-width: 900px) {
  .gallery-thumbs { column-count: 2; }
}
@media (max-width: 600px) {
  .gallery-thumbs { column-count: 1; }
}
.thumb-item {
  break-inside: avoid;
  margin-bottom: 10px;
  width: 100%;
  display: block;
}
.pg-thumb {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.3s;
  aspect-ratio: attr(style aspect-ratio);
}
.pg-thumb:hover {
  transform: scale(1.05);
}

/* Tryb pełnoekranowy */

.fullscreen-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow: hidden;
}

.fullscreen-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 96vw;
  max-width: 900px;
  height: 100vh;
}

.fullscreen-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 5px;
  transition: transform 0.5s cubic-bezier(.4,2,.6,1), opacity 0.5s cubic-bezier(.4,2,.6,1);
  display: block;
  margin: 0 auto;
  opacity: 1;
  transform: translateX(0);
}

/* Podpis zawsze na dole ekranu, z zachowaniem enterów */
.fullscreen-caption-multiline {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100vw;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 1.1em;
  line-height: 1.3;
  text-align: center;
  padding: 18px 14px 22px 14px;
  box-sizing: border-box;
  z-index: 10001;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 0;
  margin: 0;
  max-width: 100vw;
  pointer-events: none;
}




/* Nawigacja */
.fullscreen-prev, .fullscreen-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  border: none;
  color: white;
  font-size: 2.5em;
  padding: 10px 15px;
  cursor: pointer;
  user-select: none;
  border-radius: 3px;
  z-index: 10000;
  transition: background-color 0.3s;
}
.fullscreen-prev { left: 20px; }
.fullscreen-next { right: 20px; }
.fullscreen-prev:hover, .fullscreen-next:hover {
  background: rgba(0,0,0,0.8);
}
.close-fullscreen {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.5);
  border: none;
  color: white;
  font-size: 2.5em;
  cursor: pointer;
  border-radius: 3px;
  z-index: 10001;
}
