


.cg-faq { width: 100%; }
.cg-faq__list { display: grid; gap: var(--faq-gap, 12px); }

/* Item */
.cg-faq__item {
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 8px;
  background: inherit;
  color: inherit;
  overflow: hidden;
}

/* Editor: always show content so authors can edit comfortably */
.cg-faq.is-editor .cg-faq__content {
  max-height: none !important;
  opacity: 1 !important;
  padding-top: 12px !important;
  padding-bottom: 16px !important;
  overflow: visible !important;
}


/* Summary (question) */
.cg-faq__summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  position: relative;
  font-weight: 600;
  outline: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cg-faq__summary::-webkit-details-marker { display: none; }

/* Icon placement */
.cg-faq.icon-pos-right .cg-faq__summary { padding-right: 40px; }
.cg-faq.icon-pos-left  .cg-faq__summary { padding-left: 40px; }

/* Icon container */
.cg-faq__icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  line-height: 1;
  opacity: .85;
  transition: transform .2s ease;
}
.cg-faq.icon-pos-right .cg-faq__icon { right: 12px; }
.cg-faq.icon-pos-left  .cg-faq__icon { left: 12px; }

/* Icon visuals (text-based for simplicity) */
.cg-faq.icon-plus  .cg-faq__icon::before { content: "+"; display: inline-block; }
.cg-faq.icon-plus  .cg-faq__item[open] .cg-faq__icon::before { content: "×"; }

.cg-faq.icon-chevron .cg-faq__icon::before { content: "▾"; display: inline-block; transform-origin: 50% 50%; }
.cg-faq.icon-chevron .cg-faq__item[open] .cg-faq__icon::before { transform: rotate(180deg); }

/* No icon */
.cg-faq.icon-none .cg-faq__icon { display: none; }




/* Animated box: no padding here */
.cg-faq__content {
  overflow: hidden;
  max-height: none; /* editor will override; front-end JS manages this */
  opacity: 1;
  will-change: max-height, opacity;
  contain: layout; /* reduces reflow jank */
}

/* Put padding on the inner wrapper (not animated) */
.cg-faq__content-inner {
  padding: 12px 16px 16px 16px;
}

/* Front-end CSS animation baseline (JS drives values) */
.cg-faq[data-animate="1"] .cg-faq__content {
  transition:
    max-height var(--faq-anim-ms, 220ms) cubic-bezier(.25,.8,.25,1),
    opacity    var(--faq-anim-ms, 220ms) linear;
}

.cg-faq[data-animate="1"] .cg-faq__item[open] .cg-faq__content {
  max-height: 1000px; /* sufficiently large for typical answers */
  opacity: 1;
  padding-top: 12px;
  padding-bottom: 16px;
}

/* Editor: always show content for comfy editing */
.cg-faq.is-editor .cg-faq__content {
  max-height: none !important;
  opacity: 1 !important;
  overflow: visible !important;
}


/* Make core blocks tidy inside answers */
.cg-faq__content .wp-block-paragraph { margin: .5rem 0; }
.cg-faq__content .wp-block-buttons { margin-top: .5rem; }
.cg-faq__content .wp-block-image img { display:block; width:100%; height:auto; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cg-faq[data-animate="1"] .cg-faq__content {
    transition: none;
  }
}
