/* ==========================================================================
   TDV Media, Page FAQ (centre d'aide)
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Hero ---------- */
.faq-hero__text { margin-left: auto; margin-right: auto; }
.faq-hero__slogan {
  margin-top: 18px;
  font-family: var(--font-brand);
  font-size: 1.05rem;
  font-weight: 600;
  background: var(--silver-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Icon sizing overrides (global svg rule is 100% + stroke-based) ---------- */
.faq-search__icon,
.faq-item__copy svg {
  fill: currentColor;
  stroke: none;
  flex-shrink: 0;
}
.faq-search__icon { width: 20px; height: 20px; }
.faq-item__copy svg { width: 16px; height: 16px; }

/* ---------- Search ---------- */
.faq-search {
  max-width: 620px;
  margin: 40px auto 0;
}
.faq-search__box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--anthracite);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.faq-search__box:focus-within {
  border-color: var(--silver-light);
  box-shadow: 0 0 0 4px rgba(245, 245, 245, 0.1);
}
.faq-search__icon { flex-shrink: 0; color: var(--muted); }
.faq-search__box input {
  flex: 1;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--white);
  font-family: inherit;
  font-size: 1rem;
  padding: 16px 12px;
}
.faq-search__box input:focus { outline: none; }
.faq-search__box input::placeholder { color: var(--muted); }
.faq-search__clear {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background 0.2s ease;
}
.faq-search__clear[hidden] { display: none; }
.faq-search__clear:hover { color: var(--white); background: rgba(255, 255, 255, 0.08); }
.faq-search__counter {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--muted);
  min-height: 1.3em;
}

/* ---------- Layout ---------- */
.faq-section { padding-top: 80px; }
.faq-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: start;
}

/* ---------- Category nav (sidebar desktop / scroll mobile) ---------- */
.faq-catnav {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
}
.faq-catnav__list { display: flex; flex-direction: column; gap: 2px; }
.faq-catnav__link {
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease;
  border-left: 2px solid transparent;
}
.faq-catnav__link:hover { color: var(--white); }
.faq-catnav__link.is-active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
  border-left-color: var(--silver-light);
}

/* ---------- Categories & items ---------- */
.faq-category { margin-bottom: 56px; scroll-margin-top: calc(var(--header-h) + 24px); }
.faq-category:last-child { margin-bottom: 0; }
.faq-category__title {
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.faq-category__items { display: flex; flex-direction: column; gap: 10px; }

.faq-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--anthracite);
  overflow: hidden;
  transition: border-color 0.2s ease;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.faq-item.is-open { border-color: var(--silver-mid); }
.faq-item.is-highlighted { border-color: var(--silver-light); box-shadow: 0 0 0 4px rgba(245, 245, 245, 0.12); }

.faq-item__question { font-size: 1rem; font-weight: 600; }
.faq-item__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 10px 20px;
}
.faq-item__trigger {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  text-align: left;
  color: var(--white);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
}
.faq-item__q-text { flex: 1; }
.faq-item__copy {
  color: var(--muted);
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s ease, background 0.2s ease;
}
.faq-item__copy:hover { color: var(--white); background: rgba(255, 255, 255, 0.08); }
.faq-item__copy.is-copied { color: var(--silver-light); }
.faq-item__chevron {
  color: var(--muted);
  font-size: 0.85rem;
  transition: transform 0.25s ease;
}
.faq-item.is-open .faq-item__chevron { transform: rotate(180deg); }
.faq-item.is-open .faq-item__trigger { color: var(--white); }

.faq-item__panel {
  padding: 0 20px 20px;
  animation: faq-panel-in 0.25s ease;
}
@keyframes faq-panel-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.faq-item__answer {
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.7;
}
.faq-item__cta {
  display: inline-block;
  margin-left: 8px;
  color: var(--light-silver);
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.faq-item__cta:hover { color: var(--white); text-decoration: underline; }

/* hide items filtered out by search, without removing from DOM */
.faq-item[hidden],
.faq-category[hidden] { display: none; }

/* ---------- Periodic CTA band ---------- */
.faq-cta-band {
  margin: 12px 0 44px;
  padding: 36px 32px;
  border-radius: var(--radius-lg);
  background: var(--silver-gradient);
  color: var(--black);
  text-align: center;
}
.faq-cta-band__title { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.faq-cta-band__text { font-size: 0.95rem; margin-bottom: 20px; opacity: 0.8; }
.faq-cta-band .btn--primary {
  background: var(--black);
  color: var(--white);
  box-shadow: none;
}
.faq-cta-band .btn--primary:hover { filter: brightness(1.3); }

/* ---------- No results ---------- */
.faq-noresults {
  grid-column: 1 / -1;
  text-align: center;
  max-width: 480px;
  margin: 40px auto;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}
.faq-noresults .btn { margin-top: 20px; }

/* ---------- Final CTA ---------- */
.faq-final-cta__text {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 620px;
  margin: 16px auto 32px;
  line-height: 1.7;
}
.faq-final-cta__brand {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.8;
}
.faq-final-cta__brand-name {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 1rem;
  color: var(--white);
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .faq-layout { grid-template-columns: 1fr; gap: 24px; }
  .faq-catnav {
    position: static;
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
    margin-bottom: 8px;
  }
  .faq-catnav__list { flex-direction: row; gap: 8px; }
  .faq-catnav__link {
    white-space: nowrap;
    border-left: none;
    border: 1px solid var(--border);
  }
  .faq-catnav__link.is-active { border-color: var(--silver-light); }
}

@media (max-width: 760px) {
  .faq-section { padding-top: 48px; }
  .faq-item__row { padding: 6px 8px 6px 16px; }
  .faq-item__panel { padding: 0 16px 16px; }
  .faq-cta-band { padding: 28px 22px; }
}

@media (max-width: 480px) {
  .faq-item__q-text { font-size: 0.94rem; }
  .faq-search__box input { padding: 14px 10px; font-size: 0.95rem; }
}
