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

/* Text Content */

section.text {
  padding: 5rem 0;
}

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

/* 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);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

/* Responsive Adjustments */
@media (max-width: 991.98px) {
  .text-block-gallery {
    min-height: 300px;
  }

  .text-block-shortcode {
    min-height: 200px;
    padding: 1.5rem;
  }
}

@media (max-width: 767.98px) {
  .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;
  }
}

/**
 * Split Editorial Layout
 * Subline + Headline links / Text rechts + optionale Icons
 */

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

.text-block-split-row {
  align-items: start;
}

.text-block-split-left,
.text-block-split-right {
  height: 100%;
}

.text-block-subline {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-accent-color);
}

.text-block-right-text p:last-child {
  margin-bottom: 0;
}

.text-block-split .container {
  position: relative;
}

/* Icons */
.text-block-icons-row {
  margin-top: 5rem;
}

.text-block-icons-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.text-block-icons-slider {
  overflow: hidden;
  position: relative;
}

.text-block-icons-track {
  display: flex;
  align-items: center;
  gap: clamp(2rem, 4vw, 4rem);
  width: max-content;
  min-width: 100%;
  animation: scroll 30s linear infinite;
}
.text-block-icons-group {
  display: flex;
  gap: 2rem;
}

.text-block-icon {
  flex: 0 0 150px;
  max-width: 150px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-block-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.text-block-extra-text {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: right;
  text-wrap: wrap;
  max-width: 300px;
}

/* Light Text Variant */
.light-text * {
  color: #fff;
}

.light-text .text-block-headline {
  color: #fff;
  margin-bottom: 1rem;
}

.light-text .text-content,
.light-text .text-block-right-text {
  color: rgba(255, 255, 255, 0.85);
}

.light-text .text-block-subline {
  color: var(--brand-accent-color);
}

.light-text a:not(.btn) {
  color: #fff;
}

.light-text .text-block-link-text {
  color: rgba(255, 255, 255, 0.75);
}

@media (min-width: 992px) {
  .text-block-split-left {
    padding-right: 3rem;
  }

  .text-block-split-right {
    padding-top: 2.25rem;
  }
}

@media (max-width: 991.98px) {
  .text-block-headline {
    max-width: 100%;
  }

  .text-block-right-text {
    max-width: 100%;
  }

  .text-block-split-right {
    padding-top: 0;
  }

  .text-block-icons-row {
    margin-top: 3rem;
  }

  .text-block-icons-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .text-block-icons-slider {
    width: 100%;
  }

  .text-block-icons-track {
    min-width: max-content;
  }

  .text-block-extra-text {
    width: 100%;
    max-width: 100%;
    text-align: left;
  }
}

/**
 * Text Links Layout
 * Repeater navigation_links for text_links block type
 */

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

.text-block-links-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.text-block-link-item {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 2rem 0;
  border-top: 3px solid var(--bs-gray-200);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.text-block-links-list .text-block-link-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.text-block-link-item-inner {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: start;
}

.text-block-link-number {
  justify-self: flex-end;
  font-size: 2rem;
  line-height: 1;
  font-weight: 700;
  color: var(--brand-accent-color);
  letter-spacing: -0.02em;
}

.text-block-link-content {
  position: relative;
  padding-right: 3rem;
  min-width: 0;
}

.text-block-link-arrow {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 50%;
  right: -1.5rem;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  font-size: 1.5rem;
  background-color: var(--brand-accent-color);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.text-block-link-content:hover .text-block-link-arrow,
.text-block-link-content:active .text-block-link-arrow {
  opacity: 1;
}

.text-block-link-content:hover .text-block-link-title,
.text-block-link-content:active .text-block-link-title {
  color: var(--brand-accent-color);
}

.text-block-link-text {
  color: var(--bs-secondary-color);
  font-size: 1rem;
  line-height: 1.7;
}

.text-block-link-text p:last-child {
  margin-bottom: 0;
}

.text-block-link-icon {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  min-width: 56px;
}

.text-block-link-icon img {
  max-width: 56px;
  height: auto;
  display: block;
}

.text-block-link-icon-default {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-accent-color);
  color: #fff;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  line-height: 1;
}

.text-block-link-icon-default span {
  transform: translateX(1px);
  display: inline-block;
}

.text-block-text_links .text-block-split-left {
  padding-right: 2rem;
}

.text-block-text_links .text-block-links {
  padding-left: 0;
}

@media (min-width: 992px) {
  .text-block-text_links .text-block-links {
    padding-left: 2rem;
  }
  .text-block-link-number {
    justify-self: flex-start;
  }
}

@media (max-width: 991.98px) {
  .text-block-link-item {
    padding: 1.5rem 0;
  }

  .text-block-link-item-inner {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .text-block-link-icon {
    grid-column: 2;
    justify-content: flex-start;
    margin-top: 1rem;
  }
}

@media (max-width: 576px) {
  .text-block-link-item-inner {
    position: relative;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .text-block-link-number {
    position: absolute;
    top: 0;
    right: 0;
  }

  .text-block-link-icon {
    grid-column: auto;
    margin-top: 0.5rem;
  }
  .text-block-link-arrow {
    right: 0;
  }
  .text-block-split-left {
    order: 2;
  }
  .text-block-split-right {
    order: 1;
    padding-top: 0;
  }
}
/*  animation */
@keyframes scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
