/* =========================================================================
   Meilleures Agences Digitales — feuille de style de base (template)
   Les couleurs viennent des variables injectées par inc/head.php (config/site.php)
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--color-ink);
  background: var(--color-bg);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); margin: 0 0 .5rem; }
h2 { font-size: clamp(1.4rem, 2.5vw, 1.9rem); }

.container { width: min(1120px, 100% - 2rem); margin-inline: auto; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--color-ink); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }

/* --- Boutons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.25rem; border-radius: 10px; font-weight: 600; font-size: .95rem;
  border: 1.5px solid transparent; cursor: pointer; transition: transform .05s, background .2s, box-shadow .2s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-dark); }
.btn--accent { background: var(--color-accent); color: #1a1200; }
.btn--accent:hover { filter: brightness(.95); }
.btn--outline { background: transparent; color: var(--color-primary); border-color: currentColor; }
.btn--ghost { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.4); }
.btn--lg { padding: .9rem 1.6rem; font-size: 1.02rem; }
.btn--block { width: 100%; }

/* --- Header --- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-bottom: 1px solid #e5e9f0; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 66px; }
.site-header__brand { font-weight: 800; font-size: 1.15rem; color: var(--color-ink); display: flex; align-items: center; gap: .5rem; }
.site-header__brand:hover { text-decoration: none; }
.site-header__logo { color: var(--color-primary); }
.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav__list { display: flex; gap: 1.1rem; list-style: none; margin: 0; padding: 0; }
.site-nav__list a { color: var(--color-ink); font-weight: 500; font-size: .93rem; }
/* Menu déroulant */
.has-dropdown { position: relative; }
.dropdown-toggle { background: none; border: 0; padding: 0; font: inherit; font-weight: 500; font-size: .93rem; color: var(--color-ink); cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; }
.dropdown-toggle::after { content: ""; width: .4rem; height: .4rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
.dropdown { display: none; position: absolute; top: 100%; left: -.75rem; min-width: 14rem; margin: 0; padding: .4rem; list-style: none; background: #fff; border: 1px solid #e5e9f0; border-radius: 10px; box-shadow: 0 10px 30px rgba(15,23,42,.12); }
.dropdown a { display: block; padding: .5rem .75rem; border-radius: 6px; white-space: nowrap; }
.dropdown a:hover { background: var(--color-muted, #f1f5f9); text-decoration: none; }
.has-dropdown.is-open > .dropdown { display: block; }
@media (min-width: 901px) {
  .has-dropdown::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: .6rem; }
  .has-dropdown:hover > .dropdown, .has-dropdown:focus-within > .dropdown { display: block; }
}
.site-header__burger { display: none; background: none; border: 0; flex-direction: column; gap: 5px; padding: 8px; cursor: pointer; }
.site-header__burger span { width: 24px; height: 2px; background: var(--color-ink); display: block; }

@media (max-width: 900px) {
  .site-header__burger { display: flex; }
  .site-nav {
    position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: .5rem;
    background: #fff; border-bottom: 1px solid #e5e9f0; padding: 1rem; display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav__list { flex-direction: column; gap: .25rem; }
  .site-nav__list a { display: block; padding: .6rem 0; }
  .dropdown-toggle { padding: .6rem 0; width: 100%; justify-content: space-between; }
  .dropdown { position: static; box-shadow: none; border: 0; padding: 0 0 0 1rem; }
  .dropdown a { padding: .5rem 0; }
}

/* --- Hero --- */
.hero { background: linear-gradient(160deg, var(--color-primary-dark), var(--color-primary)); color: #fff; padding: clamp(3rem, 7vw, 5.5rem) 0; }
.hero__inner { text-align: center; max-width: 780px; margin-inline: auto; }
.hero__eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 600; opacity: .85; }
.hero__title span { color: var(--color-accent); }
.hero__lead { font-size: 1.1rem; opacity: .92; margin: 1rem auto 1.75rem; }
.hero__actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.hero__stats { list-style: none; display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; margin: 2.5rem 0 0; padding: 0; }
.hero__stats strong { display: block; font-size: 1.7rem; }
.hero__stats span { font-size: .85rem; opacity: .85; }

/* --- Sections --- */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section--muted { background: var(--color-muted); }
.section__title { margin: 0 0 .35rem; }
.section__intro { color: #55617a; margin: 0 0 2rem; max-width: 60ch; }
.section__header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.link-arrow::after { content: " →"; }

/* --- Grilles services / villes --- */
.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.service-card { border: 1px solid #e2e8f0; border-radius: 14px; padding: 1.25rem; background: #fff; color: var(--color-ink); transition: border-color .2s, box-shadow .2s, transform .1s; }
.service-card:hover { text-decoration: none; border-color: var(--color-primary); box-shadow: 0 10px 30px -12px rgba(37,99,235,.3); transform: translateY(-2px); }
.service-card h3 { margin: 0 0 .35rem; font-size: 1.1rem; }
.service-card p { margin: 0 0 .75rem; font-size: .9rem; color: #55617a; }
.service-card__count { font-size: .8rem; font-weight: 600; color: var(--color-primary); }

.city-grid { display: flex; flex-wrap: wrap; gap: .6rem; }
.city-chip { border: 1px solid #d7deea; border-radius: 999px; padding: .5rem 1rem; background: #fff; font-size: .88rem; color: var(--color-ink); }
.city-chip:hover { text-decoration: none; border-color: var(--color-primary); color: var(--color-primary); }

/* --- Méthodologie --- */
.methodology-teaser { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; }
.pillars { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.pillars li { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1rem 1.25rem; font-size: .92rem; }
.pillars strong { display: inline-block; min-width: 3.2rem; color: var(--color-primary); font-size: 1.1rem; }
@media (max-width: 800px) { .methodology-teaser { grid-template-columns: 1fr; } }

/* --- Cartes agences (classement en une seule colonne) --- */
.agency-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.agency-grid__empty { text-align: center; color: #55617a; padding: 2rem 0; }
.agency-card { position: relative; display: flex; flex-direction: column; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; overflow: hidden; }
.agency-card__rank { position: absolute; top: 0; left: 0; background: var(--color-ink); color: #fff; font-weight: 700; font-size: .82rem; padding: .25rem .6rem; border-bottom-right-radius: 10px; }
.agency-card__body { padding: 1.4rem 1.4rem .75rem; flex: 1; }
.agency-card__head { padding-left: 2rem; }
.agency-card__name { margin: 0; font-size: 1.15rem; }
.agency-card__name a { color: var(--color-ink); }
.agency-card__baseline { margin: .15rem 0 .75rem; font-size: .88rem; color: #55617a; }
.agency-card__rating { display: flex; align-items: center; gap: .4rem; font-size: .92rem; margin-bottom: .75rem; }
.stars { color: var(--color-accent); letter-spacing: 1px; }
.agency-card__reviews { color: #7a869c; }
.agency-card__meta { list-style: none; margin: 0 0 .75rem; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .84rem; color: #445; }
.agency-card__tags { list-style: none; margin: 0 0 .75rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { background: var(--color-muted); border-radius: 6px; padding: .2rem .55rem; font-size: .78rem; font-weight: 500; }
.tag a { color: inherit; }
.agency-card__certifs { font-size: .8rem; color: #2f7d3a; margin: 0; }
.agency-card__footer { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.4rem; border-top: 1px solid #eef1f6; background: #fbfcfe; }
.agency-card__score { font-weight: 700; font-size: .9rem; }

/* Classement en une colonne : cartes en ligne (infos à gauche, score + CTA à droite) sur écran large */
@media (min-width: 720px) {
  .agency-card { flex-direction: row; }
  .agency-card__footer {
    flex-direction: column; justify-content: center; align-items: center; gap: .6rem;
    border-top: 0; border-left: 1px solid #eef1f6;
    padding: 1.5rem 2.2rem; min-width: 180px; text-align: center;
  }
  .agency-card__score { font-size: 1.35rem; }
}

/* --- Fiche agence / page-head --- */
.page-head { padding: 2.5rem 0 1.5rem; background: var(--color-muted); }
.page-head__lead { font-size: 1.05rem; color: #445; max-width: 70ch; }
.page-head__meta { font-size: .88rem; color: #667; margin-top: .5rem; }
.breadcrumb { font-size: .82rem; color: #7a869c; margin-bottom: .75rem; }
.breadcrumb a { color: #7a869c; }
.breadcrumb span { margin: 0 .35rem; }

.agency-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; }
.agency-hero__baseline { color: #55617a; margin: .1rem 0 .6rem; }
.agency-hero__score { text-align: center; background: var(--color-primary); color: #fff; border-radius: 14px; padding: 1rem 1.4rem; }
.agency-hero__score-value { display: block; font-size: 2rem; font-weight: 800; }
.agency-hero__score-label { font-size: .75rem; opacity: .85; }

.agency-layout { display: grid; grid-template-columns: 1fr 340px; gap: 2.5rem; align-items: start; }
.agency-main h2 { margin: 2rem 0 .75rem; }
.agency-main h2:first-child { margin-top: 0; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.check-list li::before { content: "✓ "; color: var(--color-primary); font-weight: 700; }
@media (max-width: 900px) { .agency-layout { grid-template-columns: 1fr; } }

.card { border: 1px solid #e2e8f0; border-radius: 16px; padding: 1.5rem; background: #fff; }
.spec { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0 0 1.25rem; font-size: .9rem; }
.spec dt { font-weight: 600; color: #55617a; }
.spec dd { margin: 0; }

/* --- CTA reco --- */
.cta-reco { background: var(--color-ink); color: #fff; padding: 3rem 0; }
.cta-reco__inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta-reco__title { margin: 0 0 .35rem; }
.cta-reco p { margin: 0; opacity: .85; max-width: 52ch; }

/* --- Filtres --- */
.filters { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin-bottom: 1.75rem; padding: 1.25rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; }
.filters__field { display: flex; flex-direction: column; gap: .3rem; }
.filters__field label { font-size: .78rem; font-weight: 600; color: #55617a; }
.filters__count { margin: 0 0 0 auto; font-size: .88rem; font-weight: 600; }
select, input[type="text"], input[type="email"], textarea { font: inherit; padding: .55rem .7rem; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; min-width: 160px; }
textarea { width: 100%; resize: vertical; }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }

/* --- Formulaires --- */
.form-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2.5rem; align-items: start; }
.reco-form { display: grid; gap: 1.1rem; }
.reco-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.reco-form .filters__field { width: 100%; }
.reco-form .filters__field input, .reco-form .filters__field select { width: 100%; }
.checkbox { display: flex; gap: .6rem; font-size: .86rem; color: #445; align-items: flex-start; }
.form-note, .form-aside__stat { font-size: .82rem; color: #667; }
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: .4rem; }
@media (max-width: 900px) {
  .form-layout { grid-template-columns: 1fr; }
  .reco-form__row { grid-template-columns: 1fr; }
}

/* --- Prose --- */
.prose { max-width: 72ch; }
.prose h2 { margin: 2rem 0 .75rem; }
.prose ul, .prose ol { display: grid; gap: .4rem; padding-left: 1.2rem; }

/* --- FAQ --- */
.faq details { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: .6rem; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { margin: .6rem 0 0; color: #445; }

/* --- Tableau comparatif --- */
.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.comparison-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: .88rem; background: #fff; }
.comparison-table th, .comparison-table td { padding: .75rem 1rem; border-bottom: 1px solid #eef1f6; text-align: left; white-space: nowrap; }
.comparison-table tbody tr:last-child td { border-bottom: 0; }
.comparison-table thead th {
  background: var(--color-muted); color: #55617a;
  font-weight: 700; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em;
  position: sticky; top: 0; z-index: 2;
}
.comparison-table tbody tr:nth-child(even) { background: #fbfcfe; }
.comparison-table tbody tr:hover { background: #f3f6fb; }
.comparison-table .u-num { text-align: right; font-variant-numeric: tabular-nums; }
.comparison-table .stars { font-size: .85em; }

.comparison-table__rank-col, .comparison-table__name-col { position: sticky; background: #fff; z-index: 1; }
.comparison-table__rank-col { left: 0; width: 3.6rem; text-align: center; }
.comparison-table__name-col { left: 3.6rem; font-weight: 600; box-shadow: 2px 0 4px -2px rgba(15, 23, 42, .1); }
.comparison-table thead .comparison-table__rank-col, .comparison-table thead .comparison-table__name-col { z-index: 3; background: var(--color-muted); }
.comparison-table tbody tr:nth-child(even) .comparison-table__rank-col,
.comparison-table tbody tr:nth-child(even) .comparison-table__name-col { background: #fbfcfe; }
.comparison-table tbody tr:hover .comparison-table__rank-col,
.comparison-table tbody tr:hover .comparison-table__name-col { background: #f3f6fb; }

.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.85rem; height: 1.85rem; border-radius: 999px;
  background: var(--color-muted); color: var(--color-ink); font-weight: 700; font-size: .8rem;
}
.rank-badge--1 { background: #fde68a; color: #7a5b00; }
.rank-badge--2 { background: #e2e8f0; color: #3a4457; }
.rank-badge--3 { background: #fcd9b6; color: #7a3e00; }

/* --- Encart « Que retenir » --- */
.takeaways { background: #fff; border: 1px solid #e2e8f0; border-left: 4px solid var(--color-primary); border-radius: 12px; padding: 1.25rem 1.5rem; margin: 1.5rem 0 2rem; }
.takeaways__title { margin: 0 0 .6rem; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--color-primary); }
.takeaways .check-list { gap: .4rem; }

/* --- Utilitaires --- */
.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; }

/* --- Blog --- */
.blog-cats { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 2rem; }
.city-chip.is-active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.post-card { display: flex; flex-direction: column; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; overflow: hidden; }
.post-card__media { display: block; aspect-ratio: 16 / 9; background: var(--color-muted); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-card__ph { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 2.5rem; font-weight: 800; color: var(--color-primary); background: linear-gradient(135deg, var(--color-muted), #e2e8f0); }
.post-card__body { padding: 1.25rem 1.4rem 1.4rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.post-card__meta { font-size: .8rem; color: #7a869c; margin: 0; }
.post-card__meta a { color: var(--color-primary); }
.post-card__title { font-size: 1.12rem; margin: 0; line-height: 1.3; }
.post-card__title a { color: var(--color-ink); }
.post-card__excerpt { font-size: .9rem; color: #55617a; margin: 0; }

.article-head__meta { font-size: .88rem; color: #667; margin-top: .5rem; }
.article-cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: 16px; margin-bottom: 2rem; }
.article-body { font-size: 1.03rem; }
.article-body h2 { margin: 2.25rem 0 .75rem; }
.article-body h3 { margin: 1.75rem 0 .5rem; }
.article-body ul, .article-body ol { padding-left: 1.3rem; }
.article-body blockquote { margin: 1.5rem 0; padding: .5rem 1.25rem; border-left: 3px solid var(--color-primary); background: var(--color-muted); border-radius: 0 8px 8px 0; }
.article-body blockquote p { margin: .5rem 0; }
.article-body pre { background: #0b1220; color: #e2e8f0; padding: 1rem 1.25rem; border-radius: 10px; overflow-x: auto; font-size: .9rem; }
.article-body code { background: var(--color-muted); padding: .1rem .35rem; border-radius: 4px; font-size: .92em; }
.article-body pre code { background: none; padding: 0; }
.article-body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .95rem; }
.article-body th, .article-body td { border: 1px solid #e2e8f0; padding: .55rem .75rem; text-align: left; }
.article-body th { background: var(--color-muted); }
.article-body img { border-radius: 10px; margin: 1.5rem 0; }

/* --- Footer --- */
.site-footer { background: #0b1220; color: #c7d0e0; padding: 3rem 0 1.5rem; font-size: .9rem; }
.site-footer a { color: #c7d0e0; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.site-footer__brand { font-weight: 800; color: #fff; font-size: 1.05rem; margin: 0 0 .35rem; }
.site-footer__tagline { margin: 0 0 .75rem; opacity: .8; }
.site-footer__title { font-weight: 700; color: #fff; margin: 0 0 .6rem; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.site-footer__legal { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #1e293b; font-size: .8rem; opacity: .7; display: grid; gap: .5rem; }
@media (max-width: 800px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .site-footer__grid { grid-template-columns: 1fr; } }

/* Agence partenaire */
.agency-card--partner { border-color: var(--color-accent); box-shadow: 0 0 0 2px rgba(245,158,11,.25); }
.agency-card__rank--partner { background: var(--color-accent); color: #3a2a00; text-transform: uppercase; letter-spacing: .04em; }
.partner-tag { display: inline-block; background: var(--color-accent); color: #3a2a00; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: .2rem .45rem; border-radius: 6px; }
.partner-note { font-size: .85rem; color: #475569; margin: .75rem 0 0; }

/* Cocon sémantique / maillage blog */
.cocon-banner { background: var(--color-muted); border-left: 4px solid var(--color-primary); padding: .7rem 1rem; border-radius: 8px; font-size: .92rem; margin: 0 0 1.5rem; }
.cocon-hub { margin-top: 2.5rem; }
.cocon-hub__cluster { margin-bottom: 1.75rem; }
.cocon-hub__cluster h3 { margin: 0 0 .5rem; font-size: 1.1rem; }
.cocon-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.cocon-list a { text-decoration: none; }
.cocon-list a:hover { text-decoration: underline; }
.cocon-pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0; font-weight: 600; }
.cocon-cta { margin-top: 2rem; padding: 1.25rem; background: var(--color-muted); border-radius: 12px; }
.cocon-cta .section__title { font-size: 1.1rem; margin-top: 0; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 1.25rem; margin: 2rem 0 0; font-weight: 600; }

.spec-updated { font-size: .82rem; color: #64748b; margin: .75rem 0 0; }
