/* FAQ Block */

/* Screen reader only class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.faq-answer-content p {margin-top:0px;}


.faq-block {
  position: relative;
  width: 100%;
  height: 450px; /* Stała wysokość dla 5 pytań */
  overflow: hidden; /* Ukrywamy overflow */
}

.faq-container {
  padding: 0;
  height: 100%;
  overflow-y: auto; /* Zmienione na auto aby przewijanie działało */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.faq-container::-webkit-scrollbar {
  display: none;
}

/* FAQ Items */
.faq-item {
  border-bottom: 1px solid;
  transition: all 0.3s ease;
  /* Usuwamy stałą wysokość - pytania mogą się rozwinąć */
  min-height: 90px; /* Minimalna wysokość zamiast stałej */
  display: flex;
  flex-direction: column;
}

.faq-item:last-child {
  border-bottom: none;
}

/* Question Button - nadpisujemy globalny max-width */
.faq-question {
  width: 100% !important;
  max-width: 100% !important; /* Nadpisujemy globalny max-width */
  padding: 1.5rem 0;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  transition: all 0.3s ease;
  flex: 1;
  min-height: 90px; /* Minimalna wysokość przycisku */
}

.faq-question:hover {
  opacity: 0.8;
}

.faq-question-text {
  font-size: 1.3rem;
  font-weight: var(--typography-weight-medium);
  line-height: 1.4;
  flex: 1;
  margin-right: 1rem;
  /* Naprawiam ucinanie tekstu */
  word-break: break-word;
  hyphens: auto;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  display: block;
  width: 100%;
  max-width: calc(100% - 50px);
}

/* Usuwamy style dla strzałki chevron - nie ma już ikonki */

/* Answer */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer[aria-hidden="false"] {
  max-height: 2000px; /* Zwiększamy aby pomieścić całą treść */
}

.faq-answer-content {
  padding: 0 0 1.5rem 0;
  line-height: 1.6;
}

/* Strzałki do przewijania - styl jak w testimonials */
.faq-scroll-btn {
  position: absolute !important;
  right: 20px !important;
  height: 50px !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  display: flex !important;
  padding: 0px !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s ease !important;
  z-index: 999 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.faq-scroll-btn:hover {
  background: var(--color-science-blue) !important;
}

.faq-scroll-btn svg {
  fill: var(--color-science-blue) !important;
  transition: fill 0.3s ease !important;
  width: 50px !important;
  height: 50px !important;
}

.faq-scroll-btn:hover svg {
  fill: var(--color-white) !important;
}

.faq-scroll-btn:focus {
  outline: none !important;
}

.faq-scroll-up {
  top: 10px !important;
}

.faq-scroll-down {
  bottom: 10px !important;
}

/* Color Schemes */
.faq-block.scheme-dark {
  background-color: var(--color-main);
  color: var(--color-white);
}

.faq-block.scheme-dark .faq-item {
  border-bottom-color: var(--color-science-blue);
}

.faq-block.scheme-dark .faq-question-text {
  color: var(--color-white);
}

.faq-block.scheme-dark .faq-answer-content {
  color: var(--color-white) !important;
}

/* Wymuszenie białego koloru dla wszystkich elementów w odpowiedzi */
.faq-block.scheme-dark .faq-answer-content * {
  color: var(--color-white) !important;
}

.faq-block.scheme-light {
  background-color: var(--color-white);
  color: var(--color-heading);
}

.faq-block.scheme-light .faq-item {
  border-bottom-color: var(--color-science-blue);
}

.faq-block.scheme-light .faq-question-text {
  color: var(--color-heading);
}

.faq-block.scheme-light .faq-answer-content {
  color: var(--color-paragraph);
}

/* Focus states */
.faq-question:focus {
  outline: none;
}

/* Mobile */
@media (max-width: 768px) {
  .faq-block {
    height: 400px; /* Mniejsza wysokość na mobile */
  }
  
  .faq-container {
    margin-top: 20px; /* Dodaj margines od góry na mobile */
  }
  
  .faq-item {
    min-height: 80px; /* Minimalna wysokość na mobile */
  }
  
  .faq-question {
    padding: 1rem 0;
    min-height: 80px;
  }
  
  .faq-question-text {
    font-size: 1.1rem;
    max-width: calc(100% - 40px);
  }
  
  .faq-answer-content {
    padding: 0 0 1rem 0;
  }
  
  .faq-scroll-btn {
    right: 15px !important; /* Zwiększ odstęp od prawej krawędzi */
    width: 40px !important;
    height: 40px !important;
    z-index: 1000 !important; /* Zwiększ z-index */
  }
  
  .faq-scroll-btn svg {
    width: 40px !important;
    height: 40px !important;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .faq-block {
    height: 350px;
  }
  
  .faq-container {
    margin-top: 20px; /* Dodaj margines od góry na małych ekranach */
  }
  
  .faq-item {
    min-height: 70px;
  }
  
  .faq-question {
    padding: 0.8rem 0;
    min-height: 70px;
  }
  
  .faq-question-text {
    font-size: 1rem;
    max-width: calc(100% - 35px);
  }
  
  .faq-answer-content {
    padding: 0 0 0.8rem 0;
  }
  
  .faq-scroll-btn {
    right: 12px !important; /* Zwiększ odstęp od prawej krawędzi */
    width: 35px !important;
    height: 35px !important;
    z-index: 1000 !important; /* Zwiększ z-index */
    padding: 0px !important;
  }
  
  .faq-scroll-btn svg {
    width: 35px !important;
    height: 35px !important;
  }
}

/* Extra small mobile */
@media (max-width: 360px) {
  .faq-block {
    height: 300px;
  }
  
  .faq-container {
    margin-top: 20px; /* Dodaj margines od góry na bardzo małych ekranach */
  }
  
  .faq-item {
    min-height: 60px;
  }
  
  .faq-question {
    padding: 0.6rem 0;
    min-height: 60px;
  }
  
  .faq-question-text {
    font-size: 0.9rem;
    max-width: calc(100% - 30px);
  }
  
  .faq-answer-content {
    padding: 0 0 0.6rem 0;
  }
}