.tx-bautagebuch {
  position: relative;
}

.bautagebuch-timeline {
  position: relative;
  padding-left: 0;
}

.bautagebuch-entry {
  position: relative;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  padding: 0 0 4rem;
  overflow: hidden;
}

.bautagebuch-entry::before {
  content: "";
  position: absolute;
  left: 59px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e14e5e;
}

.bautagebuch-entry:last-child::before {
  bottom: 2rem;
}

.bautagebuch-entry__marker {
  position: relative;
  z-index: 1;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(145deg, #c3195d 0%, #e14e5e 100%);
  color: #fff;
  font-weight: 500;
  text-align: center;
  padding: 1rem;
}

.bautagebuch-entry__content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  min-width: 0;
  padding-top: 2.5rem;
}

.bautagebuch-entry__title,
.bautagebuch-detail__title {
  margin-bottom: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.bautagebuch-entry__location,
.bautagebuch-detail__date {
  color: #4a4a4a;
  font-weight: 500;
}

.bautagebuch-entry__location {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
  font-size: 0.95rem;
}

.bautagebuch-entry__location-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: #2b2b2b;
  line-height: 1;
}

.bautagebuch-entry__intro,
.bautagebuch-detail__intro {
  margin-bottom: 0;
  max-width: 680px;
  color: #4a4a4a;
  line-height: 1.75;
}

.bautagebuch-entry__intro p:last-child,
.bautagebuch-detail__intro p:last-child {
  margin-bottom: 0;
}

.bautagebuch-gallery {
  width: 100%; 
  min-width: 0;
}

.bautagebuch-gallery .img-carousel {
  min-width: 0;
  max-width: 100%;
  margin: 0.25rem 0 0;
}

.bautagebuch-gallery--single .card {
  position: relative;
  width: 100%;
  margin-bottom: 0;
  border-radius: 0;
  overflow: hidden;
  background: #d4d5d6;
}

.bautagebuch-gallery--single .card-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  background: #d4d5d6;
  max-width: 100%;
}

.bautagebuch-gallery--single .card-img-overlay {
  position: absolute;
  inset: 0;
  padding: 0;
}

.bautagebuch-gallery--single .card-img-overlay .card-img-overlay-text {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
}

.bautagebuch-gallery--single .card-img-overlay .overlay-background {
  width: calc(100% - 1rem);
  margin-right: 1rem;
}

.bautagebuch-detail__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 2rem;
}

.bautagebuch-detail__content,
.bautagebuch-detail__contact {
  min-width: 0;
}

.bautagebuch-detail__contact .card:last-child,
.bautagebuch-sidebar-contact-slot .card:last-child {
  margin-bottom: 0 !important;
}

.bautagebuch-sidebar-contact-slot:empty {
  display: none !important;
}

@media (min-width: 992px) {
  .bautagebuch-detail__contact {
    margin-top: 0 !important;
  }
}

.bautagebuch-entry__marker {
  background: linear-gradient(145deg, #c3195d 0%, #e14e5e 100%);
}

.bautagebuch-entry__marker::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #CC1E1C;
  background-size: cover;
  opacity: 0.8; /* Hier stellst du die Transparenz ein (0.0 bis 1.0) */
  z-index: -1;
  border-radius: 999px;
}

.bautagebuch-entry::before {
  transition: height 1s;
  height: 0;
}

.bautagebuch-entry.scrolled::before {
  height: 100%;
}

@media (max-width: 767.98px) {
  .bautagebuch-entry {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-bottom: 2.5rem;
  }

  .bautagebuch-entry::before {
    left: 1.4rem;
    top: 5rem;
  }

  .bautagebuch-entry__marker {
    width: 80px;
    height: 80px;
    font-size: 0.875rem;
  }

  .bautagebuch-entry__content {
    gap: 0.875rem;
    max-width: none;
    padding-top: 0;
  }

  .bautagebuch-entry::before {
    left: 2.4rem;
  }
  .bautagebuch-entry__content {
    width: calc(100% - 65px);
    transform: translateX(65px);
  }
}

/* Bautagebuch timeline: matching the approved XD layout. */
.bautagebuch-timeline {
  --bautagebuch-line-color: #e14e5e;
  --bautagebuch-marker-size: 80px;
  --bautagebuch-line-position: 39px;
  padding-bottom: 3rem;
}

.bautagebuch-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--bautagebuch-line-position);
  width: 2px;
  background: var(--bautagebuch-line-color);
}

.bautagebuch-timeline::after {
  content: "";
  position: absolute;
  left: calc(var(--bautagebuch-line-position) - 4px);
  bottom: 1px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--bautagebuch-line-color);
  border-bottom: 2px solid var(--bautagebuch-line-color);
  transform: rotate(45deg);
}

.bautagebuch-entry {
  grid-template-columns: var(--bautagebuch-marker-size) minmax(0, 1fr);
  gap: 2rem;
  overflow: visible;
}

.bautagebuch-entry::before,
.bautagebuch-entry.scrolled::before {
  display: none;
}

.bautagebuch-entry__marker {
  width: var(--bautagebuch-marker-size);
  height: var(--bautagebuch-marker-size);
  padding: 0.5rem;
  border-radius: 10px;
  background: #df1d16;
  font-size: 0.875rem;
  line-height: 1.2;
}

.bautagebuch-entry__marker::before {
  display: none;
}

.bautagebuch-entry__marker-date {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bautagebuch-entry__marker-day,
.bautagebuch-entry__marker-year {
  display: block;
}

@media (max-width: 767.98px) {
  .bautagebuch-timeline {
    --bautagebuch-marker-size: 64px;
    --bautagebuch-line-position: 31px;
  }

  .bautagebuch-entry {
    grid-template-columns: 1fr;
  }

  .bautagebuch-entry::before,
  .bautagebuch-entry.scrolled::before {
    display: none;
  }

  .bautagebuch-entry__content {
    width: calc(100% - 65px);
    transform: translateX(65px);
  }
}

/* Final timeline behaviour: animated segments, aligned content and end marker. */
.bautagebuch-timeline {
  padding-bottom: 0;
}

.bautagebuch-timeline::before,
.bautagebuch-timeline::after {
  display: none;
}

.bautagebuch-entry {
  overflow: hidden;
}

.bautagebuch-entry::before,
.bautagebuch-entry.scrolled::before {
  display: block;
  top: 0;
  bottom: 0;
  left: var(--bautagebuch-line-position);
  height: auto;
  background: var(--bautagebuch-line-color);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1s ease;
}

.bautagebuch-entry.scrolled::before {
  transform: scaleY(1);
}

.bautagebuch-entry:last-child::before {
  bottom: 10px;
}

.bautagebuch-entry:last-child::after {
  content: "";
  position: absolute;
  left: calc(var(--bautagebuch-line-position) - 6px);
  bottom: 0;
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 0v12M1 7l6 6 6-6' fill='none' stroke='%23e14e5e' stroke-width='2'/%3E%3C/svg%3E") no-repeat center / contain;
  opacity: 0;
  transition: opacity 0.2s ease 1s;
}

.bautagebuch-entry:last-child.scrolled::after {
  opacity: 1;
}

.bautagebuch-entry__content {
  padding-top: 1rem;
}

@media (max-width: 767.98px) {
  .bautagebuch-entry {
    grid-template-columns: var(--bautagebuch-marker-size) minmax(0, 1fr);
    gap: 1rem;
  }

  .bautagebuch-entry__content {
    width: auto;
    padding-top: 1rem;
    transform: none;
  }
}

@media (max-width: 1199.98px) {
  .bautagebuch-timeline {
    --bautagebuch-marker-size: 64px;
    --bautagebuch-line-position: 31px;
  }

  .bautagebuch-entry {
    grid-template-columns: var(--bautagebuch-marker-size) minmax(0, 1fr);
    gap: 1rem;
  }

  .bautagebuch-entry__content {
    width: auto;
    padding-top: 0;
    transform: none;
  }
}
