/* Container & Layout */
.accordion-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
  color: #333;
  padding: 40px 20px;
}

.accordion-content-col {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.accordion-gallery-col {
  flex: 1.2;
  min-width: 300px;
  display: flex;
  gap: 12px;
  height: 600px; /* Adjust height as needed */
}

/* Typography & Content Styling */
/* Preheader (Just standard text now, no hacky heights) */
.accordion-preheader {
  text-transform: uppercase;
  font-size: 16px;
  margin-top: 40px;
  padding-left: 40px;
  font-family: 'Barlow', sans-serif;
  color: #444;
  font-weight: 500;
  margin-bottom: 24px; /* Space between preheader and the main wrapper */
  /* Remove any forced padding-left or height here */
}


.accordion-title {
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 24px 0;
  line-height: 1.2;
  color: #111;
}

.accordion-desc {
  font-size: 16px;
  line-height: 1.6;
  color: #555;
  margin-bottom: 20px;
}

.accordion-list-title {
  font-size: 16px;
  color: #555;
  margin-bottom: 12px;
}

.accordion-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 24px;
}

.accordion-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 12px;
  color: #555;
  line-height: 1.5;
  font-size: 16px;
}

.accordion-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  background-color: #888;
  border-radius: 50%;
}

.accordion-btn {
  display: inline-flex;
  align-items: center;
  background-color: #0b0b0b;
  color: #fff;
  padding: 14px 28px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  font-size: 15px;
  margin-top: 10px;
  transition: background-color 0.2s ease;
}

.accordion-btn:hover {
  background-color: #333;
}

/* Controls Layer */
.accordion-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
  border-top: 1px solid transparent; 
}

.accordion-arrows {
  display: flex;
  gap: 12px;
}

.hs-arrow {
    transform: unset;
    margin-top: auto;
    border-radius: 4px;
    border: 1px solid #d4d7dd;
    height: 40px;
    width: 40px;
    padding: 0;
    aspect-ratio: 1:1; !important
    display: flex;
    align-items: center;
    justify-content: center;
    transition:all 0.3s linear;
}

.hs-arrow#Prev {
    background: url(https://lp.ajm.si/hubfs/AJM%20-%202024/images/global/Arrow%20Left.svg);
    background-repeat: no-repeat !important;
    background-position: center !important;
}

.hs-arrow#Next {
    background: url(https://lp.ajm.si/hubfs/AJM%20-%202024/images/global/Arrow%20Right2.svg);
    background-repeat: no-repeat !important;
    background-position: center !important;
}


.hs-arrow:hover {
  box-shadow: 0px 0px 0px 4px rgba(4, 78, 159, 0.20);
}

/* Size the custom arrow images */
.hs-arrow img {
  width: 20px; /* Adjust this number if you want the arrows larger/smaller */
  height: auto;
  object-fit: contain;
  display: block;
}

/* Optional: Slight opacity change on hover to make it feel interactive */
.hs-arrow:hover img {
  opacity: 0.7;
}

.accordion-dots {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 16px 20px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.hs-dot {
  width: 4px;
  height: 4px;
  background-color: #ccc;
  cursor: pointer;
  transition: all 0.2s;
}

.hs-dot.active {
  width: 4px;
  height: 4px;
  background-color: #000;
}

/* Accordion Gallery Items */
.hs-accordion-item {
  flex: 1;
  display: flex; /* Makes the item itself a flex container */
  flex-direction: column;
  position: relative; /* Still needed so the titles point upwards */
  transition: flex 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  cursor: pointer;
  height: 100%; 
}

.hs-accordion-item.active {
  flex: 4.5; 
}

/* Accordion Images (Bulletproof Height Fix) */
.hs-accordion-img {
  
  flex: 1; /* This is the magic! It forces the image div to stretch and fill the column */
  width: 100%; 
  background-color: #f5f5f5;
  background-size: cover;
  background-position: center;
  border-radius: 2px; 
  z-index: 1;
}


/* Make sure your titles stay layered on top */
.hs-accordion-title {
  position: absolute;
  max-height: 120px;
  bottom: 100%; 
  left: 0;
  padding-bottom: 12px; 
  font-size: 14px;
  text-align: right;
  transition: color 0.3s;
  z-index: 2;
  color: #000;
  font-weight: 300;
}

.hs-accordion-title span {
  writing-mode: vertical-rl; 
  white-space: wrap;
}

.hs-accordion-item.active .hs-accordion-title {
  color: #000;
  font-weight: 300;
}

.hs-accordion-img {
  width: 100%; 
  height: 100%; /* Fills the container, forming the strict top boundary */
  background-color: #f5f5f5;
  background-size: cover;
  background-position: center;
  border-radius: 2px;
}

/* Mobile Layout Overrides */
@media (max-width: 900px) {
  .accordion-wrapper { 
    display: flex; 
    flex-direction: column; 
    gap: 0; 
    padding: 0 15px 40px 15px;
    
    /* CRITICAL: Creates space ABOVE the gallery so the vertical titles 
       don't overlap the preheader! Adjust this if your titles are longer */
    margin-top: 140px; 
  }
  
  .accordion-preheader {
    padding-left: 15px; /* Aligns preheader with the mobile wrapper padding */
    margin-top: 30px; 
    margin-bottom: 0;
  }
  
  /* "Un-nests" the children so we can reorder them */
  .accordion-content-col { 
    display: contents; 
  }

  /* 1. Accordion Gallery goes to the top (just below the absolute titles) */
  .accordion-gallery-col { 
    order: 1;
    width: 100%; 
    height: 380px; 
    min-height: 380px; /* Add this line to force the browser to respect the height */
    margin-bottom: 20px;
  }

  .hs-accordion-item {
    height: 380px !important;
    display: block !important; /* Removes inner flexbox to stop collapsing */
  }
  
  .hs-accordion-img {
    height: 380px !important;
    width: 100% !important;
    display: block !important;
  }
  
  /* Adjust active image width on mobile so closed tabs remain tappable */
  .hs-accordion-item.active {
    flex: 3; 
  }

  /* 2. Controls directly under the gallery */
  .accordion-controls {
    order: 2;
    max-width: 100%; 
    margin-top: 0;
    margin-bottom: 30px;
    flex-direction: row-reverse; /* Swaps arrows to the right and dots to the left */
  }

  /* 3. The Text Content (Title, description, button) at the very bottom */
  .accordion-slides-container {
    order: 3;
  }

  /* Mobile typography adjustments */
  .accordion-title {
    font-size: 28px;
    margin-bottom: 16px;
  }
}