/**
 * @file
 * La page « Questions fréquentes » sous TC Horizon : recherche, catégories,
 * une carte par question. Même charte que le devis (devis.css).
 */

.tc-faq {
  --dv-vert: var(--tc-accent, #00251B);
  --dv-vert-clair: var(--tc-accent-light, #E8EFE9);
  --dv-sable: var(--tc-primary, #CDA06D);
  --dv-sable-fonce: var(--tc-primary-strong, #8F6530);
  --dv-jaune: var(--tc-action, #FCDB1A);
  --dv-encre: var(--tc-ink, #2A2C29);
  --dv-gris: var(--tc-ink-soft, #5A5C58);
  --dv-bord: var(--tc-border, #E3E1DC);
  --dv-fond: var(--tc-surface-soft, #F6F6F4);
  font-size: 17px;
  line-height: 1.55;
  color: var(--dv-encre);
}

.tc-faq *,
.tc-faq *::before,
.tc-faq *::after {
  box-sizing: border-box;
}

/* Boutons du bandeau final et de la recherche vide. */
.tc-faq__bouton,
.tc-faq__effacer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--dv-jaune);
  font: inherit;
  font-weight: 800;
  color: var(--tc-on-action, #00251B);
  text-decoration: none;
  cursor: pointer;
}

.tc-faq__bouton:focus-visible,
.tc-faq__effacer:focus-visible {
  outline: 3px solid var(--tc-focus, var(--dv-jaune));
  outline-offset: 3px;
}

.tc-faq__effacer {
  border-color: var(--dv-bord);
  background: #FFFFFF;
}

.tc-faq__bouton--ligne {
  border-color: rgb(255 255 255 / 50%);
  background: transparent;
  color: #FFFFFF;
}

.tc-faq [hidden] { display: none !important; }
.tc-faq__tete .tc-devis-tete__inner { padding-bottom: 36px; }
.tc-faq__recherche { position: relative; max-width: 640px; margin: 22px 0 0; }
.tc-faq__recherche input {
  width: 100%; min-height: 60px; padding: 14px 20px 14px 56px; border: 2px solid #CFCBC3; border-radius: 999px;
  background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23141311' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E") left 20px center / 22px no-repeat;
  font: inherit; font-size: 17.5px; color: var(--dv-encre);
}
.tc-faq__recherche input:focus-visible { outline: 3px solid var(--tc-focus, var(--dv-jaune)); outline-offset: 2px; border-color: var(--dv-vert); }
.tc-faq__etat { margin: 10px 0 0 20px; font-size: 15px; color: var(--dv-gris); min-height: 1.4em; }

.tc-faq__corps { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 48px; align-items: start; max-width: 1180px; margin: 0 auto; padding: 44px var(--tc-gutter, 24px) 88px; }
/* Sous l'en-tête du site quand il réapparaît (--tc-header-visible, posé par le
   script de l'en-tête de TC Horizon ; zéro ailleurs). */
.tc-faq__nav { position: sticky; top: calc(var(--tc-chrome-offset, 0px) + var(--tc-header-visible, 0px) + 24px); transition: top 250ms ease; }
@media (prefers-reduced-motion: reduce) { .tc-faq__nav { transition: none; } }
.tc-faq__nav-titre { margin: 0 0 10px; font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dv-sable-fonce); }
.tc-faq__nav ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.tc-faq__nav a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; padding: 0 14px; border-radius: 12px; font-weight: 700; color: var(--dv-encre); text-decoration: none; }
.tc-faq__nav a:hover { background: var(--dv-fond); }
.tc-faq__nav a.is-courant { background: var(--dv-vert); color: #FFFFFF; }
.tc-faq__nav a.is-courant span { background: rgba(255,255,255,.18); color: #FFFFFF; }
.tc-faq__nav a span { min-width: 28px; padding: 1px 8px; border-radius: 999px; background: var(--dv-vert-clair); font-size: 14px; text-align: center; color: var(--dv-vert); }
.tc-faq__nav a:focus-visible { outline: 3px solid var(--tc-focus, var(--dv-jaune)); outline-offset: 2px; }

.tc-faq__groupe { margin: 0 0 40px; scroll-margin-top: calc(var(--tc-chrome-offset, 0px) + 24px); }
.tc-faq__groupe h2 { margin: 0 0 14px; font-family: var(--tc-serif, Georgia, serif); font-size: 28px; color: var(--dv-vert); }
/* Chaque question est une carte à part : pas de cadre autour de la liste,
   et on neutralise le cadre par défaut que le thème donne aux <details>. */
.tc-faq__liste { display: grid; gap: 10px; }
.tc-faq__q {
  margin: 0; border: 1px solid var(--dv-bord); border-radius: 16px; background: #FFFFFF;
  box-shadow: 0 1px 0 rgb(20 19 17 / 3%); transition: border-color .15s ease, box-shadow .15s ease;
}
.tc-faq__q:hover { border-color: #CFCBC3; }
.tc-faq__q[open] { border-color: var(--dv-sable); box-shadow: 0 10px 26px rgb(20 19 17 / 8%); }
.tc-faq__q > summary { border-radius: 16px; }
.tc-faq__q[open] > summary { border-radius: 16px 16px 0 0; }
.tc-faq__q > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 64px; padding: 16px 22px;
  font-size: 17.5px; font-weight: 700; line-height: 1.4; color: var(--dv-encre); cursor: pointer; list-style: none;
}
.tc-faq__q > summary::-webkit-details-marker { display: none; }
.tc-faq__q > summary::after {
  content: ""; flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--dv-vert-clair) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23141311' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E") center / 16px no-repeat;
  transition: transform .2s ease;
}
.tc-faq__q[open] > summary::after { transform: rotate(45deg); background-color: var(--tc-highlight, var(--dv-jaune)); }
.tc-faq__q > summary:hover { background: var(--dv-fond); }
.tc-faq__q[open] > summary:hover { background: transparent; }
.tc-faq__q > summary:focus-visible { outline: 3px solid var(--tc-focus, var(--dv-jaune)); outline-offset: -3px; }
.tc-faq__q:target > summary { background: var(--dv-fond); }
.tc-faq__r { padding: 0 22px 20px; font-size: 16.5px; line-height: 1.7; color: var(--dv-gris); }
.tc-faq__r > :first-child { margin-top: 0; }
.tc-faq__r p { margin: 0 0 .9em; }
.tc-faq__r ul { margin: 0 0 1em; padding-left: 1.2em; }
.tc-faq__r a { color: var(--dv-vert); font-weight: 600; text-underline-offset: 3px; overflow-wrap: anywhere; }
.tc-faq__lien { display: inline-block; margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--dv-sable-fonce) !important; }
mark.tc-faq__trouve { padding: 0 2px; border-radius: 3px; background: var(--tc-highlight-soft, #FFE98A); color: inherit; }

.tc-faq__vide { padding: 36px 28px; border: 2px dashed var(--dv-sable); border-radius: 22px; text-align: center; }
.tc-faq__vide p { margin: 0 0 16px; color: var(--dv-gris); }

.tc-faq__fin { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; margin-top: 12px; padding: 28px 30px; border-radius: 22px; background: var(--dv-vert); color: #FFFFFF; }
.tc-faq__fin h2 { margin: 0 0 4px; font-family: var(--tc-serif, Georgia, serif); font-size: 24px; color: #FFFFFF; }
.tc-faq__fin p { margin: 0; color: rgba(255,255,255,.85); }
.tc-faq__fin-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.tc-faq__bouton--ligne { border-color: rgba(255,255,255,.5); background: transparent; color: #FFFFFF; }

@media (max-width: 1000px) {
  .tc-faq__corps { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 24px; }
  .tc-faq__nav { position: sticky; top: calc(var(--tc-chrome-offset, 0px) + var(--tc-header-visible, 0px)); z-index: 2; margin: 0 calc(-1 * var(--tc-gutter, 24px)); padding: 10px var(--tc-gutter, 24px); background: #FFFFFF; border-bottom: 1px solid var(--dv-bord); }
  .tc-faq__nav-titre { display: none; }
  .tc-faq__nav ul { display: flex; gap: 8px; overflow-x: auto; }
  .tc-faq__nav a { white-space: nowrap; border: 1px solid var(--dv-bord); min-height: 42px; }
  .tc-faq__fin { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .tc-faq__q > summary { padding: 14px 16px; font-size: 16.5px; }
  .tc-faq__r { padding: 0 16px 18px; }
  .tc-faq__groupe h2 { font-size: 24px; }
}
