/* === La rue des vitrines : scène, boutiques, chaussée, vitrine ouverte === */

.rue {
  --l-client: clamp(260px, 44vh, 420px);
  --allee: 100px;              /* allée du passant, sous la bande des métiers */
  --allee-couleur: #2A446F;
  --l-demo: calc(var(--l-client) * .82);
  position: relative; background: var(--nuit-2); color: var(--creme);
}
.rue__scene { position: relative; display: flex; flex-direction: column; overflow: clip; padding-top: 24px; }
.rue--pilotee .rue__scene { position: sticky; top: 0; height: 100vh; height: 100svh; padding-top: calc(var(--entete-h) + 8px); }
.rue__entete { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.rue__entete h2 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); }
/* Ordinateur : titre à gauche, présentation à droite, pour remonter la rue dans l'écran */
.rue--pilotee .rue__entete .section-header--nuit { max-width: none; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: clamp(24px, 5vw, 72px); align-items: end; }
.rue--pilotee .rue__entete .section-label { grid-column: 1; }
.rue--pilotee .rue__entete h2 { grid-column: 1; margin-bottom: 0; }
.rue--pilotee .rue__entete .section-header--nuit p { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
.rue__consigne { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; color: var(--lampe); font-weight: 600; font-size: .95rem; }
.rue__consigne-pilote { display: none; }
.rue--pilotee .rue__consigne-pilote { display: inline; }
.rue--pilotee .rue__consigne-glisse { display: none; }

.rue__lointain { position: absolute; left: 0; bottom: 40px; width: 100%; height: 38%; fill: var(--nuit); opacity: .55; pointer-events: none; }

/* La voie : la bande des boutiques et l'allée du passant, qui lui sert de repère */
.rue__voie { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; min-height: 0; margin-top: clamp(24px, 5vh, 44px); }
.rue__defileur {
  position: relative; display: flex; align-items: flex-end;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--trottoir) transparent;
}
.rue--pilotee .rue__defileur { overflow: clip; scroll-snap-type: none; }

.rue__piste {
  position: relative; display: flex; align-items: flex-end; gap: clamp(16px, 2.4vw, 36px);
  width: max-content; margin: 0;
  padding: 0 max(24px, 6vw) var(--allee);
  background:
    repeating-linear-gradient(90deg, rgba(11, 23, 48, .35) 0 2px, transparent 2px 88px) left bottom / 100% var(--allee) no-repeat,
    linear-gradient(to top, var(--allee-couleur) 0 var(--allee), rgba(255, 241, 222, .28) var(--allee) calc(var(--allee) + 3px), var(--trottoir) calc(var(--allee) + 3px) calc(var(--allee) + 44px), transparent calc(var(--allee) + 44px));
}
.rue--pilotee .rue__piste { will-change: transform; }

/* ── Boutiques ────────────────────────────────────────── */
.boutique { flex: 0 0 auto; width: var(--l-client); scroll-snap-align: center; container-type: inline-size; --facade: var(--facade-2); }
.boutique--client:nth-child(even) { --facade: #325694; }
.boutique--demo { width: var(--l-demo); --facade: var(--facade-1); }
.boutique--demo:nth-child(odd) { --facade: #29467A; }
.boutique--a-louer { width: var(--l-client); --facade: #1F355E; --auvent: var(--encre-douce); }

.boutique__lien { display: block; color: inherit; text-decoration: none; }
.boutique__lien:focus-visible { outline: 3px solid var(--lampe); outline-offset: 6px; }
.boutique__cadre { position: relative; display: block; }
.boutique__facade { display: block; width: 100%; height: auto; }

.boutique__enseigne {
  position: absolute; left: 3.75%; width: 92.5%; top: 30.67%; height: 14.67%;
  display: grid; place-items: center; padding: 0 8px; overflow: hidden;
  background: var(--nuit); color: var(--lampe);
  font: 400 clamp(14px, 6.4cqi, 22px)/1.05 var(--titre); text-align: center; text-wrap: balance;
  transition: background var(--transition), color var(--transition);
}
.boutique__lien:hover .boutique__enseigne,
.boutique__lien:focus-visible .boutique__enseigne { background: var(--auvent); color: var(--nuit); }
.boutique--a-louer .boutique__lien:hover .boutique__enseigne,
.boutique--a-louer .boutique__lien:focus-visible .boutique__enseigne { background: var(--lampe); }

.boutique__vitrine {
  position: absolute; left: 5%; top: 56%; width: 74.375%; height: 40%;
  display: grid; place-items: center; overflow: hidden;
  background: var(--lampe); color: var(--nuit); font-size: 12px; font-weight: 600; text-align: center; padding: 4px;
}
.boutique__vitrine img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .4s ease; }
.boutique__vitrine:has(img) { padding: 0; }
.boutique__lien:hover .boutique__vitrine img,
.boutique__lien:focus-visible .boutique__vitrine img { transform: scale(1.08); }
.boutique__vitrine--vide { background: transparent; border: 2px dashed var(--lampe); color: var(--lampe); font-size: 13px; }

.boutique__badge {
  display: grid; place-items: center; height: 44px; padding: 0 4px;
  font-size: 12.5px; line-height: 1.2; text-align: center; color: rgba(255, 241, 222, .92);
}

/* Panneau « Ruelle des démos » */
.rue__panneau { flex: 0 0 auto; align-self: flex-end; display: flex; flex-direction: column; align-items: center; padding-bottom: 44px; }
.rue__plaque {  /* panneau flèche : les démos sont plus loin, à droite */
  position: relative; isolation: isolate; display: inline-block;
  padding: 14px 48px 14px 20px; color: var(--creme);
  font: 400 21px/1.2 var(--titre); white-space: nowrap;
}
.rue__plaque-fond { position: absolute; inset: 0; z-index: -1; display: block; width: 100%; height: 100%; overflow: visible; }
.rue__panneau::after { content: ""; width: 5px; height: clamp(80px, 14vh, 130px); background: rgba(255, 241, 222, .5); }

/* Chaussée + barre d'avancement */
.rue__chaussee { position: relative; z-index: 1; flex-shrink: 0; height: 40px; background: var(--nuit-profonde); }
/* Le passant : il se promène sur le trottoir (passant.mjs le déplace et l'anime) */
.rue__passant { position: absolute; left: 0; bottom: 3px; z-index: 2; width: calc(min(66px, var(--allee) - 30px) * .55); height: min(66px, calc(var(--allee) - 30px)); transform: translateX(15vw); transform-origin: 50% 50%; pointer-events: none; }
.rue__passant svg { display: block; width: 100%; height: 100%; overflow: visible; }
.passant__jambe, .passant__bras { transform-box: fill-box; transform-origin: 50% 0; }
.passant__jambe--avant { transform: rotate(var(--angle, 0deg)); }
.passant__jambe--arriere { transform: rotate(calc(var(--angle, 0deg) * -1)); }
.passant__bras--avant { transform: rotate(calc(var(--angle, 0deg) * -.8)); }
.passant__bras--arriere { transform: rotate(calc(var(--angle, 0deg) * .8)); }
.rue__progression { display: none; position: absolute; left: max(24px, 6vw); right: max(24px, 6vw); top: 50%; height: 3px; background: rgba(255, 241, 222, .18); }
.rue--pilotee .rue__progression { display: block; }
.rue__progression-barre { display: block; height: 100%; background: var(--auvent); transform-origin: left center; transform: scaleX(0); }

/* ── Vitrine ouverte (dialog) ─────────────────────────── */
html:has(dialog[open]) { overflow: hidden; }
.vitrine {
  width: min(880px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; border: 0;
  border-radius: 14px; background: var(--creme-2); color: var(--nuit); box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.vitrine::backdrop { background: rgba(11, 23, 48, .72); }
.vitrine[open] { animation: vitrine-ouvre .34s cubic-bezier(.2, .8, .2, 1); }
@keyframes vitrine-ouvre { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }
.vitrine__cadre { position: relative; }
.vitrine__image { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; background: var(--lampe); }
.vitrine__image[hidden] { display: none; }  /* le display: block ci-dessus l’emportait sur [hidden] */
.vitrine__texte { padding: 22px 26px 26px; }
.vitrine__badge { margin: 0 0 6px; font-weight: 600; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--auvent-texte); }
.vitrine__nom { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 8px; }
.vitrine__description { margin: 0 0 20px; color: var(--encre-douce); }
.vitrine__fermer {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; background: var(--nuit); color: var(--creme);
}
.vitrine__fermer .ico { width: 20px; height: 20px; transform: rotate(45deg); }

@media (max-height: 760px) {
  .rue { --l-client: clamp(220px, 36vh, 400px); --allee: 76px; }
  .rue--pilotee .rue__entete h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
}
@media (max-height: 640px) {
  .rue { --l-client: clamp(200px, 36vh, 260px); --allee: 64px; }
  .rue--pilotee .rue__entete h2 { font-size: 1.5rem; }
}
@media (max-width: 640px) {
  .vitrine { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
}
