/* FAQ Manager — faq-styles.css v1.3 */

:root {
  /* FAQ Manager default variables — overridden by FAQ_Design in <head> */
  --faq-acc-border:        #e8e8e8;
  --faq-acc-radius:        10px;
  --faq-acc-border-width:  1.5px;
  --faq-acc-open-color:    #2271b1;
  --faq-acc-bg:            #ffffff;
  --faq-acc-bg-open:       #ffffff;
  /* Question */
  --faq-q-font-size:       15px;
  --faq-q-font-weight:     500;
  --faq-q-color:           #1d2327;
  --faq-q-pad-v:           16px;
  --faq-q-pad-h:           20px;
  /* Answer */
  --faq-a-font-size:       15px;
  --faq-a-color:           #333333;
  --faq-a-bg:              #ffffff;
  --faq-a-pad-v:           16px;
  --faq-a-pad-h:           20px;
  /* Category buttons */
  --faq-cat-bg:            #ffffff;
  --faq-cat-color:         #444444;
  --faq-cat-border:        #d0d0d0;
  --faq-cat-radius:        999px;
  --faq-cat-active-bg:     #2271b1;
  --faq-cat-active-color:  #ffffff;
  /* Search */
  --faq-search-border:     #d0d0d0;
  --faq-search-radius:     8px;
  --faq-search-focus:      #2271b1;
  /* Search highlight */
  --faq-highlight-bg:      #fff176;
  --faq-highlight-color:   #1d2327;
  /* Layout */
  --faq-item-gap:          8px;
}

.faq-manager-app {
  font-family: inherit;
  max-width: 860px;
  margin: 0 auto;
}

/* ── Search bar ──────────────────────────────────────────────────────────── */
.faq-search-wrap {
  position: relative !important;
  display: block !important;
  box-sizing: border-box !important;
}
.faq-search {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px 12px 44px;
  font-size: 15px;
  border: 1.5px solid var(--faq-search-border);
  border-radius: var(--faq-search-radius);
  outline: none;
  background: #fff;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.faq-search:focus {
  border-color: var(--faq-search-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--faq-search-focus) 18%, transparent);
}
.faq-search-icon {
  position: absolute !important;
  left: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #888 !important;
  pointer-events: none !important;
  display: flex !important;
  align-items: center !important;
  z-index: 2 !important;
  line-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.faq-search-status {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
  display: none;
}
.faq-search-status:not(:empty) {
  display: block;
}

/* Clear button — right side of search field */
.faq-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.12s, background 0.12s;
  line-height: 1;
}
.faq-search-clear:hover {
  color: #555;
  background: rgba(0,0,0,0.06);
}
.faq-search-clear[hidden] {
  display: none;
}
/* Shift input right padding when clear button is visible */
.faq-search-wrap:has(.faq-search-clear:not([hidden])) .faq-search {
  padding-right: 40px;
}

/* ── Category bar ────────────────────────────────────────────────────────── */
.faq-category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  transition: opacity 0.2s;
  /* Justify-content driven by --faq-cat-justify (set via design panel or Elementor) */
  justify-content: var(--faq-cat-justify, flex-start);
}
.faq-cat-count {
  opacity: 0.6;
  font-size: 0.85em;
}
.faq-cat-btn.active .faq-cat-count {
  opacity: 0.8;
}
.faq-cat-btn {
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid var(--faq-cat-border);
  border-radius: var(--faq-cat-radius);
  background: var(--faq-cat-bg);
  color: var(--faq-cat-color);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
  line-height: 1.4;
}
.faq-cat-btn:hover {
  border-color: var(--faq-acc-open-color);
  color: var(--faq-acc-open-color);
}
.faq-cat-btn.active {
  background: var(--faq-cat-active-bg);
  border-color: var(--faq-cat-active-bg);
  color: var(--faq-cat-active-color);
}

/* ── Accordion list ──────────────────────────────────────────────────────── */
.faq-accordion-list {
  display: flex;
  flex-direction: column;
  gap: var(--faq-item-gap);
}

/* Each item: relative so the copy button can be absolute inside it */
.faq-item {
  position: relative;
  border: var(--faq-acc-border-width) solid var(--faq-acc-border);
  border-radius: var(--faq-acc-radius);
  background: var(--faq-acc-bg);
  overflow: hidden;
  transition: border-color 0.15s;
}
.faq-item[open] {
  border-color: var(--faq-acc-open-color);
  background: var(--faq-acc-bg-open);
}

/* ── Question row ────────────────────────────────────────────────────────── */
.faq-question {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--faq-q-pad-v) var(--faq-q-pad-h);
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-weight: var(--faq-q-font-weight);
  font-size: var(--faq-q-font-size);
  color: var(--faq-q-color);
}
.faq-question::-webkit-details-marker { display: none; }

.faq-question-text {
  flex: 1;
  min-width: 0;
}

/* Category tags — shown via JS during search */
.faq-cat-tags {
  display: none;
  gap: 5px;
  flex-shrink: 0;
}
.faq-cat-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--faq-cat-active-bg) 12%, #fff);
  color: var(--faq-cat-active-bg);
  white-space: nowrap;
}

/* Chevron */
.faq-chevron {
  color: #999;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: transform 0.2s ease-out;
}
details[open] .faq-chevron {
  transform: rotate(180deg);
}

/* ── Answer ──────────────────────────────────────────────────────────────── */
.faq-answer {
  position: relative;
  padding: var(--faq-a-pad-v) var(--faq-a-pad-h);
  font-size: var(--faq-a-font-size);
  line-height: 1.7;
  color: var(--faq-a-color);
  background: var(--faq-a-bg);
  border-top: 1px solid color-mix(in srgb, var(--faq-acc-border) 70%, transparent);
}
.faq-answer p:first-child { margin-top: 0; }
.faq-answer p:last-child  { margin-bottom: 0; }
.faq-answer a { color: var(--faq-acc-open-color); }
.faq-answer ul, .faq-answer ol { padding-left: 24px; }

/* Copy button styles are output inline in <head> by FAQ_Design::output_css_vars()
   to ensure they load after theme CSS and cannot be overridden. */

/* ── Search highlight ─────────────────────────────────────────────────────── */
mark.faq-highlight {
  background: var(--faq-highlight-bg);
  color: var(--faq-highlight-color);
  border-radius: 2px;
  padding: 0 1px;
  font-style: normal;
}

/* ── No results ──────────────────────────────────────────────────────────── */
.faq-no-results-cta {
  display: inline-block;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--faq-acc-open-color, #2271b1);
  text-decoration: none;
  padding: 8px 20px;
  border: 1.5px solid currentColor;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.faq-no-results-cta:hover {
  background: var(--faq-acc-open-color, #2271b1);
  color: #fff;
}
.faq-no-results {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 15px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .faq-question { font-size: calc(var(--faq-q-font-size) * 0.93); }
  .faq-cat-tags { display: none !important; }
  .faq-category-bar { gap: 6px; }
  .faq-cat-btn { padding: 6px 12px; font-size: 13px; }
}

/* ── Related questions ──────────────────────────────────────────────────── */
.faq-related {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--faq-acc-border) 60%, transparent);
}
.faq-related-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #888;
  margin-bottom: 8px;
}
.faq-related-link {
  display: inline-block;
  font-size: 13px;
  color: var(--faq-acc-open-color);
  text-decoration: none;
  background: color-mix(in srgb, var(--faq-acc-open-color) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--faq-acc-open-color) 25%, transparent);
  border-radius: 4px;
  padding: 4px 10px;
  margin: 0 6px 6px 0;
  transition: background 0.12s;
}
.faq-related-link:hover {
  background: color-mix(in srgb, var(--faq-acc-open-color) 16%, transparent);
  text-decoration: none;
}

/* feedback and copy-btn styles are fully controlled by JS inline styles */

/* ── Widget ─────────────────────────────────────────────────────────────── */
.faq-widget-block {
  /* No max-width constraint — inherits from container */
  max-width: none !important;
}
.faq-widget-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px;
  color: inherit;
}
