
/* Glossary CMS — chunk 04: FAQ, bridge CTA, Webflow Rich Text CMS output */

/* FAQ accordion — script chunk 08 converts CMS h3+p.answer → details/summary */
.ch-glossary-faq details {
  border-bottom: 1px solid var(--grey);
  padding: 0.85rem 0;
}

.ch-glossary-faq details:first-child {
  padding-top: 0;
}

.ch-glossary-faq summary {
  cursor: pointer;
  font-family: var(--font-primary);
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  font-weight: 400;
  list-style: none;
  padding-right: 1.5rem;
  position: relative;
}

.ch-glossary-faq summary::-webkit-details-marker {
  display: none;
}

.ch-glossary-faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  color: var(--black);
  font-weight: 400;
}

.ch-glossary-faq details[open] summary::after {
  content: "−";
}

.ch-glossary-faq .answer {
  margin-top: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-secondary);
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  line-height: 1.6;
}

/* Closed by default until script runs */
.ch-glossary-faq:not(.ch-faq-enhanced) p.answer,
.ch-glossary-faq:not(.ch-faq-enhanced) .w-richtext p.answer,
#faq:not(.ch-faq-enhanced) p.answer,
#faq:not(.ch-faq-enhanced) .w-richtext p.answer {
  display: none;
}

/* Click-toggle fallback (when details API unavailable or bindToggle used) */
.ch-glossary-faq.ch-faq-toggle h3.ch-faq-open::after,
#faq.ch-faq-toggle h3.ch-faq-open::after {
  content: "−";
}

.ch-glossary-faq.ch-faq-toggle h3.ch-faq-open + p.answer,
.ch-glossary-faq.ch-faq-toggle h3.ch-faq-open + div,
.ch-glossary-faq.ch-faq-toggle h3.ch-faq-open + figure,
#faq.ch-faq-toggle h3.ch-faq-open + p.answer,
#faq.ch-faq-toggle h3.ch-faq-open + div,
#faq.ch-faq-toggle h3.ch-faq-open + figure,
.ch-glossary-faq.ch-faq-toggle [data-ch-faq-answer]:not([hidden]),
#faq.ch-faq-toggle [data-ch-faq-answer]:not([hidden]) {
  display: block !important;
}

.ch-glossary-faq.ch-faq-toggle [data-ch-faq-answer][hidden],
#faq.ch-faq-toggle [data-ch-faq-answer][hidden] {
  display: none !important;
}

.ch-glossary-faq:not(.ch-faq-enhanced) h3,
#faq:not(.ch-faq-enhanced) h3 {
  cursor: pointer;
  user-select: none;
}

/* Pre-enhance fallback: stacked h3/answer before script runs */
.ch-glossary-faq [data-cms="faq"] h3,
.ch-glossary-faq .w-richtext h3,
#faq h3 {
  font-family: var(--font-primary);
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  font-weight: 400;
  margin: 0;
  padding: 0.85rem 1.5rem 0.85rem 0;
  border-bottom: 1px solid var(--grey);
  position: relative;
}

.ch-glossary-faq [data-cms="faq"] h3::after,
.ch-glossary-faq .w-richtext h3::after,
#faq h3::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0.85rem;
  color: var(--black);
  font-weight: 400;
}

.ch-glossary-faq [data-cms="faq"] p.answer,
.ch-glossary-faq .w-richtext p.answer,
#faq p.answer {
  margin: 0;
  padding: 0.65rem 0 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-secondary);
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  line-height: 1.6;
  border-bottom: 1px solid var(--grey);
}

.ch-glossary-faq [data-cms="faq"] p.answer:last-child,
.ch-glossary-faq .w-richtext p.answer:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.ch-glossary-bridge {
  margin: 3rem 0 0;
  padding: clamp(1.25rem, 3vw, 1.5rem);
  background: var(--black);
  color: var(--light-base);
  border-radius: var(--ch-radius-lg);
}

.ch-glossary-bridge h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-primary);
  font-size: clamp(1.375rem, 3vw, 1.75rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--light-base);
}

.ch-glossary-bridge p {
  margin: 0 0 1rem;
  font-family: var(--font-secondary);
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  line-height: 1.5;
  color: var(--grey);
}

.ch-glossary-bridge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ch-glossary-btn {
  display: inline-block;
  padding: 15px 35px;
  border-radius: var(--ch-radius-pill);
  font-family: var(--font-secondary);
  font-size: 16px;
  font-weight: 400;
  text-decoration: none;
  transition: transform 0.2s var(--ch-ease), background-color 0.2s ease;
}

.ch-glossary-btn--primary {
  background: var(--primary);
  color: var(--black);
  border: 1px solid var(--primary);
}

.ch-glossary-btn--primary:hover {
  transform: scale(1.05);
}

.ch-glossary-btn--ghost {
  border: 1px solid var(--grey);
  color: var(--light-base);
  background: transparent;
}

.ch-glossary-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.02);
}

/* Webflow CMS Rich Text — shared module hooks (paste HTML classes in CMS fields) */
.ch-glossary-page .w-richtext ol.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: ch-step;
  font-family: var(--font-secondary);
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  line-height: 1.6;
}

.ch-glossary-page .w-richtext ol.steps li {
  counter-increment: ch-step;
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.55rem;
}

.ch-glossary-page .w-richtext ol.steps li::before {
  content: counter(ch-step);
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 1px solid #000;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
}

.ch-glossary-page .w-richtext .ch-glossary-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.75rem 0 1rem;
  border: 1px solid var(--grey);
  border-radius: 20px;
  background: var(--light-base);
}

@media (max-width: 479px) {
  .ch-glossary-bridge-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .ch-glossary-btn {
    text-align: center;
    padding: 14px 24px;
  }
}

/* ── Responsive: hybrid native + embed structure ── */
.ch-glossary-page > aside,
.ch-glossary-page > article,
.ch-glossary-page > section,
.ch-glossary-page aside.ch-glossary-tldr,
.ch-glossary-page article.ch-glossary-content,
article.ch-glossary-content,
[class*="ch-glossary-content"] {
  width: 100%;
}

.ch-glossary-page section,
.ch-glossary-content section,
article section,
#faq.ch-glossary-faq {
  margin-bottom: clamp(2rem, 4vw, 2.75rem);
}

.ch-glossary-page section:last-child,
.ch-glossary-content section:last-child,
article section:last-child {
  margin-bottom: 0;
}

.ch-glossary-page section > h2,
.ch-glossary-content section > h2,
#faq > h2 {
  font-family: var(--font-primary);
  font-size: clamp(1.375rem, 2.8vw, 2rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--black);
  margin: 0 0 0.85rem;
  letter-spacing: -0.01em;
}

.ch-glossary-page p,
.ch-glossary-page li,
.ch-glossary-page .w-richtext p,
.ch-glossary-page .w-richtext li,
.ch-glossary-content .w-richtext p,
.ch-glossary-content .w-richtext li,
article.ch-glossary-content .w-richtext p,
article.ch-glossary-content .w-richtext li {
  max-width: 72ch;
}

@media (min-width: 1280px) {
  .ch-glossary-page p,
  .ch-glossary-page li,
  .ch-glossary-page .w-richtext p,
  .ch-glossary-page .w-richtext li,
  .ch-glossary-content .w-richtext p,
  .ch-glossary-content .w-richtext li,
  article.ch-glossary-content .w-richtext p,
  article.ch-glossary-content .w-richtext li {
    max-width: none;
  }
}

.ch-glossary-page .w-richtext table,
.ch-glossary-page table {
  max-width: none;
}

@media (min-width: 1280px) {
  .ch-glossary-hero h1,
  .ch-glossary-page .ch-glossary-hero h1,
  header.ch-glossary-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }

  .ch-glossary-page section > h2,
  .ch-glossary-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
  }

  .ch-glossary-tldr {
    padding: 1.65rem 1.85rem;
    margin-bottom: 3rem;
  }

  .ch-glossary-bridge {
    margin-top: 3.5rem;
    padding: 1.75rem 2rem;
  }
}

@media (max-width: 991px) {
  .ch-glossary-meta {
    gap: 0.45rem 1rem;
  }

  .ch-glossary-content > section,
  .ch-glossary-page section,
  article section {
    margin-bottom: 2.35rem;
  }
}

@media (max-width: 767px) {
  .ch-glossary-hero {
    margin-bottom: 1.5rem;
  }

  .ch-glossary-hero h1,
  .ch-glossary-page .ch-glossary-hero h1,
  header.ch-glossary-hero h1 {
    font-size: clamp(1.5rem, 6vw, 1.875rem);
    line-height: 1.22;
  }

  .ch-glossary-meta {
    font-size: 13px;
    gap: 0.4rem 0.85rem;
  }

  .ch-glossary-meta__chip {
    max-width: 100%;
  }

  .ch-glossary-breadcrumb {
    line-height: 1.45;
    word-break: break-word;
  }

  .ch-glossary-page section > h2,
  .ch-glossary-content h2 {
    font-size: clamp(1.25rem, 5vw, 1.5rem);
  }

  .ch-glossary-content th,
  .ch-glossary-content td,
  .ch-glossary-page .w-richtext th,
  .ch-glossary-page .w-richtext td {
    padding: 0.6rem 0.65rem;
  }

  .ch-glossary-related {
    gap: 0.4rem;
  }

  .ch-glossary-related a {
    font-size: 13px;
    padding: 0.35rem 0.75rem;
  }

  .ch-glossary-bridge {
    margin-top: 2.25rem;
    border-radius: 16px;
  }

  .ch-glossary-faq summary,
  .ch-glossary-faq h3,
  #faq h3 {
    font-size: 1rem;
    line-height: 1.45;
    padding-right: 1.75rem;
  }

  .ch-glossary-faq summary::after,
  #faq h3::after {
    top: 0.15rem;
  }

  .ch-glossary-faq h3,
  #faq h3 {
    -webkit-tap-highlight-color: transparent;
  }
}

@media (max-width: 479px) {
  .ch-glossary-hero h1,
  .ch-glossary-page .ch-glossary-hero h1,
  header.ch-glossary-hero h1 {
    font-size: 1.5rem;
  }

  .ch-glossary-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .ch-glossary-tldr {
    border-radius: 16px;
  }

  .ch-glossary-content h3,
  .ch-glossary-page .w-richtext h3 {
    font-size: 1.0625rem;
  }

  .ch-glossary-cta-band {
    padding: 0.85rem 0.95rem;
    border-radius: 16px;
  }

  .ch-glossary-table-wrap {
    border-radius: 16px;
    margin-left: -0.15rem;
    margin-right: -0.15rem;
    width: calc(100% + 0.3rem);
  }

  .ch-glossary-bridge h2 {
    font-size: 1.25rem;
  }

  .ch-glossary-bridge p {
    font-size: 0.9375rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ch-glossary-btn {
    transition: none;
  }

  .ch-glossary-btn--primary:hover,
  .ch-glossary-btn--ghost:hover {
    transform: none;
  }
}
