/**
 * Astra Sites Showcase — Category FAQ accordion styles.
 *
 * Independent of Spectra. Reuses semantic `<details>` for native open/close.
 * Visual reference: wpastra.com/website-templates/ FAQ section.
 */

.stc-faq {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .stc-faq {
    grid-template-columns: 1fr;
  }
}

.stc-faq-item {
  background: #fff;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.stc-faq-item[open] {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.stc-faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
  font-size: 16px;
  font-weight: 600;
  color: #1d2327;
  user-select: none;
}

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

.stc-faq-question::marker {
  display: none;
  content: "";
}

.stc-faq-question:hover {
  background: #f8fafc;
}

.stc-faq-question:focus-visible {
  outline: 2px solid #492cdd;
  outline-offset: -2px;
}

.stc-faq-question-text {
  flex: 1 1 auto;
  min-width: 0;
}

.stc-faq-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: #1e293b;
  transition: transform 0.2s ease;
}

.stc-faq-chevron svg {
  display: block;
  width: 14px;
  height: 18px;
}

.stc-faq-item[open] .stc-faq-chevron {
  transform: rotate(90deg);
}

/* Outer wrapper is the one the JS animates from 0 to scrollHeight by
 * setting an inline height in pixels with a CSS transition. Padding lives
 * on `.stc-faq-answer-inner` so it does not interfere with the height
 * interpolation. */
.stc-faq-answer {
  overflow: hidden;
  height: 0;
  transition: height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When the item is open and not mid-animation, allow the answer to grow
 * with its content (e.g. on viewport resize, dynamic content updates).
 * The JS clears the inline height once the open animation finishes. */
.stc-faq-item[open]:not(.is-animating) .stc-faq-answer {
  height: auto;
}

@media (prefers-reduced-motion: reduce) {
  .stc-faq-answer {
    transition: none;
  }
}

.stc-faq-answer-inner {
  padding: 0 22px 20px;
  color: #4b5563;
  font-size: 15px;
  line-height: 1.6;
}

.stc-faq-answer-inner p {
  margin: 0 0 12px;
}

.stc-faq-answer-inner p:last-child {
  margin-bottom: 0;
}

.stc-faq-answer-inner a {
  color: #492cdd;
}

@media (max-width: 600px) {
  .stc-faq-question {
    padding: 14px 16px;
    font-size: 15px;
  }

  .stc-faq-answer-inner {
    padding: 0 16px 16px;
    font-size: 14px;
  }
}
