/*
 * Perfect Go Theme — Main CSS (styles communs à toutes les pages)
 * Chargé en async sur chaque page.
 * Les styles spécifiques sont dans home.css et page-lead.css.
 */

/* ─── Nav sticky ─────────────────────────────────────────────────────────── */
.site-nav { position: sticky; top: 0; z-index: 100; }

/* ─── Sections génériques (utilisées partout) ────────────────────────────── */
.section { padding: 72px var(--pad-h); border-bottom: 2px solid var(--noir); }
.section--beige { background: var(--beige); }
.section--dark  { background: var(--noir); color: var(--blanc); }

/* ─── Grilles (homepage, archive, lead) ──────────────────────────────────── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--noir);
}
.grid-3 > * { background: var(--blanc); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  background: var(--noir);
}
.grid-2 > * { background: var(--blanc); }

/* ─── Cards articles (homepage blog + archive) ───────────────────────────── */
.article-card {
  border: var(--border);
  background: var(--blanc);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}
.article-card:hover { transform: translateY(-4px); }
.article-card__image {
  background: var(--beige);
  height: 200px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: var(--border);
  overflow: hidden;
  flex-shrink: 0;
}
.article-card__image img { width: 100%; height: 200px; object-fit: cover; }
.article-card__body { padding: 28px 24px; flex: 1; display: flex; flex-direction: column; }
.article-card__date { font-size: 11px; color: #999; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 12px; }
.article-card__title { font-family: var(--font-title); font-weight: 800; font-size: 20px; line-height: 1.2; margin: 0 0 16px; color: var(--noir); flex: 1; }
.article-card__cta { font-size: 14px; font-weight: 600; color: var(--orange); margin-top: auto; }

/* ─── Accordéons natifs <details>/<summary> (homepage FAQ, articles, lead) ── */
details { border: var(--border); background: var(--blanc); }
details + details { margin-top: -2px; }
details summary {
  padding: 24px 28px;
  cursor: pointer;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 18px;
  color: var(--noir);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  -webkit-user-select: none;
  user-select: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: '+'; color: var(--orange); font-size: 24px; font-weight: 400; flex-shrink: 0; transition: transform .2s ease; }
details[open] > summary::after { content: '−'; }
.details-content { padding: 20px 28px 28px; border-top: var(--border); font-size: 15px; color: #555; line-height: 1.7; }
.details-content p { margin: 0 0 12px; }
.details-content p:last-child { margin-bottom: 0; }
.details-content ul { margin: 0; padding-left: 20px; list-style: disc; }
.details-content li { margin-bottom: 6px; }
.details-num { background: var(--orange); color: var(--blanc); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.faq-list { display: flex; flex-direction: column; gap: 2px; }

/* ─── Contenu article (single post) ─────────────────────────────────────── */
.article-content { font-size: 17px; color: #3d3d3a; line-height: 1.8; }
.article-content h2 { font-family: var(--font-title); font-weight: 800; font-size: 32px; margin: 48px 0 20px; color: var(--noir); letter-spacing: -.02em; }
.article-content h3 { font-family: var(--font-title); font-weight: 800; font-size: 24px; margin: 36px 0 16px; color: var(--noir); }
.article-content p { margin: 0 0 24px; }
.article-content ul, .article-content ol { margin: 0 0 24px; padding-left: 24px; list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: 8px; }
.article-content strong { font-weight: 700; color: var(--noir); }
.article-content a { color: var(--orange); text-decoration: underline; }
.article-content a:hover { text-decoration: none; }
.article-content code { background: var(--beige); padding: 2px 6px; font-family: 'Courier New', monospace; font-size: 15px; }
.article-content pre { background: var(--noir); color: var(--beige); padding: 20px; overflow-x: auto; font-family: 'Courier New', monospace; font-size: 14px; margin: 0 0 24px; }
.article-content pre code { background: none; padding: 0; font-size: inherit; color: inherit; }

/* ─── Tableaux dans les articles ─────────────────────────────────────────── */
.article-content table,
.table-blog {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 32px;
  font-size: 15px;
}
.article-content table thead tr,
.table-blog thead tr {
  background: var(--noir);
  color: var(--blanc);
}
.article-content table thead th,
.table-blog thead th {
  padding: 14px 20px;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: left;
  color: #FFFFFF !important;
}
.article-content table tbody tr,
.table-blog tbody tr {
  border-bottom: 1px solid #E8E2D5;
}
.article-content table tbody tr:nth-child(even),
.table-blog tbody tr:nth-child(even) {
  background: var(--beige);
}
.article-content table tbody tr:hover,
.table-blog tbody tr:hover {
  background: #EDE9E0;
}
.article-content table td,
.article-content table th,
.table-blog td,
.table-blog th {
  padding: 14px 20px;
  vertical-align: top;
  line-height: 1.6;
  color: #3d3d3a;
}
.article-content table strong,
.table-blog strong { color: var(--noir); }

/* ─── Sommaire ───────────────────────────────────────────────────────────── */
.sommaire { background: var(--beige); border: var(--border); padding: 28px 32px; margin-bottom: 48px; }
.sommaire-title { font-family: var(--font-title); font-weight: 800; font-size: 18px; margin-bottom: 20px; color: var(--noir); }
.sommaire-list { margin: 0; padding-left: 20px; list-style: decimal; font-size: 15px; color: #555; line-height: 2; }
.sommaire-list a { color: var(--noir); font-weight: 500; transition: color .15s; }
.sommaire-list a:hover { color: var(--orange); }

/* ─── Encart résumé ──────────────────────────────────────────────────────── */
.encart-resume { border: var(--border); display: grid; grid-template-columns: 80px 1fr; margin-bottom: 48px; }
.encart-resume__label { background: var(--noir); display: flex; align-items: center; justify-content: center; border-right: var(--border); }
.encart-resume__label span { font-family: var(--font-title); font-weight: 800; font-size: 13px; color: var(--orange); letter-spacing: .12em; text-transform: uppercase; writing-mode: vertical-rl; transform: rotate(180deg); }
.encart-resume__content { padding: 28px 32px; }
.encart-resume__text { font-size: 17px; color: #3d3d3a; line-height: 1.75; margin: 0; }

/* ─── CTA inline article ─────────────────────────────────────────────────── */
.cta-audit { background: var(--noir); color: var(--blanc); padding: 40px; margin: 64px 0; border: var(--border); }
.cta-audit__title { font-family: var(--font-title); font-weight: 800; font-size: 24px; margin-bottom: 12px; }
.cta-audit__desc { font-size: 15px; color: #B0B0B0; margin: 0 0 24px; line-height: 1.6; }

/* ─── Articles similaires ────────────────────────────────────────────────── */
.related-posts { margin-top: 80px; padding-top: 48px; border-top: var(--border); }
.related-posts__title { font-family: var(--font-title); font-weight: 800; font-size: 28px; margin: 0 0 32px; color: var(--noir); }
.related-posts__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.related-card { border: var(--border); background: var(--blanc); display: flex; flex-direction: column; }
.related-card__image { background: var(--beige); height: 140px; display: flex; align-items: center; justify-content: center; border-bottom: var(--border); overflow: hidden; flex-shrink: 0; }
.related-card__image img { width: 100%; height: 140px; object-fit: cover; }
.related-card__body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.related-card__title { font-family: var(--font-title); font-weight: 800; font-size: 16px; line-height: 1.3; margin: 0 0 12px; color: var(--noir); flex: 1; }
.related-card__cta { font-size: 13px; font-weight: 600; color: var(--orange); }

/* ─── Header article ─────────────────────────────────────────────────────── */
.article-header { max-width: var(--max-article); margin: 0 auto; padding: 72px 40px 0; }
.article-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.article-meta__cat { font-size: 11px; color: var(--orange); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.article-meta__sep { font-size: 11px; color: #999; }
.article-meta__date, .article-meta__time { font-size: 11px; color: #999; font-weight: 500; }
.article-title { font-family: var(--font-title); font-weight: 800; font-size: 48px; line-height: 1.1; letter-spacing: -.04em; margin: 0 0 32px; color: var(--noir); }
.article-featured-image { border: var(--border); margin-bottom: 48px; overflow: hidden; height: 400px; }
.article-featured-image img { width: 100%; height: 400px; object-fit: cover; display: block; }

/* ─── Archive blog ───────────────────────────────────────────────────────── */
.archive-header { padding: 72px var(--pad-h) 56px; border-bottom: var(--border); }
.archive-header__label { font-family: var(--font-title); font-weight: 800; font-size: 11px; color: var(--orange); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 12px; }
.archive-header__title { font-family: var(--font-title); font-weight: 800; font-size: 56px; line-height: 1; letter-spacing: -.04em; margin: 0 0 20px; color: var(--noir); }
.archive-header__desc { font-size: 17px; color: #555; line-height: 1.7; margin: 0; max-width: 580px; }
.archive-articles { padding: 72px var(--pad-h); }
.archive-articles__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 8px; padding: 48px 0; flex-wrap: wrap; }
.pagination a, .pagination span { border: var(--border); padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--noir); display: inline-block; transition: background .15s, color .15s; }
.pagination a:hover { background: var(--noir); color: var(--blanc); }
.pagination .current { background: var(--orange); color: var(--blanc); border-color: var(--orange); }
.pagination .dots { border: none; padding: 10px 4px; }

/* ─── Encart auteur ──────────────────────────────────────────────────────── */
.encart-auteur { display: grid; grid-template-columns: 80px 1fr; gap: 28px; align-items: start; border: var(--border); padding: 32px 36px; margin: 56px 0 0; background: var(--beige); }
.encart-auteur__photo { width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--orange); object-fit: cover; display: block; }
.encart-auteur__body { display: flex; flex-direction: column; gap: 12px; }
.encart-auteur__meta { display: flex; flex-direction: column; gap: 2px; }
.encart-auteur__label { font-size: 10px; font-weight: 600; color: var(--orange); letter-spacing: .14em; text-transform: uppercase; }
.encart-auteur__name { font-family: var(--font-title); font-weight: 800; font-size: 20px; margin: 4px 0 0; color: var(--noir); }
.encart-auteur__name a { color: var(--noir); }
.encart-auteur__name a:hover { color: var(--orange); }
.encart-auteur__role { font-size: 13px; color: #777; font-weight: 500; }
.encart-auteur__bio { font-size: 15px; color: #3d3d3a; line-height: 1.7; margin: 0; }
.encart-auteur__footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid #ddd; }
.encart-auteur__certs { font-size: 11px; font-weight: 600; color: #999; letter-spacing: .04em; }
.encart-auteur__links { display: flex; align-items: center; gap: 16px; }
.encart-auteur__link { font-size: 13px; font-weight: 600; color: var(--orange); display: flex; align-items: center; gap: 5px; transition: opacity .15s; }
.encart-auteur__link:hover { opacity: .75; }

/* ─── Footer global (toutes les pages) ──────────────────────────────────── */
.site-footer { padding: 48px var(--pad-h); background: var(--beige); border-top: var(--border); }
.site-footer--extended { padding: 60px var(--pad-h) 40px; }

/* Grille 3 colonnes (visible si "Afficher les colonnes de liens" coché) */
.site-footer__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; margin-bottom: 40px; }
.site-footer__col h4 { font-family: var(--font-title); font-weight: 800; font-size: 13px; color: var(--noir); margin: 0 0 20px; letter-spacing: .02em; }
.site-footer__col-links { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.site-footer__col-links a,
.site-footer__col-links span { color: #555; }
.site-footer__col-links a:hover { color: var(--orange); }
.site-footer__col-links a.active { color: var(--orange); font-weight: 500; }

/* Barre du bas : logo + tagline + certs + copyright */
.site-footer__bottom-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; padding-top: 24px; }
.site-footer__bottom-bar--bordered { border-top: var(--border); }
.site-footer__bottom-left { display: flex; flex-direction: column; gap: 4px; }
.site-footer__bottom-right { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.site-footer__logo { font-family: var(--font-title); font-weight: 800; font-size: 16px; color: var(--noir); }
.site-footer__logo span { color: var(--orange); }
.site-footer__tagline { font-size: 13px; color: #777; }
.site-footer__certs { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.site-footer__cert-badge { font-size: 12px; color: #999; font-weight: 400; }
.site-footer__copyright { font-size: 12px; color: #999; white-space: nowrap; }

/* ─── Pages légales (Mentions légales, CGV) ──────────────────────────────── */
.legal-page { max-width: 780px; margin: 60px auto; padding: 0 var(--pad-h) 80px; }
.legal-page h1 { font-family: var(--font-title); font-weight: 800; font-size: 40px; letter-spacing: -.03em; color: var(--noir); margin: 0 0 8px; line-height: 1.15; }
.legal-page > p:first-of-type { font-size: 13px; color: #999; margin: 0 0 48px; }
.legal-page h2 { font-family: var(--font-title); font-weight: 800; font-size: 20px; color: var(--noir); margin: 48px 0 16px; padding-top: 48px; border-top: var(--border); }
.legal-page h3 { font-family: var(--font-title); font-weight: 700; font-size: 16px; color: var(--noir); margin: 24px 0 10px; }
.legal-page p { font-size: 15px; color: #444; line-height: 1.75; margin: 0 0 16px; }
.legal-page ul { margin: 0 0 16px 24px; padding: 0; }
.legal-page ul li { font-size: 15px; color: #444; line-height: 1.75; margin-bottom: 6px; }
.legal-page a { color: var(--orange); text-decoration: underline; }
.legal-page code { background: #F5F5F5; border: 1px solid #E8E8E8; padding: 2px 6px; border-radius: 3px; font-size: 13px; font-family: monospace; }

/* ─── Contact Form 7 — charte graphique ─────────────────────────────────── */

/* Wrapper global */
.wpcf7 { max-width: 560px; }

/* Supprimer le <br> que CF7 met entre label et input */
.wpcf7 form label br { display: none; }

/* Chaque champ = un bloc avec espacement */
.wpcf7 form p {
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
}

/* Label : petite typo Syne uppercase */
.wpcf7 form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--noir);
}

/* Wrap du champ = pleine largeur */
.wpcf7 .wpcf7-form-control-wrap { display: block; width: 100%; }

/* Inputs et textarea */
.wpcf7 .wpcf7-form-control.wpcf7-text,
.wpcf7 .wpcf7-form-control.wpcf7-email,
.wpcf7 .wpcf7-form-control.wpcf7-textarea {
  display: block;
  width: 100% !important;
  border: var(--border);
  border-radius: 0;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--noir);
  background: var(--blanc);
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  line-height: 1.5;
}
.wpcf7 .wpcf7-form-control.wpcf7-text:focus,
.wpcf7 .wpcf7-form-control.wpcf7-email:focus,
.wpcf7 .wpcf7-form-control.wpcf7-textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(196,68,10,.08);
}
.wpcf7 .wpcf7-form-control.wpcf7-textarea {
  resize: vertical;
  min-height: 180px;
}

/* Erreurs de validation */
.wpcf7 .wpcf7-not-valid { border-color: #C0392B !important; box-shadow: none !important; }
.wpcf7 .wpcf7-not-valid-tip { font-size: 12px; color: #C0392B; margin-top: 6px; display: block; font-family: var(--font-body); }

/* Turnstile Cloudflare */
.cf7-cf-turnstile { margin: 8px 0 28px !important; }

/* Bouton Envoyer — !important pour écraser les styles inline de CF7 */
.wpcf7-submit,
.wpcf7 input[type="submit"] {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  background: var(--orange) !important;
  color: var(--blanc) !important;
  font-family: var(--font-title) !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  letter-spacing: .1em !important;
  text-transform: uppercase !important;
  border: 2px solid var(--orange) !important;
  padding: 16px 44px !important;
  cursor: pointer !important;
  transition: background .2s, border-color .2s !important;
  -webkit-appearance: none !important;
  border-radius: 0 !important;
  line-height: 1 !important;
  min-height: 52px;
}
.wpcf7-submit:hover,
.wpcf7 input[type="submit"]:hover {
  background: var(--noir) !important;
  border-color: var(--noir) !important;
}
/* Spinner CF7 */
.wpcf7-spinner { margin-left: 10px; }

/* Message de réponse succès / erreur */
.wpcf7 .wpcf7-response-output {
  border: var(--border);
  padding: 16px 20px;
  margin: 24px 0 0;
  font-size: 14px;
  font-family: var(--font-body);
  line-height: 1.6;
}
.wpcf7 .wpcf7-mail-sent-ok {
  border-color: #27AE60;
  background: #F0FFF4;
  color: #1E8449;
}
.wpcf7 .wpcf7-mail-sent-ng,
.wpcf7 .wpcf7-aborted { border-color: #C0392B; color: #C0392B; }
.wpcf7 .wpcf7-validation-errors,
.wpcf7 .wpcf7-acceptance-missing { border-color: var(--orange); color: var(--orange); }

/* ─── Responsive commun ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --pad-h: 32px; }
  .grid-3, .archive-articles__grid, .related-posts__grid { grid-template-columns: repeat(2, 1fr); }
  .encart-auteur { padding: 24px; gap: 20px; }
}

@media (max-width: 768px) {
  :root { --pad-h: 20px; --nav-h: 72px; }
  /* ─── Nav mobile : burger + panneau déroulant ──────────────────────────── */
  .site-nav {
    padding: 0 20px;
    flex-wrap: wrap;
    height: auto;
    min-height: var(--nav-h);
  }
  .site-nav__logo { height: var(--nav-h); display: flex; align-items: center; }
  .site-nav__burger { display: flex; margin-left: auto; }

  /* Panneau fermé par défaut — ouvert via .is-open posé par main.js */
  .site-nav__menu,
  .site-nav__actions { display: none; }
  .site-nav.is-open .site-nav__menu,
  .site-nav.is-open .site-nav__actions {
    display: flex;
    flex: 0 0 100%;
    width: 100%;
  }

  .site-nav__menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    height: auto;
    border-top: var(--border);
  }
  .site-nav__item {
    height: auto;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .site-nav__item > a { flex: 1; padding: 14px 0; font-size: 17px; }
  .site-nav__toggle { width: 44px; height: 44px; }

  /* Sous-pages : accordéon, ouvert au clic sur la flèche */
  .site-nav__submenu {
    position: static;
    transform: none;
    display: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    margin: 0 0 8px;
    padding: 0 0 4px 14px;
    border: none;
    border-left: 2px solid rgba(12, 12, 11, 0.15);
    box-shadow: none;
  }
  .site-nav__item.is-open .site-nav__submenu { display: block; }
  .site-nav__submenu a { padding: 12px 8px; font-size: 15px; }

  /* LinkedIn + CTA sous le menu */
  .site-nav__linkedin { display: flex; }
  .site-nav.is-open .site-nav__actions {
    align-items: center;
    gap: 12px;
    padding: 16px 0 20px;
  }
  .site-nav.is-open .site-nav__actions .btn-primary { flex: 1; text-align: center; }
  .grid-3, .grid-2, .archive-articles__grid, .related-posts__grid { grid-template-columns: 1fr; }
  .article-title { font-size: 32px; }
  .archive-header__title { font-size: 40px; }
  .encart-auteur { grid-template-columns: 1fr; gap: 16px; }
  .encart-auteur__footer { flex-direction: column; align-items: flex-start; }
  .site-footer__bottom-bar { flex-direction: column; align-items: flex-start; }
  .site-footer__bottom-right { flex-direction: column; align-items: flex-start; gap: 12px; }
  .site-footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .encart-resume { grid-template-columns: 60px 1fr; }
  .article-featured-image, .article-featured-image img { height: 250px; }
}
