/**
 * FAQ — Apple-style accordion: measured max-height animation (reliable across browsers).
 */

.cew-faq {
  /* Panel height animation — JS reads this for timing; keep CSS in sync */
  --cew-faq-panel-duration: 2.1s;
  --cew-faq-panel-ease: cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cew-faq *,
.cew-faq *::before,
.cew-faq *::after {
  box-sizing: border-box;
}

.cew-faq__inner {
  width: 100%;
  margin-inline: auto;
}

.cew-faq__list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.cew-faq__item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  margin: 0;
  /* Fallback hairlines until Style → Border is set (Elementor rules override via higher specificity) */
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transition: background-color 0.25s cubic-bezier(0.25, 0.1, 0.25, 1),
    border-color 0.25s ease;
}

.cew-faq__item:first-of-type {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

@media (hover: hover) {
  .cew-faq__item:hover {
    transition: background-color 0.25s cubic-bezier(0.25, 0.1, 0.25, 1),
      border-color 0.25s ease;
  }
}

/* Full-width row so question background / border span the column (not shrink-wrapped like inline buttons) */
.cew-faq__question {
  display: block;
  width: 100%;
  min-width: 0;
  flex-shrink: 0;
}

/* div[role="button"]: avoids theme CSS aimed at button / input[type="button"] */
.cew-faq__summary {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease;
}

.cew-faq__question-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.35;
  color: #1d1d1f;
  text-align: start;
  transition: color 0.2s ease;
}

.cew-faq__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #86868b;
  transition: transform 0.28s ease, color 0.25s ease;
}

.cew-faq__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.cew-faq__item.is-open .cew-faq__icon {
  transform: rotate(45deg);
  color: #424245;
}

/* Height animated via inline max-height + this transition */
.cew-faq__answer {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--cew-faq-panel-duration) var(--cew-faq-panel-ease);
}

.cew-faq__answer-inner {
  padding-top: 0.25rem;
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: #6e6e73;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--cew-faq-panel-duration) var(--cew-faq-panel-ease),
    transform var(--cew-faq-panel-duration) var(--cew-faq-panel-ease);
}

.cew-faq__item.is-open .cew-faq__answer-inner {
  opacity: 1;
  transform: translateY(0);
}

.cew-faq__answer-inner > *:first-child {
  margin-top: 0;
}

.cew-faq__answer-inner > *:last-child {
  margin-bottom: 0;
}

.cew-faq__answer-inner p {
  margin: 0 0 0.75em;
}

.cew-faq__answer-inner p:last-child {
  margin-bottom: 0;
}

.cew-faq__answer-inner a {
  color: #0066cc;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

@media (hover: hover) {
  .cew-faq__answer-inner a:hover {
    text-decoration: underline;
    opacity: 0.85;
  }
}

.cew-faq__answer-inner ul,
.cew-faq__answer-inner ol {
  margin: 0 0 0.75em;
  padding-left: 1.25em;
}

.cew-faq__summary:focus {
  outline: none;
}

.cew-faq__summary:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 4px;
  border-radius: 4px;
}
