/* Pages SEO de l'annuaire : hub /detective-prive, cantons, villes (FR et DE), page introuvable.
   Direction « maquette A » (docs/maquettes/a-airbnb.html). Jetons de app.css uniquement ; classes préfixées pg-seo-.
   Chargée après app.css par layout.js (styles: ['pages/seo.css']). Aucun style inline (CSP style-src 'self'). */

/* ---------- En-tête : bandeau doux, code du canton, chiffres-clés ---------- */
.pg-seo-hero { position: relative; margin: 0 0 18px; padding: 26px 32px 28px; border: 1px solid #FBE2DB; border-radius: var(--r-xl); background: linear-gradient(170deg, #FFF4F0 0%, #FFFFFF 72%); }
.pg-seo-hero .crumbs { margin-bottom: 14px; }
.pg-seo-hero-row { display: flex; align-items: center; gap: 28px; }
.pg-seo-hero-text { flex: 1; min-width: 0; }
.pg-seo-hero h1 { margin-bottom: 12px; overflow-wrap: anywhere; hyphens: auto; }
.pg-seo-code { flex: none; display: grid; place-items: center; width: 96px; height: 96px; border-radius: 28px; background: #fff; color: var(--coral-ink); font-size: 32px; font-weight: 800; letter-spacing: -.02em; box-shadow: var(--shadow); transform: rotate(-4deg); }
.pg-seo-stats { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; }
.pg-seo-stat { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.pg-seo-stat-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; }
.pg-seo-stat-t { min-width: 0; }
.pg-seo-stat strong { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pg-seo-stat-t > span { display: block; color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.pg-seo-fresh { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; color: var(--ink-2); font-size: 13.5px; }
.pg-seo-fresh .ico { color: var(--mint-ink); }

/* ---------- Sommaire d'ancres, collant sous l'en-tête du site ---------- */
.pg-seo-jump { position: sticky; top: 80px; z-index: 6; display: flex; gap: 6px; margin: 0 0 4px; padding: 10px 0; overflow-x: auto; scrollbar-width: none; background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: saturate(1.6) blur(10px); backdrop-filter: saturate(1.6) blur(10px); border-bottom: 1px solid var(--line); }
.pg-seo-jump::-webkit-scrollbar { display: none; }
.pg-seo-jump a { flex: none; padding: 8px 15px; border-radius: 999px; color: var(--ink-2); font-size: 14.5px; font-weight: 700; text-decoration: none; white-space: nowrap; transition: background-color .2s, color .2s; }
.pg-seo-jump a:hover { background: var(--soft); color: var(--ink); }
.pg-seo-sec, .pg-seo-ask { scroll-margin-top: 150px; }

/* ---------- Recherche du hub : barre en pilule (maquette A) ---------- */
.pg-seo-search { display: flex; align-items: center; gap: 8px; max-width: 760px; margin: 22px 0 0; padding: 8px; background: #fff; border: 1px solid var(--line-2); border-radius: 999px; box-shadow: var(--shadow-lg); transition: box-shadow .2s; }
.pg-seo-search:focus-within { outline: 3px solid var(--ink); outline-offset: 3px; }
.pg-seo-search-f { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 6px 22px; border-radius: 999px; cursor: text; }
.pg-seo-search-k { font-size: 12.5px; font-weight: 800; letter-spacing: .01em; color: var(--ink); }
.pg-seo-search input { width: 100%; min-height: 0; margin: 0; padding: 2px 0 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 15.5px; color: var(--ink); -webkit-appearance: none; appearance: none; }
.pg-seo-search input:focus, .pg-seo-search input:focus-visible { outline: none; box-shadow: none; }
.pg-seo-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.pg-seo-search .btn { flex: none; min-height: 56px; padding: 0 26px 0 22px; border-radius: 999px; }
.pg-seo-results { margin: 16px 0 0; padding: 16px 18px 6px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); }
.pg-seo-results > p { margin: 0 0 12px; font-weight: 700; }
.pg-seo-results .pills { margin-bottom: 10px; }
.pg-seo-results.is-none { padding-bottom: 2px; background: var(--sun-soft); border-color: #F4DCA2; }
.pg-seo-results.is-none > p { font-weight: 600; }

/* ---------- Grille des cantons : jauge proportionnelle (part du canton le mieux fourni, calculée) ---------- */
/* Rangées de même hauteur ; noms courts (« Appenzell Rh.-Int. ») : la grille ne casse plus. */
.pg-seo .canton-grid { grid-auto-rows: 1fr; }
.pg-seo .canton-grid li { display: flex; }
.pg-seo .canton-grid a { flex: 1; min-width: 0; }
.pg-seo-cantons a { position: relative; padding-bottom: 16px; }
.pg-seo-gauge { position: absolute; left: 14px; right: 14px; bottom: 7px; height: 4px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.pg-seo-gauge::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--grad); }
.pg-seo-g0 { visibility: hidden; }
.pg-seo-g1::after { width: 10%; } .pg-seo-g2::after { width: 20%; } .pg-seo-g3::after { width: 30%; } .pg-seo-g4::after { width: 40%; }
.pg-seo-g5::after { width: 50%; } .pg-seo-g6::after { width: 60%; } .pg-seo-g7::after { width: 70%; } .pg-seo-g8::after { width: 80%; }
.pg-seo-g9::after { width: 90%; } .pg-seo-g10::after { width: 100%; }
.pg-seo-neigh { margin-bottom: 24px; }

/* ---------- Pastilles de villes ---------- */
.pg-seo-cities a.on { pointer-events: none; }
.pg-seo-near-code { display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--coral-soft); color: var(--coral-ink); font-size: 11.5px; font-weight: 800; }
.pills a.on .pg-seo-near-code { background: rgba(255, 255, 255, .2); color: #fff; }

/* ---------- Villes proches : distance calculée ---------- */
.pg-seo-near { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.pg-seo-near a { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink); text-decoration: none; transition: border-color .2s, box-shadow .2s, transform .2s; }
.pg-seo-near a:hover { border-color: var(--ink); box-shadow: var(--shadow-sm); transform: translateY(-1px); color: var(--ink); }
.pg-seo-near-name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.pg-seo-near-km { flex: none; color: var(--ink-2); font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Cartes de fiches (sur ces pages seulement) ---------- */
.pg-seo .listing-grid { align-items: start; }
.pg-seo .card.listing { border-radius: var(--r-lg); }
.pg-seo .listing-ico { position: relative; letter-spacing: -.02em; }
.pg-seo .listing-ico.is-checked { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--mint); }
.pg-seo .listing-ico-check { position: absolute; right: -6px; bottom: -6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--mint-ink); color: #fff; border: 2px solid #fff; }
.pg-seo .listing-ico-check .ico { width: 12px; height: 12px; stroke-width: 3.2; }
.pg-seo .listing-actions .listing-quote { flex: 1 1 100%; justify-content: center; }
/* Action principale de la fiche, en teinte douce : un seul bouton en dégradé par écran (celui de la page). */
.pg-seo .listing-actions .btn.listing-quote { background: var(--coral-soft); color: var(--coral-ink); border: 1.5px solid #F7C9C0; box-shadow: none; }
.pg-seo .listing-actions .btn.listing-quote:hover { background: #FFE0D9; color: var(--coral-ink); border-color: var(--coral-ink); box-shadow: none; }
.pg-seo .listing-more { margin: -4px 0 0; font-size: 14px; font-weight: 700; }
.pg-seo .listing-more a { display: inline-flex; align-items: center; gap: 4px; color: var(--mint-ink); }
.pg-seo .listing-foot { margin-top: 0 !important; padding-top: 10px; font-size: 13px; }
.pg-seo .listing-foot a { color: var(--ink-3); }
.pg-seo .listing-foot a:hover { color: var(--ink); }
.pg-seo .listing.is-sponsored { border-color: #F1D493; background: linear-gradient(180deg, var(--sun-soft) 0, #fff 92px); }
.pg-seo .listing-sponsor { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: -4px 0 0; color: var(--sun-ink); font-size: 12.5px; font-weight: 700; }
.pg-seo .badge.listing-sponsor-badge { background: #fff; color: var(--sun-ink); box-shadow: 0 0 0 1.5px #E3B64F inset; }
.pg-seo .badge.listing-sponsor-badge .ico { fill: currentColor; }
.pg-seo .listing-legend { list-style: none; max-width: 820px; margin: 24px 0 0; padding: 16px 18px; display: grid; gap: 10px; background: var(--soft); border-radius: var(--r-md); }
.pg-seo .listing-legend li { display: grid; grid-template-columns: 9rem minmax(0, 1fr); align-items: start; gap: 6px 14px; color: var(--ink-2); font-size: 14px; }
.pg-seo .listing-legend .badge { justify-self: start; }
.pg-seo .listing-claim { display: flex; align-items: flex-start; gap: 10px; max-width: 820px; margin: 18px 0 0; padding: 14px 16px; border-radius: var(--r-md); background: var(--mint-soft); font-size: 14.5px; }
.pg-seo .listing-claim .ico { margin-top: 2px; color: var(--mint-ink); flex: none; }
.pg-seo .listing-claim a { font-weight: 800; color: var(--ink); }
.pg-seo .card.listing:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.pg-seo .listing.is-verified { background: linear-gradient(180deg, var(--mint-soft) 0, #fff 96px); }
.pg-seo .listing-ico { width: 52px; height: 52px; border-radius: 16px; font-size: 21px; }
.pg-seo .listing-actions .btn-sm { min-width: 0; }
.pg-seo .listing-grid > * { animation: rise .6s var(--ease) both; }
.pg-seo .listing-grid > :nth-child(2) { animation-delay: .05s; }
.pg-seo .listing-grid > :nth-child(3) { animation-delay: .1s; }
.pg-seo .listing-grid > :nth-child(4) { animation-delay: .15s; }
.pg-seo .listing-grid > :nth-child(n+5) { animation-delay: .2s; }

/* ---------- Demande : situations illustrées, pré-remplies (canton + situation) ---------- */
.cta-card.pg-seo-ask { display: block; padding: 36px 40px 30px; }
.pg-seo-ask-head { max-width: 760px; }
.pg-seo-ask-head p { margin: 0; }
.pg-seo-ask-k { margin: 26px 0 12px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--coral-ink); }
.pg-seo-needs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.pg-seo-need { display: flex; flex-direction: column; height: 100%; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink); text-decoration: none; transition: box-shadow .25s, transform .25s, border-color .25s; }
.pg-seo-need:hover { color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.pg-seo-need-art { display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; }
.pg-seo-need-img { width: 80%; height: auto; transition: transform .6s var(--ease); }
.pg-seo-need:hover .pg-seo-need-img { transform: scale(1.07) rotate(-1.5deg); }
.pg-seo-art-peach { background: linear-gradient(160deg, #FFF3EC, #FFE2D3); }
.pg-seo-art-mint { background: linear-gradient(160deg, #EEFBF7, #D6F2EA); }
.pg-seo-art-sun { background: linear-gradient(160deg, #FFF8E6, #FFEBC0); }
.pg-seo-art-sky { background: linear-gradient(160deg, #F0F8FE, #D9ECFA); }
.pg-seo-art-plum { background: linear-gradient(160deg, #F4F1FF, #E3DCFF); }
.pg-seo-art-coral { background: linear-gradient(160deg, #FFF3F1, #FFDCD6); }
.pg-seo-need-t { padding: 14px 16px 0; font-size: 16px; font-weight: 800; letter-spacing: -.015em; line-height: 1.25; }
.pg-seo-need-h { flex: 1; padding: 4px 16px 0; color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.pg-seo-need-go { display: inline-flex; align-items: center; gap: 6px; padding: 12px 16px 16px; font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.pg-seo-need-go .ico { transition: transform .25s; }
.pg-seo-need:hover .pg-seo-need-go .ico { transform: translateX(4px); }
.pg-seo-ask-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 26px 0 0; }
.pg-seo-ask-foot .btn-line { gap: 8px; }
.cta-card .pg-seo-ask-free { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; }
.pg-seo-ask-free .ico { color: var(--mint-ink); }
/* Rappel police 117 (disparition, danger) sous les situations. */
.cta-card .pg-seo-police { display: flex; align-items: flex-start; gap: 10px; max-width: none; margin: 18px 0 0; padding: 12px 16px; border-radius: var(--r-sm); background: #fff; border: 1px solid #F2C4C9; color: var(--ink); font-size: 14.5px; }
.pg-seo-police .ico { flex: none; margin-top: 2px; color: var(--coral-ink); }
.pg-seo-police a { font-weight: 800; color: var(--coral-ink); }

/* ---------- Règles du canton (fiche légale vérifiée, source affichée) ---------- */
.pg-seo-law-card { max-width: 900px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-sm); }
.pg-seo-law-k { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 10px; font-size: 17px; font-weight: 800; }
.pg-seo-law-k .ico { flex: none; margin-top: 2px; color: var(--mint-ink); }
.pg-seo-law-t { margin: 0 0 10px; color: var(--ink-2); }
.pg-seo-law-points { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); }
.pg-seo-law-out { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--sky-soft); color: var(--ink); font-size: 14.5px; }
.pg-seo-law-src { margin: 0; overflow-wrap: anywhere; }

/* ---------- Questions fréquentes : le composant .faq d'app.css (le même que l'accueil et les pages légales) ---------- */
.pg-seo-faq { margin: 0 0 24px; }
/* 24 px entre la dernière question et le lien qui suit. */
.pg-seo-sec + .seo-links, .pg-seo-after { margin-top: 24px; }

/* ---------- Page introuvable ---------- */
.pg-seo-lost .btns { margin: 22px 0 0; }
.pg-seo-lost-illus { flex: none; width: 150px; height: auto; }

/* ---------- Grands écrans → téléphone ---------- */
@media (max-width: 1120px) {
  .pg-seo-needs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .cta-card.pg-seo-ask { padding: 30px 24px 26px; }
  .pg-seo-needs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 744px) {
  .pg-seo-hero { padding: 20px 18px 22px; border-radius: 26px; }
  .pg-seo-hero-row { gap: 14px; }
  .pg-seo-code { width: 60px; height: 60px; border-radius: 18px; font-size: 21px; align-self: flex-start; }
  .pg-seo-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pg-seo-stat { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .pg-seo-stat-ico { width: 36px; height: 36px; border-radius: 11px; }
  .pg-seo-stat strong { font-size: 21px; }
  .pg-seo-jump { top: 64px; margin: 0 -20px 4px; padding: 8px 20px; }
  .pg-seo-sec, .pg-seo-ask { scroll-margin-top: 130px; }
  .pg-seo-search { flex-direction: column; align-items: stretch; border-radius: 26px; padding: 10px; }
  .pg-seo-search-f { padding: 8px 14px; border-radius: 18px; }
  .pg-seo-search .btn { min-height: 52px; border-radius: 16px; }
  .pg-seo-needs { grid-template-columns: 1fr; gap: 10px; }
  .pg-seo-need { display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: 14px; }
  .pg-seo-need-art { grid-row: 1 / 4; aspect-ratio: auto; height: 100%; }
  .pg-seo-need-t { padding: 12px 14px 0 0; font-size: 15.5px; }
  .pg-seo-need-h { padding: 2px 14px 0 0; font-size: 13.5px; }
  .pg-seo-need-go { padding: 8px 14px 12px 0; font-size: 13.5px; }
  .pg-seo-ask-foot { flex-direction: column; align-items: stretch; }
  .pg-seo-ask-foot .btn, .pg-seo-ask-foot .btn-line { justify-content: center; text-align: center; }
  .pg-seo-law-card { padding: 18px; }
  .pg-seo .listing-legend li { grid-template-columns: 1fr; font-size: 13.5px; }
  .pg-seo-lost-illus { width: 96px; }
}
@media (max-width: 400px) {
  .pg-seo-code { display: none; }
}

/* ---------- Moins d'animations : app.css coupe déjà toute animation ; on fige aussi les survols ---------- */
@media (prefers-reduced-motion: reduce) {
  .pg-seo .card.listing:hover, .pg-seo-need:hover, .pg-seo-near a:hover { transform: none; }
  .pg-seo-need:hover .pg-seo-need-img { transform: none; }
}

/* ---------- Impression : la liste des fiches, sans navigation ni formulaires ---------- */
@media print {
  .pg-seo-jump, .pg-seo-search, .pg-seo-results, .pg-seo-ask, .pg-seo-code, .pg-seo-gauge, .listing-actions .btn-sm[href^="/carte/"] { display: none !important; }
  .pg-seo-hero { border: 0; background: none; padding: 0; }
  .pg-seo-stat, .pg-seo .card.listing { box-shadow: none; break-inside: avoid; }
  .pg-seo-faq details > p { display: block; }
  .pg-seo-law-card { box-shadow: none; }
}
