/**
 * Text Block Styles
 * 
 * Flexible text block with optional gallery or shortcode
 * Supports 3 layouts: text-only, text+images, text+shortcode
 */

.relative{
  position:relative;
}

.backgroundimage:after{
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(20, 36, 51, 0.78);
  z-index: 1;
  pointer-events: none;
  z-index:0;
}

/* Text Content */
#center .text-block-content{
  width:50%;
  margin:0 auto;
  text-align:center;
}
#center .text-block-content .topline{
  margin:0 auto;
}

.text-block-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.text-content {
  margin-bottom: 2rem;
}

.text-content ul {
  padding-left: 1.5rem;
  list-style: disc;
}

.text-content ol {
  padding-left: 1.5rem;
  list-style: decimal;
}

.text-content ul li,
.text-content ol li {
  margin-bottom: 0.5rem;
}

/* Link List (Buttons) */
.link-list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.text h3{
  margin-top: 0;
}

.text .row{
  justify-content: space-between;
}

.icon-list-icon{
  padding-right: 10px;
}

.icon-list-icon img{
  width: 50px;
  height: 50px;
}

.link-list-link {
  font-size: 1rem;
  font-weight: 600;
  font-style: italic;
  text-transform: uppercase;
  text-decoration: none;
  color: currentColor;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.link-list-link:hover {
  color: var(--brand-secondary-color, var(--bs-primary, #0d6efd));
}

.link-list-link::after {
  content: '→';
  font-style: normal;
  font-weight: 400;
}

.text-cta-btn{
  width: fit-content;
}

/* .text-block-content .zahlenwrapper{padding-top:25px;/border-top:solid 1px var(--bs-body-color);} */
.text-block-content .zahlenwrapper .zahl{font-size:350%;color:var(--brand-accent-color);font-weight:700;margin-right:5px;line-height:1;float:left;}
.text-block-content .zahlenwrapper .beschreibung{font-size:100%;margin-top:40px;display:inline-block;line-height:1.2;font-weight:600;color:var(--brand-primary-color)}

.has-dark-bg .text-block-content .zahlenwrapper{border-color:#fff;}

/* Image Gallery */
.text-block-gallery {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 400px;
  gap: 1.25rem;
  margin: 0;
}

/* Single image (1 image) */
.text-block-gallery.gallery-count-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.gallery-item {
  grid-column: 1;
  grid-row: 1;
  border-radius: var(--br);
  aspect-ratio: 7 / 5;
  width: 100%;
}

.gallery-item-wrapper{
  position: relative;
}

figcaption{
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  padding: 1rem;
  background-color: var(--brand-primary-color-20);
  backdrop-filter: blur(4px);
  border-radius: var(--br);
  display: flex;
  flex-direction: column;
}

.gallery-caption-year{
  font-size: 170%;
  font-weight: 700;
  color: var(--brand-accent-color);
  display: block;
}

.gallery-caption-text{
  color: var(--brand-primary-color-text)
}

/* Two images layout */
.text-block-gallery.gallery-count-2 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: 1fr 1fr;
}

.text-block-gallery.gallery-count-2 .img-1 {
  grid-column: 1 / -1;
  grid-row: 1;
}

.text-block-gallery.gallery-count-2 .img-2 {
  grid-column: 1 / -1;
  grid-row: 2;
}

/* Three or four images layout (advanced grid) */
.text-block-gallery.gallery-count-3,
.text-block-gallery.gallery-count-4 {
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
}

/* 3+ images: Large hero image */
.text-block-gallery .img-1 {
  grid-column: 1 / span 8;
  grid-row: 1 / span 5;
}

/* 3+ images: Bottom right small */
.text-block-gallery .img-2 {
  grid-column: 6 / span 3;
  grid-row: 6 / span 3;
}

/* Image 3: Bottom left small */
.text-block-gallery .img-3 {
  grid-column: 1 / span 3;
  grid-row: 6 / span 3;
}

/* Image 4: Bottom center (only if 4 images) */
.text-block-gallery .img-4 {
  grid-column: 4 / span 2;
  grid-row: 6 / span 3;
}

/* All gallery images */
.text-block-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--br);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Shortcode Content */
.text-block-shortcode label{
  color: var(--brand-primary-color-text);
}

.text-block-shortcode {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 2rem;
  border-radius: var(--br);
  border: 1px solid var(--brand-primary-color);
  background-color: var(--brand-secondary-color);
}

.text-block-shortcode .fluentform{
  width: 100%;
}

.text-block-short .text-content ul{padding-left:0;}
.text-block-short .text-content ul li{position: relative;font-weight: 600;line-height: 1.35;font-size: 100%;padding: 5px 20px;list-style:none;}
.text-block-short .text-content ul li:before{content: "✓";position: absolute;left: 0;top: 5px;color: var(--brand-accent-color);}

.text-block-text.has-ansprechpartner{
  padding: 5rem 0 0!important;
}

.text-block-text.has-ansprechpartner .container{
  max-width:1150px;
}

.row .partner{
    order: 1;
}

.row .text{
  order: 2;
}

.row .partner img{
  border-radius: var(--br);
  max-width: 475px;
  width: 100%;
}

.text-block-ansprechpartner-name{
  font-size: 150%;
}

/* #kontakt{margin-top:-5rem;padding-top:10rem;} */


.retrofit-right{background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.1);border-radius:20px;padding:32px;position:relative;z-index:1;}
.retrofit-right-title{color:#fff;margin-bottom:15px;}
.retrofit-stats{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.rstat{background:rgba(255,255,255,.06);border-radius:12px;padding:16px;}
.rstat-val{font-size:175%;font-weight:900;color:var(--brand-accent-color);letter-spacing:-.03em;line-height:1;}
.rstat-label{color:rgba(255,255,255,.45);margin-top:3px;line-height:1.4;}

#haken.text-block-kachel .text-content .passt-big-stat{font-size:350%;font-weight:700;color:var(--brand-accent-color);line-height:1;}
#haken.text-block-kachel .text-content ul{padding-left:0;}
#haken.text-block-kachel .text-content ul li{position: relative;font-weight: 600;line-height: 1.35;font-size: 100%;padding: 5px 20px;list-style:none;}
#haken.text-block-kachel .text-content ul li:before{content: "✓";position: absolute;left: 0;top: 5px;color: var(--brand-accent-color);}
.text-block-kachel .retrofit-icons .item{background:var(--white);display:flex;gap:15px;margin-bottom:15px;border:1px solid #e8edf2;padding:20px;width:100%;border-radius:15px;}
/* .text-block-kachel .retrofit-icons .item:last-child{background:var(--brand-primary-color);}
.text-block-kachel .retrofit-icons .item:last-child *{color:var(--white);}
.text-block-kachel .retrofit-icons .item:last-child span{color:var(--brand-accent-color);font-weight:600;} */
.text-block-kachel .retrofit-icons .item .icon img{width:50px;}
.text-block-kachel .retrofit-icons .item .content{align-content:center;}
.text-block-kachel .retrofit-icons .item .content .headline{display:block;font-weight:700;color:var(--brand-primary-color)}

.text-block-aufzahlung .icon-list-item{
  margin-bottom:0!important;
}
.text-block-aufzahlung .icon-list-item .icon-list-content{
  width:100%;
}
.text-block-aufzahlung .icon-list-item h3{
  padding:35px 0;
  border-top:1px solid #e6ece8;
  font-size:150%;
}
.text-block-aufzahlung .icon-list-item:last-child h3{
  border-bottom:1px solid #e6ece8;
}
.text-block-aufzahlung .icon-list-item h3 span{
  font-weight:700;
}

.text-block-aufzahlung .text-block-content{justify-content: start;}

#petra .gallery-item-wrapper{margin-bottom:0;}
#petra .gallery-item-wrapper img{aspect-ratio: 1/1;}

/* Vernetzungs-Diagramm */
@keyframes pulse{0%,100%{transform:scale(1);}50%{transform:scale(1.06);}}
.iq-diagram{position:relative;height:100%;display:flex;align-items:center;justify-content:center;}
.iq-center{position:absolute;width:120px;height:120px;border-radius:50%;background:var(--lime);display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:10;box-shadow:0 0 0 12px rgba(164,198,20,.12),0 0 0 24px rgba(164,198,20,.06);animation:pulse 3s ease-in-out infinite;}
.iq-center-label{font-size:16px;font-weight:900;color:var(--navy-dark);line-height:1;}
.iq-center-sub{font-size:9px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--navy);margin-top:2px;}
.iq-node{position:absolute;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.12);border-radius:12px;padding:10px 14px;text-align:center;z-index:5;backdrop-filter:blur(8px);}
.iq-node:hover{background:rgba(164,198,20,.1);border-color:rgba(164,198,20,.3);}
.iq-node-icon{width:50px;margin:5px auto;}
.iq-node-label{font-size:100%;font-weight:700;color:var(--white);white-space:nowrap;}
/* Positionen */
.iq-node-wb{top:20px;left:50%;transform:translateX(-50%);}
.iq-node-pv{top:50%;left:0;transform:translateY(-50%);}
.iq-node-sp{top:50%;right:20px;transform:translateY(-50%);}
.iq-node-wp{bottom:20px;left:15%;}
.iq-node-ed{bottom:20px;right:15%;}
/* Verbindungslinien als SVG */
.iq-lines{position:absolute;inset:0;pointer-events:none;height: 100%;top: 50%;left: 50%;transform: translateX(-50%) translateY(-50%);}
.iq-text h3{font-size:clamp(20px,2.4vw,30px);font-weight:900;color:var(--white);letter-spacing:-.02em;margin-bottom:12px;}
.iq-text p{font-size:14px;color:rgba(255,255,255,.55);line-height:1.75;margin-bottom:24px;}
.iq-feats{display:flex;flex-direction:column;gap:11px;}
.iq-feat{display:flex;gap:13px;align-items:flex-start;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.07);border-radius:11px;padding:14px 16px;transition:.2s;}
.iq-feat:hover{background:rgba(164,198,20,.07);border-color:rgba(164,198,20,.2);}
.iq-feat-icon{font-size:1.1rem;flex-shrink:0;}
.iq-feat h4{font-size:13px;font-weight:900;color:var(--white);margin-bottom:2px;}
.iq-feat p{font-size:12px;color:rgba(255,255,255,.45);line-height:1.5;}


.bidir-visual{display:flex;flex-direction:column;align-items:center;gap:0;}
.bidir-node{display:flex;flex-direction:column;align-items:center;background:var(--white);border:1.5px solid var(--off2);border-radius:16px;padding:20px 24px;width:50%;text-align:center;transition:.2s;margin-bottom:50px;position:relative;}
.bidir-node:after{content:'↕';color:var(--brand-accent-color);width:25px;height:25px;position:absolute;bottom:0;left:50%;transform:translateX(-50%) translateY(100%);font-size:150%;font-weight:700;}
.bidir-node:last-child{margin-bottom:0;}
.bidir-node:last-child:after{display:none;}
.bidir-node:hover{border-color:rgba(164,198,20,.4);}
.bidir-node-icon{width:50px;height:50px;margin-bottom:15px;}
.bidir-node-label{font-size:125%;font-weight:900;color:var(--navy-dark);}
.bidir-node-sub{font-size:100%;color:var(--muted);margin-top:1px;}


.ap_form{display:flex;gap:50px;}
.ap_form .image img{max-width:125px;border-radius:50%;}
.ap_form .content{align-content:center;}
.ap_form .content .headline{display:block;font-weight:700;font-size:150%;display:block;color:var(--brand-primary-color);}
.ap_form .content .name{display:block;font-weight:700;}
.ap_form .content .position{display:block;font-weight:300;}



@media(min-width: 992px){
  .row .text{
    padding-left: 75px;
  }
}

/* Responsive Adjustments */
@media(max-width:1199px){
  .iq-diagram{height:60%;}
}

@media (max-width: 991px) {
  .row .text{
    order: 1;
    margin-bottom:1.5rem;
  }
  .text-block-gallery {
    min-height: 300px;
  }
  
  .text-block-shortcode {
    min-height: 200px;
    padding: 1.5rem;
  }

  .text-block-ansprechpartner{
    text-align: center;
  }
  .text-block-ansprechpartner img{
    margin: 0 auto;
  }
  #center .text-block-content{
    width:100%;
  }
  .text-block-animation .text{
    order:1;
    margin-bottom:1.5rem;
  }
  .text-block-animation .animationswrapper{
    order:2;
  }
  .text-block-animation .animationswrapper .iq-diagram{
    height:650px;
  }
  .text-block-box .boxenswrapper{
    order:2;
  }
  .text-block-kachel .retrofit-icons .item .content{
    margin-bottom:0;
  }

  .text-block-aufzahlung .row .text{
    order: 1;
  }
  .text-block-aufzahlung .row .aufzahlungswrapper{
    order: 2;
  }

  .ap_form{gap:20px;}
  .ap_form .image img{width:100px;}
  .ap_form .content{order:2;margin:0;}
  .ap_form .content .headline{font-size:125%;}

}

@media (max-width: 767px) {
  .text-block-gallery.gallery-count-3,
  .text-block-gallery.gallery-count-4 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    min-height: auto;
  }
  
  .text-block-gallery .img-1,
  .text-block-gallery .img-2,
  .text-block-gallery .img-3,
  .text-block-gallery .img-4 {
    grid-column: span 1;
    grid-row: auto;
    aspect-ratio: 4/3;
  }
  
  .link-list {
    gap: 1rem;
  }


  .text-block-animation .animationswrapper .iq-diagram{height:600px;}
  .text-block-animation .animationswrapper .iq-diagram .iq-lines{
    width:100%;
  }
  
}

@media(max-width:575px){
  .retrofit-right{
    padding:15px;
  }
  .text-block-animation .animationswrapper .iq-diagram{
    display:none;
  }
  .bidir-node{
    width:100%;
  }
  .has-dark-bg .text-block-content h2, .has-dark-bg .text-block-content h3, .has-dark-bg .text-block-title, .has-dark-bg .icon-list-heading{
    z-index:99;
  }
  .has-dark-bg .text-content, .has-dark-bg .icon-list-text, .has-dark-bg .text-block-ansprechpartner-subtitle{
    z-index:99;
  }
  .text-block-aufzahlung .icon-list-item h3{
    font-size:125%;
  }
  .text-block-kachel .retrofit-icons .item .content{
    width:calc(100% - 50px);
  }

}
