/**
 * FAQ section (template-parts/faq.php)
 * Układ jak opis kategorii: nagłówek po lewej, lista pytań po prawej.
 */

.faq-section__container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 0 2rem;
}

.faq-section__divider {
  height: 1px;
  background-color: var(--color-secondary);
  margin: 2rem 0 3rem;
}

.faq-section__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 3rem;
  align-items: start;
}

/* Nagłówek */
.faq-section__header {
  position: sticky;
  top: 6rem;
}

.faq-section__title {
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--color-text-primary);
  margin: 0 0 1rem;
}

.faq-section__lead {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin: 0;
  max-width: 28rem;
}

.faq-section__lead a {
  color: var(--color-secondary);
  text-decoration: none;
  font-weight: 500;
}

.faq-section__lead a:hover {
  text-decoration: underline;
}

/* Lista */
.faq-section__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border-radius: 8px;
  background-color: var(--color-bgc-primary);
  overflow: hidden;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.faq-item:hover {
  background-color: #edf1f5;
}

.faq-item[open] {
  background-color: #fff;
  box-shadow: 0 0 0 1px rgba(34, 60, 78, 0.1), 0 8px 24px rgba(34, 60, 78, 0.06);
}

.faq-item__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.125rem 1.5rem;
  cursor: pointer;
  list-style: none;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text-primary);
}

.faq-item__question::-webkit-details-marker {
  display: none;
}

.faq-item[open] .faq-item__question-text,
.faq-item__question:hover .faq-item__question-text {
  color: var(--color-primary);
}

.faq-item__icon {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: #fff;
  background-image: url("../../images/caret-down-labid.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1rem;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.faq-item[open] .faq-item__icon {
  background-color: var(--color-bgc-primary);
  transform: rotate(180deg);
}

.faq-item__answer {
  padding: 0 1.5rem 1.375rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text-primary);
}

.faq-item__answer > :first-child {
  margin-top: 0;
}

.faq-item__answer > :last-child {
  margin-bottom: 0;
}

.faq-item__answer ul,
.faq-item__answer ol {
  padding-left: 1.25rem;
}

.faq-item__answer a {
  color: var(--color-secondary);
}

@media (max-width: 1024px) {
  .faq-section__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .faq-section__header {
    position: static;
  }

  .faq-section__lead {
    max-width: none;
  }
}

@media (max-width: 900px) {
  .faq-section__divider {
    margin: 1.5rem 0 2rem;
  }

  .faq-section__title {
    font-size: 1.35rem;
  }

  .faq-item__question {
    font-size: 1rem;
    padding: 0.9rem 1rem;
    gap: 1rem;
  }

  .faq-item__icon {
    width: 1.75rem;
    height: 1.75rem;
    background-size: 0.875rem;
  }

  .faq-item__answer {
    padding: 0 1rem 1rem;
  }
}
