/*
 * Ergänzungen zur Original-Theme-CSS von rock-im-baum.de.
 *
 * Das öffentliche Design kommt vollständig aus css/theme*.css (Sydney-Theme
 * der Live-Seite). Hier stehen nur die Ergänzungen für die neu implementierte
 * Kontaktformular-Verarbeitung.
 */

/* Galerien: Envira-Layout ohne das CMS-Plugin nachgebaut. */
.envira-gallery-public {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}
.envira-gallery-item {
  box-sizing: border-box;
}
.envira-gallery-item-inner {
  overflow: hidden;
}
.envira-gallery-image {
  display: block;
  max-width: 100%;
}
.envira-gallery-justified-public .envira-gallery-item {
  width: 160px;
}
.envira-gallery-justified-public .envira-gallery-image {
  width: 150px;
  height: 150px;
  object-fit: cover;
}
.envira-gallery-3-columns .envira-gallery-item {
  width: 33.3333%;
}
.envira-gallery-3-columns .envira-gallery-image {
  width: 100%;
  height: auto;
}
@media only screen and (max-width: 600px) {
  .envira-gallery-3-columns .envira-gallery-item {
    width: 50%;
  }
}

/* Lightbox der Galerien. */
.rib-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .92);
  color: #fff;
}
.rib-lightbox[hidden] {
  display: none;
}
.rib-lightbox img {
  max-width: 88vw;
  max-height: 82vh;
}
.rib-lightbox button {
  position: absolute;
  top: 12px;
  right: 16px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
}
.rib-lightbox button[data-action="prev"] {
  top: 50%;
  right: auto;
  left: 16px;
  font-size: 60px;
}
.rib-lightbox button[data-action="next"] {
  top: 50%;
  font-size: 60px;
}
.rib-lightbox-caption {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: .85em;
  opacity: .85;
}

/* Header-Bild der Innenseiten: wie im Original auf kleinen Screens aus. */
@media only screen and (max-width: 1024px) {
  .inner-hero .header-image {
    background-image: none !important;
    height: auto !important;
  }
}

/* Statusmeldungen direkt über dem Kontaktformular. */
.contact-status {
  display: block;
  margin: 0 0 1.2em;
  padding: 10px 14px;
  border: 1px solid;
  font-size: .95em;
}
.contact-status-success {
  color: #155724;
  background: #d4edda;
  border-color: #c3e6cb;
}
.contact-status-error {
  color: #721c24;
  background: #f8d7da;
  border-color: #f5c6cb;
}

/* Pflichtfeld-Markierung und Fehlerhinweise im Kontaktformular. */
.required-mark {
  color: #b00020;
  font-weight: bold;
}
.pbh-contact-not-valid {
  border-color: #b00020 !important;
}
.pbh-contact-not-valid-tip {
  display: block;
  margin: 2px 0 8px;
  color: #b00020;
  font-size: .9em;
}

/* Honeypots: off-screen statt display:none, damit Bots sie nicht einfach
   überspringen. Für Tastatur und Screenreader zusätzlich ausgenommen. */
.contact-honeypots {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
}

/* Einmalcode-Eingabe direkt unter dem Kontaktformular. */
.contact-code-panel {
  margin-top: 1.2em;
  padding: 14px 16px;
  border: 1px solid #c3e6cb;
  background: #f4fbf5;
  color: #000;
}
.contact-code-panel[hidden],
.contact-code-error[hidden] {
  display: none;
}
.contact-code-hint {
  margin: 0 0 .4em;
  font-weight: 600;
}
.contact-code-error {
  padding: 8px 12px;
  color: #721c24;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
}
.contact-code-form button[type="submit"] {
  background-color: var(--sydney-global-color-1);
  border: none;
  color: #fff;
  cursor: pointer;
  display: inline-block;
  margin-top: 0;
  min-width: 120px;
  padding: 10px 30px;
  text-align: center;
  text-transform: uppercase;
}
.contact-code-form button[type="submit"]:disabled {
  cursor: not-allowed;
}

/* Kontaktbereich am Ende der Startseite. */
.rib-contact {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--sydney-global-color-8);
}
.rib-contact-intro {
  margin-bottom: 1.5em;
}
.rib-contact .wpcf7-form textarea {
  max-width: 100%;
}

/* Externe Links / Links in neuem Tab: dezenter Hinweis. */
.external-link-icon {
  display: inline-block;
  margin-left: .25em;
  font-size: .7em;
  line-height: 1;
  text-decoration: none;
}
.external-link-note {
  clear: both;
  margin: 0 0 10px;
  font-size: .8em;
  opacity: .85;
}

/* --------------------------------------------------------------------------
 * Performance: Layout-Shift im Slider vermeiden.
 * Das Original-Theme setzt die Sliderhöhe erst per JavaScript (bzw. nachdem
 * das erste Bild geladen ist). Ohne reservierte Höhe rutscht der Seiteninhalt
 * beim Laden nach unten (CLS ~0.44 mobil / ~0.84 desktop).
 * ------------------------------------------------------------------------ */
.sydney-hero-area .header-slider {
  height: 100vh;
  min-height: 400px;
}

/* Superslides versteckt alle Folien, bis sein JavaScript initialisiert ist.
   Die erste Folie bleibt daher per CSS sichtbar (verbessert den LCP); site.js
   entfernt die Klasse, sobald der Slider läuft. */
.sydney-hero-area .slide-item.slide-initial {
  display: block !important;
}

/* Das Original-Theme animiert "right" von -1200px auf 0. Das verschiebt
   während jeder Folie den Text und erzeugt CLS. Gleiche Optik per Transform. */
@keyframes rib-fade-in-right {
  from { transform: translate3d(80px, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}
.sydney-hero-area .text-slider {
  animation-name: rib-fade-in-right !important;
}

@media only screen and (max-width: 1025px) {
  /* Die mobilen Bilder haben 800x500 px = 62,5 % der Breite. Superslides
     setzt die Höhe per Inline-Style auf die Fensterhöhe; das muss hier
     überschrieben werden, sonst rutscht der Inhalt nach dem JS-Start weg. */
  .sydney-hero-area,
  .sydney-hero-area .header-slider {
    height: 62.5vw !important;
    min-height: 0;
  }
  .sydney-hero-area .slides-container .slide-item {
    height: 100% !important;
  }
  .sydney-hero-area .mobile-slide {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}
