/* ============================================================
   sections-v2-places-extra.css  (v2 — 21-05-2026)
   Additif à sections-v2.css :
   - Images de fond floutées sur les cartouches de lieux
   - Bandeau passerelle « Communes des environs »

   Changements v2 :
   - Cartouches : image bien plus visible (0.28 → 0.65)
                  voile blanc allégé pour laisser respirer le visuel
   - Bandeau    : voile bleu atténué (image plus présente)
                  image de fond plus opaque (0.55 → 0.85)
   ============================================================ */

/* ------------------------------------------------------------
   1) CARTOUCHES DE LIEUX : image de fond floutée + overlay
   ------------------------------------------------------------ */

/* Préparation : le contexte d'empilement + overflow */
.v2-place-card.has-bg {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* Image de fond floutée — pseudo-élément derrière le contenu.
   On déborde de quelques pixels (inset: -12px) pour éviter
   les bords nets que le flou laisse apparaître sur la périphérie. */
.v2-place-card.has-bg::before {
  content: '';
  position: absolute;
  inset: -12px;
  background-image: var(--card-bg);
  background-size: cover;
  background-position: center;
  filter: blur(1px) saturate(0.95);
  opacity: 0.95;            /* v2 : 0.28 → 0.65 — image clairement visible */
  z-index: -2;
  transition: opacity .35s ease, filter .35s ease, transform .6s ease;
  transform: scale(1.04);
}

/* Voile blanc gradient pour garantir la lisibilité du texte
   par-dessus l'image floutée — allégé en v2 pour laisser
   l'image respirer. */
.v2-place-card.has-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.72) 55%,
    rgba(255, 255, 255, 0.82) 100%
  );
  z-index: -1;
  transition: background .35s ease;
}

/* Hover : on révèle encore plus l'image, on atténue le voile,
   et on zoome très légèrement pour donner de la profondeur. */
.v2-place-card.has-bg:hover::before,
.v2-place-card.has-bg:focus-visible::before {
  opacity: 0.95;
  filter: blur(1px) saturate(1.05);
  transform: scale(1.08);
}

.v2-place-card.has-bg:hover::after,
.v2-place-card.has-bg:focus-visible::after {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.40) 0%,
    rgba(255, 255, 255, 0.60) 55%,
    rgba(255, 255, 255, 0.75) 100%
  );
}

/* On s'assure que tout le contenu reste au-dessus des pseudo-elts. */
.v2-place-card.has-bg > * {
  position: relative;
  z-index: 1;
}

/* Léger renfort de lisibilité sur titre/description :
   subtil text-shadow blanc qui détache le texte du fond visuel
   sans dénaturer la typographie. */
.v2-place-card.has-bg .v2-place-card__title,
.v2-place-card.has-bg .v2-place-card__desc {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ------------------------------------------------------------
   2) BANDEAU PASSERELLE « COMMUNES DES ENVIRONS »
   ------------------------------------------------------------ */

.v2-environs-banner {
  display: block;
  margin-top: 2.5rem;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  isolation: isolate;
  /* Fond de secours plus doux si pas d'image (v2 : moins saturé) */
  background: linear-gradient(135deg, #4a6691 0%, #5e7aa5 100%);
  box-shadow: 0 6px 22px -8px rgba(46, 70, 110, 0.4);
  transition: transform .35s ease, box-shadow .35s ease;
}

.v2-environs-banner:hover,
.v2-environs-banner:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px -10px rgba(46, 70, 110, 0.55);
}

/* Image de fond du bandeau (si fournie) — bien plus présente en v2 */
.v2-environs-banner.has-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--banner-bg);
  background-size: cover;
  background-position: center;
  opacity: 0.85;            /* v2 : 0.55 → 0.85 */
  z-index: -2;
  transition: opacity .4s ease, transform .8s ease;
}

.v2-environs-banner.has-bg:hover::before,
.v2-environs-banner.has-bg:focus-visible::before {
  opacity: 0.95;
  transform: scale(1.03);
}

/* Voile dégradé pour la lisibilité du texte blanc —
   nettement atténué en v2 : on garde juste assez d'ombre
   sur la moitié gauche (où se trouve le texte) pour le contraste,
   et on laisse la partie droite quasi transparente. */
.v2-environs-banner.has-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(28, 42, 70, 0.62) 0%,
    rgba(38, 58, 90, 0.40) 45%,
    rgba(46, 70, 110, 0.18) 80%,
    rgba(46, 70, 110, 0.10) 100%
  );
  z-index: -1;
}

/* Structure interne */
.v2-environs-banner__inner {
  position: relative;
  z-index: 1;
  padding: 2rem 2.25rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.75rem;
  align-items: center;
  color: #fff;
  min-height: 180px;
}

.v2-environs-banner__text {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.v2-environs-banner__eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 0.1rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.v2-environs-banner__title {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1.2;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.v2-environs-banner__desc {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.96);
  max-width: 56ch;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

/* Zone action (compteur + CTA) à droite */
.v2-environs-banner__action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
  min-width: 160px;
}

/* Compteur — fond plus marqué pour qu'il reste lisible
   sur la zone droite désormais quasi transparente */
.v2-environs-banner__count {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.9rem 1.25rem;
  background: rgba(28, 42, 70, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  min-width: 140px;
}

.v2-environs-banner__count-num {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.v2-environs-banner__count-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.92);
  margin-top: 0.3rem;
}

.v2-environs-banner__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.55rem 1rem;
  background: rgba(28, 42, 70, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background .25s ease, border-color .25s ease;
}

.v2-environs-banner:hover .v2-environs-banner__cta,
.v2-environs-banner:focus-visible .v2-environs-banner__cta {
  background: rgba(28, 42, 70, 0.62);
  border-color: rgba(255, 255, 255, 0.55);
}

/* ------------------------------------------------------------
   3) RESPONSIVE
   ------------------------------------------------------------ */

@media (max-width: 720px) {
  .v2-environs-banner__inner {
    grid-template-columns: 1fr;
    padding: 1.5rem 1.5rem;
    gap: 1.25rem;
  }

  .v2-environs-banner__action {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
  }

  .v2-environs-banner__title {
    font-size: 1.35rem;
  }

  .v2-environs-banner__count {
    padding: 0.6rem 0.9rem;
    min-width: 0;
  }

  .v2-environs-banner__count-num {
    font-size: 1.55rem;
  }
}

/* ------------------------------------------------------------
   4) ACCESSIBILITÉ : prefers-reduced-motion
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .v2-place-card.has-bg::before,
  .v2-place-card.has-bg::after,
  .v2-environs-banner,
  .v2-environs-banner.has-bg::before,
  .v2-environs-banner__cta {
    transition: none;
  }
  .v2-environs-banner:hover,
  .v2-environs-banner:focus-visible {
    transform: none;
  }
  .v2-place-card.has-bg::before {
    transform: none;
  }
}