/* The bubble of a project: a panel (veil, blur behind, a fine line, sharp corners), the project's photograph, its name,
   then the way to it or its place; joined by a leader line, as on a plan, to what names the project. Two uses:
   - on the home page, beside a building of the drawing (css/ville-accueil.css, js/ville-accueil.js);
   - in the text of the pages, above or below a link to a project (« --texte », js/apercu-projets.js,
     functions/apercu-projets.php; asked by Christophe on 27/11/2026: « le même tooltip au survol que sur la page
     d'accueil »). */

.doda-bulle {
  position: absolute;
  z-index: 30;
  width: 15rem;
  padding: var(--espace-s);
  background: var(--doda-voile-dense);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid var(--doda-trait-fort);
  border-radius: 0;
  color: var(--doda-blanc);
  opacity: 0;
  visibility: hidden;
  transform: translateX(var(--doda-bulle-depart, 0.5rem));
  transition: opacity 0.3s ease-out, transform 0.3s ease-out, visibility 0s linear 0.3s;
}

.doda-bulle.est-ouverte {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.3s ease-out, transform 0.3s ease-out, visibility 0s;
}

.doda-bulle--gauche {
  --doda-bulle-depart: -0.5rem;
}

/* The leader line, from the bubble's side to the building, at the building's middle height (--doda-bulle-trait) */
.doda-bulle::before {
  content: "";
  position: absolute;
  top: var(--doda-bulle-trait, 50%);
  right: 100%;
  width: var(--doda-bulle-ecart, 2rem);
  border-top: 1px solid var(--doda-blanc);
}

/* and its end on the building, a small square, as the point of an annotation */
.doda-bulle::after {
  content: "";
  position: absolute;
  top: calc(var(--doda-bulle-trait, 50%) - 2px);
  right: calc(100% + var(--doda-bulle-ecart, 2rem) - 2px);
  width: 5px;
  height: 5px;
  background: var(--doda-blanc);
}

.doda-bulle--gauche::before {
  right: auto;
  left: 100%;
}

.doda-bulle--gauche::after {
  right: auto;
  left: calc(100% + var(--doda-bulle-ecart, 2rem) - 3px);
}

.doda-bulle__photo {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 0;
}

.doda-bulle__nom {
  margin: var(--espace-s) 0 var(--espace-xs);
  font-family: var(--font-titre);
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--doda-blanc);
}

.doda-bulle__lien {
  display: inline-block;
  padding-bottom: 2px;
  font-family: var(--font-titre);
  font-size: 0.68rem;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--doda-gris-clair);
  text-decoration: none;
  border-bottom: 1px solid var(--doda-trait-fort);
  transition: color 0.2s, border-color 0.2s;
}

.doda-bulle__lien:hover,
.doda-bulle__lien:focus-visible {
  color: var(--doda-blanc);
  border-bottom-color: var(--doda-blanc);
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .doda-bulle,
  .doda-bulle.est-ouverte {
    transform: none;
    transition: none;
  }
}

/* In the text of a page: set over the page (fixed, closed on scroll), above the link or, without room there, below it;
   the leader line runs down (or up) to the link, its small square just off the letters (--doda-bulle-x: where it
   leaves the bubble; --doda-bulle-ecart: its length). Nothing in it to click: the link under the mouse is the way to
   the project. */
.doda-bulle--texte {
  position: fixed;
  z-index: 999;   /* under the header (1000), which the bubble never reaches (js/apercu-projets.js) */
  pointer-events: none;
  transform: translateY(var(--doda-bulle-depart-y, 0.4rem));
}

.doda-bulle--dessous {
  --doda-bulle-depart-y: -0.4rem;
}

.doda-bulle--texte::before {
  top: 100%;
  right: auto;
  left: var(--doda-bulle-x, 50%);
  width: 0;
  height: var(--doda-bulle-ecart, 1rem);
  border-top: 0;
  border-left: 1px solid var(--doda-blanc);
}

.doda-bulle--texte::after {
  top: calc(100% + var(--doda-bulle-ecart, 1rem) - 2px);
  right: auto;
  left: calc(var(--doda-bulle-x, 50%) - 2px);
}

.doda-bulle--dessous::before {
  top: auto;
  bottom: 100%;
}

.doda-bulle--dessous::after {
  top: auto;
  bottom: calc(100% + var(--doda-bulle-ecart, 1rem) - 3px);
}

/* The project's place, under its name, in the small capitals of « Voir le projet » */
.doda-bulle__lieu {
  margin: 0;
  font-family: var(--font-titre);
  font-size: 0.68rem;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--doda-gris-clair);
}

.doda-bulle--texte .doda-bulle__nom:last-child {
  margin-bottom: 0;
}
