/* =============================================================================
   Annuaire des praticiennes (/annuaire/)
   Liste à gauche, carte collante à droite (≥ 1100 px). En dessous, liste seule
   et carte en plein écran à la demande (bouton « Carte »).
   ============================================================================= */

.dir-page { background: #fff; }

.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;
}

.dir {
  --dir-top: 100px;          /* menu (100) : pas de bandeau promo sur l'annuaire */
  --dir-sticky: 88px;        /* menu réduit (76) + marge */
  --dir-ink: var(--sf-ink, #1a1f2c);
  --dir-muted: var(--sf-gray-500, #6B7280);
  --dir-line: var(--sf-gray-200, #E5E7EB);
  --dir-soft: var(--sf-gray-100, #F3F4F6);
  --dir-sage: #A5B29F;
  --dir-sage-dark: #6B8B68;
  padding-top: var(--dir-top);
  color: var(--dir-ink);
}

.dir-wrap { max-width: 1440px; margin: 0 auto; padding: 0 24px; }

/* Menu de l'annuaire (partials/navbar-annuaire.php) : sans bandeau promo, le
   menu fixe se cale en haut de l'écran au lieu de 37 px plus bas. */
.dir-page .navbar--annuaire { top: 0; }

/* ---------- En-tête + recherche ---------- */
.dir-head { padding: 28px 0 20px; }
.dir-title {
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px;
}
.dir-sub { color: var(--dir-muted); margin: 0 0 20px; max-width: 860px; line-height: 1.55; }

.dir-search {
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid var(--dir-line); border-radius: 999px;
  background: #fff; box-shadow: 0 6px 24px rgba(31, 41, 55, .06);
  max-width: 860px; padding: 6px;
}
.dir-field {
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px; min-height: 48px; flex: 1 1 0; min-width: 0;
}
.dir-field + .dir-field { border-left: 1px solid var(--dir-line); }
.dir-field svg, .dir-near svg, .dir-map-toggle svg {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.dir-field svg { color: var(--dir-muted); }
.dir-field input, .dir-field select {
  border: 0; outline: 0; background: transparent; width: 100%;
  font: inherit; font-size: 15px; color: var(--dir-ink); min-width: 0;
  appearance: none; -webkit-appearance: none; cursor: pointer;
}
.dir-field input { cursor: text; }
.dir-field:focus-within { border-radius: 999px; box-shadow: inset 0 0 0 2px var(--dir-sage); }
.dir-near {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  border: 0; border-radius: 999px; padding: 0 20px; min-height: 48px;
  background: var(--dir-ink); color: #fff; font: inherit; font-weight: 600; font-size: 15px;
  cursor: pointer; transition: background .15s;
}
.dir-near:hover { background: #000; }
.dir-near.is-on { background: var(--dir-sage-dark); }
.dir-near[aria-busy="true"] { opacity: .7; cursor: progress; }

/* ---------- Corps : liste + carte ---------- */
/* mobile-optimizations.css donne 40 px de padding à toute <section> : sur la
   liste, cela creusait un trou entre la recherche et le bouton « Carte ». */
.dir .dir-results { padding: 0; }
.dir .dir-faq { padding: 0; }
.dir-body {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px;
  padding-bottom: 64px;
}
@media (min-width: 1100px) {
  .dir-body { grid-template-columns: minmax(0, 1fr) minmax(360px, 40%); }
  .dir-body--nomap { grid-template-columns: minmax(0, 1fr); }
}

.dir-toolbar { display: flex; align-items: center; justify-content: flex-end; margin: 0 0 12px; }
@media (min-width: 1100px) { .dir-toolbar { display: none; } }
.dir-count { margin: 0; font-weight: 600; font-size: 16px; letter-spacing: 0; }
.dir-map-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--dir-line); border-radius: 999px; background: #fff;
  padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer;
}
@media (min-width: 1100px) { .dir-map-toggle { display: none; } }

/* Grandes photos (choix du 20/10/2026, après essai de vignettes et de cartes
   étroites, jugées moins belles). La longueur est tenue par l'affichage 8 par 8. */
.dir-grid {
  display: grid; gap: 28px 24px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.dir-empty { color: var(--dir-muted); }

/* ---------- Carte praticienne ---------- */
.dir-card { position: relative; display: flex; flex-direction: column; gap: 12px; }
.dir-card[hidden] { display: none; }
.dir-card.is-active .dir-media { box-shadow: 0 0 0 3px var(--dir-sage); }

.dir-media {
  position: relative; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden;
  background: var(--dir-soft); transition: box-shadow .15s;
}
/* Au-dessus du lien qui couvre la carte (.dir-link::after, z-index 1) : sinon
   le calque capte le doigt et les photos ne défilent pas sur mobile. Un appui
   sur une photo ouvre quand même la fiche (directory.js). */
.dir-slides {
  position: relative; z-index: 2; cursor: pointer; touch-action: pan-x pan-y;
  display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.dir-slides::-webkit-scrollbar { display: none; }
.dir-slides img {
  flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start;
}
.dir-placeholder {
  height: 100%; display: grid; place-items: center;
  background: linear-gradient(135deg, #EDE7DD 0%, #dfe5db 100%);
}
.dir-placeholder span {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--dir-sage-dark); font-size: 28px; font-weight: 700;
}
.dir-offer {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: #fff; color: var(--dir-ink); border-radius: 999px; padding: 4px 12px;
  font-size: 13px; font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.dir-dots {
  position: absolute; bottom: 10px; left: 0; right: 0; z-index: 2;
  display: flex; justify-content: center; gap: 5px; pointer-events: none;
}
.dir-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .55); }
.dir-dots span.is-on { background: #fff; }
.dir-slide-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92);
  font-size: 20px; line-height: 1; color: var(--dir-ink); cursor: pointer;
  opacity: 0; transition: opacity .15s; box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}
.dir-slide-btn--prev { left: 10px; }
.dir-slide-btn--next { right: 10px; }
.dir-card:hover .dir-slide-btn, .dir-slide-btn:focus-visible { opacity: 1; }
@media (hover: none) { .dir-slide-btn { display: none; } }

.dir-info { display: flex; flex-direction: column; gap: 2px; }
.dir-info--thumb { flex-direction: row; align-items: flex-start; gap: 12px; }
.dir-info-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.dir-thumb {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none;
  margin-top: 2px; background: #EDE7DD; box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, .12);
}
.dir-name-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dir-name { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; min-width: 0; }
.dir-name-last { white-space: nowrap; }
/* Toute la carte est cliquable, sans imbriquer de liens. */
.dir-link { color: inherit; text-decoration: none; }
.dir-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 16px; }

.dir-link:focus-visible { outline: none; }
.dir-link:focus-visible::after { box-shadow: 0 0 0 3px var(--dir-sage); }
.dir-card:hover .dir-link { text-decoration: underline; text-underline-offset: 3px; }
.dir-member { display: inline-block; margin-left: 5px; position: relative; z-index: 2; vertical-align: -2px; }
.dir-member svg { width: 16px; height: 16px; display: block; }
.dir-rating {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  font-weight: 700; font-size: 15px;
}
.dir-rating svg { width: 16px; height: 16px; fill: #F5B301; }
.dir-rating-count { font-weight: 400; color: var(--dir-muted); font-size: 14px; }
.dir-meta {
  margin: 0; color: var(--dir-muted); font-size: 14.5px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dir-distance::after { content: " · "; }
.dir-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; }
.dir-tag {
  display: inline-block; font-size: 12.5px; font-weight: 500; color: var(--dir-sage-dark);
  background: #f1f4ef; border-radius: 999px; padding: 2px 10px;
}

.dir-card--more { display: none; }
.dir-more-wrap { display: flex; justify-content: center; margin-top: 32px; }
.dir-more-wrap[hidden] { display: none; }
.dir-more-btn {
  border: 1px solid var(--dir-ink); background: #fff; color: var(--dir-ink); border-radius: 999px;
  padding: 12px 28px; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
  transition: background .15s, color .15s;
}
.dir-more-btn:hover { background: var(--dir-ink); color: #fff; }

.dir-noresult {
  text-align: center; padding: 48px 16px; border: 1px dashed var(--dir-line); border-radius: 16px;
}
.dir-noresult p { margin: 0 0 6px; }
.dir-reset {
  margin-top: 12px; border: 1px solid var(--dir-line); background: #fff; border-radius: 999px;
  padding: 8px 18px; font: inherit; font-weight: 600; cursor: pointer;
}

.dir-join {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 48px; padding: 24px 28px; border-radius: 16px;
  background: #FAF9F6; border: 1px solid #e8e6e0;
}
.dir-join-title { margin: 0 0 4px; font-weight: 700; font-size: 17px; }
.dir-join-text { margin: 0; color: var(--dir-muted); }

/* ---------- Fil d'Ariane ---------- */
.dir-crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--dir-muted); margin-bottom: 12px; }
.dir-crumbs a { color: var(--dir-muted); text-decoration: none; }
.dir-crumbs a:hover { color: var(--dir-ink); text-decoration: underline; }
.dir-crumbs [aria-current] { color: var(--dir-ink); }

/* ---------- FAQ ---------- */
.dir-faq { margin-top: 56px; }
.dir .dir-faq h2, .dir .dir-links h2 { font-size: 20px; font-weight: 700; margin: 0 0 12px; letter-spacing: 0; line-height: 1.3; }
.dir-faq details { border-bottom: 1px solid var(--dir-line); }
.dir-faq summary {
  cursor: pointer; list-style: none; padding: 16px 32px 16px 0; position: relative;
  font-weight: 600; font-size: 16px;
}
.dir-faq summary::-webkit-details-marker { display: none; }
.dir-faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 22px; font-weight: 400; color: var(--dir-muted);
}
.dir-faq details[open] summary::after { content: "−"; }
.dir .dir-faq summary h3 {
  display: inline; font-size: 16px; font-weight: 600; margin: 0; line-height: 1.4;
  letter-spacing: 0; font-family: inherit;
}
.dir-faq-answer { padding: 0 0 16px; color: var(--sf-gray-600, #4B5563); line-height: 1.6; }
.dir-faq-answer p { margin: 0 0 8px; }
.dir-faq-answer p:last-child { margin-bottom: 0; }
.dir-faq-answer ul { margin: 4px 0 10px; padding-left: 20px; }
.dir-faq-answer li { margin-bottom: 4px; }
.dir-faq-answer a { color: var(--dir-sage-dark); font-weight: 600; }

/* ---------- Liens par spécialité / ville ---------- */
.dir-links { display: flex; flex-direction: column; gap: 28px; margin-top: 48px; }
.dir .dir-links h2 { font-size: 16px; }
.dir-links ul { list-style: none; margin: 0; padding: 0; columns: 3 160px; column-gap: 24px; }
.dir-links li { break-inside: avoid; margin-bottom: 6px; }
.dir-links a { color: var(--dir-ink); text-decoration: none; }
.dir-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.dir-links span { color: var(--dir-muted); font-size: 14px; }

/* ---------- Carte géographique ---------- */
.dir-map-panel { position: relative; }
.dir-map { width: 100%; height: 100%; background: var(--dir-soft); }
.dir-map-close { display: none; }

@media (min-width: 1100px) {
  .dir-map-panel {
    position: sticky; top: var(--dir-sticky);
    height: calc(100vh - var(--dir-sticky) - 24px);
    border-radius: 16px; overflow: hidden;
  }
}

@media (max-width: 1099.98px) {
  .dir-map-panel {
    position: fixed; inset: 0; z-index: 1100; background: #fff;
    display: none;
  }
  .dir-map-panel.is-open { display: block; }
  .dir-map-close {
    display: grid; place-items: center; position: absolute; top: 16px; right: 16px; z-index: 2;
    width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff;
    font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
  }
}

/* Bulle d'information de la carte */
.dir-iw-head {
  font-family: var(--font-sans, sans-serif); font-size: 15px; font-weight: 700; color: #1a1f2c;
  padding-top: 4px; max-width: 210px;
}
.dir-iw {
  font-family: var(--font-sans, sans-serif); display: flex; gap: 12px; align-items: center;
  max-width: 270px; padding-bottom: 2px;
}
.dir-iw-photo {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none;
  background: #EDE7DD;
}
.dir-iw-initial {
  display: grid; place-items: center; color: #6B8B68; font-weight: 700; font-size: 20px;
}
.dir-iw-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dir-iw-rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 13.5px; color: #1a1f2c; }
.dir-iw-rating svg { width: 14px; height: 14px; fill: #F5B301; }
.dir-iw-rating em { font-style: normal; font-weight: 400; color: #6B7280; }
.dir-iw-meta { color: #6B7280; font-size: 13px; }
.dir-iw a { color: #6B8B68; font-weight: 600; font-size: 13px; margin-top: 2px; }

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .dir { --dir-top: 84px; }   /* menu mobile (83), sans bandeau promo */
  .dir-head { padding: 20px 0 14px; }
  .dir-wrap { padding: 0 16px; }
  .dir-search { flex-direction: column; border-radius: 20px; padding: 8px; gap: 6px; }
  .dir-field { border: 1px solid var(--dir-line); border-radius: 12px; }
  .dir-field + .dir-field { border-left: 1px solid var(--dir-line); }
  .dir-field:focus-within { border-radius: 12px; }
  .dir-near { justify-content: center; border-radius: 12px; }
  .dir-grid { grid-template-columns: minmax(0, 1fr); }
  .dir-join { padding: 20px; }
}
