/**
 * Section: FAQ
 *
 * Desktop (Figma 190:139): 893px accordion column, 310px image at the
 * right. Mobile (190:182): single column, image hidden.
 */

.vu-faq {
  display: flex;
  align-items: flex-start;
  gap: 11.5%;            /* 157 / 1360 */
}

.vu-faq__main {
  flex: 1 1 65.7%;       /* 893 / 1360 */
  min-width: 0;
}

.vu-faq__media {
  flex: 0 0 22.8%;       /* 310 / 1360 */
}

.vu-faq__image {
  width: 100%;
  height: auto;
}

/* ------------------------------------------------------------- Tabs */
.vu-faq__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 8px;
  margin-block-end: var(--vu-space-8);
}

.vu-faq__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px var(--vu-space-5) 20px;
  border-radius: var(--vu-radius-pill);
  font-weight: 500;
  font-size: var(--vu-button-size);
  letter-spacing: var(--vu-button-track);
  line-height: 1;
  color: var(--vu-ink);
  box-shadow: inset 0 0 0 var(--vu-rule-width) var(--vu-ink);
  transition: background-color var(--vu-transition), color var(--vu-transition);
}

.vu-faq__tab:hover {
  background-color: var(--vu-ink);
	color: #fff;
}

/* Selection is carried by aria-selected, so the state can never drift
   out of sync between what is seen and what is announced. */
.vu-faq__tab[aria-selected="true"] {
  background-color: var(--vu-ink);
  color: #fff;
}

/* The dark pill would swallow a dark outline. */
.vu-faq__tab[aria-selected="true"]:focus-visible {
  outline-color: var(--vu-ink);
  outline-offset: 3px;
}

/* Category headings are for the no-JS case, where every panel is shown
   at once and the pills are inert. With JS they are redundant. */
.vu-faq__panel-title {
  font-family: var(--vu-font-serif);
  font-weight: 400;
  font-size: var(--vu-serif-lg-size);
  margin-block-end: var(--vu-space-4);
}

.vu-faq__tabs ~ .vu-faq__panel .vu-faq__panel-title {
  display: none;
}

.vu-faq__panel[hidden] {
  display: none;
}

/* -------------------------------------------------------- Accordion */
.vu-faq__item {
  border-block-start: var(--vu-rule-width) solid var(--vu-rule);
}

.vu-faq__item:last-of-type {
  border-block-end: var(--vu-rule-width) solid var(--vu-rule);
}

.vu-faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--vu-space-5);
  /* Comfortably past the 44px minimum target — WCAG 2.2 SC 2.5.8. */
  padding-block: var(--vu-space-6);
  cursor: pointer;
  list-style: none;
}

/* Suppress the native disclosure triangle in both engines. */
.vu-faq__q::-webkit-details-marker {
  display: none;
}

.vu-faq__q::marker {
  content: "";
}

.vu-faq__q:hover .vu-faq__q-text {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.vu-faq__q:focus-visible {
  outline: var(--vu-focus-width) solid var(--vu-focus-colour);
  outline-offset: -3px;
}

.vu-faq__q-text {
  font-weight: 500;
  font-size: 22px;
  line-height: 26px;
  letter-spacing: -0.01em;
}

.vu-faq__icon {
  flex-shrink: 0;
  color: var(--vu-ink);
  transition: rotate var(--vu-transition);
}

/* The plus becomes a cross — one glyph, one transform. */
.vu-faq__item[open] .vu-faq__icon {
  rotate: 45deg;
}

.vu-faq__a {
  padding-block-end: var(--vu-space-6);
  font-size: 18px;
  line-height: 28px;
  letter-spacing: -0.01em;
  /* The answer column stops short of the icon, as in the design. */
  max-width: 62ch;
}

.vu-faq__a p + p {
  margin-block-start: var(--vu-space-5);
}

/* ================================================================
 * Mobile — Figma 190:182
 * ============================================================== */
@media (max-width: 767px) {
  .vu-faq {
    flex-direction: column;
    /* Stretch, not flex-start: otherwise the column sizes itself to the
       non-wrapping tab strip and overflows the viewport (WCAG 1.4.10). */
    align-items: stretch;
    gap: var(--vu-space-8);
  }

  .vu-faq__main {
    width: 100%;
  }

  /* Decorative, and it costs a lot of vertical space on a phone. */
  .vu-faq__media {
    display: none;
  }

  /* Horizontal pill strip that scrolls rather than wrapping to five rows. */
  .vu-faq__tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: calc(var(--vu-gutter) * -1);
    padding-inline: var(--vu-gutter);
    overscroll-behavior-x: contain;
  }

  .vu-faq__tabs::-webkit-scrollbar {
    display: none;
  }

  .vu-faq__tab {
    flex: 0 0 auto;
  }

  .vu-faq__q-text {
    font-size: 19px;
    line-height: 24px;
  }

  .vu-faq__a {
    font-size: 17px;
    line-height: 27px;
  }
}
@media (max-width: 767px) {
  .vu-faq__tabs {
    display: flex;
    flex-direction: column;
    position: relative;
  }

  .vu-faq__tab {
    order: 1;
    display: none; 
  }
  .vu-faq__tab[aria-selected="true"] {
    order: -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border-radius: 999px;
    background: #111;
    color: #fff;
    border: none;
    padding: 14px 20px;
    font-size: 15px;
	position: relative;
  }
  .vu-faq__tab[aria-selected="true"]::after {
    content: "";
    width: 10px;
    height: 10px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
    transition: all 0.5s ease-in-out;
    position: absolute;
	right: 20px;
	top: 17px
  }
  .vu-faq__tabs.is-open .vu-faq__tab[aria-selected="true"]::after {
    transform: rotate(-135deg);
	  display: inline-block;
  }

  /* When open, reveal the rest as a dropdown list under the pill */
  .vu-faq__tabs.is-open .vu-faq__tab {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 1px solid #e2e2e2;
    border-radius: 999px;
    color: #111;
    padding: 14px 20px;
    margin-top: 4px;
	position: relative;
  }
  .vu-faq__tabs.is-open .vu-faq__tab[aria-selected="true"] {
    margin-top: 0; /* pill stays flush at top */
  }
  .vu-faq__tabs.is-open .vu-faq__tab:hover {
    background: #000;
	  color: #fff;
  }
}
