/* Portable FAQ accordion + simple demo tabs */

.tb-faq {
  max-width: none;
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

/* Hide legacy eyebrow if an older plugin build still prints it */
.tb-faq__eyebrow,
.tb-faq-fallback__eyebrow {
  display: none !important;
}

.tb-faq__title {
  margin: 0;
  font-size: 1.875rem;
  letter-spacing: -0.02em;
}

.tb-faq__intro {
  margin: 0.75rem 0 0;
  color: var(--tb-text-secondary, #334155);
  line-height: 1.55;
  max-width: 38rem;
}

.tb-faq__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 1.25rem;
}

.tb-faq__nav a {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tb-link, #0369a1);
  text-underline-offset: 4px;
}

.tb-faq__group {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--tb-border, #e2e8f0);
  scroll-margin-top: 5rem;
}

.tb-faq__group-title {
  margin: 0;
  font-size: 1.25rem;
}

.tb-faq__group-desc {
  margin: 0.35rem 0 0.75rem;
  color: var(--tb-text-muted, #5a6779);
  font-size: 0.9375rem;
}

.tb-faq__item {
  border-top: 1px solid var(--tb-border, #e2e8f0);
  scroll-margin-top: 5rem;
}

.tb-faq__question {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 0.25rem;
  font-weight: 600;
  font-size: 0.975rem;
}

.tb-faq__question::-webkit-details-marker {
  display: none;
}

.tb-faq__question::after {
  content: "+";
  flex-shrink: 0;
  width: 1.25rem;
  text-align: center;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1;
  color: var(--tb-text-muted, #5a6779);
}

.tb-faq__item[open] > .tb-faq__question::after {
  content: "−";
}

.tb-faq__answer {
  padding: 0 0.25rem 1.1rem;
  color: var(--tb-text-secondary, #334155);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.tb-faq__answer-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .tb-faq__answer-grid--split {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: start;
  }

  .tb-faq__answer-grid--media-left .tb-faq__answer-copy {
    order: 2;
  }

  .tb-faq__answer-grid--media-left .tb-faq__media {
    order: 1;
  }
}

.tb-faq__media {
  margin: 0;
  position: relative;
}

.tb-faq__media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.tb-faq__media-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
}

.tb-faq__media figcaption {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--tb-text-muted, #5a6779);
  line-height: 1.45;
}

.tb-faq-gallery {
  margin-top: 1.25rem;
}

.tb-faq-gallery__stage {
  position: relative;
  min-height: 12rem;
}

.tb-faq-gallery__slide {
  margin: 0;
}

.tb-faq-gallery__slide[hidden] {
  display: none !important;
}

.tb-faq-gallery__slide img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 22rem;
  object-fit: contain;
  border-radius: 0.5rem;
  border: 1px solid var(--tb-border, #e2e8f0);
  background: var(--tb-canvas, #f8fafc);
}

.tb-faq-gallery__slide figcaption {
  margin-top: 0.65rem;
  text-align: center;
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--tb-text-muted, #5a6779);
  line-height: 1.45;
}

.tb-faq-gallery__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.tb-faq-gallery__nav {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--tb-border, #e2e8f0);
  background: var(--tb-elevated, #fff);
  color: var(--tb-text-secondary, #334155);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.tb-faq-gallery__nav:hover {
  border-color: var(--tb-link, #0369a1);
  color: var(--tb-link, #0369a1);
}

.tb-faq-gallery__dots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tb-faq-gallery__dot {
  width: 0.4rem;
  height: 0.4rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--tb-text-muted, #5a6779);
  cursor: pointer;
}

.tb-faq-gallery__dot.is-active {
  background: var(--tb-brand, #0284c7);
}

.tb-faq__citations {
  /* Match React FaqCitations: no card: label + left-border quotes */
  margin: 1rem 0.75rem 0; /* mx-3 mt-4 */
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

@media (min-width: 640px) {
  .tb-faq__citations {
    margin-left: 1rem; /* sm:mx-4 */
    margin-right: 1rem;
  }
}

.tb-faq__citations-label {
  margin: 0;
  font-size: 0.8125rem; /* text-xs floor */
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--tb-brand-strong, #0369a1);
}

.tb-faq__citations-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem; /* space-y-2.5 */
}

.tb-faq__citation {
  margin: 0;
  padding-left: 0.75rem; /* pl-3 */
  border-left: 2px solid var(--tb-brand-strong, #0369a1);
  font-size: 0.875rem; /* text-sm */
  line-height: 1.5;
  color: var(--tb-text-secondary, #475569);
}

.tb-faq__citation-stat {
  font-weight: 600;
  color: var(--tb-text, #0f172a);
}

.tb-faq__citation-source {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8125rem; /* text-xs */
  color: var(--tb-text-muted, #5a6779);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tb-faq__citation-source:hover {
  color: var(--tb-text, #0f172a);
}

.tb-faq-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(2, 6, 23, 0.78);
  cursor: zoom-out;
}

.tb-faq-lightbox img {
  max-width: min(96vw, 56rem);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 0.5rem;
  background: var(--tb-elevated, #fff);
}

.tb-faq-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  color: var(--tb-text, #0f172a);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.tb-faq__cta {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--tb-border, #e2e8f0);
  text-align: center;
}

.tb-faq__cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
}

.tb-demo {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--tb-border, #e2e8f0);
  border-radius: 0.5rem;
  background: var(--tb-canvas, #f8fafc);
  width: 100%;
  box-sizing: border-box;
}

.tb-demo__intro {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.tb-demo__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.tb-demo__tab {
  border: 1px solid #cbd5e1;
  background: var(--tb-elevated, #fff);
  border-radius: 0.375rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--tb-text-secondary, #334155);
}

.tb-demo__tab.is-active {
  background: #0284c7;
  border-color: var(--tb-link, #0369a1);
  color: #fff;
}

.tb-demo__panel {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--tb-text-secondary, #334155);
}

.tb-demo__amount {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--tb-text, #0f172a);
}

.tb-demo__amount-note {
  margin: 0.15rem 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--tb-text-muted, #5a6779);
}

.tb-demo--note {
  background: var(--tb-elevated, #fff);
}

.tb-demo__note-title {
  margin: 0 0 0.35rem;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Tax efficiency preference: portable bar mock (mirrors app FAQ) */
.tb-demo--tax-eff {
  background: var(--tb-elevated, #fff);
}

.tb-tax-eff__panel + .tb-tax-eff__vs {
  margin: 0.65rem 0;
}

.tb-tax-eff__vs {
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tb-text-muted, #5a6779);
}

.tb-tax-eff__label {
  margin: 0 0 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tb-text, #0f172a);
}

.tb-tax-eff__bars {
  position: relative;
  padding: 0.65rem 0.7rem 0.55rem;
  border: 1px solid var(--tb-border, #e2e8f0);
  border-radius: 0.5rem;
  background: var(--tb-canvas, #f8fafc);
}

.tb-tax-eff__mix-track {
  position: absolute;
  top: 0.65rem;
  bottom: 2rem;
  left: calc(4.25rem + 0.7rem);
  right: 0.7rem;
  pointer-events: none;
  z-index: 1;
}

.tb-tax-eff__mix-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 999px;
  background: rgba(5, 150, 105, 0.65);
}

.tb-tax-eff__row {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.tb-tax-eff__acct {
  width: 4.25rem;
  flex-shrink: 0;
  font-size: 0.8125rem;
  color: var(--tb-text-secondary, #334155);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-tax-eff__bar {
  position: relative;
  display: flex;
  height: 0.75rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 0.2rem;
  background: var(--tb-elevated, #fff);
}

.tb-tax-eff__eq {
  display: block;
  height: 100%;
  background: #0369a1;
}

.tb-tax-eff__fi {
  display: block;
  height: 100%;
  background: #b45309;
}

.tb-tax-eff__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  margin-top: 0.55rem;
  font-size: 0.8125rem;
  color: var(--tb-text-secondary, #334155);
}

.tb-tax-eff__legend-mix::before,
.tb-tax-eff__legend-eq::before,
.tb-tax-eff__legend-fi::before {
  content: '';
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.3rem;
  border-radius: 0.1rem;
  vertical-align: -0.05rem;
}

.tb-tax-eff__legend-mix::before {
  width: 0.2rem;
  height: 0.7rem;
  border-radius: 999px;
  background: rgba(5, 150, 105, 0.85);
  vertical-align: -0.1rem;
}

.tb-tax-eff__legend-eq::before {
  background: #0369a1;
}

.tb-tax-eff__legend-fi::before {
  background: #b45309;
}

.tb-tax-eff__foot {
  margin: 0.65rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--tb-text-secondary, #334155);
}

@media (prefers-color-scheme: dark) {
  .tb-faq,
  .tb-demo,
  .tb-demo--note,
  .tb-demo--tax-eff {
    color: var(--tb-text);
  }

  .tb-demo,
  .tb-demo--note,
  .tb-demo--tax-eff {
    background: var(--tb-subtle);
    border-color: var(--tb-border);
  }

  .tb-demo__tab {
    background: var(--tb-elevated);
    border-color: var(--tb-border);
    color: var(--tb-text);
  }

  .tb-demo__tab.is-active,
  .tb-demo__tab[aria-selected="true"] {
    background: var(--tb-brand);
    border-color: var(--tb-brand);
    color: #0b1220;
  }

  .tb-tax-eff__bars {
    background: var(--tb-canvas);
    border-color: var(--tb-border);
  }

  .tb-tax-eff__bar {
    background: var(--tb-elevated);
  }

  .tb-faq__citations {
    border: 0;
    background: transparent;
  }

  .tb-faq__citations-label {
    color: var(--tb-link);
  }

  .tb-faq__citation {
    border-left-color: var(--tb-brand);
  }

  .tb-faq__cta {
    border-color: var(--tb-border);
  }
}
