/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Ensure the body allows natural scrolling */
body {
  font-family: "Inter", sans-serif;
  background-color: #f4e7d1;
  color: #6f2e34;
  line-height: 1.6;
  overflow-x: hidden; /* Only prevent horizontal scroll from the zoomed image */
  min-height: 100vh;
  scroll-behavior: smooth !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Ensures smooth scroll stops at the right spot */
}

/* Hero Header - Stays at the top */
.hero-section {
  height: 50vh;
  background-image: url("../assets/images/background-top.webp");
  background-size: cover;
  background-position: center bottom;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 60px;

  /* STICKY LOGIC */
  position: sticky;
  /* We want to scroll up until only the bottom 60px-80px of this section is visible */
  top: calc(-50vh + 95px);
  z-index: 100;
  overflow-x: hidden; /* Only prevent horizontal scroll from the zoomed image */
}

/* Logo & Navbar remain the same */
.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
  /* Add this line to pull it up */
  margin-top: -15px;
}

.main-logo {
  width: 80px;
  height: auto;
  margin-bottom: -10px;
}
.main-logo-text {
  width: 500px;
  max-width: 90%;
  height: auto;
  display: block;
}

.navbar {
  position: absolute;
  /* This places it 20px from the bottom of the background image */
  bottom: 20px;
  left: 0;
  width: 100%;
  background-color: #f4e7d1;
  padding: 12px 0;
  z-index: 10;
}

.navbar ul {
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 40px;
}
.navbar a {
  text-decoration: none;
  color: #6f2e34;
  font-size: 1.2rem;
  font-weight: 400;
}

/* Main Content Area - Flows naturally down the page */
.content-wrapper {
  width: 100%;
  margin-top: 20px;
  position: relative;
  z-index: 5;
  background-color: #f4e7d1; /* Essential so the hero doesn't show through */
}

.intro-section {
  display: flex;
  align-items: flex-start; /* Align to top so text and image start together */
  justify-content: space-between;
  width: 100%;
}

.text-content {
  flex: 1;
  padding-left: 150px;
  padding-right: 50px;
  position: relative;
  z-index: 3;

  padding-top: 200px;
}

.text-content h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  font-weight: 600;
  color: #a67c7c;
}

.text-content p {
  font-weight: 400;
  font-size: 1.1rem;
  padding-right: 80px;
  margin-bottom: 1.5rem;
}

/* Image Container - Tucked behind the header */
.image-content {
  flex: 1.2;
  margin-top: -120px; /* Pulls image up to overlap/go under the header */
  margin-right: -300px; /* Pushes it off-screen to the right */
  position: relative;
  z-index: -1; /* Goes behind the hero background-top */
}

.featured-img {
  width: 100%;
  height: auto;
  display: block;
  transform: scale(1.1);
  transform-origin: right center;
  translate: 50px 0;
  image-rendering: -webkit-optimize-contrast;
}

.carousel-container {
  position: relative;
  min-height: 120px; /* Adjust to fit your longest text */
  overflow: visible; /* Changed to allow the subtle drift */
}

.carousel-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;

  /* Initial state: Invisible and slightly lower */
  opacity: 0;
  transform: translateY(15px);
  filter: blur(5px); /* Adds a soft artistic touch during transition */

  /* Smooth, high-end transition curve */
  transition:
    opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1),
    transform 1.2s cubic-bezier(0.4, 0, 0.2, 1),
    filter 1.2s ease;

  pointer-events: none;
  line-height: 1.8;
}

.carousel-item.active {
  opacity: 1;
  transform: translateY(0); /* Drift up to natural position */
  filter: blur(0);
  pointer-events: auto;
}

/* Optional: Slide the old text OUT upward and away */
.carousel-item.exit {
  opacity: 0;
  transform: translateY(-15px);
  filter: blur(5px);
}

/* Pagination Dots */
.carousel-pagination {
  display: flex;
  gap: 15px;
  margin-top: 5px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(
    111,
    46,
    52,
    0.3
  ); /* Muted version of your text color */
  cursor: pointer;
  transition: background-color 0.3s;
}

.dot.active {
  background-color: #6f2e34; /* Your main text color */
}

/* --- NEW SECTION STYLES --- */
.second-section {
  flex-direction: row; /* Standard row layout */
}

/* Style for the centered titles in the picture */
.title-top {
  margin-top: -100px;
  text-align: left;
  font-size: 2.2rem;
  color: #a67c7c;
  margin-bottom: 5px;
}

.subtitle-top {
  text-align: left;
  font-size: 1.8rem;
  font-weight: 300;
  color: #a67c7c;
  margin-bottom: 40px;
}

.mental-text-block strong {
  display: block;
  margin-bottom: 15px;
  font-weight: 600;
}

/* Adjust the left image to bleed off the left side */
.left-image {
  margin-left: -250px; /* Mirroring your first section bleed */
  margin-right: 0;
  margin-top: 0;
}

.left-image .featured-img {
  transform: scale(1.1);
  transform-origin: left center;
}

/* Mirror the layout for sections with the .reverse-layout class */
.reverse-layout {
  flex-direction: row; /* Ensure image is left, text is right */
}

/* Handle the left-side image bleed */
.left-bleed {
  margin-left: -300px; /* Bleeds off the left side */
  margin-right: 0;
  margin-top: 120px; /* Adjust this to control vertical position */
  z-index: 1;
}

/* Ensure the image in the left-bleed container scales from the left */
.left-bleed .featured-img {
  transform: scale(1.1);
  transform-origin: left center;
  translate: -50px 0; /* Shifts it slightly left */
}

/* Adjust padding for the text when it is on the right side */
/* Adjust padding for the text when it is on the right side */
.reverse-layout .text-content {
  /* Increased from 50px to 150px to push it right by 100px */
  padding-left: 150px;

  padding-right: 150px;
  padding-top: 100px;
}

/* --- RESPONSIVE DESIGN --- */

/* Tablet Styles (Screens smaller than 1024px) */
@media (max-width: 1024px) {
  .text-content {
    padding-left: 50px;
    padding-right: 30px;
    padding-top: 100px;
  }

  .reverse-layout .text-content {
    padding-left: 50px;
    padding-right: 50px;
  }

  .image-content,
  .left-bleed {
    margin-right: -150px;
    margin-left: -150px;
  }
}

/* Mobile Styles (Screens smaller than 768px) */
@media (max-width: 768px) {
  /* 1. Header & Logo Adjustments */
  .hero-section {
    height: 30vh;
    top: calc(-30vh + 70px); /* Adjust sticky point for mobile */
    padding-top: 25px;
  }

  /* 2. Logo Container: Tighten spacing */
  .logo-container {
    gap: 15px; /* Reduced gap between icon and text logo */
    margin-top: -10px;
  }

  /* 3. Logos: Scale down for smaller screens */
  .main-logo {
    width: 50px; /* Reduced from 80px */
    margin-bottom: -5px;
  }

  .main-logo-text {
    width: 220px; /* Significantly smaller text logo */
    max-width: 80%;
  }

  .navbar {
    bottom: 10px;
  }

  .navbar ul {
    gap: 15px; /* Tighten links */
    flex-wrap: wrap;
    padding: 0 10px;
  }

  .navbar a {
    font-size: 0.9rem;
  }

  /* 2. Layout Changes: Stack sections vertically */
  .intro-section,
  .reverse-layout {
    flex-direction: column; /* Stack image and text */
    align-items: center;
  }

  /* 3. Text Content Adjustments */
  .text-content {
    padding: 40px 25px !important; /* Reset all large desktop paddings */
    width: 100%;
    order: 2; /* Ensure text comes after image or before based on preference */
    text-align: center;
  }

  .text-content h2,
  .title-top,
  .subtitle-top {
    text-align: center;
    font-size: 1.8rem;
  }

  .text-content p {
    padding-right: 0; /* Remove the 80px desktop padding */
    font-size: 1rem;
  }

  .carousel-container {
    cursor: grab;
    /* Prevents accidental page refreshing while swiping the carousel */
    touch-action: pan-y;
  }
  .carousel-container:active {
    cursor: grabbing;
  }

/* Narrow the gap under the carousel */
  #hypnocoaching-section .text-content {
    padding-bottom: 0 !important;
  }

  .carousel-pagination {
    margin-bottom: 5px; /* Minimal space */
    justify-content: center;
  }

  /* Narrow the gap above Über mich */
  .info-block-section .text-content {
    padding-top: 20px !important; /* Reduced from 60px */
  }

  /* 4. Image & Bleed Adjustments */
.image-content, 
  .left-bleed {
    order: 1;
    width: 100% !important;
    margin: 0 !important;
    position: relative;
    z-index: 1;
    /* This is the crucial fix: */
    overflow: hidden; 
  }

  .featured-img {
    display: block;
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    /* Reset transforms completely for mobile */
    transform: none !important;
    translate: 0 0 !important;
  }

  .left-bleed .featured-img {
    transform: scale(1);
    translate: 0 0;
  }

  /* 5. Section specific fixes */
  .info-block-section .text-content {
    padding-top: 60px !important;
  }

  .title-top {
    margin-top: 0; /* Reset the negative margin from desktop */
  }
}
