/* =======================================================
   TRAM-E — PAGE RÉSIDENCES
   Couleurs primaires franches, zéro dégradé, grille uniforme
======================================================= */

body.page-residences {
  color: #f0ece0;
}

.res-wrapper {
  width: 100%;
  min-height: 100%;
}

/* =======================================================
   HERO
======================================================= */

.res-hero {
  padding: 5rem 4rem 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #2b3341;
}

.res-hero__eyebrow {
  font-family: "Mohave", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 1rem;
}

.res-hero__title {
  font-family: "Matrimoine", sans-serif;
  font-size: clamp(3.5rem, 8vw, 9rem);
  line-height: 0.9;
  color: #fff;
  margin-bottom: 1.5rem;
}

.res-hero__intro {
  font-family: "Mohave", sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  color: rgba(255, 255, 255, 0.55);
  max-width: 520px;
  border-left: 3px solid #fff;
  padding-left: 1.2rem;
}

/* =======================================================
   GRILLE — cases toutes identiques
======================================================= */

.res-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 300px; 
  gap: 4px;
  padding: 4px;
}

/* =======================================================
   CARTE
======================================================= */

.res-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--card-color, #222);
}

/* Image de fond */
.res-card__bg {
  position: absolute;
  inset: 0;
}

.res-card__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  filter: brightness(0.55);
}

.res-card__placeholder {
  width: 100%;
  height: 100%;
  background: var(--card-color, #333);
}

/* Overlay aplat couleur au survol — PAS de dégradé */
.res-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--card-color, #000);
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 1;
  mix-blend-mode: multiply;
}

.res-card:hover::after {
  opacity: 0.55;
}

/* Trait coloré pleine largeur en bas */
.res-card::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-color, #fff);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
  z-index: 3;
}

.res-card:hover::before {
  transform: scaleX(1);
}

/* Zoom image au hover */
.res-card:hover .res-card__bg img {
  transform: scale(1.06);
  filter: brightness(0.4);
}

/* =======================================================
   CONTENU DE LA CARTE
======================================================= */

.res-card__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  z-index: 2;
}

.res-card__title {
  font-family: "Matrimoine", sans-serif;
  font-size: clamp(1.1rem, 1.8vw, 1.6rem);
  line-height: 1.1;
  color: #fff;
  margin-bottom: 0;
  transition: margin-bottom 0.3s ease;
}

.res-card__desc {
  font-family: "Mohave", sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin: 0.6rem 0 0.8rem;
  max-width: 280px;
  /* Caché par défaut, révélé au hover */
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.35s ease,
    opacity 0.3s ease 0.05s;
}

.res-card:hover .res-card__desc {
  max-height: 80px;
  opacity: 1;
}

.res-card__cta {
  font-family: "Mohave", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  background: var(--card-color, #555);
  padding: 4px 12px;
  display: inline-block;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.25s ease 0.1s,
    transform 0.25s ease 0.1s;
}

.res-card:hover .res-card__cta {
  opacity: 1;
  transform: translateY(0);
}

/* =======================================================
   LIGHTBOX
======================================================= */

.res-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: #1f1f22;
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.res-lightbox.active {
  display: flex;
}

.res-lb__inner {
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.res-lb__header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 1rem;
}

.res-lb__title {
  font-family: "Matrimoine", sans-serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: #fff;
  margin-bottom: 0.4rem;
}

.res-lb__desc {
  font-family: "Mohave", sans-serif;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.5);
}

.res-lb__main {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #111;
}

.res-lb__main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.res-lb__thumbs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.res-lb__thumbs img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s;
  border: 2px solid transparent;
}

.res-lb__thumbs img:hover,
.res-lb__thumbs img.active {
  opacity: 1;
  border-color: #fff;
}

.res-lb__empty {
  font-family: "Mohave", sans-serif;
  color: rgba(255, 255, 255, 0.25);
  text-align: center;
  padding: 4rem;
  font-style: italic;
}

/* Boutons lightbox */
.res-lb__close,
.res-lb__prev,
.res-lb__next {
  position: fixed;
  background: #fff;
  color: #000;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    transform 0.2s;
  font-family: "Mohave", sans-serif;
}

.res-lb__close:hover,
.res-lb__prev:hover,
.res-lb__next:hover {
  background: #ff00e9;
  color: #fff;
}

.res-lb__close {
  top: 1.5rem;
  right: 1.5rem;
}
.res-lb__prev {
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
}
.res-lb__next {
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
}
.res-lb__prev:hover {
  transform: translateY(-50%) scale(1.1);
}
.res-lb__next:hover {
  transform: translateY(-50%) scale(1.1);
}

/* =======================================================
   RESPONSIVE
======================================================= */

@media (max-width: 1024px) {
  .res-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .res-hero {
    padding: 4rem 2rem 2.5rem;
  }
}

@media (max-width: 640px) {
  
  
  .res-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 220px;
  }
  .res-hero {
    padding: 3rem 1.5rem 2rem;
  }
  .res-lb__prev,
  .res-lb__next {
    display: none;
  }
    .res-card__desc {
    max-height: 80px;
    opacity: 1;
  }
  .res-card__cta {
    opacity: 1;
    transform: translateY(0);
  }
  
}

.res-detail {
  width: 100%;
  min-height: 100vh;
  background: #201b1b;
}

.res-detail__layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  height: 100vh;
}


/* ============ COLONNE GAUCHE ============ */

.res-detail__left {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--res-header-bg);
}

.res-detail__header {
  padding: 2.5rem 2.5rem 1rem;
  flex-shrink: 0;
}

.res-detail__back {
  display: inline-block;
  font-family: "Mohave", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  transition: color 0.2s;
}
.res-detail__back:hover { color: var(--res-color); background:white; border:2px solid white; }

.res-detail__titre {
  font-family: "Matrimoine", sans-serif;
  font-size: clamp(2rem, 3.5vw, 3.5rem);
  line-height: 1;
  color: #fff;
  margin-bottom: 1.5rem;
}

.res-detail__desc {
  font-family: "Mohave", sans-serif;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.55);
  border-left: 3px solid var(--res-color);

}

.res-detail__bar {
  height: 4px;
  background: var(--res-color);
  flex-shrink: 0;
}

/* Visionneur — prend tout le reste de la hauteur disponible */
.res-detail__viewer {
  flex: 1;
  min-height: 0;
  background: var(--res-viewer-bg);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#viewerImage,
#viewerVideo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 0.25s ease;
}

.res-detail__placeholder {
  width: 100%;
  height: 100%;
  background: var(--res-color, #333);
  opacity: 0.3;
}

/* ============ COLONNE DROITE ============ */

.res-detail__right {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  background: #0a0a0a;
}

.res-detail__section-title {
  font-family: "Mohave", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--res-color);
  padding: 20px 20px 10px;
}

/* --- Bloc vidéos, en haut --- */
.res-detail__videos {
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.res-detail__video-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 20px;
}

.res-detail__video-thumb {
  width: calc(50% - 4px);
  aspect-ratio: 16/9;
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  background: none;
  padding: 0;
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s;
}
.res-detail__video-thumb:hover { transform: scale(1.03); }

.res-detail__video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
  backdrop-filter: blur(2px);
  transition: 0.3s;
}
.res-detail__video-thumb:hover .play { transform: scale(1.2); }

.res-detail__video-thumb.active,
.res-detail__gal-thumb.active {
  border-color: var(--res-color);
}

/* --- Bloc galerie, en dessous, prend le reste --- */
.res-detail__gallery {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.res-detail__gal-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 0 20px 20px;
}

.res-detail__gal-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid transparent;
  background: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.55;
  transition: border-color 0.2s, opacity 0.2s;
}

.res-detail__gal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.res-detail__gal-thumb:hover { opacity: 0.85; }

.res-detail__gal-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  font-family: "Mohave", sans-serif;
  color: rgba(255, 255, 255, 0.2);
  font-style: italic;
  padding: 0 20px 20px;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 1024px) {
  .res-detail__layout {
    grid-template-columns: 320px 1fr;
  }
  .res-detail__header {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .res-detail__layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .res-detail__left,
  .res-detail__right {
    height: auto;
    overflow: visible;
  }
  .res-detail__viewer {
    height: 55vw;
    min-height: 220px;
  }
  .res-detail__video-thumb {
    width: calc(33.333% - 6px);
  }
  .res-detail__gal-thumbs {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* -------------------------------------------------------
   3. Lightbox mobile plein écran (residences.css)
      Cachée par défaut, activée uniquement ≤768px via JS
------------------------------------------------------- */
.res-mobile-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #000;
  align-items: center;
  justify-content: center;
}
 
.res-mobile-lightbox.active {
  display: flex;
}
 
.res-mobile-lightbox__inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
 
.res-mobile-lightbox__inner img,
.res-mobile-lightbox__inner video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
 
.res-mobile-lightbox__close {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
 