/* Werstok i okolice — wyłącznie lokalne korekty CSS.
   Kolejność reguł zachowana, aby nie zmieniać działania kaskady. */

/* Werstok i okolice — poprawki ograniczone do tej podstrony. */

/* Taka sama geometria tytułu jak w zaakceptowanych Cenniku i Kalendarzu. */

@media (min-width:781px) {
  .werstok-modern .wm-intro {
    padding-top: 31px !important;
  }
}

@media (max-width:780px) {
  .werstok-modern .wm-intro {
    padding-top: 15px !important;
  }
}

/* Usuwamy zbędny efekt ramki/cienia z odziedziczonego kontenera. */

.werstok-modern .wm-okolice .wm-okolice-body,
.werstok-modern .wm-okolice .wm-okolice-body > table {
  box-shadow: none !important;
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
}

.werstok-modern .wm-okolice .wm-okolice-body > table {
  width: 100% !important;
  border-spacing: 0 !important;
  margin: 0 !important;
}

.werstok-modern .wm-okolice .wm-okolice-body > table > tbody > tr > td {
  padding: 0 !important;
}

/* Cztery miniatury tworzą zwartą galerię, z zachowaniem powiększania. */

.werstok-modern .wm-okolice .wm-okolice-gallery {
  display: grid !important;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
  max-width: 900px;
  margin: 12px auto 22px !important;
}

.werstok-modern .wm-okolice .wm-okolice-gallery a {
  display: block;
  min-width: 0;
}

.werstok-modern .wm-okolice .wm-okolice-gallery img {
  display: block;
  width: 100% !important;
  height: 150px !important;
  object-fit: cover !important;
  margin: 0 !important;
  border-radius: 8px !important;
}

/* O połowę mniejszy odstęp przed stopką. */

.werstok-modern .wm-okolice {
  padding-bottom: 35px !important;
}

@media (max-width:780px) {
  .werstok-modern .wm-okolice {
    padding-bottom: 22px !important;
  }

  .werstok-modern .wm-okolice .wm-okolice-gallery {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 9px;
  }

  .werstok-modern .wm-okolice .wm-okolice-gallery img {
    height: clamp(100px,27vw,160px) !important;
  }
}

/* Grabarka — dwie fotografie obok siebie, z podpisem pod nimi. */

.werstok-modern .wm-okolice .wm-grabarka-pair {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px;
  max-width: 850px;
  margin: 12px auto 8px;
  align-items: center;
}

.werstok-modern .wm-okolice .wm-grabarka-pair .wm-photo-zoom {
  display: block;
  min-width: 0;
}

.werstok-modern .wm-okolice .wm-grabarka-pair img {
  display: block;
  width: 100% !important;
  height: 260px !important;
  object-fit: cover;
  margin: 0 !important;
  border-radius: 8px;
}

/* Powiększanie zdjęć najechaniem kursorem. */

.werstok-modern .wm-okolice .wm-photo-zoom {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  cursor: zoom-in;
  z-index: 1;
}

.werstok-modern .wm-okolice .wm-photo-zoom img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  transition: transform .23s ease,box-shadow .23s ease;
  transform-origin: center center;
}

@media (hover:hover) and (pointer:fine) {
  .werstok-modern .wm-okolice .wm-photo-zoom:hover,
 .werstok-modern .wm-okolice .wm-photo-zoom:focus-visible {
    z-index: 20;
  }

  .werstok-modern .wm-okolice .wm-photo-zoom:hover img,
 .werstok-modern .wm-okolice .wm-photo-zoom:focus-visible img {
    transform: scale(1.35);
    box-shadow: 0 12px 35px rgba(0,0,0,.28);
  }
}

.werstok-modern .wm-okolice .wm-photo-float {
  float: right;
  margin: 12px;
  max-width: 45%;
}

.werstok-modern .wm-okolice .wm-photo-float img {
  width: 100%;
  max-width: 330px;
}

.wm-photo-dialog {
  border: 0;
  border-radius: 12px;
  padding: 14px;
  max-width: min(94vw,1100px);
  max-height: 92vh;
  background: #f9f7f0;
  box-shadow: 0 18px 80px #0007;
}

.wm-photo-dialog::backdrop {
  background: rgba(0,0,0,.75);
}

.wm-photo-dialog img {
  display: block;
  max-width: calc(94vw - 28px);
  max-height: calc(92vh - 40px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.wm-photo-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #244632;
  font-size: 26px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  z-index: 2;
}

@media (max-width:600px) {
  .werstok-modern .wm-okolice .wm-grabarka-pair {
    gap: 8px;
  }

  .werstok-modern .wm-okolice .wm-grabarka-pair img {
    height: clamp(120px,33vw,210px) !important;
  }

  .werstok-modern .wm-okolice .wm-photo-float {
    max-width: 48%;
    margin: 8px;
  }
}

@media (prefers-reduced-motion:reduce) {
  .werstok-modern .wm-okolice .wm-photo-zoom img {
    transition: none;
  }
}

/* przywracamy miniatury, stabilizujemy parę Skit i zdjęcia przy kalendarium. */

.werstok-modern .wm-okolice .wm-skit-pair {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px;
  max-width: 940px;
  margin: 12px auto 8px;
  align-items: start;
}

.werstok-modern .wm-okolice .wm-skit-pair .wm-photo-zoom {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.werstok-modern .wm-okolice .wm-skit-pair img {
  display: block;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 459/307;
  object-fit: cover;
  margin: 0 !important;
}

.werstok-modern .wm-okolice .wm-photo-float {
  float: right !important;
  display: block !important;
  width: min(38%,400px) !important;
  max-width: 400px !important;
  margin: 12px 0 16px 24px !important;
}

.werstok-modern .wm-okolice .wm-photo-float img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0 !important;
}

.werstok-modern .wm-okolice .wm-float-break {
  display: block;
  clear: both;
  height: 0;
}

@media (max-width:600px) {
  .werstok-modern .wm-okolice .wm-skit-pair {
    gap: 8px;
  }

  .werstok-modern .wm-okolice .wm-photo-float {
    float: none !important;
    width: 100% !important;
    max-width: 420px !important;
    margin: 12px auto 16px !important;
  }
}

/* ograniczamy rozmiar pary Skit, niezależnie od dawnych reguł obrazów. */

.werstok-modern .wm-okolice .wm-skit-pair {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: flex-start !important;
  gap: 14px !important;
  width: 100% !important;
  max-width: 760px !important;
  margin: 12px auto 8px !important;
}

.werstok-modern .wm-okolice .wm-skit-pair > a.wm-skit-photo {
  display: block !important;
  position: relative !important;
  flex: 1 1 240px !important;
  min-width: 0 !important;
  width: calc(50% - 7px) !important;
  max-width: 370px !important;
  overflow: visible !important;
}

.werstok-modern .wm-okolice .wm-skit-pair > a.wm-skit-photo > img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 230px !important;
  max-height: 230px !important;
  object-fit: cover !important;
  margin: 0 !important;
  transform: none;
  transform-origin: center !important;
}

@media (hover:hover) and (pointer:fine) {
  .werstok-modern .wm-okolice .wm-skit-pair > a.wm-skit-photo:hover > img,
 .werstok-modern .wm-okolice .wm-skit-pair > a.wm-skit-photo:focus-visible > img {
    transform: scale(1.12) !important;
  }
}

@media (max-width:600px) {
  .werstok-modern .wm-okolice .wm-skit-pair {
    gap: 8px !important;
  }

  .werstok-modern .wm-okolice .wm-skit-pair > a.wm-skit-photo {
    flex: 1 1 120px !important;
    width: calc(50% - 4px) !important;
  }

  .werstok-modern .wm-okolice .wm-skit-pair > a.wm-skit-photo > img {
    height: clamp(120px,32vw,200px) !important;
    max-height: 200px !important;
  }
}

/* pełny kadr dla Grabarki i Skitu: bez przycinania pionowego. */

.werstok-modern .wm-okolice .wm-grabarka-pair img,
.werstok-modern .wm-okolice .wm-skit-pair > a.wm-skit-photo > img {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
}

/* Powiększenie zachowuje proporcje i nie zmienia układu strony. */

@media (hover:hover) and (pointer:fine) {
  .werstok-modern .wm-okolice .wm-grabarka-pair .wm-photo-zoom:hover img,
  .werstok-modern .wm-okolice .wm-grabarka-pair .wm-photo-zoom:focus-visible img,
  .werstok-modern .wm-okolice .wm-skit-pair .wm-photo-zoom:hover img,
  .werstok-modern .wm-okolice .wm-skit-pair .wm-photo-zoom:focus-visible img {
    transform: scale(1.12) !important;
  }
}
