/* FAQ
   Numbered accordion. Each row: number + question + a per-item accent block
   (infographic palette) that opens to an answer. Native <details name> gives
   exclusive open with no JS. A soft brand glow sits bottom-left. Typography comes
   from text-* utilities in the markup; only color/layout live here. */

.faq {
  overflow: hidden;
  padding-block: var(--module-padding-block, 4rem);
  position: relative;
}

.faq__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  position: relative;
  z-index: 1;
}

.faq__heading {
  color: var(--color-primary-dark);
}

.faq__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.faq__item {
  --row-accent: var(--color-info-steel);
}

/* Per-row accent → infographic palette token. */
.faq__item--comp {
  --row-accent: var(--color-info-comp);
}
.faq__item--celadon {
  --row-accent: var(--color-info-celadon);
}
.faq__item--steel {
  --row-accent: var(--color-info-steel);
}
.faq__item--nonphoto {
  --row-accent: var(--color-info-nonphoto);
}
.faq__item--persian {
  --row-accent: var(--color-info-persian);
}
.faq__item--azure {
  --row-accent: var(--color-info-azure);
}
.faq__item--heliotrope {
  --row-accent: var(--color-info-heliotrope);
}
.faq__item--mauve {
  --row-accent: var(--color-info-mauve);
}
.faq__item--shocking {
  --row-accent: var(--color-info-shocking);
}
.faq__item--rose {
  --row-accent: var(--color-info-rose);
}
.faq__item--carrot {
  --row-accent: var(--color-info-carrot);
}
.faq__item--mustard {
  --row-accent: var(--color-info-mustard);
}

/* Summary row */

/* The accent tiles are a fixed square, not a share of the row height. They used
   to be block-size: 100% + aspect-ratio: 1 inside an absolutely positioned
   full-height block, so a question that wrapped to two lines made the whole
   accent run wider — visibly inconsistent next to single-line rows, and clipped
   once it passed the reserve. 3.25rem matches a single-line summary, so short
   rows look unchanged. */
.faq__summary {
  --accent-tile: 3.25rem;
  --faq-accent-reserve: calc(var(--accent-tile) * 3);

  align-items: stretch;
  background-color: var(--color-light-bg);
  cursor: pointer;
  display: flex;
  gap: var(--space-3);
  list-style: none;
  overflow: hidden;
  padding-right: var(--faq-accent-reserve);
  position: relative;
  transition:
    background-color var(--duration-medium) var(--easing-standard),
    box-shadow var(--duration-medium) var(--easing-standard);
}

.faq__summary:hover,
.faq__summary:focus-visible {
  background-color: color-mix(in srgb, var(--row-accent) 10%, var(--color-light-bg));
  box-shadow: inset 4px 0 0 var(--row-accent);
}

.faq__summary:focus-visible {
  outline: 2px solid var(--row-accent);
  outline-offset: 2px;
}

.faq__summary::-webkit-details-marker {
  display: none;
}

.faq__number {
  align-self: center;
  color: var(--color-oxford);
  font-family: var(--font-secondary);
  padding-left: var(--space-5);
}

.faq__question {
  align-self: center;
  color: var(--color-oxford);
  flex: 1;
  min-width: 0;
  font-weight: 400;
  padding: var(--space-3) var(--space-3);
}

/* Accent block: two steps of the row hue + an arrow tile. */
.faq__accent {
  align-items: center;
  display: flex;
  flex: none;
  inset: 0 0 0 auto;
  max-inline-size: var(--faq-accent-reserve);
  overflow: hidden;
  position: absolute;
}

.faq__step {
  background-color: var(--row-accent);
  block-size: var(--accent-tile);
  flex: 0 0 auto;
  inline-size: var(--accent-tile);
}

.faq__step--1 {
  opacity: 0.45;
}

.faq__step--2 {
  opacity: 0.75;
}

.faq__chev {
  align-items: center;
  background-color: var(--row-accent);
  block-size: var(--accent-tile);
  color: var(--color-white);
  display: flex;
  flex: 0 0 auto;
  inline-size: var(--accent-tile);
  justify-content: center;
}

.faq__chev .icon {
  block-size: 1rem;
  inline-size: 1rem;
  transition: transform var(--duration-medium) var(--easing-standard);
}

.faq__item[open] .faq__chev .icon {
  transform: rotate(90deg);
}

/* Answer panel — indented to sit under the question text. */
.faq__panel {
  padding: var(--space-8) var(--space-5) var(--space-8) calc(var(--space-5) + 2.25rem);
}

.faq.is-enhanced .faq__panel {
  overflow: hidden;
  will-change: height;
}

.faq.is-enhanced .faq__answer {
  will-change: opacity;
}

.faq.is-enhanced .faq__item:not([open]) .faq__answer,
.faq.is-enhanced .faq__item.is-closing .faq__answer {
  opacity: 0;
}

.faq.is-enhanced .faq__item[open]:not(.is-closing) .faq__answer {
  opacity: 1;
}

.faq-light-mode .faq__answer,
.faq-light-mode .faq__heading,
.faq-light-mode .faq__answer a{
  color: var(--color-light1);
}

.faq__answer {

@media (max-width: 767px) {
  .faq__summary {
    align-items: stretch;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding-right: 0;
  }

  /* Back into flow as a grid cell. Height is left to the fixed tile — forcing
     block-size: 100% here would stretch the arrow into a tall rectangle on
     two-line questions, the same inconsistency in the other axis. */
  .faq__accent {
    inline-size: auto;
    inset: auto;
    max-inline-size: none;
    position: static;
  }

  .faq__step {
    display: none;
  }
}

/* Mobile: open up the summary row so the title breathes and the number aligns
   to the first line instead of centering on a multi-line block. */
@media (max-width: 600px) {
  .faq__summary {
    align-items: center;
    gap: var(--space-2);
    padding-block: 0;
    min-height: 58px;
  }

  .faq__number {
    align-self: center;
    font-size: 14px; /* allow-custom-type */
    padding-left: var(--space-3);
  }

  .faq__question.text-h4 {
    align-self: center;
    font-size: 16px; /* allow-custom-type */
    line-height: 1.35; /* allow-custom-type */
    padding: var(--space-2) var(--space-2);
  }

  .faq__accent {
    align-self: stretch;
  }
}
