/**
 * FAQ Carousel Section.
 *
 * FAQ visual em formato de cards horizontais expansíveis.
 *
 * @package NexoBase
 */

.nexo-faq-carousel-section {
  box-sizing: border-box;
  width: 100%;
  max-width: 1180px;
  margin-right: auto !important;
  margin-left: auto !important;
  margin-top: 40px;
  padding-right: 24px;
  padding-left: 24px;
}

.nexo-faq-carousel-section *,
.nexo-faq-carousel-section *::before,
.nexo-faq-carousel-section *::after {
  box-sizing: border-box;
}

/* ==========================================================================
   Cabeçalho
   ========================================================================== */

.nexo-faq-carousel-section__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 34px;
}

.nexo-faq-carousel-section__heading {
  min-width: 0;
}

.nexo-faq-carousel-section__title {
  margin: 0;
  color: #25292a;
  font-size: 42px;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.nexo-faq-carousel-section__title span {
  display: block;
  color: #7a7d7d;
}

.nexo-faq-carousel-section__controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}

.nexo-faq-carousel-section__control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #050707;
  color: #ffffff;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}

.nexo-faq-carousel-section__control-icon {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
  pointer-events: none;
  filter: brightness(0) invert(1);
}

.nexo-faq-carousel-section__control:hover,
.nexo-faq-carousel-section__control:focus {
  background: #1f2523;
}

.nexo-faq-carousel-section__control:hover {
  transform: translateY(-1px);
}

.nexo-faq-carousel-section__control:focus-visible {
  outline: 3px solid rgba(255, 90, 0, 0.28);
  outline-offset: 3px;
}

/* ==========================================================================
   Track
   ========================================================================== */

.nexo-faq-carousel-section__viewport {
  width: 100%;
  overflow: hidden;
}

.nexo-faq-carousel-section__track {
  display: flex;
  gap: 14px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.nexo-faq-carousel-section__track::-webkit-scrollbar {
  display: none;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.nexo-faq-carousel-card {
  position: relative;
  display: flex;
  flex: 0 0 168px;
  flex-direction: column;
  min-height: 430px;
  padding: 34px 24px;
  border-radius: 8px;
  background: #d6d6d6;
  color: #25292a;
  overflow: hidden;
  transition:
    flex-basis 0.42s ease,
    background-color 0.28s ease,
    color 0.28s ease,
    padding 0.28s ease;
  will-change: flex-basis;
}

.nexo-faq-carousel-card.is-active {
  flex-basis: 430px;
  background: #ff5a00;
  color: #07111f;
}

.nexo-faq-carousel-card__trigger {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.nexo-faq-carousel-card__trigger:focus {
  outline: none;
}

.nexo-faq-carousel-card__trigger:focus-visible {
  outline: 3px solid rgba(7, 17, 31, 0.22);
  outline-offset: 5px;
  border-radius: 4px;
}

.nexo-faq-carousel-card__question {
  display: block;
  width: 100%;
  color: inherit;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-transform: none;
  transition:
    font-size 0.34s ease,
    line-height 0.34s ease,
    letter-spacing 0.34s ease;
}

.nexo-faq-carousel-card.is-active .nexo-faq-carousel-card__question {
  font-size: 26px;
  line-height: 1.08;
}

.nexo-faq-carousel-card__answer {
  margin-top: 28px;
  color: #07111f;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.28s ease 0.14s,
    transform 0.28s ease 0.14s,
    margin-top 0.28s ease;
}

.nexo-faq-carousel-card__answer[hidden] {
  display: block !important;
  height: 0;
  margin-top: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(8px);
  pointer-events: none;
}

.nexo-faq-carousel-card__answer > *:first-child {
  margin-top: 0;
}

.nexo-faq-carousel-card__answer > *:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Redução de movimento para acessibilidade
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .nexo-faq-carousel-section__track {
    scroll-behavior: auto;
  }

  .nexo-faq-carousel-card,
  .nexo-faq-carousel-card__question,
  .nexo-faq-carousel-card__answer,
  .nexo-faq-carousel-section__control {
    transition: none;
  }
}

/* ==========================================================================
   Responsivo
   ========================================================================== */

@media (max-width: 1024px) {
  .nexo-faq-carousel-section__title {
    font-size: 34px;
  }

  .nexo-faq-carousel-card {
    flex-basis: 150px;
    min-height: 390px;
    padding: 30px 22px;
  }

  .nexo-faq-carousel-card.is-active {
    flex-basis: 390px;
  }

  .nexo-faq-carousel-card__question {
    font-size: 17px;
  }

  .nexo-faq-carousel-card.is-active .nexo-faq-carousel-card__question {
    font-size: 23px;
  }
}

@media (max-width: 767px) {
  .nexo-faq-carousel-section {
    padding-right: 18px;
    padding-left: 18px;
  }

  .nexo-faq-carousel-section__header {
    display: block;
    margin-bottom: 28px;
  }

  .nexo-faq-carousel-section__title {
    font-size: 30px;
  }

  .nexo-faq-carousel-section__controls {
    display: none;
  }

  .nexo-faq-carousel-section__viewport {
    overflow: visible;
  }

  .nexo-faq-carousel-section__track {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    overflow: visible;
  }

  .nexo-faq-carousel-card,
  .nexo-faq-carousel-card.is-active {
    flex-basis: auto;
    min-height: auto;
    padding: 24px 22px;
    border-radius: 8px;
  }

  .nexo-faq-carousel-card__question,
  .nexo-faq-carousel-card.is-active .nexo-faq-carousel-card__question {
    font-size: 18px;
    line-height: 1.16;
  }

  .nexo-faq-carousel-card__answer {
    margin-top: 18px;
    font-size: 13px;
  }
}
