/* =========================================================
   ATRA BYTE — FAQ
   Complete replacement stylesheet
   ========================================================= */

.faqx-section {
  --faqx-ink: #0b0d18;
  --faqx-muted: #5b6072;
  --faqx-violet: #5d3de1;
  --faqx-soft: #e8e8ff;
  --faqx-hover: #f8f7ff;
  --faqx-rule: #d4d6df;
  --faqx-bg: #f5f6fa;

  background: var(--faqx-bg);
  color: var(--faqx-ink);

  padding: clamp(4rem, 6vw, 6.5rem) 0;

  font-family: inherit;
}


/* =========================================================
   MAIN CONTAINER
   ========================================================= */

.faqx-inner {
  width: min(1320px, calc(100% - 5rem));
  margin-inline: auto;
}


/* =========================================================
   LEGACY HEADING
   Hide the old standalone heading if it still exists
   in the template.

   The new design contains its title inside .faqx-context.
   ========================================================= */

.faqx-heading {
  display: none;
}


/* =========================================================
   MAIN FAQ PANEL
   ========================================================= */

.faqx-desk {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);

  width: 100%;

  overflow: hidden;

  background: var(--faqx-bg);

  border: 1px solid var(--faqx-rule);
  border-radius: 18px;
}


/* =========================================================
   LEFT / INTRO COLUMN
   ========================================================= */

.faqx-context {
  display: flex;
  flex-direction: column;

  min-width: 0;
  min-height: 40rem;

  padding: clamp(2rem, 3vw, 3rem);

  background: var(--faqx-bg);

  border-inline-end: 1px solid var(--faqx-rule);
}


/* =========================================================
   CONTEXT TOP
   ========================================================= */

.faqx-context-top {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 2rem;

  padding-bottom: 1rem;

  border-bottom: 1px solid var(--faqx-rule);
}

.faqx-context-top span,
.faqx-context-top p {
  margin: 0;

  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.5;
}

.faqx-context-top span {
  color: var(--faqx-violet);
}

.faqx-context-top p {
  color: var(--faqx-muted);
}


/* =========================================================
   CONTEXT MAIN COPY
   ========================================================= */

.faqx-context-copy {
  display: flex;
  flex: 1;

  flex-direction: column;
  justify-content: center;

  width: 100%;
  max-width: 34rem;

  padding-block: clamp(3rem, 6vw, 6rem);
}


/* Main FAQ title */

.faqx-context-copy h3 {
  max-width: 11ch;

  margin: 0;

  color: var(--faqx-ink);

  font-family: inherit;
  font-size: clamp(2.7rem, 4.1vw, 4.6rem);
  font-weight: 500;
  line-height: 1.2;

  letter-spacing: -0.035em;

  text-wrap: balance;
}

html[dir="rtl"] .faqx-context-copy h3 {
  letter-spacing: 0;
}


/* Supporting description */

.faqx-context-copy p {
  width: min(100%, 43ch);

  margin: 1.35rem 0 0;

  color: var(--faqx-muted);

  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.95;

  text-wrap: pretty;
}


/* =========================================================
   CONTEXT BOTTOM CTA
   ========================================================= */

.faqx-context-bottom {
  display: flex;

  align-items: flex-end;
  justify-content: space-between;

  gap: 2rem;

  padding-top: 1.35rem;

  border-top: 1px solid var(--faqx-rule);
}

.faqx-context-bottom > span {
  color: var(--faqx-muted);

  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.6;
}

.faqx-context-bottom a {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  gap: 0.5rem;

  padding-bottom: 0.3rem;

  border-bottom: 1px solid currentColor;

  color: var(--faqx-ink);

  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.5;

  text-decoration: none;

  transition:
    opacity 0.2s ease,
    gap 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.faqx-context-bottom a i {
  font-style: normal;

  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.faqx-context-bottom a:hover {
  gap: 0.7rem;
  opacity: 0.65;
}

.faqx-context-bottom a:hover i {
  transform: translate(2px, -2px);
}

html[dir="rtl"] .faqx-context-bottom a:hover i {
  transform: translate(-2px, -2px);
}

.faqx-context-bottom a:focus-visible {
  outline: 2px solid var(--faqx-violet);
  outline-offset: 4px;
}


/* =========================================================
   PROGRESS
   Existing JavaScript updates:
   - [data-faqx-current]
   - --faqx-progress
   ========================================================= */

.faqx-progress {
  display: grid;
  grid-template-columns: auto 1fr auto;

  align-items: center;

  gap: 0.9rem;

  width: 100%;

  margin-top: 1.4rem;

  color: var(--faqx-muted);

  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1;
}

.faqx-progress i {
  display: block;

  width: 100%;
  height: 1px;

  background:
    linear-gradient(
      to right,
      var(--faqx-violet) var(--faqx-progress, 20%),
      var(--faqx-rule) var(--faqx-progress, 20%)
    );
}

html[dir="rtl"] .faqx-progress i {
  background:
    linear-gradient(
      to left,
      var(--faqx-violet) var(--faqx-progress, 20%),
      var(--faqx-rule) var(--faqx-progress, 20%)
    );
}


/* =========================================================
   FAQ LIST
   ========================================================= */

.faqx-list {
  min-width: 0;

  background: var(--faqx-bg);
}


/* =========================================================
   FAQ ITEM
   ========================================================= */

.faqx-item {
  position: relative;

  background: var(--faqx-bg);

  border-bottom: 1px solid var(--faqx-rule);

  transition:
    background 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.faqx-item:last-child {
  border-bottom: 0;
}

.faqx-item.is-active {
  background: var(--faqx-soft);
}

.faqx-item h3 {
  margin: 0;
}


/* =========================================================
   QUESTION BUTTON
   ========================================================= */

.faqx-item button {
  appearance: none;

  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;

  align-items: start;

  gap: clamp(1rem, 1.7vw, 1.5rem);

  width: 100%;

  padding:
    clamp(1.7rem, 2.5vw, 2.25rem)
    clamp(1.5rem, 2.7vw, 2.5rem);

  border: 0;

  background: transparent;

  color: inherit;

  font: inherit;
  text-align: start;

  cursor: pointer;
}


/* =========================================================
   QUESTION NUMBER
   ========================================================= */

.faqx-item button > span {
  padding-top: 0.4rem;

  color: var(--faqx-violet);

  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
}


/* =========================================================
   QUESTION TITLE
   ========================================================= */

.faqx-item button > strong {
  min-width: 0;

  color: var(--faqx-ink);

  font-size: clamp(1rem, 1.3vw, 1.22rem);
  font-weight: 600;
  line-height: 1.65;

  text-wrap: balance;
}


/* =========================================================
   QUESTION ARROW
   HTML <i> stays unchanged for JS compatibility.
   ========================================================= */

.faqx-item button > i {
  position: relative;

  display: grid;

  width: 1.1rem;
  height: 1.1rem;

  margin-top: 0.15rem;

  place-items: center;
}

.faqx-item button > i::before {
  content: "↗";

  display: block;

  color: var(--faqx-ink);

  font-size: 0.95rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1;

  transform-origin: center;

  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.25s ease;
}

.faqx-item button > i::after {
  content: none;
}


/* Active arrow */

.faqx-item.is-active button > i::before {
  color: var(--faqx-violet);
  transform: rotate(45deg);
}


/* =========================================================
   QUESTION HOVER
   ========================================================= */

@media (hover: hover) {

  .faqx-item:not(.is-active):hover {
    background: var(--faqx-hover);
  }

  .faqx-item:not(.is-active):hover button > i::before {
    transform: translate(2px, -2px);
  }

  html[dir="rtl"]
  .faqx-item:not(.is-active):hover
  button > i::before {
    transform: translate(-2px, -2px);
  }
}


/* =========================================================
   QUESTION FOCUS
   ========================================================= */

.faqx-item button:focus-visible {
  position: relative;

  outline: 2px solid var(--faqx-violet);
  outline-offset: -3px;

  z-index: 1;
}


/* =========================================================
   ANSWER
   IMPORTANT:
   Existing JS only toggles .is-active and inert.
   This animation intentionally keeps that contract.
   ========================================================= */

.faqx-answer {
  display: grid;

  grid-template-rows: 0fr;

  opacity: 0;

  transition:
    grid-template-rows 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.25s ease;
}

.faqx-answer > div {
  min-height: 0;
  overflow: hidden;
}

.faqx-answer p {
  width: min(100%, 62ch);

  margin: 0;

  padding-inline:
    clamp(4.4rem, 5.5vw, 5.8rem)
    clamp(1.5rem, 2.7vw, 2.5rem);

  padding-block: 0;

  color: var(--faqx-muted);

  font-size: 0.8rem;
  font-weight: 400;
  line-height: 2;

  text-wrap: pretty;
}


/* Open state */

.faqx-item.is-active .faqx-answer {
  grid-template-rows: 1fr;

  opacity: 1;
}

.faqx-item.is-active .faqx-answer p {
  padding-bottom: clamp(1.8rem, 2.5vw, 2.3rem);
}


/* =========================================================
   OPTIONAL EXISTING FOOTER
   Kept in case .faqx-foot still exists in the template.
   ========================================================= */

.faqx-foot {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 2rem;

  padding-top: 1.5rem;

  color: var(--faqx-muted);

  font-size: 0.68rem;
  line-height: 1.8;
}

.faqx-foot p {
  margin: 0;
}

.faqx-foot strong {
  color: var(--faqx-ink);
}

.faqx-foot > span {
  color: var(--faqx-violet);
  text-align: end;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

  .faqx-section {
    padding-block: clamp(3.5rem, 7vw, 5rem);
  }

  .faqx-inner {
    width: calc(100% - 3rem);
  }

  .faqx-desk {
    grid-template-columns: 1fr;

    border-radius: 16px;
  }

  .faqx-context {
    min-height: auto;

    padding: 2rem;

    border-inline-end: 0;
    border-bottom: 1px solid var(--faqx-rule);
  }

  .faqx-context-copy {
    max-width: 42rem;

    padding-block: clamp(3.5rem, 8vw, 5rem);
  }

  .faqx-context-copy h3 {
    max-width: 14ch;

    font-size: clamp(2.6rem, 7vw, 4rem);
  }

  .faqx-context-copy p {
    max-width: 48ch;
  }

  .faqx-item button {
    padding-inline: 2rem;
  }

  .faqx-answer p {
    padding-inline: 4.6rem 2rem;
  }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 650px) {

  .faqx-section {
    padding-block: 3.5rem;
  }

  .faqx-inner {
    width: calc(100% - 2rem);
  }

  .faqx-desk {
    border-radius: 14px;
  }


  /* Intro */

  .faqx-context {
    padding: 1.35rem;
  }

  .faqx-context-top {
    gap: 1rem;

    padding-bottom: 0.9rem;
  }

  .faqx-context-top span,
  .faqx-context-top p {
    font-size: 0.62rem;
  }

  .faqx-context-copy {
    padding-block: 3rem;
  }

  .faqx-context-copy h3 {
    max-width: 12ch;

    font-size: clamp(2.15rem, 10.5vw, 3rem);
    line-height: 1.25;
  }

  .faqx-context-copy p {
    width: min(100%, 38ch);

    margin-top: 1rem;

    font-size: 0.8rem;
    line-height: 1.9;
  }


  /* CTA */

  .faqx-context-bottom {
    align-items: flex-start;
    flex-direction: column;

    gap: 0.85rem;

    padding-top: 1.2rem;
  }

  .faqx-progress {
    margin-top: 1.25rem;
  }


  /* FAQ questions */

  .faqx-item button {
    grid-template-columns: auto minmax(0, 1fr) auto;

    gap: 0.9rem;

    padding: 1.4rem 1.1rem;
  }

  .faqx-item button > span {
    padding-top: 0.3rem;
  }

  .faqx-item button > strong {
    font-size: 1rem;
    line-height: 1.65;
  }


  /* Answers */

  .faqx-answer p {
    width: 100%;

    padding-inline: 3.1rem 1.1rem;

    font-size: 0.78rem;
    line-height: 1.95;
  }

  .faqx-item.is-active .faqx-answer p {
    padding-bottom: 1.5rem;
  }


  /* Footer */

  .faqx-foot {
    align-items: flex-start;
    flex-direction: column;

    gap: 0.75rem;
  }

  .faqx-foot > span {
    text-align: start;
  }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 420px) {

  .faqx-inner {
    width: calc(100% - 1.5rem);
  }

  .faqx-context {
    padding: 1.15rem;
  }

  .faqx-context-copy {
    padding-block: 2.6rem;
  }

  .faqx-context-copy h3 {
    font-size: clamp(2rem, 11vw, 2.6rem);
  }

  .faqx-item button {
    gap: 0.75rem;

    padding: 1.3rem 0.9rem;
  }

  .faqx-answer p {
    padding-inline: 2.85rem 0.9rem;
  }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  .faqx-item,
  .faqx-answer,
  .faqx-item button > i::before,
  .faqx-context-bottom a,
  .faqx-context-bottom a i {
    transition: none !important;
  }
}