/* ==========================================================================
   Fiche projet — single-projet.php
   Mobile-first. Tokens repris de la maquette Figma, structure éditoriale
   inspirée de calq.fr (galerie tout de suite après le hero, texte en colonne
   principale, encart infos premium + carte à droite, légères animations
   au scroll).
   ========================================================================== */

.projet-single {
  --avf-text: #35373b;
  --avf-black: #171a1d;
  --avf-tag-bg: #edeff1;
  --avf-border: #e3e5e8;
  --avf-font: "Plus Jakarta Sans", sans-serif;
  --avf-radius: 4px;
  --avf-gutter: 20px;

  /*
   * Largeur de la grille Figma (canvas 1920px, marges de 60px de chaque
   * côté). À garder synchronisée à la main avec le réglage Elementor
   * Site Settings > Layout > Content Width si tu le changes un jour.
   */
  --avf-content-width: 1800px;

  font-family: var(--avf-font);
  color: var(--avf-text);
}

/* ---------- Hero ---------- */

.projet-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #d9dbde;
}

@media (min-width: 640px) {
  .projet-hero {
    aspect-ratio: 16 / 9;
  }
}

@media (min-width: 1024px) {
  .projet-hero {
    aspect-ratio: 21 / 8;
    max-height: 680px;
  }
}

.projet-hero__image {
  width: 100%;
  height: 112%; /* dépasse légèrement le cadre pour laisser de la marge au parallax JS */
  object-fit: cover;
  display: block;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .projet-hero__image {
    height: 100%;
  }
}

.projet-hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(23, 26, 29, 0) 50%, rgba(23, 26, 29, 0.8) 100%);
  pointer-events: none;
}

.projet-hero__caption {
  position: absolute;
  left: var(--avf-gutter);
  right: var(--avf-gutter);
  bottom: 28px;
  color: #fff;
}

@media (min-width: 1024px) {
  .projet-hero__caption {
    left: 60px;
    bottom: 48px;
    max-width: 65%;
  }
}

.projet-hero__title {
  font-family: var(--avf-font);
  font-weight: 700;
  font-size: clamp(28px, 6vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.projet-hero__meta {
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.85;
  margin: 0;
}

/* ---------- Conteneur général ---------- */

.projet-content {
  max-width: var(--avf-content-width);
  margin: 0 auto;
  padding: 32px var(--avf-gutter) 100px;
}

@media (min-width: 1024px) {
  .projet-content {
    padding: 48px 60px 140px;
  }
}

/* ---------- Fil d'Ariane ---------- */

.projet-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--avf-text);
}

@media (min-width: 1024px) {
  .projet-breadcrumb {
    margin-bottom: 32px;
  }
}

.projet-breadcrumb a {
  color: var(--avf-text);
  opacity: 0.55;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.projet-breadcrumb a:hover,
.projet-breadcrumb a:focus-visible {
  opacity: 1;
  text-decoration: underline;
}

.projet-breadcrumb span[aria-hidden] {
  opacity: 0.35;
}

.projet-breadcrumb__current {
  opacity: 0.85;
  font-weight: 500;
}

/* ---------- En-tête : badges + adresse ---------- */

.projet-subhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 24px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--avf-border);
}

@media (min-width: 1024px) {
  .projet-subhead {
    margin-bottom: 64px;
  }
}

.projet-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.projet-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--avf-tag-bg);
  color: var(--avf-text);
  font-weight: 700;
  font-size: 12px;
  line-height: 1.55;
  padding: 6px 12px;
  border-radius: 999px;
}

.projet-tag--outline {
  background: transparent;
  border: 1px solid var(--avf-border);
}

.projet-tag__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.projet-subhead__adresse {
  font-weight: 500;
  font-size: 14px;
  color: var(--avf-text);
  opacity: 0.8;
  margin: 0;
}

/* ---------- Galerie : rail horizontal, juste après le hero ---------- */

.projet-galerie {
  margin-bottom: 64px;
}

@media (min-width: 1024px) {
  .projet-galerie {
    margin-bottom: 96px;
  }
}

.projet-galerie__rail {
  display: flex;
  align-items: flex-start; /* chaque item garde sa propre hauteur : une légende ne doit pas étirer ses voisins */
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none; /* masque la scrollbar, reste navigable clavier/tactile */
}

.projet-galerie__rail::-webkit-scrollbar {
  display: none;
}

.projet-galerie__item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  margin: 0;
}

.projet-galerie__link {
  display: block;
  height: 260px;
  overflow: hidden;
  border-radius: var(--avf-radius);
}

@media (min-width: 640px) {
  .projet-galerie__link {
    height: 360px;
  }
}

@media (min-width: 1024px) {
  .projet-galerie__link {
    height: 480px;
  }
}

.projet-galerie__item img {
  height: 100%;
  width: auto;
  max-width: none;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.projet-galerie__link:hover img,
.projet-galerie__link:focus-visible img {
  transform: scale(1.045);
}

@media (prefers-reduced-motion: reduce) {
  .projet-galerie__item img {
    transition: none;
  }
  .projet-galerie__link:hover img {
    transform: none;
  }
}

.projet-galerie__item figcaption {
  margin-top: 8px;
  font-weight: 700;
  font-size: 13px;
  color: var(--avf-text);
  max-width: 320px;
}

/* ---------- Flèches : discrètes, sans fond ---------- */

.projet-galerie__nav {
  display: flex;
  gap: 24px;
  margin-top: 16px;
}

/*
 * Le thème (Hello Elementor + réglages globaux Elementor non configurés)
 * applique des styles par défaut aux <button>. On les neutralise
 * explicitement ici pour que le composant reste autonome, quels que
 * soient les réglages globaux définis plus tard dans Elementor.
 */
.projet-galerie__arrow,
.projet-galerie__arrow:hover,
.projet-galerie__arrow:focus,
.projet-galerie__arrow:active,
.projet-galerie__arrow:visited {
  appearance: none;
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px;
  cursor: pointer;
  color: var(--avf-black) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.projet-galerie__arrow:hover {
  transform: translateX(2px);
}

.projet-galerie__arrow[data-dir="prev"]:hover {
  transform: translateX(-2px);
}

.projet-galerie__arrow:disabled,
.projet-galerie__arrow:disabled:hover {
  color: var(--avf-black) !important;
  opacity: 0.25;
  cursor: default;
  transform: none;
}

.projet-galerie__arrow:focus-visible {
  outline: 2px solid var(--avf-black);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Corps : texte pleine largeur, puis bande infos pleine largeur ----------
   Deux tentatives précédentes ont laissé du vide (texte flexible avec
   contenu plafonné, puis encart flexible avec grille interne trop large
   pour son contenu). Le côte-à-côte oblige à faire correspondre deux
   largeurs variables (texte ↔ encart) qui ne matchent jamais sur tous les
   projets, certains textes étant courts, d'autres longs. On empile : le
   texte prend toute la largeur, puis l'encart devient une bande basse
   pleine largeur, avec ses items en ligne à largeur naturelle (pas de
   colonnes forcées) — impossible d'y créer un vide, chaque item ne prend
   que la place dont il a besoin. */

.projet-main {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* ---------- Texte de présentation ---------- */

.projet-texte p {
  max-width: 78ch;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: var(--avf-text);
  margin: 0 0 20px;
}

@media (min-width: 1024px) {
  .projet-texte p {
    font-size: 18px;
  }
}

.projet-texte p:last-child {
  margin-bottom: 0;
}

/* ---------- Fiche technique : bande premium pleine largeur, façon calq.fr ----------
   Items en ligne (flex-wrap), largeur naturelle par item : aucune colonne
   forcée ne peut donc rester vide, quel que soit le nombre de champs
   renseignés sur le projet. */

.projet-infos {
  background: var(--avf-black);
  color: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  padding: 32px;
}

@media (min-width: 1024px) {
  .projet-infos {
    padding: 40px 48px;
  }
}

.projet-infos__title {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 24px;
}

.projet-infos__list {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 44px;
}

.projet-infos__item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 0 1 auto;
  max-width: 260px;
}

.projet-infos__label {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.projet-infos__value {
  font-weight: 500;
  font-size: 15px;
  line-height: 1.5;
  color: #fff;
}

/* ---------- Carte de localisation : bande courte sous les infos ---------- */

.projet-map {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.projet-map__label {
  display: block;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 14px;
}

.projet-map__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

@media (min-width: 768px) {
  .projet-map__frame {
    /* Bande large et courte : la carte occupe toute la largeur de
       l'encart sans faire grimper sa hauteur. */
    aspect-ratio: 21 / 6;
  }
}

.projet-map__frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.projet-map__trigger {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--avf-font);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.projet-map__trigger:hover,
.projet-map__trigger:focus-visible {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

/* ---------- Projets similaires ---------- */

.projet-similaires {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--avf-border);
}

@media (min-width: 1024px) {
  .projet-similaires {
    margin-top: 96px;
    padding-top: 64px;
  }
}

.projet-similaires__title {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--avf-black);
  margin: 0 0 32px;
}

.projet-similaires__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 640px) {
  .projet-similaires__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .projet-similaires__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
  }
}

.projet-similaire {
  display: block;
  color: inherit;
  text-decoration: none;
}

.projet-similaire__media {
  aspect-ratio: 4 / 3;
  border-radius: var(--avf-radius);
  overflow: hidden;
  background: #d9dbde;
  margin-bottom: 16px;
}

.projet-similaire__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.projet-similaire:hover .projet-similaire__media img,
.projet-similaire:focus-visible .projet-similaire__media img {
  transform: scale(1.045);
}

.projet-similaire__tag {
  display: inline-block;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--avf-text);
  opacity: 0.55;
  margin-bottom: 8px;
}

.projet-similaire__title {
  font-weight: 600;
  font-size: 17px;
  line-height: 1.35;
  color: var(--avf-black);
  margin: 0 0 4px;
}

.projet-similaire__lieu {
  display: block;
  font-size: 13px;
  color: var(--avf-text);
  opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
  .projet-similaire__media img {
    transition: none;
  }
  .projet-similaire:hover .projet-similaire__media img {
    transform: none;
  }
}

/* ---------- Encart contact : incitation à contacter l'agence ---------- */

.projet-cta {
  margin-top: 64px;
  background: var(--avf-black);
  border-radius: 12px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

@media (min-width: 1024px) {
  .projet-cta {
    margin-top: 96px;
    padding: 56px 64px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
  }
}

.projet-cta__text h2 {
  font-weight: 700;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.25;
  color: #fff;
  margin: 0 0 8px;
}

.projet-cta__text p {
  font-weight: 400;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}

.projet-cta__button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--avf-black);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 16px 32px;
  border-radius: 999px;
  transition: transform 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.projet-cta__button:hover,
.projet-cta__button:focus-visible {
  transform: translateY(-1px);
  opacity: 0.9;
}

/* ---------- Animations légères au scroll (cf. JS, IntersectionObserver) ---------- */

.avf-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.avf-reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .avf-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Lightbox minimaliste (option, cf. JS) ---------- */

.avf-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(23, 26, 29, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}

.avf-lightbox[hidden] {
  display: none;
}

.avf-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--avf-radius);
}

.avf-lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
}
