/* ==========================================================================
   Réalisations — styles spécifiques (préfixe .rea-)
   Héro « polaroid » avant/après piloté par le défilement, galerie filtrable,
   visionneuse plein écran, avis, bandeau CTA.
   ========================================================================== */

/* --- HÉRO ---------------------------------------------------------------- */
/* padding-top et taille du H1 : échelle commune .page-hero (main.css) */
.rea-hero {
  padding-bottom: clamp(3.5rem, 2.5rem + 4vw, 6.5rem);
  background:
    radial-gradient(70% 50% at 50% 0%, rgba(255, 211, 219, .9), transparent 72%),
    linear-gradient(180deg, var(--blush-100) 0%, var(--blush-50) 48%, var(--paper) 82%);
}
.rea-hero h1 { max-width: 19ch; }
.rea-hero .lead { max-width: 50ch; }
/* intros centrées : lignes équilibrées, pas de mot orphelin */
.rea-hero .lead, .cta-band .lead { text-wrap: balance; }
/* retour à la ligne des titres, seulement à partir de la tablette */
.rea-br { display: none; }
@media (min-width: 640px) { .rea-br { display: inline; } }

/* Scène : grand comparateur façon photo polaroid */
.rea-stage {
  --bun: clamp(74px, 4.6vw + 50px, 124px);
  position: relative;
  z-index: 2;
  width: min(100%, 1040px);
  margin: calc(var(--bun) * .72 + clamp(1rem, .6rem + 1.4vw, 2rem)) auto 0;
}
.rea-polaroid {
  position: relative;
  z-index: 1;
  padding: clamp(.55rem, .35rem + .8vw, 1rem) clamp(.55rem, .35rem + .8vw, 1rem) 0;
  border: var(--border);
  border-radius: clamp(20px, 1vw + 14px, 30px);
  background: var(--white);
  box-shadow: var(--shadow-sticker-lg), 0 36px 64px -36px rgba(176, 42, 75, .42);
  transform: rotate(-1.2deg);
  transform-origin: 50% 70%;
}
/* Mobile : ombre douce plus courte, pour qu’elle ne soit pas coupée net en bas du héro */
@media (max-width: 639px) {
  .rea-polaroid { box-shadow: var(--shadow-sticker-lg), 0 24px 40px -24px rgba(176, 42, 75, .42); }
}
.rea-polaroid__ba.ba {
  aspect-ratio: 1 / 1;
  border-radius: clamp(14px, .8vw + 9px, 20px);
  box-shadow: none;
}
@media (min-width: 640px) { .rea-polaroid__ba.ba { aspect-ratio: 4 / 3; } }
@media (min-width: 1000px) { .rea-polaroid__ba.ba { aspect-ratio: 16 / 10; } }
.rea-polaroid__ba img { object-position: 50% 62%; }
.rea-polaroid__ba .ba__handle { width: clamp(56px, 2vw + 46px, 70px); height: clamp(56px, 2vw + 46px, 70px); }
.rea-polaroid__ba .ba__handle .icon { width: 28px; height: 28px; }
.rea-polaroid__ba .ba__label { bottom: clamp(.8rem, .5rem + 1vw, 1.4rem); font-size: clamp(.78rem, .72rem + .2vw, .9rem); }
.rea-polaroid__ba .ba__label--before { left: clamp(.8rem, .5rem + 1vw, 1.4rem); }
.rea-polaroid__ba .ba__label--after { right: clamp(.8rem, .5rem + 1vw, 1.4rem); }
.rea-polaroid__caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .25rem 1.2rem;
  padding: .8rem .4rem 1rem;
}
/* légende manuscrite du polaroid : seule écriture « à la main » de la page */
.rea-polaroid__title {
  font-family: var(--font-hand);
  font-size: clamp(1.6rem, 1.2rem + 1.3vw, 2.4rem);
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
}
.rea-polaroid__meta {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--ink-2);
}
.rea-polaroid__meta .icon { width: 1.1em; height: 1.1em; color: var(--brand); }

/* Reflet « propre » qui balaie la photo à la fin du nettoyage */
.rea-shine {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}
.rea-shine::before {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 26%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .6) 50%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(var(--shine, -130%)) skewX(-14deg);
}

/* Mascotte qui dépasse de derrière la photo */
.rea-stage__bunny {
  position: absolute;
  z-index: 0;
  right: 7%;
  top: calc(var(--bun) * -.98);
  width: var(--bun);
  height: auto;
  transform: rotate(7deg);
  transform-origin: 50% 100%;
  filter: drop-shadow(0 5px 0 rgba(42, 26, 32, .12));
  pointer-events: none;
}
@media (min-width: 640px) { .rea-stage__bunny { right: 22%; } }

/* --- GALERIE -------------------------------------------------------------- */
.rea-gallery__inner { position: relative; z-index: 1; }
.rea-gallery .section-head { margin-bottom: clamp(1.6rem, 1.1rem + 1.6vw, 2.4rem); }
.rea-discretion {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  margin-top: .2rem;
  padding: .45rem 1.1rem .45rem .5rem;
  border: var(--bw) dashed rgba(42, 26, 32, .35);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .7);
  font-size: var(--step--1);
  font-weight: 650;
  line-height: 1.35;
  color: var(--ink-2);
  text-align: left;
}
.rea-discretion__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: var(--border);
  border-radius: 50%;
  background: var(--lilac);
  color: var(--ink);
}
.rea-discretion__icon .icon { width: 16px; height: 16px; }

/* Barre de filtres (visible uniquement avec JavaScript) */
.rea-toolbar {
  display: grid;
  justify-items: center;
  margin-bottom: clamp(2rem, 1.4rem + 2vw, 3.4rem);
}
html:not(.js) .rea-toolbar { display: none; }
.rea-filters {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .3rem;
  max-width: 100%;
  padding: .35rem;
  border: var(--border);
  border-radius: var(--r-pill);
  background: var(--white);
  box-shadow: var(--shadow-sticker-sm);
}
.rea-filters__glider {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 0;
  height: 0;
  border-radius: var(--r-pill);
  background: var(--ink);
  box-shadow: 0 3px 0 var(--pink-400);
  opacity: 0;
  pointer-events: none;
}
.rea-filters.has-glider .rea-filters__glider { opacity: 1; }
.rea-filter {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 48px;
  padding: .55rem 1.1rem .55rem .95rem;
  border-radius: var(--r-pill);
  font-size: .98rem;
  font-weight: 750;
  line-height: 1.1;
  white-space: nowrap;
  color: var(--ink);
  transition: color .35s, background-color .35s;
  -webkit-tap-highlight-color: transparent;
}
.rea-filter .icon { width: 1.15em; height: 1.15em; color: var(--brand); transition: color .35s, transform .5s var(--ease-bounce); }
.rea-filter:hover { background: var(--blush-100); color: var(--ink); }
.rea-filter:hover .icon { transform: rotate(-10deg) scale(1.12); }
.rea-filter[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.rea-filter[aria-pressed="true"] .icon { color: var(--pink-400); }
.rea-filters.has-glider .rea-filter[aria-pressed="true"] { background: transparent; }
.rea-filters.is-init .rea-filter, .rea-filters.is-init .rea-filter .icon, .rea-filters.is-init .rea-filter__count { transition: none; }
.rea-filter:focus-visible { border-radius: var(--r-pill); outline-offset: 2px; }
.rea-filter__count {
  display: inline-grid;
  place-items: center;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0 .35rem;
  border-radius: var(--r-pill);
  background: var(--blush-100);
  color: var(--ink);
  font-size: .76rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transition: background-color .35s;
}
.rea-filter[aria-pressed="true"] .rea-filter__count { background: var(--pink-400); }
/* Sous 900 px, les 4 filtres (~690 px) ne tiennent plus sur une ligne : grille 2 × 2
   plutôt qu’une répartition 3 + 1 (compacte sur tablette, pleine largeur sur mobile) */
@media (max-width: 899px) {
  .rea-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: var(--r-lg); }
  .rea-filters__glider, .rea-filter { border-radius: 19px; }
}
@media (max-width: 639px) {
  .rea-filters { width: 100%; }
  .rea-filter { gap: .4rem; padding: .5rem .45rem; font-size: .9rem; }
  .rea-filter__count { min-width: 1.35rem; height: 1.35rem; font-size: .7rem; }
}
@media (max-width: 359px) { .rea-filter .icon { display: none; } }

/* Grille des réalisations */
.rea-grid {
  position: relative;
  display: grid;
  gap: clamp(1.3rem, .8rem + 1.6vw, 2.3rem);
  align-items: start;
  align-content: start;
  list-style: none;
}
@media (min-width: 640px) { .rea-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .rea-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rea-item { position: relative; z-index: 1; }
/* Décalage de la colonne centrale (comme l’accueil), recalculé en JS après chaque filtrage */
@media (min-width: 640px) {
  .rea-item.is-offset { margin-top: clamp(1.6rem, 1rem + 2vw, 3.2rem); }
}
@media (min-width: 640px) and (max-width: 999px) {
  html:not(.js) .rea-item:nth-child(2n) { margin-top: clamp(1.6rem, 1rem + 2vw, 3.2rem); }
}
@media (min-width: 1000px) {
  html:not(.js) .rea-item:nth-child(3n+2) { margin-top: 3.2rem; }
}
/* Apparition au défilement (gérée en JS) + filet de sécurité */
.js.has-gsap .rea-item:not(.is-in) { opacity: 0; }
.js.has-gsap .rea-grid:not(.is-ready) .rea-item { animation: failsafeShow .6s 3.5s forwards; }

/* Carte projet : la photo, le service, un titre */
.rea-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow: clip;
  border: var(--border);
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: var(--shadow-sticker);
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out);
}
@media (hover: hover) {
  .rea-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-sticker-lg); }
}
.rea-card .ba {
  border: 0;
  border-bottom: var(--border);
  border-radius: 0;
  box-shadow: none;
}
.rea-card .ba__handle { width: 52px; height: 52px; }
.rea-card .ba__handle .icon { width: 23px; height: 23px; }
.rea-card .ba__label { bottom: .8rem; padding: .3rem .7rem; font-size: .72rem; }
.rea-card .ba__label--before { left: .8rem; }
.rea-card .ba__label--after { right: .8rem; }

/* Avant | après côte à côte : photos prises sous deux angles différents, donc sans curseur
   (rea-duo--stack : l’une au-dessus de l’autre, pour les photos en largeur) */
.rea-duo {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  aspect-ratio: 1 / 1;
  border-bottom: var(--border);
  background: var(--ink);
}
.rea-duo--stack { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
.rea-duo__half { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.rea-duo__half img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease-out);
}
@media (hover: hover) {
  .rea-card:hover .rea-duo__half img { transform: scale(1.04); }
}
.rea-duo .ba__label { top: .7rem; bottom: auto; left: .7rem; right: auto; padding: .3rem .7rem; font-size: .72rem; }
.rea-card__body { display: grid; gap: .4rem; padding: 1.05rem 1.3rem 1.35rem; }
.rea-card__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.rea-card__kicker {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--brand-dark);
}
.rea-card__num {
  flex: none;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: .85;
  color: var(--blush-200);
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  transition: color .4s, transform .6s var(--ease-bounce);
}
.rea-card:hover .rea-card__num { color: var(--pink-400); transform: rotate(-8deg) scale(1.08); }
.rea-card__title { font-size: clamp(1.22rem, 1.1rem + .45vw, 1.5rem); line-height: 1.15; }

/* Bouton « agrandir » (visionneuse) */
.rea-zoom {
  position: absolute;
  top: .8rem;
  right: .8rem;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  transition: transform .4s var(--ease-bounce), background-color .3s, box-shadow .3s;
}
.rea-zoom:hover { background: var(--pink-400); color: var(--ink); transform: scale(1.08) rotate(-6deg); }
.rea-zoom:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.rea-zoom:focus-visible { border-radius: 50%; }
.rea-zoom .icon { width: 19px; height: 19px; }

/* Aucun résultat */
.rea-empty {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: 2.5rem 1rem 1rem;
  text-align: center;
  font-weight: 700;
  color: var(--ink-2);
}
.rea-empty img { width: 90px; }

/* --- VISIONNEUSE ---------------------------------------------------------- */
.rea-lightbox {
  --lb-pad: clamp(.6rem, .3rem + 1.6vw, 2rem);
  --lb-side: clamp(300px, 24vw, 360px);
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: var(--lb-pad);
  border: 0;
  background: rgba(42, 26, 32, .86);
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.rea-lightbox[open] { display: grid; place-items: center; }
.rea-lightbox::backdrop { background: transparent; }
/* verrouillage du défilement sans décalage de mise en page (la gouttière reste réservée) */
html.rea-lb-open, html.rea-lb-open.lenis.lenis-stopped { overflow: hidden; scrollbar-gutter: stable; }
.rea-lightbox__panel {
  position: relative;
  display: grid;
  width: min(100%, 640px);
  overflow: hidden;
  overflow: clip;
  border: var(--border);
  border-radius: var(--r-xl);
  background: var(--paper);
  box-shadow: 0 10px 0 var(--pink-400), 0 40px 120px -30px rgba(0, 0, 0, .6);
}
.rea-lightbox__media { background: var(--ink); }
.rea-lightbox__ba.ba {
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.rea-lightbox__info {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  padding: clamp(1.2rem, 1rem + 1vw, 1.9rem);
  border-top: var(--border);
}
.rea-lightbox__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 46px; }
.rea-lightbox__pos {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.rea-lightbox__close { flex: none; }
.rea-lightbox__text-wrap { display: grid; gap: .5rem; }
.rea-lightbox__title { font-size: var(--step-2); line-height: 1.1; }
/* infos en haut, commandes (précédent / suivant + devis) groupées en bas */
.rea-lightbox__nav { display: flex; align-items: center; gap: .6rem; margin-top: auto; padding-top: .4rem; }
.rea-lightbox__keys {
  display: none;
  align-items: center;
  gap: .3rem;
  margin-left: .4rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--ink-2);
}
.rea-lightbox__keys kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.7rem;
  height: 1.7rem;
  border: 1.5px solid currentColor;
  border-radius: 7px;
  font-family: var(--font-body);
  font-size: .8rem;
}
.rea-lightbox__cta { margin-top: .5rem; padding-top: 1.2rem; border-top: var(--bw) dashed var(--line); }
@media (min-width: 900px) {
  .rea-lightbox__panel { grid-template-columns: auto var(--lb-side); width: auto; max-width: 100%; }
  .rea-lightbox__ba.ba {
    width: min(calc(100vh - 2 * var(--lb-pad) - 4px), calc(100vw - 2 * var(--lb-pad) - var(--lb-side) - 6px), 880px);
    width: min(calc(100dvh - 2 * var(--lb-pad) - 4px), calc(100vw - 2 * var(--lb-pad) - var(--lb-side) - 6px), 880px);
  }
  .rea-lightbox__info { border-top: 0; border-left: var(--border); }
}
@media (hover: hover) and (pointer: fine) { .rea-lightbox__keys { display: inline-flex; } }

/* --- AVIS ----------------------------------------------------------------- */
.rea-reviews { padding-bottom: clamp(3rem, 2rem + 4vw, 6rem); }
.rea-reviews .section-head { margin-bottom: 2rem; }
/* Grille statique (pas de défilement automatique) : 1, 2 + 1 puis 3 colonnes */
.rea-reviews__grid .review { width: auto; }
@media (min-width: 640px) {
  .rea-reviews__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rea-reviews__grid > .review:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  .rea-reviews__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rea-reviews__grid > .review:last-child:nth-child(odd) { grid-column: auto; }
}

/* --- CTA FINAL ------------------------------------------------------------ */
/* Mise en page mobile du bandeau (boutons, lapin) : règles communes .cta-band (main.css) */
.rea-cta { padding-top: clamp(1rem, 2vw, 2rem); }
.rea-cta .cta-band .title { max-width: 24ch; }
@media (max-width: 559px) {
  /* libellé raccourci à l’écran, complet pour les lecteurs d’écran */
  .rea-cta__more {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
  }
}
