/* =====================================================================
   Refonte 2.3 — catalogue, recherche et pages géographiques (parts/catalogue.php, taxonomy.php).
   Chargé seulement sur ces pages. Les classes lues par catalog.js / map.js sont conservées.
   ===================================================================== */

/* Début du H1 en petit : « Programmes immobiliers neufs à » + nom de la ville. */
.display-pre { display: block; margin-bottom: 14px; font-family: var(--lc-font) !important; font-size: clamp(0.85rem, 1.1vw, 1rem); font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; font-style: normal; line-height: 1.3; }

/* ---------- Barre de filtres à cheval sur l'en-tête ---------- */
.catalog-sec--dock { padding-top: 0; }
.catalog-sec--dock .filters { position: relative; z-index: 3; margin-top: calc(-1 * clamp(56px, 6vw, 84px)); }
.filters {
  grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr)); gap: 10px; padding: 14px; margin-bottom: 28px;
  background: #fff; border-radius: calc(var(--lc-radius) + 4px); box-shadow: var(--lc-shadow-soft); border: 1px solid var(--lc-line);
}
.filters .field label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lc-ink-soft); }
.filters .field input, .filters .field select { background: var(--lc-sky); border-color: transparent; border-radius: 14px; }
.filters .field input:focus, .filters .field select:focus { background: #fff; border-color: var(--lc-blue); }
.filters__checks { align-items: center; gap: 8px; padding: 2px 0 0; }
.check--pill { position: relative; gap: 8px; padding: 9px 16px 9px 12px; border-radius: 999px; border: 1px solid var(--lc-line); font-size: 15px; font-weight: 600; transition: background-color 200ms var(--lc-ease), border-color 200ms var(--lc-ease), color 200ms var(--lc-ease); }
.check--pill input { width: 18px; height: 18px; }
.check--pill:has(input:checked) { background: var(--lc-blue); border-color: var(--lc-blue); color: #fff; }
.check--pill:has(input:checked) input { accent-color: #fff; }
.check--pill:has(input:focus-visible) { outline: 2px solid var(--lc-blue); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .check--pill:hover { border-color: var(--lc-blue); } }
.filters > .btn[type='reset'] { align-self: center; }

/* ---------- Résultats ---------- */
.catalog__bar { align-items: baseline; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--lc-line); }
.catalog__count { font-family: var(--lc-font-display); font-weight: 400; font-size: clamp(1.8rem, 3vw, 2.6rem); letter-spacing: -0.02em; line-height: 1; }
.catalog__hint { font-size: 14px; }
.catalog__grid { gap: 14px; }
.catalog__grid .card { aspect-ratio: 4 / 4.6; }
.catalog__mapcol { padding: 8px; border-radius: calc(var(--lc-radius) + 8px); background: #fff; border: 1px solid var(--lc-line); box-shadow: var(--lc-shadow-soft); }
.catalog__map { height: calc(100vh - var(--lc-nav-h) - 96px); height: calc(100svh - var(--lc-nav-h) - 96px); }
.catalog__mapnote { padding: 0 8px 4px; }
.catalog__empty { position: relative; overflow: hidden; background: var(--lc-sand); }
.catalog__empty-deco { right: -40px; bottom: -40px; width: 340px; opacity: 0.12; }
.catalog__more .btn { min-width: 260px; justify-content: center; }

/* ---------- Pages géographiques : introduction ---------- */
.geo-intro { position: relative; overflow: hidden; isolation: isolate; padding-bottom: clamp(32px, 4vw, 56px); }
.geo-intro__word { right: -3vw; top: 8%; }
.geo-intro__grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.geo-intro .h2 { max-width: 14ch; margin-bottom: 26px; }
.geo-intro__text { font-size: 18px; }
.geo-intro__links { margin-top: 32px; }
.geo-intro__links-t { font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--lc-ink-soft); margin-bottom: 12px; }
.geo-intro__links ul { display: flex; flex-wrap: wrap; gap: 8px; }
.chip--line { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--lc-line); background: #fff; color: var(--lc-ink); font-size: 15px; font-weight: 600; text-decoration: none; transition: border-color 200ms var(--lc-ease), color 200ms var(--lc-ease); }
.chip--line span { font-size: 12.5px; font-weight: 700; color: var(--lc-blue); background: var(--lc-sky); border-radius: 999px; padding: 2px 8px; }
@media (hover: hover) and (pointer: fine) { .chip--line:hover { border-color: var(--lc-blue); color: var(--lc-blue); } }
.geo-stats { display: grid; gap: 12px; margin: 0; }
.geo-stat { margin: 0; padding: 24px 26px; border-radius: var(--lc-radius); background: var(--lc-night); color: #fff; display: grid; gap: 4px; }
.geo-stat:nth-child(2) { background: var(--lc-blue); }
.geo-stat:nth-child(3) { background: var(--lc-sky); color: var(--lc-ink); }
.geo-stat dt { font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.8; }
.geo-stat dd { margin: 0; font-family: var(--lc-font-display) !important; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1; letter-spacing: -0.02em; }

/* ---------- Adaptatif ---------- */
@media (max-width: 1180px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters__q, .filters__checks { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .catalog-sec--dock { padding-top: clamp(32px, 6vw, 56px); }
  .catalog-sec--dock .filters { margin-top: 0; }
  .filters.is-sheet { box-shadow: none; border: 0; }
  .geo-intro__grid { grid-template-columns: minmax(0, 1fr); }
  .geo-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .geo-stat { padding: 18px; }
  .geo-stat dd { font-size: clamp(1.5rem, 7vw, 2.1rem); overflow-wrap: anywhere; }
  .catalog__grid .card { aspect-ratio: 4 / 3; }
}

/* ---------- Refonte 2.7.6 — carte et liste synchronisées (map.js) ---------- */
[data-map-reset][hidden], [data-more][hidden] { display: none !important; }
[data-card] { position: relative; scroll-margin-top: calc(var(--lc-nav-h) + 24px); }
[data-card].is-entering { animation: card-in 320ms var(--lc-ease) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { [data-card].is-entering { animation: none; } }
/* « Voir sur la carte » : posé sur la photo, à côté du lien de la fiche. */
.card-locate {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: var(--lc-blue); cursor: pointer;
  box-shadow: 0 4px 14px rgba(4, 31, 58, 0.18); transition: transform 200ms var(--lc-ease), background-color 200ms var(--lc-ease), color 200ms var(--lc-ease), opacity 500ms var(--lc-ease) 300ms;
}
@media (hover: hover) and (pointer: fine) { .card-locate:hover { background: var(--lc-blue); color: #fff; transform: scale(1.06); } }
.card-locate:active { transform: scale(0.94); }
.card-locate:focus-visible { outline: 3px solid var(--lc-blue); outline-offset: 2px; }
[data-card]:has(.card-locate) .card__top { right: 62px; }
/* Le bouton attend que la fiche ait fini d'apparaître (révélation par le haut). */
.js [data-card]:has(.card[data-reveal]:not(.is-in)) .card-locate { opacity: 0; pointer-events: none; }
.lc-sans-anim [data-card] .card-locate { opacity: 1; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .js [data-card] .card-locate { opacity: 1; pointer-events: auto; } }
[data-card].is-picked .card-locate { background: var(--lc-blue); color: #fff; }
/* Zone choisie sur la carte : rappel au-dessus de la liste et bouton dans la carte. */
.catalog__zone { cursor: pointer; }
.map-reset {
  margin: 14px !important; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--lc-night); color: #fff; font: 600 14px/1 var(--lc-font); cursor: pointer; box-shadow: 0 6px 18px rgba(4, 31, 58, 0.25);
  transition: background-color 200ms var(--lc-ease), transform 160ms var(--lc-ease);
}
@media (hover: hover) and (pointer: fine) { .map-reset:hover { background: var(--lc-blue); } }
.map-reset:active { transform: scale(0.96); }
.map-reset:focus-visible { outline: 3px solid var(--lc-mint); outline-offset: 2px; }
@media (max-width: 860px) {
  .catalog__mapcol.is-open .map-reset { margin-top: max(14px, env(safe-area-inset-top)) !important; }
  .card-locate { width: 44px; height: 44px; }
  .catalog-pill button { white-space: nowrap; }
}

/* ---------- Téléphone et tablette (≤ 860 px) : pas de carte, seulement les filtres (2.12.2) ----------
   La carte, ses commandes et Leaflet n'existent qu'à l'ordinateur (map.js). Le bouton flottant ouvre le
   panneau des filtres ; le filtre « zone de la carte » est ignoré (catalog.js). */
@media (max-width: 860px) {
  .catalog__mapcol, [data-map-pill], [data-map-only], [data-map-reset], .catalog__maptoggle, .card-locate { display: none !important; }
  .catalog-pill { padding: 5px; }
  .catalog-pill button[data-filters-open] { min-width: 168px; justify-content: center; gap: 10px; padding: 0 26px; background: var(--lc-blue); }
  .catalog-pill button[data-filters-open]::before {
    content: ''; width: 18px; height: 18px; flex: none;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M3 5h14M6 10h8M8.5 15h3' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M3 5h14M6 10h8M8.5 15h3' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  /* Panneau : champs pleine largeur, cibles tactiles de 52 px, texte à 16 px (pas de zoom d'iOS). */
  /* Le panneau reste « fixe » même dans la mise en page à barre de filtres (.catalog-sec--dock), dont la règle
     position: relative l'aurait laissé dans la page, invisible, au-dessus des résultats. */
  .catalog-sec .filters.is-sheet { position: fixed; z-index: calc(var(--lc-z-menu) + 1); margin: 0; grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .filters.is-sheet .field input, .filters.is-sheet .field select { min-height: 52px; font-size: 16px; }
  .filters.is-sheet .filters__checks { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .filters.is-sheet .check--pill { min-height: 44px; }
  .catalog__bar { flex-wrap: wrap; gap: 6px 12px; }
  .catalog__hint { flex-basis: 100%; font-size: 13px; }
}

/* ---------- Fiches ville (Explorateur de villes, étape 2) : faits sourcés, transports, cadre de vie ---------- */
.page-hero__credit {
  position: absolute; z-index: 2; right: var(--lc-gutter); bottom: 70px; max-width: min(520px, 70vw); margin: 0;
  font-size: 12px; line-height: 1.4; text-align: right; color: rgba(255, 255, 255, 0.82);
}
.page-hero__credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.vf { background: var(--lc-paper); }
.vf__head { max-width: 760px; }
.vf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: clamp(24px, 3vw, 40px) 0 0; }
.vf-stat { padding: 20px 22px; border-radius: var(--lc-radius); background: var(--lc-mist); }
.vf-stat dt { font-size: 14px; font-weight: 600; color: var(--lc-ink-soft); }
.vf-stat dd { margin: 6px 0 0; font-family: var(--lc-font-display); font-size: clamp(1.6rem, 2.6vw, 2.3rem); line-height: 1.05; letter-spacing: -0.02em; color: var(--lc-ink); }
.vf-stat p { margin: 6px 0 0; font-size: 13px; color: var(--lc-ink-soft); }
.vf-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; align-items: start; }
.vf-card { padding: clamp(20px, 2.4vw, 30px); border-radius: var(--lc-radius); background: var(--lc-mist); }
.vf-card--transport { background: var(--lc-blue); color: #fff; }
.vf-card__t { margin: 0 0 16px; font-size: 20px; font-weight: 700; line-height: 1.2; }
.vf-gares { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.vf-gares li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.12); }
.vf-gares__nom { font-weight: 700; }
.vf-gares__km { font-size: 14px; color: rgba(255, 255, 255, 0.8); }
.vf-gares__lignes { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.vf-ligne { padding: 4px 10px; border-radius: 999px; background: #fff; color: var(--lc-blue); font-size: 13px; font-weight: 700; }
.vf-card--transport .vf-note { color: rgba(255, 255, 255, 0.78); }
.vf-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.vf-count { padding: 14px; border-radius: 14px; background: var(--lc-paper); }
.vf-count dt { font-size: 13.5px; color: var(--lc-ink-soft); }
.vf-count dd { margin: 4px 0 0; font-size: 26px; font-weight: 700; line-height: 1; color: var(--lc-ink); }
.vf-list { margin: 14px 0 0; font-size: 15px; line-height: 1.5; }
.vf-note { margin: 14px 0 0; font-size: 13px; line-height: 1.45; color: var(--lc-ink-soft); }
.vf-draft { margin-top: 16px; }
.vf-draft p { margin: 0 0 8px; }
.vf-src { background: var(--lc-paper); }
.vf-src__t { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lc-ink-soft); }
.vf-src ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; color: var(--lc-ink-soft); }
.vf-src a { color: inherit; }
@media (max-width: 1100px) {
  .vf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vf-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .vf-card--transport { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .vf-grid { grid-template-columns: minmax(0, 1fr); }
  .vf-stat { padding: 16px; }
  .page-hero__credit { left: var(--lc-gutter); bottom: 46px; text-align: left; max-width: none; font-size: 11px; }
}
.vf-card__st { margin: 22px 0 10px; font-size: 15px; font-weight: 700; }
.vf-trajets { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.vf-trajets li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.12); }
.vf-trajets strong { font-size: 18px; }
.vf-trajets small { font-size: 13px; color: rgba(255, 255, 255, 0.78); }
