/**
 * FAQ accordion. Loaded wherever faq-stage.php renders (blog, FAQ page, modern city/state, MSP).
 */

.faq-stage {
  --faq-gutter: max(var(--gutter-mobile, 12px), 1rem);
  padding: 2rem var(--faq-gutter);
  background: var(--primary-color, #1b335f);
  position: relative;
  margin-left: 0;
  margin-right: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: clip;
}

.faq-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.03) 50%,
    rgba(0, 0, 0, 0.05) 100%
  );
  pointer-events: none;
}

@media (min-width: 768px) {
  .faq-stage {
    --faq-gutter: var(--gutter-tablet, 16px);
  }
}

@media (min-width: 992px) {
  .faq-stage {
    --faq-gutter: var(--gutter-desktop, 20px);
    padding: 3rem var(--faq-gutter);
  }
}

@media (min-width: 1200px) {
  .faq-stage {
    --faq-gutter: var(--gutter-large, 24px);
  }
}

.faq-stage__container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
  position: relative;
  z-index: 1;
}

.post-layout-update .container-fluid > .faq-stage {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.faq-stage__header {
  text-align: center;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .faq-stage__header {
    margin-bottom: 3rem;
  }
}

.faq-stage__title {
  font-family: "General Sans", sans-serif;
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 700;
  color: var(--color-on-primary, #fff);
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

.faq-stage__subtitle {
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 auto;
  max-width: 600px;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .faq-stage__subtitle {
    font-size: 1.125rem;
  }
}

.faq-stage__groups {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.faq-stage__category {
  min-width: 0;
}

.faq-stage__category + .faq-stage__category {
  padding-top: 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.faq-stage__columns {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-stage__group {
  min-width: 0;
}

.faq-stage__group-title {
  font-family: "General Sans", sans-serif;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: var(--color-on-primary, #fff);
  margin: 0 0 1rem;
  line-height: 1.3;
}

.faq-stage--grouped .faq-stage__container,
.faq-stage--split .faq-stage__container {
  max-width: 1140px;
}

@media (min-width: 992px) {
  .faq-stage--grouped .faq-stage__groups {
    gap: 2.5rem;
  }

  .faq-stage--grouped .faq-stage__category + .faq-stage__category {
    padding-top: 1.25rem;
  }

  .faq-stage--grouped .faq-stage__group-title {
    margin-bottom: 1.25rem;
  }

  .faq-stage--grouped .faq-stage__columns--split,
  .faq-stage--split .faq-stage__columns--split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem max(2rem, var(--faq-gutter));
    align-items: start;
  }

  .faq-stage--grouped .faq-stage__list,
  .faq-stage--split .faq-stage__list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .faq-stage--grouped .faq-stage__item,
  .faq-stage--split .faq-stage__item {
    margin-bottom: 0;
  }

  /* Keep the closed-card height when open so the question text does not jump. */
  .faq-stage--grouped .faq-stage__question,
  .faq-stage--split .faq-stage__question {
    min-height: 5.75rem;
    align-items: center;
  }
}

.faq-stage__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.faq-stage__item {
  --faq-motion: 240ms;
  --faq-ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --faq-ease-in: cubic-bezier(0.4, 0, 1, 1);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: border-color var(--faq-motion) var(--faq-ease-out);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.faq-stage__item:last-child {
  margin-bottom: 0;
}

.faq-stage__item.is-active {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

@media (hover: hover) and (pointer: fine) {
  .faq-stage__item:hover {
    border-color: rgba(255, 255, 255, 0.3);
  }
}

.faq-stage__question {
  width: 100%;
  min-height: 48px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  padding: 0.875rem 1rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  transition:
    background-color 160ms var(--faq-ease-out),
    color 160ms var(--faq-ease-out);
  font-family: "General Sans", sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text, #212529);
  line-height: 1.4;
  position: relative;
  border-radius: 12px;
}

@media (min-width: 768px) {
  .faq-stage__question {
    padding: 1.25rem 1.5rem;
    font-size: 1.0625rem;
  }
}

.faq-stage__question:focus-visible {
  outline: 2px solid rgba(var(--primary-color-rgb, 27, 51, 95), 0.35);
  outline-offset: -2px;
  box-shadow: none;
  z-index: 1;
}

.faq-stage__item.is-active .faq-stage__question {
  background: var(--color-surface, #fff);
  color: var(--primary-color, #1b335f);
}

@media (hover: hover) and (pointer: fine) {
  .faq-stage__question:hover {
    background: var(--color-surface, #fff);
    color: var(--primary-color, #1b335f);
  }
}

.faq-stage__question-text {
  flex: 1;
  margin: 0;
}

.faq-stage__icon-toggle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--primary-color-rgb, 27, 51, 95), 0.08);
  border-radius: 8px;
  transition:
    background-color 200ms var(--faq-ease-out, ease),
    transform 200ms var(--faq-ease-out, ease);
  position: relative;
}

@media (min-width: 768px) {
  .faq-stage__icon-toggle {
    width: 32px;
    height: 32px;
  }
}

.faq-stage__icon-toggle::before,
.faq-stage__icon-toggle::after {
  content: "";
  position: absolute;
  background: var(--primary-color, #1b335f);
  transition:
    opacity 200ms var(--faq-ease-out, ease),
    transform 200ms var(--faq-ease-out, ease),
    background-color 200ms var(--faq-ease-out, ease);
}

.faq-stage__icon-toggle::before {
  width: 12px;
  height: 2px;
}

.faq-stage__icon-toggle::after {
  width: 2px;
  height: 12px;
}

.faq-stage__item.is-active .faq-stage__icon-toggle {
  background: var(--primary-color, #1b335f);
  transform: rotate(180deg);
}

.faq-stage__item.is-active .faq-stage__icon-toggle::before,
.faq-stage__item.is-active .faq-stage__icon-toggle::after {
  background: var(--color-surface);
}

.faq-stage__item.is-active .faq-stage__icon-toggle::after {
  opacity: 0;
  transform: rotate(90deg);
}

.faq-stage__answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 240ms var(--faq-ease-out, cubic-bezier(0.2, 0.8, 0.2, 1));
  background: var(--color-surface, #fff);
}

.faq-stage__item.is-active .faq-stage__answer {
  grid-template-rows: 1fr;
}

.faq-stage__item:not(.is-active) .faq-stage__answer {
  transition-timing-function: var(--faq-ease-in, cubic-bezier(0.4, 0, 1, 1));
  transition-duration: 200ms;
}

/* Child of the 0fr/1fr grid so the answer can collapse. */
.faq-stage__answer-inner {
  overflow: hidden;
  min-height: 0;
}

.faq-stage__answer-text {
  padding: 0.25rem 1rem 1rem;
  font-family: "Montserrat", sans-serif;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-text-secondary, #333);
}

@media (min-width: 768px) {
  .faq-stage__answer-text {
    padding: 0.25rem 1.5rem 1.25rem;
    font-size: 1rem;
  }
}

.faq-stage__answer-text p {
  margin: 0 0 1rem;
}

.faq-stage__answer-text p:last-child {
  margin-bottom: 0;
}

.faq-stage__answer-text a {
  color: var(--primary-color, #1b335f);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .faq-stage__answer-text a:hover {
    color: var(--primary-color, #1b335f);
    text-decoration-thickness: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-stage__icon-toggle,
  .faq-stage__icon-toggle::before,
  .faq-stage__icon-toggle::after,
  .faq-stage__answer {
    transition: none !important;
  }

  .faq-stage__item.is-active .faq-stage__icon-toggle {
    transform: none;
  }
}

.faq-page {
  --blog-gutter: max(var(--gutter-mobile, 12px), 1rem);
  overflow-x: clip;
}

@media (min-width: 768px) {
  .faq-page {
    --blog-gutter: var(--gutter-tablet, 16px);
  }
}

@media (min-width: 992px) {
  .faq-page {
    --blog-gutter: var(--gutter-desktop, 20px);
  }
}

@media (min-width: 1200px) {
  .faq-page {
    --blog-gutter: var(--gutter-large, 24px);
  }
}

.faq-page .faq-stage {
  --faq-gutter: var(--blog-gutter);
}

.faq-page .page-hero-shell.blog-single {
  padding-left: 0;
  padding-right: 0;
  max-width: none;
  background: transparent;
}

.faq-page .blog-single__hero-title,
.faq-page .blog-single__hero-subheadline {
  margin-left: auto;
  margin-right: auto;
}
