/* ═══════════════════════════════
   FAQ PAGE — STYLES
═══════════════════════════════ */

.faq-page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 20px 80px;
  font-family: inherit;
}

/* ── Header ── */
.faq-header {
  text-align: center;
  margin-bottom: 40px;
  margin-top: 80px;
}

.faq-main-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #111;
}

.faq-subtitle {
  font-size: 16px;
  color: #666;
  margin-bottom: 24px;
}

/* ── Search Row ── */
.faq-search-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 620px;
  margin: 0 auto;
}

.faq-search-wrap {
  flex: 1;
}

.faq-search-inner {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.07);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
  overflow: hidden;
}

.faq-search-inner:hover {
  border-color: #bfdbfe;
}

.faq-search-inner:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.faq-search-inner input {
  width: 100%;
  padding: 15px 50px 15px 18px;
  font-size: 15px;
  font-family: inherit;
  border: none;
  outline: none;
  background: transparent;
  color: #111;
  -webkit-text-fill-color: #111;
  box-sizing: border-box;
}

.faq-search-inner input::placeholder {
  color: #94a3b8;
  -webkit-text-fill-color: #94a3b8;
  opacity: 1;
}

.faq-search-inner input::-webkit-input-placeholder {
  color: #94a3b8;
  -webkit-text-fill-color: #94a3b8;
  opacity: 1;
}

.faq-search-inner input::-moz-placeholder {
  color: #94a3b8;
  opacity: 1;
}

.faq-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s, color 0.2s;
}

.faq-search-clear svg {
  width: 14px;
  height: 14px;
  display: block;
}

.faq-search-clear:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.faq-search-clear[style*="block"] {
  display: flex !important;
}

.faq-search-hint {
  font-size: 12px;
  color: #b0bac7;
  margin-top: 8px;
  text-align: left;
  padding-left: 4px;
  transition: opacity 0.2s;
}

.faq-search-wrap.has-value .faq-search-hint {
  opacity: 0;
  pointer-events: none;
}

/* ── Filter Button (mobile only) ── */
.faq-filter-btn {
  display: none;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  background: #fff;
  color: #2563eb;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.07);
  transition: background 0.2s, border-color 0.2s;
}

.faq-filter-btn svg {
  width: 20px;
  height: 20px;
}

.faq-filter-btn:hover {
  background: #eff6ff;
  border-color: #2563eb;
}

.faq-filter-btn.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

/* ── Layout ── */
.faq-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

/* ── Sidebar ── */
.faq-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: #fff;
  border: 1.5px solid #e8e8e8;
  border-radius: 14px;
  padding: 20px 16px;
  position: sticky;
  top: 100px;
}

.faq-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.faq-sidebar-close {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 2px;
  line-height: 1;
}

.faq-sidebar-close svg {
  width: 18px;
  height: 18px;
  display: block;
}

.faq-sidebar-close:hover {
  color: #333;
}

.faq-sidebar-cats {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.faq-side-tab {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.18s, color 0.18s;
}

.faq-side-tab:hover {
  background: #eff6ff;
  color: #2563eb;
}

.faq-side-tab.active {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}

.side-count {
  font-size: 11px;
  background: #e2e8f0;
  color: #64748b;
  padding: 1px 7px;
  border-radius: 20px;
  font-weight: 500;
}

.faq-side-tab.active .side-count {
  background: #bfdbfe;
  color: #1d4ed8;
}

/* ── Overlay ── */
.faq-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 998;
}

.faq-overlay.active {
  display: block;
}

/* ── Content ── */
.faq-content {
  flex: 1;
  min-width: 0;
}

/* ── Results Info ── */
.faq-results-info {
  font-size: 13px;
  color: #888;
  margin-bottom: 16px;
  min-height: 20px;
}

/* ── FAQ Items ── */
.faq-item {
  border: 1.5px solid #e8e8e8;
  border-radius: 12px;
  margin-bottom: 10px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.faq-item:hover {
  border-color: #bfdbfe;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.07);
}

/* ── Question row ── */
.faq-question-row {
  display: flex;
  align-items: flex-start;
  padding: 16px 18px 0;
}

.faq-question-text {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: #111;
  line-height: 1.45;
}

/* ── Answer block ── */
.faq-answer-block {
  padding: 8px 18px 6px;
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
}

.faq-answer-preview {
  display: inline;
}

.faq-answer-remain {
  display: none;
}

/* ── View More / Less ── */
.faq-view-more-wrap {
  padding: 2px 18px 14px;
}

.faq-view-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.faq-view-more:hover { color: #1d4ed8; }

.faq-view-more svg {
  width: 14px;
  height: 14px;
  transition: transform 0.25s;
}

.faq-view-more.open svg {
  transform: rotate(180deg);
}

/* ── Search highlight ── */
/* FIX: display:inline prevents theme overrides that set mark to
   inline-block or block, which caused characters to visually
   split apart when a <mark> was injected mid-word.
   font-style and font-weight are reset to match surrounding text.
   white-space:normal prevents any wrapping/spacing side-effects. */
.faq-page-wrapper mark,
.faq-item mark,
.faq-question-text mark,
.faq-answer-block mark {
  display: inline !important;
  background: #fef08a !important;
  color: inherit !important;
  border-radius: 2px;
  padding: 0 1px;
  margin: 0 !important;
  font-style: normal !important;
  font-weight: inherit !important;
  white-space: normal !important;
  vertical-align: baseline !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
  word-spacing: inherit !important;
}

/* ── Pagination ── */
.faq-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.faq-page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #444;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.faq-page-btn:hover { border-color: #2563eb; color: #2563eb; }
.faq-page-btn.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.faq-page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.faq-page-ellipsis {
  font-size: 14px;
  color: #aaa;
  padding: 0 4px;
}

/* ── No Results ── */
.faq-no-results {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

.faq-no-results span { font-size: 40px; display: block; margin-bottom: 16px; }
.faq-no-results p    { font-size: 16px; margin-bottom: 20px; }

#faq-reset-search {
  padding: 10px 24px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

/* ── Loading ── */
.faq-loading {
  text-align: center;
  padding: 40px;
  color: #aaa;
  font-size: 15px;
}

/* ══════════════════════════════
   MOBILE
══════════════════════════════ */
@media (max-width: 768px) {

  .faq-page-wrapper { padding: 30px 14px 60px; }

  .faq-header {
    margin-top: 30px;
    margin-bottom: 24px;
  }

  .faq-main-title { font-size: 24px; line-height: 1.3; }
  .faq-subtitle   { font-size: 14px; margin-bottom: 16px; }

  /* Show filter button */
  .faq-filter-btn { display: flex; }

  /* Search row full width */
  .faq-search-row { max-width: 100%; }

  .faq-search-inner input {
    font-size: 16px;
    padding: 13px 46px 13px 16px;
  }

  .faq-search-hint { font-size: 11px; }

  /* Stack layout */
  .faq-layout { display: block; }

  /* Sidebar becomes slide-in drawer */
  .faq-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 265px;
    height: 100%;
    border-radius: 0;
    border: none;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 999;
    overflow-y: auto;
    transition: left 0.3s ease;
    padding: 28px 18px;
  }

  .faq-sidebar.open {
    left: 0;
  }

  .faq-sidebar-close {
    display: block;
  }

  .faq-question-row  { padding: 14px 14px 0; }
  .faq-question-text { font-size: 14px; }

  .faq-answer-block  { padding: 6px 14px 4px; font-size: 13px; }
  .faq-view-more-wrap { padding: 2px 14px 12px; }

  .faq-page-btn { min-width: 34px; height: 34px; font-size: 13px; }
}