/* FILE PURPOSE: FAQ accordion styles integrated with Essentials theme design system. */

/* FAQ Container */
#rank-math-faq {
  margin: 24px 0;
}

/* FAQ Item */
#rank-math-faq .rank-math-list-item {
  border: 1px solid var(--ess-border);
  border-radius: 8px;
  margin-bottom: 12px;
  background: var(--ess-bg);
  overflow: hidden;
  transition: all 0.2s ease;
}

#rank-math-faq .rank-math-list-item:hover {
  border-color: var(--ess-theme-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

html[data-theme="dark"] #rank-math-faq .rank-math-list-item:hover {
  box-shadow: 0 2px 8px rgba(255,255,255,0.1);
}

/* FAQ Question */
#rank-math-faq .rank-math-question {
  margin: 0;
  padding: 0;
  position: relative;
}

#rank-math-faq .ess-faq-button {
  width: 100%;
  padding: 16px 48px 16px 16px;
  border: none;
  background: transparent;
  color: var(--ess-text);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.4;
}

#rank-math-faq .ess-faq-button:hover {
  color: var(--ess-theme-color);
}

#rank-math-faq .ess-faq-button:focus {
  outline: none;
  box-shadow: none;
}

/* Subtle, accessible focus ring for keyboard users */
#rank-math-faq .ess-faq-button:focus-visible {
  outline: 2px solid var(--ess-border);
  outline-offset: 2px;
}

/* Plus/Minus Icon */
#rank-math-faq .ess-faq-button::after {
  content: '+';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ess-theme-color);
  transition: all 0.2s ease;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#rank-math-faq .ess-faq-button.ess-faq-open::after {
  content: '−';
  transform: translateY(-50%) rotate(180deg);
}

/* FAQ Answer - animated with JS-set max-height for perfect expand/collapse */
#rank-math-faq .rank-math-answer {
  margin: 0;
  padding: 0;
  background: var(--ess-bg);
  color: var(--ess-text);
  font-size: 0.95rem;
  line-height: 1.6;
  border-top: 1px solid var(--ess-border);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.28s ease, opacity 0.28s ease;
}

#rank-math-faq .rank-math-answer.ess-faq-open {
  opacity: 1;
}

/* Inner wrapper ensures padding doesn't cause jumpiness during height animation */
#rank-math-faq .rank-math-answer .ess-faq-panel-inner {
  display: block;
  padding: 16px;
}

/* Content styling within answers */
#rank-math-faq .rank-math-answer p {
  margin: 0 0 12px 0;
}

#rank-math-faq .rank-math-answer p:last-child {
  margin-bottom: 0;
}

#rank-math-faq .rank-math-answer ul,
#rank-math-faq .rank-math-answer ol {
  margin: 0 0 12px 0;
  padding-left: 20px;
}

#rank-math-faq .rank-math-answer a {
  color: var(--ess-theme-color);
  text-decoration: none;
}

#rank-math-faq .rank-math-answer a:hover {
  text-decoration: underline;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
  #rank-math-faq .ess-faq-button {
    padding: 14px 40px 14px 14px;
    font-size: 0.95rem;
  }
  
  #rank-math-faq .ess-faq-button::after {
    right: 14px;
    font-size: 1.1rem;
  }
  
  #rank-math-faq .rank-math-answer {
    padding: 0 14px 14px 14px;
    font-size: 0.9rem;
  }
}

/* Dark mode adjustments */
html[data-theme="dark"] #rank-math-faq .rank-math-list-item {
  background: var(--ess-bg);
  border-color: var(--ess-border);
}

html[data-theme="dark"] #rank-math-faq .rank-math-answer {
  background: var(--ess-bg);
  border-top-color: var(--ess-border);
}

