/* ══════════════════════════════════════════════════════════════
   FAQ.CSS — Styles propres à la section FAQ uniquement.
   Ce fichier suppose que /assets/tokens.css est déjà chargé
   (couleurs, polices, nav, footer).
   ══════════════════════════════════════════════════════════════ */

/* Page plus large sur toute la section FAQ, tout en gardant une
   limite raisonnable sur très grand écran pour rester lisible. */
.container { max-width: 1400px; }

/* ─── FIL D'ARIANE ─── */
.faq-breadcrumb {
  position: static;
  padding: 20px 0;
  font-size: 13px;
  color: var(--muted);
}
.faq-breadcrumb a { color: var(--muted); transition: color .15s; }
.faq-breadcrumb a:hover { color: var(--navy); }
.faq-breadcrumb .sep { margin: 0 6px; color: var(--border); }
.faq-breadcrumb .current { color: var(--navy); font-weight: 600; }

/* ─── INTRO FAQ (page d'accueil) ─── */
.faq-hero {
  padding: 56px 0 48px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.faq-hero h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800; color: var(--navy);
  letter-spacing: -.02em; margin-bottom: 14px;
}
.faq-hero p {
  font-size: 16px; color: var(--body-txt);
  max-width: 480px; margin: 0 auto;
}

/* Barre de recherche — désactivée pour l'instant (étape future) */
.faq-search {
  max-width: 560px; margin: 32px auto 0; position: relative;
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 18px;
  transition: border-color .15s, box-shadow .15s;
}
.faq-search:focus-within { border-color: var(--navy); box-shadow: 0 4px 16px rgba(3,50,92,0.08); }
.faq-search input {
  border: none; background: none; font-family: var(--font);
  font-size: 15px; color: var(--ink); width: 100%; outline: none;
}
.faq-search input::placeholder { color: var(--muted); }

/* ─── RÉSULTATS DE RECHERCHE INSTANTANÉS ─── */
.faq-search-results {
  max-width: 560px; margin: 8px auto 0;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
  box-shadow: 0 8px 24px rgba(3,50,92,0.08);
}
.faq-search-result {
  display: block; padding: 14px 18px; text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.faq-search-result:last-child { border-bottom: none; }
.faq-search-result:hover, .faq-search-result.is-active { background: var(--surface); }
.faq-search-result .fsr-title { font-size: 14.5px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.faq-search-result .fsr-title mark { background: var(--green-pale); color: var(--navy); border-radius: 3px; padding: 0 2px; }
.faq-search-result .fsr-cat { font-size: 12px; color: var(--navy); font-weight: 600; }
.faq-search-result .fsr-excerpt { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.faq-search-empty { padding: 18px; text-align: center; font-size: 14px; color: var(--muted); }

/* ─── QUESTIONS FRÉQUENTES (section à part, fond teinté, grille 2 colonnes) ─── */
.faq-popular-section {
  background: var(--surface);
  padding: 56px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.faq-popular-section .eyebrow {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--navy); margin-bottom: 10px;
}
.faq-popular-section h2 {
  font-size: 24px; font-weight: 800; color: var(--navy);
  letter-spacing: -.01em; margin-bottom: 24px;
}
.faq-popular-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.faq-popular-grid .faq-question-item { background: var(--white); padding: 18px 20px; }
@media (max-width: 700px) {
  .faq-popular-grid { grid-template-columns: 1fr; }
}

/* ─── MESSAGE CONTACT EN DERNIER RECOURS ─── */
.faq-last-resort {
  padding: 32px 0 72px; text-align: center;
}
.faq-last-resort p {
  font-size: 14.5px; color: var(--muted); line-height: 1.7;
}
.faq-last-resort a {
  color: var(--navy); font-weight: 700; text-decoration: underline;
  text-underline-offset: 2px;
}


/* ─── GRILLE DES CATÉGORIES ─── */
.faq-categories {
  padding: 56px 0 88px;
}
.faq-cat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
/* Deuxième rangée (les catégories les moins consultées), centrée sous la
   grille principale : on utilise la même grille à 3 colonnes, avec une
   colonne vide en premier — c'est la façon la plus simple de centrer
   2 cartes sous une grille de 3, à la main, sans calculs compliqués. */
.faq-cat-grid-secondary {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin-top: 20px;
}
.faq-cat-spacer { visibility: hidden; }

.faq-cat-card {
  display: flex; align-items: flex-start; gap: 18px; padding: 26px 24px;
  border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.faq-cat-card:hover {
  border-color: var(--navy);
  box-shadow: 0 8px 32px rgba(3,50,92,0.07);
  transform: translateY(-2px);
}
.faq-cat-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center;
  justify-content: center;
}
.faq-cat-icon img {
  width: 100%; height: 100%; object-fit: contain;
}
.faq-cat-card-body { flex: 1; min-width: 0; }
.faq-cat-card h3 {
  font-size: 16px; font-weight: 700; color: var(--navy);
  margin-bottom: 6px; line-height: 1.3;
}
.faq-cat-card p {
  font-size: 13.5px; color: var(--muted); line-height: 1.6;
}
.faq-cat-count {
  display: inline-block; margin-top: 14px;
  font-size: 12px; font-weight: 600; color: var(--navy);
}

/* ─── PAGE CATÉGORIE (liste de questions) ─── */
.faq-cat-header { padding: 24px 0 40px; }
.faq-cat-header .eyebrow {
  display: inline-block; font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--navy); margin-bottom: 12px;
}
.faq-cat-header h1 {
  font-size: clamp(24px, 3.5vw, 34px); font-weight: 800;
  color: var(--navy); letter-spacing: -.02em; margin-bottom: 12px;
}
.faq-cat-header p { font-size: 15px; color: var(--body-txt); max-width: 560px; }

.faq-question-list { padding-bottom: 88px; display: flex; flex-direction: column; gap: 12px; }
.faq-question-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 20px 24px;
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  background: var(--white); transition: border-color .15s, background .15s;
}
.faq-question-item:hover { border-color: var(--navy); background: var(--surface); }
.faq-question-item span { font-size: 15px; font-weight: 600; color: var(--ink); }
.faq-question-item svg { width: 14px; height: 14px; color: var(--navy); flex-shrink: 0; }
.faq-tag-a-venir {
  font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--surface); border-radius: 100px;
  padding: 2px 9px; margin-left: 10px; white-space: nowrap;
}

/* ─── PAGE ARTICLE ─── */
.faq-article { padding: 8px 0 72px; max-width: 1200px; }
.faq-article-body > p, .faq-article-body > ul, .faq-article-body > ol, .faq-article-body > .faq-callout { max-width: 760px; }
.faq-article h1 {
  font-size: clamp(24px, 3.5vw, 32px); font-weight: 800;
  color: var(--navy); letter-spacing: -.02em; line-height: 1.25;
  margin-top: 24px;
  margin-bottom: 28px;
}
.faq-article-body { font-size: 16px; color: var(--body-txt); line-height: 1.75; }
.faq-article-body h2 { font-size: 18px; font-weight: 700; color: var(--navy); margin: 32px 0 14px; }
.faq-article-body h3 { font-size: 15.5px; font-weight: 700; color: var(--ink); margin: 22px 0 8px; }
.faq-article-body p { margin-bottom: 18px; }
.faq-article-body ul, .faq-article-body ol { margin: 0 0 18px 20px; }
.faq-article-body ul { list-style-type: disc; }
.faq-article-body ol { list-style-type: decimal; }
.faq-article-body li { margin-bottom: 8px; list-style-type: inherit; display: list-item; }
.faq-article-body strong { color: var(--ink); }
.faq-article-body a {
  color: var(--navy); font-weight: 700;
  text-decoration: underline; text-decoration-color: var(--green);
  text-decoration-thickness: 2px; text-underline-offset: 2px;
  transition: color .15s;
}
.faq-article-body a:hover { color: var(--navy-mid); }
.faq-callout a { color: var(--navy); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* Liste des indicatifs téléphoniques, affichée sur 2 colonnes pour rester compacte */
.faq-flag-list {
  columns: 2; column-gap: 32px;
}
.faq-flag-list li { break-inside: avoid; }
@media (max-width: 640px) {
  .faq-flag-list { columns: 1; }
}

/* ─── VERSION MOBILE : cartes à la place du tableau ─── */
.faq-country-cards { display: none; }
@media (max-width: 768px) {
  .faq-table-wrap { display: none; }
  .faq-country-cards { display: block; margin: 8px 0 24px; }
}
.faq-country-card {
  border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px; margin-bottom: 12px; background: var(--white);
}
.faq-country-card.faq-row-unavailable { opacity: .45; }
.faq-country-card-name {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 800; color: var(--ink); margin-bottom: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.faq-country-card-docs { display: flex; flex-direction: column; gap: 10px; }
.faq-doc-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; color: var(--body-txt);
}
.faq-doc-row .ok, .faq-doc-row .no { margin: 0; }

.faq-flag-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 18px; border-radius: 3px;
  background: var(--surface); border: 1px solid var(--border); overflow: hidden;
  margin-right: 10px; vertical-align: middle; flex-shrink: 0;
}
.faq-flag-badge img {
  width: 100%; height: 100%; object-fit: cover;
}

/* ─── TABLEAU DES DOCUMENTS PAR PAYS ─── */
.faq-table-wrap {
  overflow-x: auto; margin: 8px 0 24px;
  border: 1.5px solid var(--border); border-radius: var(--radius-lg);
}
.faq-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.faq-table thead th {
  background: var(--navy); color: #fff;
  text-align: left; font-weight: 800; font-size: 17px;
  letter-spacing: .01em;
  padding: 24px 20px; white-space: nowrap;
}
.faq-table thead th.center, .faq-table td.center { text-align: center; }
.faq-table tbody td {
  padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.faq-table tbody tr:nth-child(even) { background: var(--surface); }
.faq-table tbody tr:hover { background: var(--green-pale); }
.faq-table tbody tr:last-child td { border-bottom: none; }
.faq-table td.country { font-weight: 700; color: var(--ink); white-space: nowrap; }

/* Cases colorées pour le statut (accepté / non accepté), plus lisibles qu'une simple icône */
.faq-table .ok, .faq-table .no, .faq-doc-row .ok, .faq-doc-row .no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  font-size: 14px; font-weight: 800;
}
.faq-table .ok, .faq-doc-row .ok { background: var(--green-pale); color: #0f8a52; border: 1.5px solid #0f8a52; }
.faq-table .no, .faq-doc-row .no { background: var(--surface); color: var(--muted); border: 1.5px solid var(--border); }

/* Encart "information importante" à l'intérieur d'un article */
.faq-callout {
  background: var(--green-pale); border-left: 4px solid var(--navy);
  border-radius: var(--radius-sm); padding: 16px 20px;
  margin: 4px 0 22px; font-size: 15px; line-height: 1.65;
}
.faq-callout strong { color: var(--navy); }

.faq-back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 700; color: var(--navy);
  margin-top: 8px;
}
.faq-back-link svg { width: 13px; height: 13px; transform: scaleX(-1); }

/* ─── ARTICLES CONNEXES (remplace le bouton "utile") ─── */
.faq-related {
  margin-top: 48px; padding-top: 32px;
  border-top: 1px solid var(--border);
}
.faq-related h2 {
  font-size: 16px; font-weight: 700; color: var(--navy);
  margin-bottom: 8px;
}
.faq-related > p {
  font-size: 14px; color: var(--muted); line-height: 1.6;
  margin-bottom: 20px; max-width: 620px;
}
.faq-related .faq-question-list { padding-bottom: 0; }

/* ─── RESPONSIVE ─── */
@media (max-width: 960px) {
  .faq-cat-grid, .faq-cat-grid-secondary { grid-template-columns: 1fr 1fr; }
  .faq-cat-spacer { display: none; }
}
@media (max-width: 640px) {
  .faq-cat-grid, .faq-cat-grid-secondary { grid-template-columns: 1fr; }
  .faq-cat-spacer { display: none; }
  .faq-question-item { padding: 16px 18px; }
}

/* ─── GRILLE DES PARTENAIRES (agences d'intérim, etc.) ─── */
.faq-partner-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px; margin: 0 0 16px;
}
.faq-partner-card {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); padding: 18px;
  display: flex; align-items: center; justify-content: center;
  height: 90px; transition: border-color .15s, box-shadow .15s;
}
.faq-partner-card:hover { border-color: var(--navy); box-shadow: 0 4px 16px rgba(3,50,92,0.06); }
.faq-partner-card img { max-width: 100%; max-height: 100%; object-fit: contain; }

.faq-franceconnect-badge {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); padding: 16px 24px;
  display: inline-flex; margin-bottom: 16px;
}
.faq-franceconnect-badge img { height: 40px; width: auto; }

/* ─── FILTRE TOGGLE (Tous les documents / FranceConnect) ─── */
.faq-filter-toggle {
  display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.faq-filter-btn {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font); font-size: 14px; font-weight: 700; color: var(--body-txt);
  background: var(--white); border: 2px solid var(--border); border-radius: var(--radius-md);
  padding: 12px 18px; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.faq-filter-btn svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); }
.faq-filter-btn:hover { border-color: var(--navy); }
.faq-filter-btn.is-active {
  background: var(--navy); border-color: var(--navy); color: #fff;
  box-shadow: 0 4px 14px rgba(3,50,92,0.25);
}
.faq-filter-btn.is-active svg { color: #fff; }
@media (max-width: 480px) { .faq-filter-toggle { flex-direction: column; } }
.faq-table tbody tr { cursor: pointer; }
.faq-table tbody tr.faq-row-unavailable { opacity: .45; }
.faq-table tbody tr.faq-row-selected { background: var(--navy) !important; }
.faq-table tbody tr.faq-row-selected td { color: #ffffff; }
.faq-table tbody tr.faq-row-selected td.country { color: #ffffff; font-weight: 800; }
.faq-table tbody tr.faq-row-selected .ok { background: #e8f9f2; }
.faq-table tbody tr.faq-row-selected .no { background: rgba(255,255,255,0.15); color: #d1d5db; border-color: rgba(255,255,255,0.3); }
.faq-table tbody tr.faq-row-reminder { cursor: default; background: var(--green-pale) !important; }
.faq-table tbody tr.faq-row-reminder td {
  padding: 6px 16px; font-size: 11px; font-weight: 700; color: var(--navy);
  text-transform: uppercase; letter-spacing: .03em; border-bottom: 2px solid var(--navy);
}
