.bsw-gallery {
  --bsw-gallery-ratio: 16 / 9;
  min-width: 0;
  margin: 0 0 1.25rem;
  color: var(--bsw-charcoal, #35383b);
  font-family: inherit;
}
.bsw-gallery__stage { position: relative; min-width: 0; }
.bsw-gallery__viewport {
  display: flex;
  width: 100%;
  min-width: 0;
  aspect-ratio: var(--bsw-gallery-ratio);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  border: 1px solid var(--bsw-border, #d8d3c9);
  border-radius: .5rem;
  background: #fff;
  touch-action: pan-x pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
}
.bsw-gallery__viewport::-webkit-scrollbar { display: none; }
.bsw-gallery__slide {
  box-sizing: border-box;
  display: flex;
  flex: 0 0 100%;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  text-decoration: none;
  cursor: zoom-in;
  -webkit-user-drag: none;
}
.bsw-gallery__slide picture {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.bsw-gallery .bsw-gallery__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.bsw-gallery__viewport.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.bsw-gallery__viewport.is-dragging .bsw-gallery__slide { cursor: grabbing; }
.bsw-gallery .bsw-gallery__control {
  box-sizing: border-box;
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--bsw-border, #d8d3c9);
  border-radius: 50%;
  background: rgb(255 255 255 / 94%);
  color: var(--bsw-charcoal, #35383b);
  box-shadow: 0 2px 8px rgb(0 0 0 / 8%);
  cursor: pointer;
}
.bsw-gallery .bsw-gallery__control[hidden] { display: none !important; }
.bsw-gallery__control--prev { top: calc(50% - 22px); left: .65rem; }
.bsw-gallery__control--next { top: calc(50% - 22px); right: .65rem; }
.bsw-gallery__control--zoom { right: .65rem; bottom: .65rem; }
.bsw-gallery .bsw-gallery__control:hover { background: #fff; border-color: var(--bsw-red-dark, #bd251f); }
.bsw-gallery .bsw-gallery__control:disabled { opacity: .35; cursor: default; }
.bsw-gallery__control svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.bsw-gallery__meta { display: flex; align-items: baseline; gap: .8rem; margin: .6rem 0; }
.bsw-gallery .bsw-gallery__counter { flex: 0 0 auto; padding: 0; color: var(--bsw-muted, #686b6d); font-size: .82rem; line-height: 1.5; }
.bsw-gallery .bsw-gallery__caption { min-width: 0; margin: 0; color: var(--bsw-charcoal, #35383b); font-size: .87rem; line-height: 1.5; overflow-wrap: anywhere; }
.bsw-gallery .bsw-gallery__thumbs {
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: .5rem;
  min-width: 0;
  padding: 3px 2px 7px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--bsw-border, #d8d3c9) transparent;
}
.bsw-gallery .bsw-gallery__thumb {
  box-sizing: border-box;
  display: flex;
  flex: 0 0 88px;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 66px;
  padding: 0;
  border: 2px solid var(--bsw-border, #d8d3c9);
  border-radius: .3rem;
  background: #fff;
  text-decoration: none;
}
.bsw-gallery .bsw-gallery__thumb[aria-current="true"] { border-color: var(--bsw-red-dark, #bd251f); }
.bsw-gallery .bsw-gallery__thumbnail { display: block; width: 100%; height: 100%; max-width: 100%; margin: 0; object-fit: cover; }
.bsw-gallery__thumb picture { display: flex; width: 100%; height: 100%; }
.bsw-gallery__viewport:focus-visible,
.bsw-gallery__slide:focus-visible,
.bsw-gallery__thumb:focus-visible,
.bsw-gallery__control:focus-visible { outline: 2px solid var(--bsw-red-dark, #bd251f); outline-offset: 2px; }

/* PhotoSwipe liegt außerhalb des ImmoMakler-Containers direkt im body. */
.pswp.bsw-pswp { z-index: 100200; --pswp-bg: #17191b; --pswp-icon-color: #fff; }
.bsw-pswp .pswp__top-bar { background: linear-gradient(to bottom, rgb(0 0 0 / 72%), rgb(0 0 0 / 28%)); }
.bsw-pswp .pswp__bsw-caption {
  position: absolute;
  right: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  left: 1rem;
  max-width: 70ch;
  margin-inline: auto;
  padding: .5rem .75rem;
  border-radius: .3rem;
  background: rgb(0 0 0 / 55%);
  color: #fff;
  font-family: var(--wp--preset--font-family--manrope, sans-serif);
  font-size: .9rem;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
}
.bsw-pswp .pswp__bsw-caption:empty { display: none; }
@media (max-width: 767px) {
  .bsw-gallery .bsw-gallery__thumb { flex-basis: 72px; width: 72px; height: 56px; }
  .bsw-gallery__control--prev { left: .4rem; }
  .bsw-gallery__control--next { right: .4rem; }
}
@media print {
  .bsw-gallery__control, .bsw-gallery__thumbs, .bsw-gallery__meta { display: none !important; }
  .bsw-gallery__viewport { display: block; overflow: visible; border: 0; }
  .bsw-gallery__slide { display: none; }
  .bsw-gallery__slide:first-child { display: flex; }
}
