/* ===========================================================
   REALISATIONS — comparateur avant / apres et grille
   =========================================================== */

.rea-grille {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  align-items: start;
}
/* chaque realisation occupe toute la largeur : les photos restent grandes */
.rea-bloc { grid-column: 1 / -1; }

/* --- comparateur --- */
.aa {
  position: relative;
  margin: 0 auto;
  overflow: hidden;
  background: #0f1215;
  width: 100%;
  height: auto;
  aspect-ratio: var(--rw, 4) / var(--rh, 3);
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  --p: 50%;
}
.aa .aa-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;      /* la photo entiere est visible, jamais rognée */
  object-position: center;
  display: block;
  pointer-events: none;
}
.aa .aa-avant {
  clip-path: inset(0 calc(100% - var(--p)) 0 0);
}
.aa .aa-curseur {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--p);
  width: 3px;
  margin-left: -1.5px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
  pointer-events: none;
}
.aa .aa-curseur::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: var(--rouge, #c00000);
  border: 3px solid #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.aa .aa-curseur::before {
  content: "‹ ›";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 15px;
  letter-spacing: 1px;
  font-weight: 700;
  pointer-events: none;
}
.aa .aa-tag {
  position: absolute;
  top: 12px;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 10px;
  background: rgba(17, 20, 23, .82);
  color: #fff;
  pointer-events: none;
}
.aa .aa-tag-avant { left: 12px; }
.aa .aa-tag-apres { right: 12px; background: var(--rouge, #c00000); }

.aa-legende {
  padding: 12px 2px 0;
}
.aa-legende h4 {
  font-size: 1.02rem;
  margin: 0 0 5px;
}
.aa-legende p {
  font-size: .88rem;
  color: #5a5a5a;
  margin: 0;
}
.aa-legende h4 { margin: 0 0 4px; }
.aa-compte { margin: 4px 0 0; }
.aa-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--rouge, #c00000);
  border: 1px solid rgba(192, 0, 0, .32);
  padding: 3px 8px;
  margin-bottom: 9px;
}

/* --- etat de repli --- */
.rea-vide {
  grid-column: 1 / -1;
  border: 1px dashed #cfcfcf;
  padding: 34px;
  text-align: center;
  color: #5a5a5a;
}

/* --- page admin --- */
.adm {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}
.adm h1 { font-size: 1.6rem; margin-bottom: 6px; }
.adm .adm-sous { color: #5a5a5a; font-size: .92rem; margin-bottom: 26px; }
.adm-carte {
  border: 1px solid #e3e3e3;
  padding: 24px;
  margin-bottom: 22px;
  background: #fff;
}
.adm-champ { margin-bottom: 16px; }
.adm-champ label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.adm-champ input[type="text"],
.adm-champ input[type="password"],
.adm-champ textarea,
.adm-champ select {
  width: 100%;
  font-family: inherit;
  font-size: .95rem;
  padding: 11px 13px;
  border: 1px solid #cfcfcf;
  background: #fff;
}
.adm-champ input:focus, .adm-champ textarea:focus, .adm-champ select:focus {
  outline: 2px solid rgba(192, 0, 0, .3);
  border-color: #c00000;
}
.adm-champ textarea { min-height: 80px; resize: vertical; }
.adm-deux { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.adm-fichier {
  border: 1px dashed #cfcfcf;
  padding: 14px;
  text-align: center;
  font-size: .84rem;
  color: #5a5a5a;
  cursor: pointer;
}
.adm-fichier input { display: none; }
.adm-apercu {
  margin-top: 9px;
  width: 100%;
  height: auto;
  object-fit: contain;
  border: 1px solid #e3e3e3;
  background: #f4f4f4;
  display: none;
}
.adm-apercu.vu { display: block; }
.adm-btn {
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  padding: 12px 22px;
  background: #c00000;
  color: #fff;
  border: 2px solid #c00000;
  cursor: pointer;
}
.adm-btn:hover { background: #960000; border-color: #960000; }
.adm-btn[disabled] { opacity: .55; cursor: not-allowed; }
.adm-btn-clair {
  background: transparent;
  color: #c00000;
}
.adm-etat {
  margin-top: 14px;
  font-size: .88rem;
  padding: 11px 13px;
  display: none;
}
.adm-etat.vu { display: block; }
.adm-etat.ok { background: #eaf7ee; color: #166534; border-left: 3px solid #16a34a; }
.adm-etat.ko { background: #fdecec; color: #991b1b; border-left: 3px solid #dc2626; }
.adm-liste { list-style: none; margin: 0; padding: 0; }
.adm-liste li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  font-size: .9rem;
}
.adm-liste img {
  width: 74px;
  height: 56px;
  object-fit: cover;
  flex: 0 0 auto;
}
.adm-liste .adm-nom { flex: 1; min-width: 0; }
.adm-liste .adm-nom b { display: block; }
.adm-liste .adm-nom span { color: #5a5a5a; font-size: .8rem; }
.adm-suppr {
  background: none;
  border: 1px solid #d9d9d9;
  color: #8a1c1c;
  font-size: .78rem;
  padding: 5px 10px;
  cursor: pointer;
  font-family: inherit;
}
.adm-suppr:hover { background: #fdecec; border-color: #dc2626; }

@media (max-width: 900px) {
  .rea-grille { grid-template-columns: 1fr; }
  .aa { width: 100%; }
  .adm-deux { grid-template-columns: 1fr; }
  .aa .aa-curseur::after { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
}

/* ===========================================================
   REALISATION MULTI-PHOTOS
   =========================================================== */
.rea-bloc {
  border-left: 2px solid #111417;     /* cotes : noir */
  border-right: 2px solid #111417;
  border-top: 4px solid #c00000;      /* haut et bas : rouge */
  border-bottom: 4px solid #c00000;
  background: #fff;
  padding: 12px 12px 14px;
  transition: box-shadow .25s, border-color .25s;
}
.rea-bloc:hover { box-shadow: 0 18px 40px -26px rgba(0, 0, 0, .45); }

/* vignettes de choix de paire */
.aa-vignettes {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.aa-vignette {
  position: relative;
  width: 92px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  background: #111417;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  font-family: inherit;
  transition: border-color .2s, transform .2s;
}
.aa-vignette img {
  width: 50%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.aa-vignette span {
  position: absolute;
  left: 0; bottom: 0;
  background: rgba(17, 20, 23, .82);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  pointer-events: none;
}
.aa-vignette:hover { transform: translateY(-2px); }
.aa-vignette.actif { border-color: var(--rouge, #c00000); }
.aa-vignette.actif span { background: var(--rouge, #c00000); }

.aa-aide {
  margin: 10px 0 0;
  font-size: .8rem;
  color: #6b6b6b;
}

/* photos non appariables */
.aa-galerie {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 12px;
}
.aa-vue {
  position: relative;
  display: block;
  overflow: hidden;
  background: #0f1215;
}
.aa-vue img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}
.aa-vue:hover img { opacity: .94; }
.aa-vue span {
  position: absolute;
  left: 0; bottom: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  background: rgba(17, 20, 23, .8);
  color: #fff;
  padding: 3px 7px;
}

.aa-compte {
  margin: 6px 0 0;
  font-size: .78rem;
  color: var(--rouge, #c00000);
  font-weight: 600;
}

@media (max-width: 900px) {
  .aa-galerie { grid-template-columns: repeat(2, 1fr); }
  .aa-vignette { width: 78px; height: 56px; }
}
@media (max-width: 560px) {
  .aa-galerie { grid-template-columns: 1fr; }
}

/* --- admin : plusieurs photos --- */
.adm-nb { font-weight: 400; color: #6b6b6b; font-size: .78rem; }
.adm-note { font-size: .8rem; color: #6b6b6b; margin: -4px 0 18px; }
.adm-apercus {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 9px;
}
.adm-apercus img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #0f1215;
  display: block;
}
@media (max-width: 560px) { .adm-apercus { grid-template-columns: repeat(2, 1fr); } }

/* ===========================================================
   GALERIE DE CHANTIER (sans paire avant / apres)
   =========================================================== */
.rea-chantier .aa-galerie-grande {
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 0;
}
.aa-galerie-grande .aa-vue {
  border: 0;
  padding: 0;
  cursor: zoom-in;
  font-family: inherit;
}
.aa-galerie-grande.avec-hero .aa-vue:first-child {
  grid-column: auto;
  grid-row: auto;
}
.aa-galerie-grande.seule { grid-template-columns: 1fr; justify-items: center; }
.aa-galerie-grande.seule .aa-vue { width: 100%; max-width: 560px; }


/* --- visionneuse --- */
.visionneuse {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(10, 10, 12, .94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.visionneuse img {
  max-width: 96vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}
.visionneuse-fermer {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.visionneuse-fermer:hover { background: var(--rouge, #c00000); }

@media (max-width: 900px) {
  .rea-chantier .aa-galerie-grande { grid-template-columns: 1fr; }
  .aa-galerie-grande .aa-vue:first-child { grid-column: auto; grid-row: auto; }
  .visionneuse { padding: 10px; }
}

/* ===========================================================
   COMPARATEURS : pleine largeur, cadre haut, photo entiere
   =========================================================== */
.rea-bloc.rea-compare { grid-column: 1 / -1; }
.rea-compare .aa {
  /* le cadre epouse le format reel de la photo, sans bandes noires :
     largeur limitee par la hauteur d'ecran disponible */
  width: min(100%, calc(86vh * var(--rw, 4) / var(--rh, 3)));
  aspect-ratio: var(--rw, 4) / var(--rh, 3);
  height: auto;
  max-height: 86vh;
  margin: 0 auto;
}
.rea-compare .aa-img { object-fit: contain; background: #0f1113; }
.rea-compare .aa-tag { font-size: 12px; padding: 7px 14px; }
@media (max-width: 900px) {
  .rea-compare .aa { max-height: 74vh; }
}

/* indice : cliquer pour agrandir */
.aa-indice {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(17, 20, 23, .78);
  padding: 5px 10px;
  pointer-events: none;
  letter-spacing: .3px;
}

/* --- vignettes video dans la galerie --- */
.aa-vue-video { position: relative; }
.aa-vue-video .aa-play {
  position: absolute;
  top: 50%; left: 50%;
  width: 54px; height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgba(192, 0, 0, .92);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .45);
  pointer-events: none;
}
.aa-vue-video .aa-play::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  margin: -10px 0 0 -6px;
  border-left: 17px solid #fff;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
}
.aa-vue-video:hover .aa-play { background: #c00000; transform: scale(1.06); }

/* --- visionneuse video --- */
.visionneuse-video video {
  max-width: 94vw;
  max-height: 90vh;
  background: #000;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .65);
}
@media (max-width: 560px) {
  .aa-vue-video .aa-play { width: 42px; height: 42px; margin: -21px 0 0 -21px; }
  .aa-vue-video .aa-play::after { margin: -8px 0 0 -5px; border-left-width: 13px; border-top-width: 9px; border-bottom-width: 9px; }
}

/* --- legendes : pas d'espace mort --- */
.aa-legende { padding: 10px 2px 2px; }
.aa-legende h4 { margin: 0 0 3px; font-size: 1rem; line-height: 1.25; }
.aa-legende p { margin: 0; }
.aa-legende .aa-compte { margin: 5px 0 0; }
.aa-legende .aa-badge { margin-bottom: 7px; }
.rea-bloc.rea-chantier { padding-bottom: 10px; }

/* ===========================================================
   BANDE DEROUANTE DE REALISATIONS (page d'accueil)
   =========================================================== */
.rea-bande {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.rea-bande-piste {
  display: flex;
  width: max-content;
  animation: defile-reas 46s linear infinite;
  will-change: transform;
}
.rea-bande:hover .rea-bande-piste { animation-play-state: paused; }
.rea-bande-groupe {
  display: flex;
  gap: 18px;
  padding-right: 18px;
}
@keyframes defile-reas {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

.rea-bande-carte {
  flex: 0 0 auto;
  width: 360px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-left: 2px solid #111417;
  border-right: 2px solid #111417;
  border-top: 4px solid #c00000;
  border-bottom: 4px solid #c00000;
  background: #fff;
  padding: 10px;
  transition: transform .25s, box-shadow .25s;
}
.rea-bande-carte:hover { transform: translateY(-4px); box-shadow: 0 18px 38px -24px rgba(0,0,0,.5); }
.rea-bande-img { display: flex; align-items: center; justify-content: center; overflow: hidden;
  aspect-ratio: 4/3; background: #0f1215; }
.rea-bande-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rea-bande-carte:hover .rea-bande-img img { transform: scale(1.05); }
.rea-bande-txt { display: block; padding: 12px 2px 2px; }
.rea-bande-txt .aa-badge { margin-bottom: 7px; }
.rea-bande-txt b { display: block; font-size: 1rem; line-height: 1.25; }
.rea-bande-info { display: block; margin-top: 6px; font-size: .8rem; color: #6b6b6b; }

@media (max-width: 900px) {
  .rea-bande-carte { width: 280px; }
  .rea-bande-piste { animation-duration: 32s; }
}
@media (max-width: 560px) {
  .rea-bande-carte { width: 240px; }
}

/* ===========================================================
   AVANT / APRES — les deux photos entieres, cote a cote
   =========================================================== */
.aa-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}
.aa-fig {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: #0f1215;
  border: 2px solid #111417;
  border-top: 4px solid var(--rouge, #c00000);
  cursor: zoom-in;
}
.aa-fig img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.aa-fig .aa-tag {
  position: absolute;
  top: 10px;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 10px;
  background: rgba(17, 20, 23, .82);
  color: #fff;
  pointer-events: none;
}
.aa-fig .aa-tag-avant { left: 10px; }
.aa-fig .aa-tag-apres { right: 10px; background: var(--rouge, #c00000); }

@media (max-width: 700px) {
  .aa-duo { grid-template-columns: 1fr; gap: 10px; }
}

/* ---------- mobile : la photo entiere tient dans l'ecran ---------- */
@media (max-width: 700px) {
  .aa-fig img,
  .aa-vue img {
    width: auto;
    max-width: 100%;
    max-height: 58vh;
    margin: 0 auto;
  }
  .aa-fig, .aa-vue { display: flex; align-items: center; justify-content: center; }
}
