/* =========================================================
   FAQs PAGE
   Values copied from the "FAQs" frame in Figma (1512 × 4055).
   Loaded after styles.css (shared header, footer and tokens).
   Every class here starts with "fq-" (or "pg-back"), so other
   pages are not affected.
   ========================================================= */
:root {
  --fq-grey-text: #787f82;   /* hero intro, form intro, divider lines */
  --fq-purple: #8b1ac3;      /* "When?" bubble */
}

/* Back chevron in the hero's top-left corner (Figma: iconamoon arrow, rotated) */
.pg-back {
  position: absolute;
  left: 55px;
  top: 33px;
  z-index: 2;
  display: flex;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transform: rotate(90deg);
}
.pg-back:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 4px; }

/* ---------- HERO (Figma: 1416 × 392, #f8f8f8, radius 30) ---------- */
.fq-hero {
  position: relative;
  height: 392px;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--color-card-grey);
}
.fq-hero-text { position: relative; z-index: 1; padding: 67px 0 0 80px; max-width: calc(80px + 587px); }
.fq-kicker {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: var(--lh);
}
.fq-hero h1 {
  margin: 12px 0 0;
  font-size: 64px;
  font-weight: 600;
  line-height: 1.2;
}
.fq-hero-intro {
  margin: 16px 0 0;
  font-size: 20px;
  font-weight: 500;
  line-height: var(--lh);
  color: var(--fq-grey-text);
}

/* Microphone + speech bubbles. The box starts at Figma x 832 in the card,
   and every piece inside keeps its Figma position relative to that. */
.fq-art {
  position: absolute;
  top: 0;
  right: 0;
  width: 584px;
  height: 392px;
  transform-origin: top right;
}
.fq-mic {
  position: absolute;
  left: 256px;            /* Figma 1088 */
  top: 108px;
  width: 152px;
  height: 430px;
  overflow: hidden;
}
.fq-mic img {
  position: absolute;
  left: -53.95%;
  top: -10.95%;
  width: 207.89%;
  max-width: none;
  height: 120.97%;
}
.fq-bubble { position: absolute; }
.fq-bubble img { position: absolute; left: 0; top: 0; max-width: none; }
.fq-bubble span {
  position: absolute;
  font-weight: 600;
  line-height: var(--lh);
  color: var(--color-white);
  white-space: nowrap;
}
.fq-bubble--what { left: 0; top: 82px; width: 237.5px; height: 118.5px; }
.fq-bubble--what img { width: 99.42%; height: 98.33%; }
.fq-bubble--what span { left: 25px; top: 12px; font-size: 52.645px; }
.fq-bubble--how { left: 414.5px; top: 201px; width: 136.5px; height: 68px; }
/* Figma flips this bubble so its tail points left */
.fq-bubble--how img { left: auto; right: 0; width: 98.59%; height: 96.66%; transform: scaleX(-1); }
.fq-bubble--how span { left: 30.5px; top: 5px; font-size: 32.689px; }
.fq-bubble--when { left: 193px; top: 304px; width: 78px; height: 38.857px; }
.fq-bubble--when img { width: 98.59%; height: 96.66%; }
.fq-bubble--when span { left: 9px; top: 4px; font-size: 15.314px; }

/* ---------- QUESTION LIST ---------- */
.fq-list { margin-top: 36px; }
.fq-intro {
  max-width: 489px;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: var(--lh);
}
.fq-group { margin-top: 102px; }
.fq-intro + .fq-group { margin-top: 39px; }
.fq-group h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: var(--lh);
  color: var(--color-text);
}
/* Each row: 40px above the question, 25px below, then a 1px grey line (88px in total) */
.fq-item { border-bottom: 1px solid var(--fq-grey-text); }
.fq-item h3 { margin: 0; }
.fq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 41px 20px 24px;
  border: 0;
  background: none;
  font: 500 18px/var(--lh) var(--font-main);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}
/* First row of each group sits 40px under the group title (later rows: 41px under the line) */
.fq-group h2 + .fq-item .fq-question { padding-top: 40px; }
/* The 24px chevron must not make the 22px-tall row taller */
.fq-question img { flex: none; margin: -1px 0; transition: transform 0.2s ease; }
.fq-question[aria-expanded="true"] img { transform: rotate(180deg); }
.fq-question:hover span { color: var(--color-nav-active); }
.fq-question:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; border-radius: 6px; }
/* The panel has no padding of its own so faq.js can animate its height to 0 */
.fq-answer { padding: 0; }
.fq-answer p {
  max-width: 940px;
  margin: 0;
  padding: 0 20px 24px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--fq-grey-text);
}
.fq-answer a { color: var(--color-nav-active); text-decoration: underline; }

/* ---------- STILL HAVE QUESTIONS? (Figma: 1416 × 614, gradient, radius 30) ---------- */
.fq-ask {
  position: relative;
  min-height: 614px;
  margin-top: 102px;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: linear-gradient(to right, var(--color-card-grey), var(--color-blue-light));
}
.fq-ask-copy {
  position: relative;
  z-index: 1;
  max-width: calc(75px + 568px);
  padding: 44px 0 58px 75px;
}
.fq-ask h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  line-height: var(--lh);
}
.fq-ask-copy > p {
  margin: 12px 0 0;
  font-size: 16px;
  font-weight: 500;
  line-height: var(--lh);
  color: var(--fq-grey-text);
}
.fq-form { display: flex; flex-direction: column; align-items: flex-start; margin-top: 48px; }
.fq-form input,
.fq-form textarea {
  width: 465px;
  max-width: 100%;
  border: 0;
  border-radius: 10px;
  background: var(--color-white);
  font: 500 14px/var(--lh) var(--font-main);
  color: var(--color-text);
}
.fq-form input { height: 50px; padding: 0 18px; }
.fq-form textarea { height: 158px; padding: 15px 25px; resize: vertical; }
.fq-form label + input:not(:nth-child(2)),
.fq-form textarea { margin-top: 16px; }
.fq-form input::placeholder,
.fq-form textarea::placeholder { color: rgba(120, 127, 130, 0.5); }
.fq-form input:focus-visible,
.fq-form textarea:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.fq-form button {
  margin-top: 33px;
  padding: 15px 30px;
  border: 0;
  border-radius: 10px;
  background: var(--color-primary);
  font: 600 16px/var(--lh) var(--font-main);
  color: var(--color-white);
  cursor: pointer;
  transition: filter 0.2s ease;
}
.fq-form button:hover { filter: brightness(1.08); }
/* Patient photo runs off the bottom of the card, as in Figma */
.fq-ask-photo {
  position: absolute;
  left: 708px;
  top: 44px;
  width: 673px;
  height: 729px;
  max-width: none;
  object-fit: cover;
}

.page-faqs .site-footer { margin-top: 58px; }


/* =========================================================
   LAPTOP (up to 1400px)
   ========================================================= */
@media (max-width: 1400px) {
  .fq-hero h1 { font-size: clamp(48px, 4.4vw, 64px); }
  .fq-hero-text { max-width: calc(100% - 520px); padding-left: 64px; }
  .fq-art { transform: scale(0.82); }
  .fq-ask-photo { left: auto; right: 2%; width: 50%; height: auto; }
}


/* =========================================================
   TABLET (up to 1080px)
   ========================================================= */
@media (max-width: 1080px) {
  /* Hero: text first, the microphone artwork below it */
  .fq-hero { height: auto; display: flex; flex-direction: column; }
  .fq-hero-text { max-width: none; padding: 64px 40px 0; }
  .fq-hero h1 { font-size: 48px; }
  .fq-hero-intro { font-size: 18px; max-width: 560px; }
  /* 360px tall so the "When?" bubble shows; the microphone is still cut by the card edge */
  .fq-art { position: relative; flex: none; align-self: center; height: 360px; margin-top: -40px; transform: none; }

  .fq-group { margin-top: 72px; }
  .fq-ask { margin-top: 72px; min-height: 0; }
  .fq-ask-copy { max-width: 60%; padding: 44px 0 56px 40px; }
  .fq-form input, .fq-form textarea { width: 100%; }
  .fq-ask-photo { width: 44%; right: 0; top: auto; bottom: -12%; }
  .page-faqs .site-footer { margin-top: 56px; }
}


/* =========================================================
   PHONE (up to 640px)
   ========================================================= */
@media (max-width: 640px) {
  .fq-hero { border-radius: 20px; }
  .pg-back { left: 20px; top: 18px; }
  .fq-hero-text { padding: 52px 20px 0; }
  .fq-kicker { font-size: 18px; }
  .fq-hero h1 { font-size: 36px; }
  .fq-hero-intro { font-size: 16px; }
  /* Artwork shrinks evenly to fit the phone width. Scaling doesn't change the space
     an element takes up, so the margins pull the layout in to the scaled size. */
  .fq-art {
    --s: 0.55;
    align-self: flex-start;
    margin: 16px 0 calc(360px * (var(--s) - 1)) calc(50% - 584px * var(--s) / 2);
    transform: scale(var(--s));
    transform-origin: top left;
  }

  .fq-intro { font-size: 16px; }
  .fq-group { margin-top: 56px; }
  .fq-intro + .fq-group { margin-top: 32px; }
  .fq-group h2 { font-size: 21px; }
  .fq-question { padding: 24px 4px 18px; font-size: 16px; gap: 16px; }
  .fq-answer p { padding: 0 4px 20px; }

  .fq-ask { margin-top: 56px; border-radius: 20px; }
  .fq-ask-copy { max-width: none; padding: 36px 20px 0; }
  .fq-ask h2 { font-size: 26px; }
  .fq-form { margin-top: 28px; }
  .fq-form button { margin-top: 24px; }
  .fq-ask-photo { position: relative; left: auto; right: auto; bottom: auto; display: block; width: min(320px, 90%); margin: 24px auto -40px; }
  .page-faqs .site-footer { margin-top: 48px; }
}

@media (max-width: 380px) {
  .fq-art { --s: 0.5; }
}
