/*
 * Scope-preserving polaroid styles moved out of template markup so the browser
 * can cache the rules and keep per-instance rendering lightweight.
 */
.banner-full { position: relative; } /* déjà présent dans front-page, doublon inoffensif */
.ea-pola {
  position: absolute;
  z-index: 6; /* devant l’image de bannière */
  left: clamp(10px, 4vw, 56px);
  bottom: clamp(10px, 3.6vw, 44px);
  pointer-events: auto;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.ea-pola--stack {
  position: static;
  z-index: auto;
  left: auto;
  bottom: auto;
  pointer-events: auto;
}
.ea-pola--stack .ea-pola-card {
  box-shadow: 0 10px 32px rgba(0,0,0,.16);
}
.ea-pola-link {
  display: contents;
}
.ea-pola--gallery {
  position: static;
  display: block;
  max-width: 320px;
  margin: 0 auto;
}
.ea-pola--gallery .ea-pola-card {
  padding: clamp(0.8rem, 1.5vw, 1.2rem);
  border-radius: 12px;
}
.ea-pola-label {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.45);
}

.ea-pola-card {
  --border: clamp(10px, 2.2vmin, 22px);
  --bottom-extra: calc(var(--border) * 2.2);
  --mx: 0; --my: 0; --rotX: 0deg; --rotY: 0deg; --idleX: 0deg; --idleY: 0deg; --scale: 1;
  --shadow-ambient: 0 16px 48px rgba(0,0,0,.22);
  --shadow-tilt: 0 0 0 rgba(0,0,0,0);

  position: relative;
  display: inline-block;
  background: #fff;
  padding: var(--border);
  padding-bottom: calc(var(--border) + var(--bottom-extra));
  border-radius: 10px;
  box-shadow: var(--shadow-ambient), var(--shadow-tilt);
  transform: rotateX(calc(var(--rotX) + var(--idleX))) rotateY(calc(var(--rotY) + var(--idleY))) scale(var(--scale));
  transform-style: preserve-3d;
  transition:
    transform 260ms cubic-bezier(.2,.6,.2,1),
    box-shadow 260ms ease,
    filter 260ms ease;
  will-change: transform, box-shadow;
}

.ea-pola-card::before {
  content: "";
  position: absolute; inset: 0; border-radius: 10px; pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255,255,255,.50) 0%, rgba(255,255,255,.20) 32%, rgba(255,255,255,0) 33%) no-repeat,
    radial-gradient(140% 120% at -20% -20%, rgba(255,255,255,.22), rgba(255,255,255,0) 60%) no-repeat;
  background-size: 140% 100%, 60% 60%;
  background-position:
    calc(50% - (var(--mx) * 28%))
    calc(0% + (var(--my) * 16%)),
    top left;
  mix-blend-mode: screen;
}

.ea-pola-card::after {
  content: "";
  position: absolute; inset: 0; border-radius: 10px; pointer-events: none;
  box-shadow:
    inset 0 0 1px rgba(0,0,0,.35),
    inset 0 -1px 2px rgba(0,0,0,.18),
    inset 0 1px 2px rgba(255,255,255,.55);
}

.ea-pola-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  border-radius: 6px;
  object-fit: contain;
  background: #f4f4f6;
}

.ea-pola-card:hover { --scale: 1.012; }

@media (max-width: 900px) {
  .ea-pola { left: clamp(8px, 3.6vw, 24px); bottom: clamp(8px, 3.6vw, 24px); }
  .ea-pola-img { max-width: min(80vw, 520px); max-height: 50dvh; }
}

@media (prefers-reduced-motion: reduce) {
  .ea-pola-card { transition: box-shadow .2s ease; }
}

/* Stack context: let the image drive the height, no max constraints. */
.ea-pola--stack .ea-pola-img {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
}
