/* ==========================================================================
   KOBIL — Inside KOBIL — Section: FAQ
   Figma: desktop 6277:52242 (1440x829 — 1280 column at x=80, title at y=60,
   eight 72px rows from y=193, 1px System/40% rules, 60 bottom) ·
   mobile 6239:50628 (393x670 — 34px title at x=16/y=40, rows from y=121).

   Every row is collapsed in the design; opening one is the prototype's
   accordion behaviour, animated here with grid-template-rows. The section is
   white — it is the first thing under the tinted page ground the cards sit on.
   ========================================================================== */

.sec-ik-faq {
  display: flex;
  flex-direction: column;
  /* title ends at 133, list starts at 193 */
  gap: var(--w60);
  width: 100%;
  padding: var(--w60) var(--w80);
  background: var(--white);
}

.ik-faq__title {
  font-family: var(--font-serif);
  font-size: var(--w56);
  font-weight: 400;
  line-height: 1.3;
  color: var(--navy);
}

.ik-faq__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Figma draws the rules as zero-height vectors between the rows, so they must
   not add to the row height — hairlines are painted, not laid out. */
.ik-faq__item { position: relative; }

.ik-faq__item::before,
.ik-faq__item:last-child::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--navy-40);
  pointer-events: none;
}

.ik-faq__item::before { top: 0; }
.ik-faq__item:last-child::after { bottom: 0; }

.ik-faq__q { margin: 0; }

.ik-faq__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--w20);
  width: 100%;
  /* Figma's collapsed row is 72 tall, hairline included. */
  min-height: var(--w72);
  padding: var(--w11) var(--w20);
  border: 0;
  background: none;
  text-align: left;
  font-family: var(--font-sans);
  font-size: var(--w18);
  font-weight: 400;
  line-height: var(--w26);
  color: var(--navy);
  cursor: pointer;
  transition:
    color var(--dur) var(--ease),
    padding var(--dur) var(--ease),
    min-height var(--dur) var(--ease);
}

@media (min-width: 769px) and (hover: hover) and (pointer: fine) {
  .ik-faq__trigger[aria-expanded="false"]:hover {
    color: var(--blue-dark);
    font-weight: 600;
    line-height: var(--w24);
  }
}

.ik-faq__trigger:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  border-radius: 8px;
}

.ik-faq__item.is-open .ik-faq__trigger {
  min-height: 0;
  padding: var(--w20) var(--w20) var(--w14);
  font-weight: 600;
  line-height: var(--w24);
  color: var(--navy);
}

.ik-faq__q-text { flex: 1; min-width: 0; }

/* ---- Plus/minus icon ---- */

.ik-faq__icon {
  position: relative;
  flex: none;
  width: var(--w18);
  height: var(--w18);
}

.ik-faq__icon::before,
.ik-faq__icon::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: currentColor;
  -webkit-mask: url("/assets/faqs/icon-plus.svg") center / contain no-repeat;
  mask: url("/assets/faqs/icon-plus.svg") center / contain no-repeat;
  transition: opacity var(--dur) var(--ease), transform 0.3s var(--ease);
}

.ik-faq__icon::after {
  opacity: 0;
  -webkit-mask-image: url("/assets/faqs/icon-minus.svg");
  mask-image: url("/assets/faqs/icon-minus.svg");
}

.ik-faq__icon img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease), transform 0.3s var(--ease);
}

.ik-faq__item.is-open .ik-faq__icon::before { opacity: 0; transform: rotate(90deg); }
.ik-faq__item.is-open .ik-faq__icon::after { opacity: 1; }

.ik-faq__icon-minus { opacity: 0; }
.ik-faq__item.is-open .ik-faq__icon-plus { opacity: 0; transform: rotate(90deg); }
.ik-faq__item.is-open .ik-faq__icon-minus { opacity: 1; }

/* ---- Answer ---- */

.ik-faq__answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur) var(--ease);
}

.ik-faq__item.is-open .ik-faq__answer {
  grid-template-rows: 1fr;
}

.ik-faq__answer-inner {
  overflow: hidden;
  min-height: 0;
}

.ik-faq__answer-text {
  margin: 0 0 var(--w20);
  padding: 0 var(--w80) 0 var(--w20);
  font-family: var(--font-sans);
  font-size: var(--w18);
  font-weight: 400;
  line-height: var(--w26);
  color: var(--navy-70);
}

@media (max-width: 768px) {
  .sec-ik-faq {
    /* title ends at 81, list starts at 121 */
    gap: var(--m40);
    padding: var(--m40) var(--m16);
  }

  .ik-faq__title {
    font-size: var(--m34);
    line-height: 1.2;
  }

  /* Figma's phone rows are 337 wide inside a 361 list — the hairlines run the
     full width but the content stops 24 short, which is what makes three of
     the eight questions wrap onto a second line (rows 78 instead of 55). */
  .ik-faq__trigger {
    gap: var(--m16);
    min-height: var(--m55);
    padding: var(--m16) var(--m24) var(--m16) 0;
    font-size: var(--m16);
    line-height: var(--m23);
  }

  .ik-faq__item.is-open .ik-faq__trigger { padding: var(--m16) var(--m24) var(--m10) 0; }

  .ik-faq__icon {
    width: var(--m18);
    height: var(--m18);
  }

  .ik-faq__answer-text {
    margin-bottom: var(--m16);
    padding: 0;
    font-size: var(--m14);
    line-height: var(--m20);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ik-faq__trigger,
  .ik-faq__icon::before,
  .ik-faq__icon::after,
  .ik-faq__icon img,
  .ik-faq__answer { transition: none; }
}
