/* Korrekturen für statische Seite ohne IONOS-JavaScript: Scrollen + Layout */

/* Normales Seiten-Scrollen (IONOS setzt body overflow:hidden für iScroll) */
body {
  overflow: auto !important;
  overflow-x: hidden !important;
  min-height: 100vh !important;
}

/* Inhalt soll im normalen Dokumentfluss fließen, nicht in fixer Scroll-Box */
#iscrollBody,
#dmFirstContainer,
#dm {
  overflow: visible !important;
  height: auto !important;
  min-height: 0 !important;
}
#dm { min-height: 0; }

/* Slider-Container braucht feste Höhe für Darstellung */
.dmRespRow.slider-container-no-bg .dmRespColsWrapper,
.dmRespRow.hasBackgroundOverlay.slider-container-no-bg {
  min-height: 400px !important;
}

/* Footer sichtbar halten (manche IONOS-CSS setzen display:null) */
.dmFooterContainer {
  display: block !important;
}

/* Gallery tiles: keep imported images in consistent size */
.dmPhotoGallery.dmPhotoGalleryResp {
  padding-left: 20px !important;
  padding-right: 20px !important;
  box-sizing: border-box;
}
.dmPhotoGallery .layout-container.square {
  width: 100%;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
}
.dmPhotoGallery .layout-container.square .photogallery-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  margin-bottom: 14px;
}
.dmPhotoGallery .layout-container.square .photogallery-column.column-4 {
  flex: 0 0 calc((100% - 42px) / 4);
  max-width: calc((100% - 42px) / 4);
}
.dmPhotoGallery .layout-container.square .photogallery-column.column-3 {
  flex: 0 0 calc((100% - 28px) / 3);
  max-width: calc((100% - 28px) / 3);
}
.dmPhotoGallery .layout-container.square .photogallery-column.column-2 {
  flex: 0 0 calc((100% - 14px) / 2);
  max-width: calc((100% - 14px) / 2);
}
.dmPhotoGallery .layout-container.square .thumbnailInnerWrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
}
.dmPhotoGallery .layout-container.square .image-container {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.dmPhotoGallery .layout-container .image-container a {
  display: block;
  width: 100%;
  height: 100%;
}
.dmPhotoGallery .layout-container .image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}
.dmPhotoGallery .photoGalleryThumbs:hover .image-container img {
  transform: scale(1.06);
}

/* Restore original-like caption box below each thumbnail */
.dmPhotoGallery .layout-container .caption-container {
  display: block !important;
  position: static !important;
  height: auto !important;
  min-height: 86px;
  background: #fff;
  padding: 10px 12px;
  border: 1px solid #e6e6e6;
  border-top: 0;
  box-sizing: border-box;
}
.dmPhotoGallery .layout-container .caption-container .caption-inner {
  display: block;
}
.dmPhotoGallery .layout-container .caption-container .caption-title {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.25;
}
.dmPhotoGallery .layout-container .caption-container .caption-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}
.dmPhotoGallery .layout-container .caption-container .caption-text p {
  margin: 0 0 4px;
}
.dmPhotoGallery .layout-container .caption-container .caption-button {
  display: none !important;
}

@media (max-width: 1024px) {
  .dmPhotoGallery .layout-container.square .photogallery-row {
    flex-wrap: wrap;
  }
  .dmPhotoGallery .layout-container.square .photogallery-column.column-4,
  .dmPhotoGallery .layout-container.square .photogallery-column.column-3 {
    flex: 0 0 calc((100% - 14px) / 2);
    max-width: calc((100% - 14px) / 2);
  }
}
@media (max-width: 767px) {
  .dmPhotoGallery.dmPhotoGalleryResp {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  .dmPhotoGallery .layout-container.square .photogallery-column.column-4,
  .dmPhotoGallery .layout-container.square .photogallery-column.column-3,
  .dmPhotoGallery .layout-container.square .photogallery-column.column-2 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Raeuber page: remove oversized gap before intro heading */
#dmFirstContainer.u_dmStyle_template_raeuber #1152369902 {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
#dmFirstContainer.u_dmStyle_template_raeuber #1591489583 {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
#dmFirstContainer.u_dmStyle_template_raeuber #1591489583 h3 {
  margin-top: 0 !important;
}

/* About me hero: fixed background + larger visible area */
#dmFirstContainer.u_dmStyle_template_aboutme #1065876626 {
  background-attachment: fixed !important;
  background-position: center center !important;
  background-size: cover !important;
  min-height: 760px !important;
  padding-top: 140px !important;
  padding-bottom: 140px !important;
}

/* Ahnenforschung: hero + icon circles like original */
#dmFirstContainer.u_dmStyle_template_ahnenforschung #1900443754 {
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-position: 50% 0 !important;
}
#dmFirstContainer.u_dmStyle_template_ahnenforschung #1908195796,
#dmFirstContainer.u_dmStyle_template_ahnenforschung #1589044280,
#dmFirstContainer.u_dmStyle_template_ahnenforschung #1791558869 {
  width: 80px !important;
  height: 80px !important;
  margin: 0 auto !important;
  border: 1px solid rgba(211, 209, 209, 1) !important;
  border-radius: 50% !important;
  box-sizing: border-box;
}
#dmFirstContainer.u_dmStyle_template_ahnenforschung #1908195796 .svg,
#dmFirstContainer.u_dmStyle_template_ahnenforschung #1589044280 .svg,
#dmFirstContainer.u_dmStyle_template_ahnenforschung #1791558869 .svg {
  width: 50% !important;
  height: auto !important;
  fill: rgba(0, 0, 0, 1) !important;
  color: rgba(0, 0, 0, 1) !important;
}

/* Force original spacing on affected pages/rows */
#dmFirstContainer.u_dmStyle_template_raeuber #1018712295 {
  padding-bottom: 8px !important;
}
#dmFirstContainer.u_dmStyle_template_raeuber #1152369902.fullBleedMode {
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: auto !important;
  max-width: none !important;
  padding-top: 0 !important;
  padding-left: 40px !important;
  padding-right: 40px !important;
}
#dmFirstContainer.u_dmStyle_template_raeuber #1801573063,
#dmFirstContainer.u_dmStyle_template_hausforschung #1330879603,
#dmFirstContainer.u_dmStyle_template_hausforschung #1125898543 {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}
#dmFirstContainer.u_dmStyle_template_raeuber #1801573063 .layout-container.square,
#dmFirstContainer.u_dmStyle_template_hausforschung #1330879603 .layout-container.square,
#dmFirstContainer.u_dmStyle_template_hausforschung #1125898543 .layout-container.square {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Lightbox close to original IONOS behavior */
#gmLightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
#gmLightbox.gm-open {
  display: flex;
}
#gmLightbox .gm-inner {
  position: relative;
  max-width: 94vw;
  max-height: 92vh;
  width: auto;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
}
#gmLightbox img {
  max-width: 94vw;
  max-height: calc(92vh - 72px);
  object-fit: contain;
  display: block;
}
#gmLightbox .gm-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  pointer-events: none;
}
#gmLightbox .gm-counter {
  color: #fff;
  font-size: 14px;
  line-height: 1;
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 9px;
  border-radius: 2px;
}
#gmLightbox .gm-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  color: #fff;
  text-align: left;
  font-size: 15px;
  line-height: 1.35;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.45));
  padding: 10px 14px 12px;
}
#gmLightbox .gm-caption-main {
  font-weight: 600;
}
#gmLightbox .gm-caption-source {
  margin-top: 4px;
  opacity: 0.95;
}
#gmLightbox .gm-caption-source strong {
  font-weight: 700;
}
#gmLightbox .gm-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
  width: 52px;
  height: 60px;
  font-size: 34px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s ease;
}
#gmLightbox .gm-btn:hover {
  background: rgba(0, 0, 0, 0.58);
}
#gmLightbox .gm-prev { left: 8px; }
#gmLightbox .gm-next { right: 8px; }
#gmLightbox .gm-close {
  top: 12px;
  right: 12px;
  transform: none;
  width: 38px;
  height: 38px;
  font-size: 30px;
  border-radius: 2px;
}

@media (max-width: 767px) {
  #dmFirstContainer.u_dmStyle_template_aboutme #1065876626 {
    background-attachment: scroll !important;
    min-height: 420px !important;
    padding-top: 70px !important;
    padding-bottom: 70px !important;
  }
  #dmFirstContainer.u_dmStyle_template_ahnenforschung #1900443754 {
    background-attachment: scroll !important;
    min-height: 420px !important;
    padding-top: 70px !important;
    padding-bottom: 70px !important;
  }
  #dmFirstContainer.u_dmStyle_template_raeuber #1152369902.fullBleedMode {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  #dmFirstContainer.u_dmStyle_template_raeuber #1801573063,
  #dmFirstContainer.u_dmStyle_template_hausforschung #1330879603,
  #dmFirstContainer.u_dmStyle_template_hausforschung #1125898543 {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
  #gmLightbox .gm-btn {
    width: 44px;
    height: 52px;
    font-size: 28px;
  }
  #gmLightbox .gm-caption {
    font-size: 14px;
  }
}

