/* ==========================================================================
   KOBIL — Secure Messenger & Documents — Section: FAQ
   Figma: desktop 6015:101778 (1360x1137 — pt 60 / pb 80 / px 40, 60 gap,
   72px rows with 20px inner padding and 1px System/40% rules) ·
   mobile 6149:70055 (369x1069 — 34px title, rows padded 16/0, 16/23 text).

   Every row is collapsed in the design; opening one is the prototype's
   accordion behaviour, animated here with grid-template-rows.
   ========================================================================== */

.sec-smd-faq {
  display: flex;
  flex-direction: column;
  gap: var(--w60);
  width: 100%;
  padding: var(--w60) var(--w40) var(--w80);
}

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

.smd-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. */
.smd-faq__item { position: relative; }

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

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

.smd-faq__q { margin: 0; }

.smd-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) {
  .smd-faq__trigger[aria-expanded="false"]:hover {
    color: var(--blue-dark);
    font-weight: 600;
    line-height: var(--w24);
  }
}

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

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

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

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

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

.smd-faq__icon::before,
.smd-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);
}

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

.smd-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);
}

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

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

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

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

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

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

.smd-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-smd-faq {
    gap: var(--m40);
    padding: var(--m40) var(--m16);
  }

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

  .smd-faq__trigger {
    gap: var(--m16);
    min-height: var(--m55);
    padding: var(--m16) 0;
    font-size: var(--m16);
    line-height: var(--m23);
  }

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

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

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

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