/* ==========================================================================
   Thème enfant Divi – Remparts Toi(T)
   Sommaire
   1. Variables de la charte
   2. Réglages généraux
   3. Composants
      3.1 Bandeau des résidences (accueil)
      3.2 Cartes uMap
   ========================================================================== */


/* 1. Variables de la charte
   -------------------------------------------------------------------------- */
:root {
  --rtt-carmin:      #b3182c;  /* titres, bordures, icônes */
  --rtt-bordeaux:    #521011;  /* texte courant, titres secondaires */
  --rtt-creme:       #fae7d5;  /* fonds de section */
  --rtt-blanc:       #ffffff;

  --rtt-font-titre:  'Outfit', Arial, sans-serif;
  --rtt-font-texte:  'Inter', Arial, sans-serif;

  --rtt-radius:      10px;
  --rtt-radius-lg:   30px;
  --rtt-ombre:       0 12px 18px -6px rgba(0, 0, 0, 0.2);
}


/* 2. Réglages généraux
   -------------------------------------------------------------------------- */

/* Évite le défilement horizontal causé par un élément qui dépasse */
html,
body {
  overflow-x: clip;
}

/* Liens de téléphone : pas de soulignement automatique sur iOS */
a[href^="tel:"] {
  white-space: nowrap;
}


/* 3. Composants
   -------------------------------------------------------------------------- */

/* 3.1 Bandeau des résidences (accueil)
   HTML : snippets/bandeau-residences.html, à coller dans un module Code */
.res-wrap {
  --res-ease: cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  width: 100%;
  height: clamp(420px, 45vw, 860px);
  font-family: 'Outfit', Arial, sans-serif;
  overflow: hidden;
}
.res-card {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  transition: flex 0.55s var(--res-ease);
}
.res-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s var(--res-ease);
}
.res-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,20,15,0.85) 0%, rgba(10,20,15,0.3) 55%, rgba(0,0,0,0) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 22px;
  transition: background 0.4s;
}

/* Titre vertical affiché quand la carte est réduite */
.res-label {
  writing-mode: vertical-rl;
  color: #ffffff;
  font-size: 22px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(180deg);
  white-space: nowrap;
  transition: opacity 0.25s 0.05s;
  pointer-events: none;
}

/* Contenu révélé */
.res-content {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.35s 0.18s, transform 0.35s 0.18s;
  max-width: 460px;
}
.res-num {
  font-size: 11px;
  letter-spacing: 0.24em;
  color: rgba(255,255,255,0.85);
  text-transform: uppercase;
  margin: 0 0 7px;
  padding: 0;
  line-height: 1.5;
}
.res-title {
  font-family: 'Outfit', Arial, sans-serif;
  font-size: 24px;
  font-weight: 400;
  color: #ffffff;
  margin: 0 0 14px;
  padding: 0;
  line-height: 1.2;
}
.res-sep {
  width: 32px;
  height: 1px;
  background: rgba(255,255,255,0.4);
  margin-bottom: 14px;
}
.res-text {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  line-height: 1.7;
  margin: 0;
  padding: 0;
}
.res-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffffff;
  border-bottom: 1px solid rgba(255,255,255,0.4);
  padding-bottom: 2px;
  text-decoration: none;
  transition: border-color 0.2s;
}
/* Toute la carte devient cliquable via le lien */
.res-cta::after {
  content: "";
  position: absolute;
  inset: 0;
}
.res-cta:hover,
.res-cta:focus-visible {
  color: #ffffff;
  border-color: #ffffff;
}
.res-cta:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
}

/* ----- Ordinateur avec souris : effet accordéon au survol ----- */
@media (hover: hover) and (min-width: 981px) {
  .res-card:hover,
  .res-card:focus-within { flex-grow: 3.2; }
  .res-card:hover img,
  .res-card:focus-within img { transform: scale(1.04); }
  .res-card:hover .res-overlay,
  .res-card:focus-within .res-overlay {
    background: linear-gradient(to top, rgba(10,20,15,0.9) 0%, rgba(10,20,15,0.42) 58%, transparent 100%);
  }
  .res-card:hover .res-label,
  .res-card:focus-within .res-label { opacity: 0; }
  .res-card:hover .res-content,
  .res-card:focus-within .res-content {
    opacity: 1;
    transform: none;
    transition-delay: 0.18s;
  }
  .res-content { min-width: 260px; }
}

/* ----- Grand écran tactile (iPad paysage…) : pas de survol, contenu visible ----- */
@media (hover: none) and (min-width: 981px) {
  .res-label { display: none; }
  .res-content { opacity: 1; transform: none; }
  .res-text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ----- Tablette et mobile : cartes empilées ----- */
@media (max-width: 980px) {
  .res-wrap {
    flex-direction: column;
    height: auto;
  }
  .res-card {
    flex: none;
    height: 380px;
  }
  .res-label { display: none; }
  .res-content { opacity: 1; transform: none; }
  .res-overlay {
    background: linear-gradient(to top, rgba(10,20,15,0.88) 0%, rgba(10,20,15,0.35) 60%, rgba(0,0,0,0) 100%);
  }
}
@media (max-width: 767px) {
  .res-card { height: 300px; }
  .res-overlay { padding: 20px 16px; }
  .res-title { font-size: 21px; margin-bottom: 10px; }
  .res-sep { margin-bottom: 10px; }
  .res-text { font-size: 13.5px; line-height: 1.6; }
}

@media (prefers-reduced-motion: reduce) {
  .res-card, .res-card img, .res-overlay, .res-label, .res-content { transition: none !important; }
}

/* 3.2 Cartes uMap
   Ajouter la classe "rtt-map" sur l'iframe (ou sur le module Code) */
.rtt-map,
.rtt-map iframe {
  display: block;
  width: 100%;
  height: 50vh;
  min-height: 340px;
  max-height: 640px;
  border: 0;
}
