/* ==========================================================================
   Zoho Connect - FAQs
   ========================================================================== */

/* --- Shared section spacing ---------------------------------------------- */
.zwc-secpad {
  padding: 120px 0;
}

/* --- FAQ hero ------------------------------------------------------------ */
.zwc-faq-hero {
  background: #f7f9fd;
  padding: 70px 0 0;
  text-align: center;
}

.zwc-faq-hero h1 {
  font-family: var(--primaryfont-bold);
  line-height: 1.15;
  margin-bottom: 18px;
}

.zwc-faq-hero p {
  line-height: 1.5;
  max-width: 780px;
  margin: 0 auto;
}

/* --- FAQ layout ---------------------------------------------------------- */
.zwc-faq {
  background: #f7f9fd;
}

.zwc-faq__layout {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

/* --- Topic navigation ---------------------------------------------------- */
.zwc-faq__nav {
  flex: 0 0 330px;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 26px 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #e9f0fc 0%, #eef3fd 100%);
  scrollbar-width: thin;
}

.zwc-faq__nav-title {
  font-family: var(--primaryfont-bold);
  padding: 0 26px;
  margin-bottom: 18px;
}

.zwc-faq__nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.zwc-faq__nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  color: #23272f;
  text-decoration: none;
  border-left: 4px solid transparent;
  font-family: var(--primaryfont-regular);
  transition:
    color 0.3s ease,
    background-color 0.3s ease,
    border-color 0.3s ease;
}

/* Highlight layer - faded in so the active topic changes smoothly */
.zwc-faq__nav-link::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(90deg, #cfe0ff 0%, rgba(207, 224, 255, 0) 100%);
  transition: opacity 0.3s ease;
}

.zwc-faq__nav-link:hover,
.zwc-faq__nav-link:focus-visible {
  color: #0047ff;
  background-color: rgba(255, 255, 255, 0.65);
}

/* Colour only - swapping the font family here would reflow the label */
.zwc-faq__nav-link[aria-current="true"] {
  color: #0047ff;
  border-left-color: #0047ff;
}

.zwc-faq__nav-link[aria-current="true"]::before {
  opacity: 1;
}

.zwc-faq__nav-link span {
  position: relative;
}

.zwc-faq__nav-icon {
  position: relative;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media screen and (prefers-reduced-motion: reduce) {
  .zwc-faq__nav-link,
  .zwc-faq__nav-link::before,
  .zwc-faq__trigger,
  .zwc-faq__icon::before,
  .zwc-faq__icon::after,
  .zwc-faq__answer {
    transition: none;
  }
}

/* --- FAQ content --------------------------------------------------------- */
.zwc-faq__main {
  flex: 1 1 auto;
  min-width: 0;
}

.zwc-faq__section {
  scroll-margin-top: 100px;
}

.zwc-faq__section + .zwc-faq__section {
  margin-top: 70px;
}

/* Topic banner - colour theme comes from the section modifier */
.zwc-faq__banner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 210px;
  padding: 40px 60px;
  border-radius: 14px;
  background: linear-gradient(105deg, var(--zwc-faq-dark) 0%, var(--zwc-faq-light) 100%);
}

/* Decorative stripe pattern on the banner */
.zwc-faq__banner::after {
  content: "";
  position: absolute;
  top: -30%;
  right: -60px;
  width: 42%;
  height: 160%;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 6px, rgba(255, 255, 255, 0) 6px 14px);
  transform: skewX(-12deg);
}

.zwc-faq__banner-title {
  position: relative;
  z-index: 1;
  color: #fff;
  font-family: var(--primaryfont-bold);
  line-height: 1.15;
  max-width: 640px;
  margin: 0;
}

/* Question list - each answer opens and closes on its own */
.zwc-faq__list {
  margin-top: 30px;
  border: 1px solid #e3e9f3;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.zwc-faq__item + .zwc-faq__item {
  border-top: 1px solid #e3e9f3;
}

.zwc-faq__question {
  margin: 0;
  line-height: 1.4;
}

.zwc-faq__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 26px 32px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.zwc-faq__trigger:hover,
.zwc-faq__trigger:focus-visible {
  background-color: #f5f8ff;
}

/* Plus sign that turns into a minus when the answer is open */
.zwc-faq__icon {
  position: relative;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

.zwc-faq__icon::before,
.zwc-faq__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #23272f;
  transform: translateY(-50%);
  transition: transform 0.35s ease;
}

.zwc-faq__icon::after {
  transform: translateY(-50%) rotate(90deg);
}

.zwc-faq__item--open .zwc-faq__icon::after {
  transform: translateY(-50%) rotate(0deg);
}

/* Collapsed answers animate from a zero-height row, so no fixed height is needed */
.zwc-faq__answer {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition:
    grid-template-rows 0.35s ease,
    visibility 0.35s;
}

.zwc-faq__item--open .zwc-faq__answer {
  grid-template-rows: 1fr;
  visibility: visible;
}

.zwc-faq__answer > div {
  overflow: hidden;
}

.zwc-faq__answer a {
  color: #0047ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.zwc-faq__answer p {
  margin: 0;
  padding: 0 70px 28px 32px;
  line-height: 1.6;
}

/* --- Topic colour themes ------------------------------------------------- */
.zwc-faq__section--about {
  --zwc-faq-dark: #1240b8;
  --zwc-faq-light: #4f95ff;
}

.zwc-faq__section--internal {
  --zwc-faq-dark: #0b1b5e;
  --zwc-faq-light: #2440a8;
}

.zwc-faq__section--engagement {
  --zwc-faq-dark: #0c6b52;
  --zwc-faq-light: #3fb894;
}

.zwc-faq__section--culture {
  --zwc-faq-dark: #7a1450;
  --zwc-faq-light: #cf4f93;
}

.zwc-faq__section--ai {
  --zwc-faq-dark: #3b1f8f;
  --zwc-faq-light: #8666ee;
}

.zwc-faq__section--knowledge {
  --zwc-faq-dark: #9c3d08;
  --zwc-faq-light: #f2912f;
}

.zwc-faq__section--tasks {
  --zwc-faq-dark: #0a5a86;
  --zwc-faq-light: #2fa5dc;
}

.zwc-faq__section--automation {
  --zwc-faq-dark: #6b1d92;
  --zwc-faq-light: #ab5cf0;
}

.zwc-faq__section--admin {
  --zwc-faq-dark: #2c3e5c;
  --zwc-faq-light: #64809f;
}

.zwc-faq__section--analytics {
  --zwc-faq-dark: #11603c;
  --zwc-faq-light: #3aa86b;
}

.zwc-faq__section--pricing {
  --zwc-faq-dark: #8f1226;
  --zwc-faq-light: #db4256;
}

.zwc-faq__section--security {
  --zwc-faq-dark: #0c4550;
  --zwc-faq-light: #2a8fa3;
}

.zwc-faq__section--integrations {
  --zwc-faq-dark: #2a2a9c;
  --zwc-faq-light: #6a6aef;
}

.zwc-faq__section--migration {
  --zwc-faq-dark: #3f5f10;
  --zwc-faq-light: #86b833;
}

/* --- Typography (desktop only) ------------------------------------------- */
@media screen and (min-width: 1200px) {
  .zwc-faq-hero h1 {
    font-size: 52px;
  }

  .zwc-faq-hero p {
    font-size: 18px;
  }

  .zwc-faq__nav-title {
    font-size: 22px;
  }

  .zwc-faq__nav-link {
    font-size: 16px;
  }

  .zwc-faq__banner-title {
    font-size: 44px;
  }

  .zwc-faq__question {
    font-size: 22px;
  }

  .zwc-faq__answer p {
    font-size: 18px;
  }
}

/* --- Large tablet -------------------------------------------------------- */
@media screen and (max-width: 1199px) {
  .zwc-faq__layout {
    gap: 28px;
  }

  .zwc-faq__nav {
    flex-basis: 260px;
  }

  .zwc-faq__banner {
    min-height: 170px;
    padding: 32px 40px;
  }

  .zwc-faq__trigger {
    padding: 22px 26px;
  }

  .zwc-faq__answer p {
    padding: 0 50px 24px 26px;
  }
}

/* --- Tablet: navigation moves above the content -------------------------- */
@media screen and (max-width: 991px) {
  .zwc-secpad {
    padding: 80px 0;
  }

  .zwc-faq__layout {
    display: block;
  }

  /* Topic rail becomes a sticky bar of chips above the questions */
  .zwc-faq__nav {
    position: sticky;
    top: 60px;
    z-index: 2;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 14px;
    margin-bottom: 34px;
  }

  .zwc-faq__nav-title {
    display: none;
  }

  .zwc-faq__nav-list {
    display: flex;
    gap: 8px;
    width: max-content;
  }

  .zwc-faq__nav-link {
    white-space: nowrap;
    padding: 10px 16px;
    border-left: 0;
    border-radius: 30px;
    background-color: #fff;
  }

  .zwc-faq__nav-link[aria-current="true"] {
    background-color: #0047ff;
    color: #fff;
  }

  .zwc-faq__nav-link::before,
  .zwc-faq__nav-link[aria-current="true"]::before {
    opacity: 0;
  }

  .zwc-faq__section {
    scroll-margin-top: 150px;
  }

  .zwc-faq__section + .zwc-faq__section {
    margin-top: 54px;
  }
}

/* --- Mobile -------------------------------------------------------------- */
@media screen and (max-width: 767px) {
  .zwc-secpad {
    padding: 60px 0;
  }

  .zwc-faq-hero {
    padding: 40px 0 0;
  }

  .zwc-faq__banner {
    min-height: 130px;
    padding: 26px 24px;
    border-radius: 10px;
  }

  .zwc-faq__list {
    margin-top: 20px;
    border-radius: 10px;
  }

  .zwc-faq__trigger {
    gap: 16px;
    padding: 20px;
  }

  .zwc-faq__answer p {
    padding: 0 20px 22px;
  }

  .zwc-faq__nav {
    display: none;
  }

  .zwc-faq__section {
    scroll-margin-top: 80px;
  }
}
