/* ==========================================================================
   Bildschutz
   ========================================================================== */

/* Bildflächen, die geschützt werden */
.hero-photo, .about-photo, .card-media, .flip-image, .single-image a,
.press-image, .dialog-photo, .person-photo, .lightbox-media, .lineplan-image, .report-image, .tr-image,
.content .wp-block-image, .content .wp-block-gallery figure.wp-block-image {
  position: relative; overflow: hidden;
}
.about-photo, .single-image a, .dialog-photo { border-radius: var(--radius); }
.about-photo, .single-image a, .dialog-photo, .lightbox-media { display: block; }
.lightbox-media { display: inline-block; max-width: 100%; line-height: 0; }
.content .wp-block-image { overflow: hidden; }

/* 1) Speichern erschweren: kein Ziehen, kein Markieren, kein Sichern per langem Drücken */
.itb-protect img {
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
/* Unsichtbare Schicht über dem Bild – Rechtsklick/Langdruck trifft nicht das Bild selbst */
.itb-protect .about-photo::before, .itb-protect .flip-image::before, .itb-protect .dialog-photo::before,
.itb-protect .person-photo::before, .itb-protect .hero-photo::before, .itb-protect .lightbox-media::before,
.itb-protect .lineplan-image::before, .itb-protect .report-image::before, .itb-protect .tr-image::before {
  content: ""; position: absolute; inset: 0; z-index: 2; background: transparent;
}

/* 2) Wasserzeichen über Archivbildern */
.itb-watermark .flip-image::before, .itb-watermark .card-media::before, .itb-watermark .single-image a::before,
.itb-watermark .lightbox-media::before, .itb-watermark .content .wp-block-image::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background-image: var(--itb-watermark); background-repeat: repeat; background-size: 240px auto;
  border-radius: inherit;
}
.itb-watermark.itb-protect .flip-image::before, .itb-watermark.itb-protect .lightbox-media::before { pointer-events: auto; }

/* 3) Abdeckung bei Screenshot-Verdacht: Bild stark verwischt, Vereinslogo darüber */
.itb-shield .hero-photo::after, .itb-shield .about-photo::after, .itb-shield .card-media::after,
.itb-shield .flip-image::after, .itb-shield .single-image a::after, .itb-shield .press-image::after,
.itb-shield .dialog-photo::after, .itb-shield .person-photo::after, .itb-shield .lightbox-media::after,
.itb-shield .lineplan-image::after, .itb-shield .report-image::after, .itb-shield .tr-image::after,
.itb-shield .content .wp-block-image::after {
  content: var(--itb-shield-label, "Geschütztes Bild");
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: flex-end; justify-content: center; padding: 0 16px 14%; text-align: center;
  background-color: rgba(58, 58, 57, .45);
  background-image: url("../images/bildmarke.png");
  background-repeat: no-repeat; background-position: center 42%; background-size: clamp(56px, 22%, 132px) auto;
  color: #fff; font: 700 .7rem/1.4 "Sora", Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .45);
  border-radius: inherit;
  opacity: 0; visibility: hidden; transition: none !important;
}
html.is-shielded .itb-shield .hero-photo::after, html.is-shielded .itb-shield .about-photo::after,
html.is-shielded .itb-shield .card-media::after, html.is-shielded .itb-shield .flip-image::after,
html.is-shielded .itb-shield .single-image a::after, html.is-shielded .itb-shield .press-image::after,
html.is-shielded .itb-shield .dialog-photo::after, html.is-shielded .itb-shield .person-photo::after,
html.is-shielded .itb-shield .lightbox-media::after, html.is-shielded .itb-shield .lineplan-image::after,
html.is-shielded .itb-shield .report-image::after, html.is-shielded .itb-shield .tr-image::after, html.is-shielded .itb-shield .content .wp-block-image::after {
  opacity: 1; visibility: visible;
}
/* Das Foto selbst bis zur Unkenntlichkeit verwischen */
html.is-shielded .itb-shield main img:not(.stone):not([src*="bildmarke"]),
html.is-shielded .itb-shield .lightbox img {
  filter: blur(36px) grayscale(1) brightness(1.05) !important;
  transform: scale(1.25) !important;
  transition: none !important;
}

/* 4) Bilder nicht mitdrucken */
@media print {
  .itb-protect main img:not(.stone), .itb-protect .lightbox { display: none !important; }
  .itb-protect .hero-photo, .itb-protect .card-media, .itb-protect .flip-image, .itb-protect .press-image,
  .itb-protect .about-photo, .itb-protect .single-image, .itb-protect .content .wp-block-image {
    background: #ececec !important; min-height: 120px; box-shadow: none !important;
  }
}
