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

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

h2{
  color: var(--brand-primary-color);
  font-size: 35px;
  line-height: 1.25em;
  -webkit-text-stroke-color: #000;
  stroke: #000;
  margin-top: 0;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.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;
}

.link-list-item {
  position: relative;
  padding-bottom: 1rem;
}

.link-list-item:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50%;
  height: 2px;
  background-color: var(--bs-gray-200, #e9ecef);
  border-radius: 2px;
}

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

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

/* 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;
}

.text-block-gallery.gallery-count-1 .img-1 {
  grid-column: 1;
  grid-row: 1;
  border-radius: var(--bs-border-radius, 0.375rem);
}

/* 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(--bs-border-radius, 0.375rem);
}

/* Shortcode Content */
.text-block-shortcode {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 2rem;
  background-color: var(--bs-light, #f8f9fa);
  border-radius: var(--bs-border-radius-lg, 0.5rem);
}

.text .col-lg-3.text, 
.text .col-lg-4.text, 
.text .col-lg-5.text, 
.text .col-lg-6.text, 
.text .col-lg-7.text, 
.text .col-lg-8.text, 
.text .col-lg-9.text{
  padding-right: 150px;
  padding-left: calc(var(--bs-gutter-x) * .5);
}

.text.is-mirrored .col-lg-3.text, 
.text.is-mirrored .col-lg-4.text, 
.text.is-mirrored .col-lg-5.text, 
.text.is-mirrored .col-lg-6.text, 
.text.is-mirrored .col-lg-7.text, 
.text.is-mirrored .col-lg-8.text, 
.text.is-mirrored .col-lg-9.text{
  padding-left: 150px;
  padding-right: calc(var(--bs-gutter-x) * .5);
}

.text-block-icon-row .col-lg-6.text, 
.text-block-kachel .col-lg-6.text, 
.text-block-icon-grid .col-lg-6.text{
  width: 100%;
  padding: 0 calc(var(--bs-gutter-x) * .5);
}

.text-block-icon-row .text-block-content, 
.text-block-icon-grid .text-block-content{
  text-align: center;
}

.text .icon-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 75px;
}

.text .icon-grid:has(.icon-item:nth-child(2):last-child) .icon-item__icon::after, 
.text .icon-grid:has(.icon-item:nth-child(3):last-child) .icon-item__icon::after{
  display: none;
}

.text .icon-grid:has(.icon-item:nth-child(2):last-child) .icon-item__icon, 
.text .icon-grid:has(.icon-item:nth-child(3):last-child) .icon-item__icon{
  margin: 0 auto 0 0;
}

.text .icon-grid:has(.icon-item:nth-child(2):last-child) .icon-item__text, 
.text .icon-grid:has(.icon-item:nth-child(3):last-child) .icon-item__text, 
.text .icon-grid:has(.icon-item:nth-child(2):last-child) .icon-item__headline, 
.text .icon-grid:has(.icon-item:nth-child(3):last-child) .icon-item__headline{
  text-align: unset;
  width: 100%;
}

.text .icon-grid:has(.icon-item:nth-child(2):last-child) .icon-item__text ul, 
.text .icon-grid:has(.icon-item:nth-child(3):last-child) .icon-item__text ul{
  padding-left: 20px;
}

.text .icon-grid:has(.icon-item:nth-child(2):last-child) .icon-item__text li, 
.text .icon-grid:has(.icon-item:nth-child(3):last-child) .icon-item__text li{
  position: relative;
}

.text .icon-grid:has(.icon-item:nth-child(2):last-child) .icon-item, 
.text .icon-grid:has(.icon-item:nth-child(3):last-child) .icon-item{
  border-radius: unset;
  padding: unset;
  box-shadow: unset;
}

.text .icon-grid:has(.icon-item:nth-child(2):last-child) .icon-item:hover, 
.text .icon-grid:has(.icon-item:nth-child(3):last-child) .icon-item:hover{
  transform: unset;
}

.text .icon-grid:has(.icon-item:nth-child(2):last-child) .icon-item__text li::before, 
.text .icon-grid:has(.icon-item:nth-child(3):last-child) .icon-item__text li::before{
  content: '';
  background: url(../../assets/img/arrow-right-accent.svg);
  background-size: 100%;
  background-repeat: no-repeat;
  display: inline-block;
  width: 11px;
  height: 11px;
  position: absolute;
  top: 6px;
  left: -20px;
}

.text .icon-item__icon{
  border: solid 3px var(--brand-accent-color);
  border-radius: 100%;
  width: 100px;
  height: 100px;
  padding: 20px;
  margin: 0 auto;
  position: relative;
}

.text .icon-item__icon::after{
  content: '';
  background: url(../../assets/img/arrow-right-accent.svg);
  background-size: 100%;
  background-repeat: no-repeat;
  display: block;
  height: 40px;
  width: 40px;
  position: absolute;
  top: 245%;
  transform: translateY(-50%);
  right: -136px;
}

.text .text-block-icons .icon-item{
  background-color: var(--white);
  border-radius: 10px;
  padding: 10px 5px;
  box-shadow: 0 0 5px 0 rgba(0,0,0,0.3);
  -webkit-box-shadow: 0 0 5px 0 rgba(0,0,0,0.3);
  -moz-box-shadow: 0 0 5px 0 rgba(0,0,0,0.3);
  transition: transform .3s ease;
}

.text .text-block-icons .icon-item:hover{
  transform: scale(1.035);
  transition: transform .3s ease;
}

.text .icon-item:last-child .icon-item__icon::after{
  display: none;
}

.text .icon-item__headline{
  text-align: center;
  color: var(--brand-primary-color);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.text .icon-item__text{
  text-align: center;
  width: 95%;
  margin: 0 auto;
}

.text-block-icon-grid .icon-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.text-block-icon-grid .icon-item__icon::after{
  display: none;
}

.text-block-icon-grid .icon-item__icon{
  margin: 0;
}

.text-block-icon-grid .icon-item__headline{
  text-align: unset;
}

.text-block-icon-grid .icon-item__text{
  text-align: unset;
  width: 100%;
  margin: 0;
}

.text-block-icon-grid .icon-item__icon{
  width: 100px;
  height: 100px;
  border: solid 3px var(--brand-accent-color);
}

.text-block-icon-grid .icon-item{
  background-color: var(--white);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 5px 0 rgba(0,0,0,0.3);
  -webkit-box-shadow: 0 0 5px 0 rgba(0,0,0,0.3);
  -moz-box-shadow: 0 0 5px 0 rgba(0,0,0,0.3);
  transition: transform .3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.text-block-icon-grid .icon-item:hover{
  transform: scale(1.035);
  transition: transform .3s ease;
}

.text-block-kachel{
  position: relative;
}

.text-block-kachel.spacing-bottom{
  padding-bottom: 7.5rem;
}

.text-block-kachel.spacing-top{
  padding-top: 7.5rem;
}

.text-block-kachel .kachel-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: stretch;
}

.text-block-kachel .kachel-item__bild{
  width: 100%;
}

.text-block-kachel .kachel-item__bild img{
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px 10px 0 0;
}

.text-block-kachel .btn.accent{
  word-break: break-word;
  white-space: wrap;
}

.text-block-kachel .kachel-item{
  background-color: var(--white);
  padding: 0 15px 20px;
  border-radius: 0 0 10px 10px;
}

.text-block-kachel .headline{
  color: var(--white);
}

.text-block-kachel .kachel-item__headline{
  color: var(--brand-primary-color);
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.text-block-kachel .kachel{
  background-color: var(--white);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-bottom: 20px;
}

.text-block-kachel .kachel-button{
  padding: 0 15px;
  margin-top: auto;
}

.text-block-kachel .container{
  max-width: 1750px;
}

.text-block-kachel .col-lg-6.text{
  max-width: 1250px;
  margin: var(--bs-gutter-y) auto 0;
  text-align: center;
}

.text-block-kachel .text-content p{
  color: var(--white);
}

.text-block-kachel .button{
  text-align: center;
  width: 550px;
  margin: 75px auto 0;
}

.text-block-kachel .bottom_content p{
  color: var(--white);
}

.text-block-kachel .bottom-headline{
  color: var(--brand-accent-color);
}

.text-block-kachel .faq-cta-headline{
  color: var(--brand-accent-color);
  font-size: 1.5rem;
  margin-bottom: 0;
  margin-top: 30px;
}

.text-block-kachel .col-lg-6.text .button{
  display: none;
}

.text-block-slider {
  height: 100%;
}

.text-slide {
  background: var(--brand-secondary-color);
  padding: 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.text-slide__headline {
  margin-bottom: 1rem;
}

.text-slide__content {
  margin-bottom: 1.5rem;
}

.text-slide .btn {
  margin-top: auto;
}

.text-block-text-slider .col-lg-6.text{
  width: 100%;
  text-align: center;
  padding-right: calc(var(--bs-gutter-x) * .5);
}

.text-block-text-slider .text-slide{
  background: unset;
  text-align: center;
  padding: 0 100px;
  height: unset;
  display: block;
}

.text-block-text-slider .swiper-button-next, 
.text-block-text-slider .swiper-button-prev{
  color: var(--brand-accent-color);
}

.text-block-text-slider .swiper-button-next::after, 
.text.text-block-text-slider .swiper-button-prev::after{
  font-size: 30px;
}

.text-block-text-slider .swiper-pagination-bullet-active{
  background: var(--brand-accent-color);
}

.text-block-text-slider .swiper-wrapper{
  height: max-content!important;
}

.text-block-text-slider .swiper-pagination{
  bottom: 0;
}

.text-block-text-slider .text-block-slider .headline{
  color: var(--brand-accent-color);
  font-size: 1.5rem;
}

.text-block-blog{
  position: relative;
}

.text-block-blog .blog-kachel .blog-image {
  position: relative;
}

.text-block-blog .blog-category {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--brand-accent-color);
  color: var(--white);
  padding: 5px 20px 4px;
  font-size: 1rem;
  border-radius: 15px;
  font-weight: 600;
}

.text-block-blog .kachel-divider {
  width: 100%;
  height: 2px;
  background: var(--bs-gray-200);
  margin: 1rem 0;
}

.text-block-blog .blog-date {
  font-size: 0.9rem;
  opacity: 0.7;
}

.text-block-blog .kachel-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 50px;
}

.custom-shape-divider--bottom{
  transform: rotate(180deg);
  position: absolute;
  bottom: 0;
}

.text-block-blog.spacing-bottom{
  padding-bottom: 7.5rem;
}

.text-block-blog.spacing-top{
  padding-top: 7.5rem;
}

.text-block-blog .col-lg-6.text{
  width: 100%;
  padding-right: calc(var(--bs-gutter-x) * .5);
  text-align: center;
}

.text-block-blog .text-block-content .headline, .text-block-blog .text-block-content .text-content p{
  color: var(--white);
}

.text-block-blog .kachel-item__bild img{
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px 10px 0 0;
}

.text-block-blog .kachel-item{
  padding: 20px;
  background-color: var(--white);
  border-radius: 0 0 10px 10px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.text-block-blog .kachel-item .headline{
  font-size: 1.25rem;
  line-height: 1.75rem;
  word-break: break-word;
  hyphens: auto;
}

.text-block-blog .kachel.blog-kachel{
  background-color: var(--white);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.text-block-blog .button{
  text-align: center;
}

.text-block-blog .button .bottom-headline, 
.text-block-blog .button .faq-cta-headline{
  color: var(--brand-accent-color);
}

.text-block-blog .button .bottom_content p{
  color: var(--white);
}

.text-block-zwei_kacheln .col-lg-6.text{
  width: 100%;
  padding-right: calc(var(--bs-gutter-x) * .5);
  text-align: center;
  margin: var(--bs-gutter-y) auto 0;
  width: 800px;
}

.text-block-zwei_kacheln .kachel-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 100px;
}

.text-block-zwei_kacheln .kachel img{
  width: 100%;
  height: 375px;
  border-radius: 10px 10px 0 0;
}

.text-block-zwei_kacheln .kachel-item{
  padding: 20px;
  border-radius: 0 0 10px 10px;
}

.text-block-zwei_kacheln .kachel{
  box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.3);
  -webkit-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.3);
  -moz-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.3);
  border-radius: 10px;
}

.text-block-zwei_kacheln .kachel-item .headline{
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.text-block-text .col-lg-6.text{
  width: 100%;
  padding-right: calc(var(--bs-gutter-x) * .5);
}

.text-block-icon-row .icon-item__text li{
  list-style: none;
  color: var(--brand-primary-color);
  font-size: 1.1rem;
}

.text-block-text .button{
  text-align: center;
}

.text-block-icon-row .button{
  display: none;
}

.text-block-text .button .cta-headline{
  color: var(--brand-accent-color);
}

@media (max-width: 1480px) {
  .text .icon-item__icon::after{
    display: none;
  }

  .text-block-kachel .kachel-grid{
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1200px) {
  .text.is-mirrored .col-lg-3.text, 
  .text.is-mirrored .col-lg-4.text, 
  .text.is-mirrored .col-lg-5.text, 
  .text.is-mirrored .col-lg-6.text, 
  .text.is-mirrored .col-lg-7.text, 
  .text.is-mirrored .col-lg-8.text, 
  .text.is-mirrored .col-lg-9.text{
    padding-left: 75px;
  }

  .text .col-lg-3.text, 
  .text .col-lg-4.text, 
  .text .col-lg-5.text, 
  .text .col-lg-6.text, 
  .text .col-lg-7.text, 
  .text .col-lg-8.text, 
  .text .col-lg-9.text{
    padding-right: 75px;
  }

  .text .icon-grid{
    grid-template-columns: repeat(2, 1fr);
    gap: 20px ;
  }

  .text .icon-item__icon{
    width: 100px;
    height: 100px;
    padding: 15px;
    border: solid 3px var(--brand-accent-color);
  }

  .text .icon-item__headline{
    font-size: 1.2rem;
  }

  .text-block-kachel .kachel-item__headline{
    font-size: 1.2rem;
  }

  .text-block-zwei_kacheln .kachel-item .headline{
    font-size: 1.2rem;
  }
}

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

  .text.is-mirrored .col-lg-3.text, 
  .text.is-mirrored .col-lg-4.text, 
  .text.is-mirrored .col-lg-5.text, 
  .text.is-mirrored .col-lg-6.text, 
  .text.is-mirrored .col-lg-7.text, 
  .text.is-mirrored .col-lg-8.text, 
  .text.is-mirrored .col-lg-9.text{
    padding-left: calc(var(--bs-gutter-x) * .5);
  }

  .text .col-lg-3.text, 
  .text .col-lg-4.text, 
  .text .col-lg-5.text, 
  .text .col-lg-6.text, 
  .text .col-lg-7.text, 
  .text .col-lg-8.text, 
  .text .col-lg-9.text{
    padding-right: calc(var(--bs-gutter-x) * .5);
  }

  .text-block-text-picture .img-fluid{
    width: 600px;
    height: 400px;
    object-fit: contain;
    margin: 0 auto;
  }

  .text-block-blog .kachel-grid{
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .text-block-zwei_kacheln .kachel-grid{
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .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;
  }
  
  .link-list-item {
    padding-bottom: 0.75rem;
  }

  .text-block-kachel .kachel-grid{
    grid-template-columns: repeat(1, 1fr);
  }

  .text-block-text-slider .text-slide{
    padding: 0 50px;
  }

  .text-block-zwei_kacheln .kachel-grid{
    grid-template-columns: repeat(1, 1fr);
  }

  .text-block-zwei_kacheln .kachel img{
    height: 250px;
  }
}

@media (max-width: 576px) {
  .text-block-text-picture .img-fluid{
    width: 400px;
    height: 250px;
  }
  
  .text-block-text-picture .image{
    margin-top: 0;
  }

  .text .icon-grid{
    grid-template-columns: repeat(1, 1fr);
  }

  .text .icon-item__headline{
    font-size: 1.1rem;
  }

  .text-block-kachel .button{
    width: 100%;
  }

  .text-block-blog .kachel-grid{
    grid-template-columns: repeat(1, 1fr);
  }

  .text-block-zwei_kacheln .kachel-item .headline{
    font-size: 1.1rem;
  }
}

@media (max-width: 400px) {
  
}