/* WP Mes Annonces — vitrine et fiche. Polices héritées du thème. */
.wpma {
  --wpma-ink: #1c2329;
  --wpma-muted: #6b7178;
  --wpma-line: #e8e5e0;
  --wpma-soft: #f7f5f2;
  --wpma-accent: #1f3a4a;
  --wpma-radius: 6px;
  color: var(--wpma-ink);
  box-sizing: border-box;
}
.wpma *, .wpma *::before, .wpma *::after { box-sizing: inherit; }
.wpma [hidden] { display: none !important; }

.wpma-empty { color: var(--wpma-muted); }
.wpma-section-title { margin: 3rem 0 1.25rem; font-size: 1.35rem; font-weight: 500; letter-spacing: .01em; }
.wpma-footnote { margin-top: 2.5rem; font-size: .78rem; color: var(--wpma-muted); }

/* ---------- Grille de vignettes ---------- */
.wpma-grid {
  display: grid; gap: 2rem 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.wpma-card {
  display: block; color: inherit; text-decoration: none; background: #fff;
}
.wpma-card__media {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--wpma-soft); border-radius: var(--wpma-radius);
}
.wpma-card__media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s ease;
}
a.wpma-card:hover .wpma-card__media img { transform: scale(1.03); }
a.wpma-card:focus-visible { outline: 2px solid var(--wpma-accent); outline-offset: 4px; }
.wpma-card.is-sold .wpma-card__media img { filter: grayscale(.35) brightness(.92); }
.wpma-card__body { padding: .9rem .1rem 0; }
.wpma-card__city {
  margin: 0; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--wpma-muted);
}
.wpma-card__title { margin: .3rem 0 .4rem; font-size: 1.05rem; font-weight: 500; line-height: 1.35; }
.wpma-card__price { margin: 0; font-size: 1.15rem; font-weight: 600; }
.wpma-card__legal {
  margin: .2rem 0 0; font-size: .75rem; color: var(--wpma-muted);
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
}

.wpma-badge {
  position: absolute; top: .9rem; left: .9rem; z-index: 2;
  background: rgba(255,255,255,.94); color: var(--wpma-ink);
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .35rem .65rem; border-radius: 3px;
}
.wpma-badge--vendu { background: var(--wpma-accent); color: #fff; }
.wpma-badge--compromis { background: #b07d2b; color: #fff; }

/* Pastille DPE (couleurs de l'étiquette énergie) */
.wpma-dpe {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.4rem; height: 1.4rem; padding: 0 .3rem; border-radius: 3px;
  font-size: .72rem; font-weight: 700; color: #fff;
}
.wpma-dpe--a { background: #009c6d; } .wpma-dpe--b { background: #52b153; }
.wpma-dpe--c { background: #a5cc74; color: #1c2329; } .wpma-dpe--d { background: #f4e70f; color: #1c2329; }
.wpma-dpe--e { background: #f0b40f; color: #1c2329; } .wpma-dpe--f { background: #eb8235; }
.wpma-dpe--g { background: #d7221f; }

/* ---------- Galerie de la fiche ---------- */
.wpma-gallery { position: relative; margin: 0 0 .75rem; }
.wpma-gallery__track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  border-radius: var(--wpma-radius); scrollbar-width: none; background: var(--wpma-soft);
}
.wpma-gallery__track::-webkit-scrollbar { display: none; }
.wpma-gallery__track:focus-visible { outline: 2px solid var(--wpma-accent); outline-offset: 3px; }
.wpma-gallery__slide { flex: 0 0 100%; margin: 0; scroll-snap-align: center; aspect-ratio: 16 / 9; }
.wpma-gallery__open {
  all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in;
}
.wpma-gallery__open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wpma-gallery__nav, .wpma-lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.92); color: var(--wpma-ink);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.wpma-gallery__nav--prev { left: 1rem; } .wpma-gallery__nav--next { right: 1rem; }
.wpma-gallery__count {
  position: absolute; right: 1rem; bottom: 1rem; z-index: 2;
  background: rgba(20,24,28,.7); color: #fff; font-size: .8rem;
  padding: .3rem .6rem; border-radius: 3px;
}
.wpma-thumbs { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; margin-bottom: 2.5rem; }
.wpma-thumbs__item {
  all: unset; flex: 0 0 auto; width: 88px; height: 60px; cursor: pointer;
  border-radius: 4px; overflow: hidden; opacity: .55; transition: opacity .2s;
}
.wpma-thumbs__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wpma-thumbs__item.is-active, .wpma-thumbs__item:hover { opacity: 1; }
.wpma-thumbs__item:focus-visible { outline: 2px solid var(--wpma-accent); outline-offset: 2px; }

@media (max-width: 700px) {
  .wpma-gallery__slide { aspect-ratio: 4 / 3; }
  .wpma-gallery__nav { display: none; }
  .wpma-thumbs { display: none; }
  .wpma-gallery { margin-bottom: 2rem; }
}

/* ---------- Mise en page de la fiche ---------- */
.wpma-single__layout { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
@media (max-width: 900px) { .wpma-single__layout { grid-template-columns: 1fr; } }
.wpma-single__city { margin: 0; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--wpma-muted); }
.wpma-single__catch { margin: .4rem 0 1rem; font-size: 1.25rem; line-height: 1.4; }
.wpma-single__price { margin: 0; font-size: 1.75rem; font-weight: 600; }
.wpma-single__fees { margin: .15rem 0 0; font-size: .85rem; color: var(--wpma-muted); }
.wpma-h { font-size: 1.15rem; font-weight: 500; margin: 2.5rem 0 .75rem; }
.wpma-desc p { margin: 0 0 .9rem; line-height: 1.7; }

.wpma-features {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  margin: 2rem 0 0; border-top: 1px solid var(--wpma-line);
}
.wpma-features > div { padding: .85rem 0; border-bottom: 1px solid var(--wpma-line); }
.wpma-features dt { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--wpma-muted); }
.wpma-features dd { margin: .2rem 0 0; font-weight: 500; }

.wpma-legal { background: var(--wpma-soft); border-radius: var(--wpma-radius); padding: 1.1rem 1.25rem; font-size: .82rem; color: #4a5056; }
.wpma-legal p { margin: 0 0 .5rem; line-height: 1.55; } .wpma-legal p:last-child { margin: 0; }
.wpma-legal a { color: inherit; }

.wpma-single__aside { position: sticky; top: 2rem; }
.wpma-contact { border: 1px solid var(--wpma-line); border-radius: var(--wpma-radius); padding: 1.5rem; background: #fff; }
.wpma-contact__name { margin: 0; font-size: 1.1rem; font-weight: 600; }
.wpma-contact__role { margin: .15rem 0 1.25rem; color: var(--wpma-muted); font-size: .9rem; }
.wpma-contact__legal { margin: 1.25rem 0 0; font-size: .72rem; color: var(--wpma-muted); line-height: 1.5; }
.wpma-btn {
  display: block; text-align: center; text-decoration: none; margin-top: .6rem;
  padding: .8rem 1rem; border-radius: 4px; border: 1px solid var(--wpma-ink); color: var(--wpma-ink);
  font-size: .92rem; transition: background .2s, color .2s;
}
.wpma-btn:hover { background: var(--wpma-ink); color: #fff; }
.wpma-btn--primary { background: var(--wpma-accent); border-color: var(--wpma-accent); color: #fff; }
.wpma-btn--primary:hover { background: #142833; }
.wpma-btn--link { border-color: transparent; color: var(--wpma-muted); text-decoration: underline; text-underline-offset: 3px; }
.wpma-btn--link:hover { background: none; color: var(--wpma-ink); }

/* ---------- Plein écran ---------- */
.wpma-lightbox {
  position: fixed; inset: 0; width: 100vw; height: 100vh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: rgba(12,14,16,.97); color: #fff; overflow: hidden;
}
.wpma-lightbox::backdrop { background: rgba(12,14,16,.97); }
.wpma-lightbox__track {
  display: flex; width: 100%; height: 100%; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.wpma-lightbox__track::-webkit-scrollbar { display: none; }
.wpma-lightbox__slide {
  flex: 0 0 100%; height: 100%; scroll-snap-align: center;
  display: flex; align-items: center; justify-content: center; padding: 3.5rem 1rem;
}
.wpma-lightbox__slide img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.wpma-lightbox__close {
  position: absolute; top: .75rem; right: .75rem; z-index: 3;
  width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer;
}
.wpma-lightbox__nav { background: rgba(255,255,255,.12); color: #fff; box-shadow: none; }
.wpma-lightbox__nav--prev { left: 1rem; } .wpma-lightbox__nav--next { right: 1rem; }
.wpma-lightbox__count { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); font-size: .85rem; opacity: .8; }
@media (max-width: 700px) { .wpma-lightbox__nav { display: none; } .wpma-lightbox__slide { padding: 3.5rem 0; } }
@media (prefers-reduced-motion: reduce) {
  .wpma-gallery__track { scroll-behavior: auto; }
  .wpma-card__media img { transition: none; }
}

/* ---------- Moteur de recherche ---------- */
.wpma-search {
  background: #fff; border: 1px solid var(--wpma-line); border-radius: var(--wpma-radius);
  padding: 1.25rem 1.25rem 1.35rem; box-shadow: 0 8px 30px rgba(28,35,41,.06);
}
.wpma-search__title { margin: 0 0 1rem; font-size: 1.15rem; font-weight: 500; }
.wpma-search__fields {
  display: grid; gap: .9rem 1rem; align-items: end;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.wpma-field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.wpma-field label { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--wpma-muted); }
.wpma-field select {
  width: 100%; height: 2.9rem; padding: 0 2.2rem 0 .8rem; font: inherit; font-size: .95rem; color: var(--wpma-ink);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7178' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right .85rem center;
  border: 1px solid var(--wpma-line); border-radius: 4px; appearance: none; -webkit-appearance: none; cursor: pointer;
}
.wpma-field select:focus { outline: 2px solid var(--wpma-accent); outline-offset: 1px; border-color: var(--wpma-accent); }
.wpma-field--submit .wpma-btn { margin: 0; height: 2.9rem; padding: 0 1.5rem; cursor: pointer; font: inherit; font-weight: 500; width: 100%; }
.wpma-search--compact { box-shadow: none; background: var(--wpma-soft); border-color: transparent; margin-bottom: 1.5rem; }
@media (max-width: 560px) { .wpma-search__fields { grid-template-columns: 1fr 1fr; } .wpma-field--submit { grid-column: 1 / -1; } }

.wpma-list__bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.5rem; }
.wpma-list__count { margin: 0; color: var(--wpma-muted); font-size: .9rem; }
.wpma-list__count a { color: var(--wpma-ink); }
.wpma-sort label { font-size: .85rem; color: var(--wpma-muted); }
.wpma-sort select { font: inherit; font-size: .85rem; border: 1px solid var(--wpma-line); border-radius: 4px; padding: .35rem .5rem; background: #fff; color: var(--wpma-ink); }
.wpma-noresult { background: var(--wpma-soft); border-radius: var(--wpma-radius); padding: 1.75rem 1.5rem; }
.wpma-noresult p { margin: 0 0 .75rem; } .wpma-noresult p:last-child { margin: 0; }
.wpma-btn--inline { display: inline-block; margin: .5rem .5rem 0 0; }
.wpma-pagination { display: flex; justify-content: center; gap: .4rem; margin-top: 2.5rem; flex-wrap: wrap; }
.wpma-pagination .page-numbers { padding: .45rem .8rem; border: 1px solid var(--wpma-line); border-radius: 4px; text-decoration: none; color: var(--wpma-ink); font-size: .9rem; }
.wpma-pagination .page-numbers.current { background: var(--wpma-accent); border-color: var(--wpma-accent); color: #fff; }
.wpma .wpma-field--submit .wpma-btn { font-size: .95rem; line-height: 1; letter-spacing: .02em; }
.wpma-noresult { font-size: .95rem; line-height: 1.6; }
.wpma-noresult strong { font-size: 1.05rem; font-weight: 600; }
.wpma .wpma-btn--inline { font-size: .9rem; }
@media (max-width: 560px) { .wpma-field select { font-size: .9rem; padding-left: .65rem; padding-right: 1.9rem; background-position: right .6rem center; } }

/* ---------- Recherche v1.3 : ville, rayon, curseurs ---------- */
.wpma-search__fields { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
@media (min-width: 760px) { .wpma-field--ville { grid-column: span 2; } }
.wpma-field input[type=text] {
  width: 100%; height: 2.9rem; padding: 0 .8rem; font: inherit; font-size: .95rem; color: var(--wpma-ink);
  background: #fff; border: 1px solid var(--wpma-line); border-radius: 4px; box-shadow: none;
}
.wpma-field input[type=text]:focus { outline: 2px solid var(--wpma-accent); outline-offset: 1px; border-color: var(--wpma-accent); }
.wpma-ac { position: relative; }
.wpma-ac__list {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px);
  margin: 0; padding: .3rem 0; list-style: none; background: #fff;
  border: 1px solid var(--wpma-line); border-radius: 4px; box-shadow: 0 10px 30px rgba(28,35,41,.12);
}
.wpma-ac__item { padding: .6rem .85rem; cursor: pointer; font-size: .95rem; }
.wpma-ac__item.is-active, .wpma-ac__item:hover { background: var(--wpma-soft); }

.wpma-range__head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.wpma-range__value { font-size: .85rem; color: var(--wpma-ink); white-space: nowrap; }
.wpma-range {
  --wpma-lo: 0%; --wpma-hi: 100%;
  position: relative; height: 2.9rem;
}
.wpma-range::before, .wpma-range::after {
  content: ""; position: absolute; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px;
}
.wpma-range::before { left: 0; right: 0; background: var(--wpma-line); }
.wpma-range::after { left: var(--wpma-lo); right: calc(100% - var(--wpma-hi)); background: var(--wpma-accent); }
.wpma-range input[type=range] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; z-index: 2;
  background: none; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.wpma-range input[type=range]::-webkit-slider-runnable-track { background: none; border: 0; }
.wpma-range input[type=range]::-moz-range-track { background: none; border: 0; }
.wpma-range input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 2px solid var(--wpma-accent); box-shadow: 0 1px 4px rgba(0,0,0,.18); cursor: grab;
}
.wpma-range input[type=range]::-moz-range-thumb {
  pointer-events: auto; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid var(--wpma-accent); box-shadow: 0 1px 4px rgba(0,0,0,.18); cursor: grab;
}
.wpma-range input[type=range]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--wpma-accent); outline-offset: 2px; }
.wpma-range input[type=range]:focus-visible::-moz-range-thumb { outline: 2px solid var(--wpma-accent); outline-offset: 2px; }
@media (max-width: 560px) { .wpma-field--range, .wpma-field--ville { grid-column: 1 / -1; } }

/* ---------- Fiche : éléments ajoutés par le thème (date, auteur, commentaires, image à la une) ---------- */
.single-wpma_annonce .entry-meta,
.single-wpma_annonce .entry-content > .post-thumbnail,
.single-wpma_annonce .entry-content > a.post-thumbnail,
.single-wpma_annonce .post-thumbnail:not(.wpma *),
.single-wpma_annonce img.featured-image:not(.wpma *),
.single-wpma_annonce .comments-area,
.single-wpma_annonce #comments { display: none !important; }

/* ---------- Étiquettes énergie / climat ---------- */
.wpma-labels { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.25rem 2rem; align-items: start; margin: 0 0 1.25rem; }
.wpma-labels--single { grid-template-columns: 1fr; max-width: 640px; }
@media (max-width: 700px) { .wpma-labels { grid-template-columns: 1fr; } .wpma-labels__climat { width: 65.6%; } } /* même échelle que l’étiquette énergie (420 / 640) */
.wpma-label { display: block; width: 100%; height: auto; overflow: visible; }
.wpma-costs { border-top: 1px solid var(--wpma-line); padding-top: 1rem; margin-bottom: .5rem; }
.wpma-costs__title { margin: 0; font-weight: 600; }
.wpma-costs__range { margin: .3rem 0; font-size: 1.05rem; }
.wpma-costs__range strong { font-size: 1.45rem; font-weight: 700; }
.wpma-costs__note { margin: 0; font-size: .78rem; color: var(--wpma-muted); line-height: 1.5; }

/* 1.2.2 : mise en page selon la largeur réellement disponible (et non celle de l'écran),
   pour que la colonne principale ne soit jamais écrasée par le cadre de contact. */
.wpma-single { container-type: inline-size; }
@container (max-width: 860px) {
  .wpma-single__layout { grid-template-columns: 1fr; }
  .wpma-single__aside { position: static; }
}
.wpma-single__main { container-type: inline-size; }
@container (max-width: 620px) {
  .wpma-labels { grid-template-columns: 1fr; }
  .wpma-labels__climat { width: 65.6%; }
}
