.button-container {
  text-align: center;
  width: 100%;
  margin-top: 30px;
}

#agency-places {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* =========================
   HERO INTRO (STABLE)
========================= */
#agency-hero{
  position: relative;
  width: 100vw;
  height: var(--hero-h, calc(var(--vh, 1vh) * 100)); /* <= piloté par JS */
  max-height: calc(var(--vh, 1vh) * 100);           /* plafond */
  overflow: hidden;
  background: #000;
}

/* centre un canvas responsive */
#agency-hero .stage{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background-image: url(https://webandmedias.com/wp-content/uploads/2026/02/backgroundDesktop.png);
  background-size: contain;
  background-repeat: repeat;
}

/* canvas : par défaut desktop 16/9 */
#agency-hero .stage-inner{
  position: relative;
  aspect-ratio: 16 / 9;
  width: min(100vw, calc(var(--vh, 1vh) * 100 * (16/9)));
  height: min(calc(var(--vh, 1vh) * 100), calc(100vw * (9/16)));
}

/* layer base */
#agency-hero .layer{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

/* BG suit EXACTEMENT le même scaling que les overlays */
#agency-hero .bg{
  z-index: 1;
  object-fit: contain; /* ✅ comme le reste */
}

/* overlays */
#agency-hero .el{
  z-index: 2;
  object-fit: contain; /* ✅ pas de déformation */
  transform: translate3d(0,0,0);
  transition: transform 900ms cubic-bezier(.2,.9,.2,1);
  will-change: transform;
  backface-visibility: hidden;
}

/* positions hors cadre (en % du canvas) */
#agency-hero .from-top    { transform: translate3d(0, -120%, 0); }
#agency-hero .from-bottom { transform: translate3d(0,  120%, 0); }
#agency-hero .from-right   { transform: translate3d(-120%, 0, 0); }
#agency-hero .from-left  { transform: translate3d( 120%, 0, 0); }
#agency-hero .is-in       { transform: translate3d(0, 0, 0); }

/* Desktop/Mobile switching */
.is-mobile{ display: none; }
.is-desktop{ display: block; }

@media (max-width: 768px){
  .is-mobile{ display: block; }
  .is-desktop{ display: none; }
  #agency-hero .stage{
  background-image: url(https://webandmedias.com/wp-content/uploads/2026/02/backgroundmobile.jpg);
  background-size: auto 100%;
}

  /* ✅ canvas mobile 9/16 */
  #agency-hero .stage-inner{
    aspect-ratio: 9 / 16;
    width: min(100vw, calc(var(--vh, 1vh) * 100 * (9/16)));
    height: min(calc(var(--vh, 1vh) * 100), calc(100vw * (16/9)));
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  #agency-hero .el{ transition: none; }
  #agency-hero .from-top,
  #agency-hero .from-bottom,
  #agency-hero .from-left,
  #agency-hero .from-right{
    transform: translate3d(0, 0, 0);
  }
}

/* =========================
   PLACES GRID
========================= */

.places-grid {
  width: 90%;
  max-width: 1400px;

  margin: 60px auto;
  padding: 0;

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;

  box-sizing: border-box;
}


/* =========================
   CARTES GLASS
========================= */

.place-card {
  position: relative;

  display: flex;
  flex-direction: column;

  min-width: 0;
  height: 100%;

  margin: 0;

  overflow: hidden;

  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.11),
      rgba(255, 255, 255, 0.035)
    );

  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);

  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);

  box-sizing: border-box;

  transition:
    transform 0.35s ease,
    background 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}


/* Reflet animé */

.place-card::before {
  content: "";

  position: absolute;
  z-index: 3;

  top: -60%;
  left: -100%;

  width: 75%;
  height: 220%;

  background:
    linear-gradient(
      110deg,
      transparent 25%,
      rgba(255, 255, 255, 0.09) 50%,
      transparent 75%
    );

  transform: rotate(12deg);

  transition: left 0.8s ease;

  pointer-events: none;
}


/* Halo discret */

.place-card::after {
  content: "";

  position: absolute;
  z-index: 1;

  right: -100px;
  bottom: -100px;

  width: 220px;
  height: 220px;

  background:
    radial-gradient(
      circle,
      rgba(255, 255, 255, 0.09),
      rgba(255, 255, 255, 0.025) 45%,
      transparent 72%
    );

  pointer-events: none;
}


/* =========================
   IMAGE HAUTE
========================= */

.place-image {
  position: relative;
  z-index: 2;

  width: 100%;
  height: 360px;

  overflow: hidden;

}


.place-image::after {
  content: "";

  position: absolute;
  inset: 0;

  background:
    linear-gradient(
      to bottom,
      transparent 55%,
      rgba(38, 36, 51, 0.78) 100%
    );

  pointer-events: none;
}


.place-image img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center;

  transition:
    transform 0.7s cubic-bezier(.2, .8, .2, 1),
    filter 0.5s ease;
}


/* =========================
   CONTENU GLASS
========================= */

.place-content {
  position: relative;
  z-index: 2;

  display: flex;
  flex-direction: column;
  flex-grow: 1;

  padding: 32px 34px 36px;

  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.045),
      rgba(255, 255, 255, 0.015)
    );

  border-top: 1px solid rgba(255, 255, 255, 0.10);

  box-sizing: border-box;
}


.place-content h3 {
  margin: 0 0 16px;

  color: #ffffff;

  font-size: 24px;
  line-height: 1.2;
}


.place-content p {
  margin: 0;

  color: rgba(255, 255, 255, 0.76);

  line-height: 1.65;
}


/* =========================
   SURVOL
========================= */

.place-card:hover {
  transform: translateY(-8px);

  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.16),
      rgba(255, 255, 255, 0.055)
    );

  border-color: rgba(255, 255, 255, 0.30);

  box-shadow:
    0 30px 65px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}


.place-card:hover::before {
  left: 130%;
}


.place-card:hover .place-image img {
  transform: scale(1.045);
  filter: brightness(1.04);
}


/* =========================
   TABLETTE
========================= */

@media screen and (max-width: 900px) {

  .places-grid {
    grid-template-columns: 1fr;

    width: calc(100% - 40px);

    gap: 24px;

    margin-top: 40px;
    margin-bottom: 40px;
  }

  .place-image {
    height: 320px;
  }

}


/* =========================
   MOBILE
========================= */

@media screen and (max-width: 600px) {

  .places-grid {
    width: calc(100% - 30px);
    gap: 20px;
  }

  .place-card {

    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }

  .place-image {
    height: 240px;
  }

  .place-content {
    padding: 26px 24px 28px;
  }

  .place-content h3 {
    font-size: 21px;
  }

  .place-card:hover {
    transform: none;
  }

  .place-card::before {
    display: none;
  }

  .place-card:hover .place-image img {
    transform: none;
  }

}