/* cabine.html : ma cabine. À gauche, la cabine en 3D de face (le canvas, derrière tout) ; à droite, son grand écriteau noir,
   pendu à sa ficelle : le formulaire de l'accueil, tel quel (ses styles sont ceux de style.css, bloc « la cabine »).
   Sur téléphone : la cabine au-dessus, l'écriteau dessous, comme sur l'accueil. Sans 3D : les pièces en vitrine, et l'écriteau. */

html.page-cabine .page-scene {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(33.5rem, 37vw);
  column-gap: var(--gouttiere);
  align-items: start;
  height: 100vh; height: 100svh;          /* un écran : la cabine et son écriteau tiennent sans défiler */
  padding: calc(var(--entete) + 2.4vh) var(--gouttiere) 0;
}
html.page-cabine .cabine { grid-column: 2; grid-row: 1; width: 100%; }
html.page-cabine .cabine-carton { max-height: calc(100svh - var(--entete) - 4.2vh); }
html.page-cabine .ma-cabine { grid-column: 1; grid-row: 1; min-width: 0; }
html.page-cabine .ma-cabine > h2 { font-size: clamp(1.9rem, 2.6vw, 2.6rem); }

/* ------------------------------------------------------------ les pièces de la cabine, en liste (la vue sans 3D, et le clavier) */
.ma-selection { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 1.4rem 1.1rem; }
.ma-selection:empty { display: none; }
.ma-selection li { display: grid; align-content: start; justify-items: start; gap: .35rem; }
.ma-selection img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 22%; border: .42rem solid var(--blanc); border-bottom-width: .8rem; box-shadow: 0 4px 12px rgb(40 30 20 / .22); rotate: -1deg; }
.ma-selection li:nth-child(even) img { rotate: 1.2deg; }
.ma-selection .titre { font: 700 1.02rem/1.18 var(--f-enseigne); }
.ma-selection .prix { font-size: .92rem; color: var(--texte-doux); }
.ma-selection .lien { margin-top: .1rem; font-size: .9rem; }
.ma-selection .lien:focus-visible { outline: 3px solid var(--cocotte); outline-offset: 2px; }

/* en 3D, les pièces pendent à la tringle : la liste reste pour les lecteurs d'écran ; au clavier, elle se montre en carton */
html.page-cabine:not(.statique) .ma-cabine > h2,
html.page-cabine:not(.statique) .ma-selection:not(:focus-within) {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
html.page-cabine:not(.statique) .ma-selection:focus-within {
  position: fixed; left: var(--gouttiere); bottom: 1.2rem; z-index: 6; width: min(42rem, 52vw);
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: 1rem;
  padding: 1.2rem; background: var(--papier); color: var(--noir); box-shadow: 0 12px 34px rgb(20 14 8 / .28);
}

/* ------------------------------------------------------------ la tringle vide : une phrase, deux portes, pendues sous la tringle de laiton */
.tringle-vide {
  --h: 3.1rem; --fil: 1.25rem; --suspente: 2.2rem;
  position: fixed; left: 0; top: 0; z-index: 4;
  display: grid; justify-items: center;
  width: max-content;
  transform-origin: 50% 0;
  pointer-events: none;
}
.tringle-vide[hidden] { display: none; }
.tringle-vide.accroche { animation: portes 1.5s cubic-bezier(.25, .8, .35, 1) both; }
@keyframes portes { 0% { rotate: -6deg; opacity: 0; } 22% { opacity: 1; } 34% { rotate: 3.4deg; } 60% { rotate: -1.4deg; } 82% { rotate: .5deg; } 100% { rotate: 0deg; opacity: 1; } }
/* le petit carton : deux ficelles le tiennent à la tringle */
.tringle-vide-mot {
  position: relative; margin-top: var(--suspente);
  padding: .95rem 1.35rem .9rem;
  background: var(--papier); color: var(--noir);
  font: 700 1.14rem/1.2 var(--f-enseigne); white-space: nowrap;
  box-shadow: 0 6px 16px rgb(30 20 10 / .24);
  pointer-events: auto;
}
.tringle-vide-mot::before, .tringle-vide-mot::after {
  content: ''; position: absolute; bottom: 100%; width: 1.5px; height: var(--suspente);
  background: #2b2722;
}
.tringle-vide-mot::before { left: 16%; }
.tringle-vide-mot::after { right: 16%; }
html.nuit .tringle-vide-mot::before, html.nuit .tringle-vide-mot::after { background: #e8dcc4; }
.tringle-vide-portes { display: flex; gap: 1.1rem; margin: 0; }
.tringle-vide .etiquette { pointer-events: auto; }
.tringle-vide.accroche .fil .etiquette { animation: balance 1.3s cubic-bezier(.25, .8, .35, 1) .25s backwards; }
.tringle-vide.accroche .fil + .fil .etiquette { animation-delay: .37s; }

/* ------------------------------------------------------------ sans 3D : les pièces en vitrine à gauche, l'écriteau à droite */
html.statique.page-cabine .page-scene { height: auto; min-height: calc(100svh - 15rem); padding-bottom: 3rem; row-gap: 2rem; }
html.statique .tringle-vide { position: static; translate: none; width: auto; justify-items: start; margin-top: 1.2rem; }
html.statique .tringle-vide-mot { margin-top: 0; }
html.statique .tringle-vide-mot::before, html.statique .tringle-vide-mot::after { display: none; }
html.statique.page-cabine .cabine::after { display: none; }

/* ------------------------------------------------------------ téléphone : la cabine au-dessus, l'écriteau dessous */
@media (max-width: 760px) {
  html.page-cabine .page-scene {
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: var(--entete) 16px max(.8rem, 1.2svh);
  }
  html.page-cabine .cabine { width: 100%; }
  html.page-cabine .cabine-carton { max-height: 54svh; }
  /* un bout de ficelle seulement : elle ne barre pas la cabine */
  html.page-cabine .cabine::after { height: 6vh; }
  html.page-cabine:not(.statique) .ma-selection:focus-within { left: 16px; right: 16px; width: auto; }
  .tringle-vide { --h: 2.5rem; --fil: 1rem; --suspente: 1.4rem; }
  .tringle-vide-mot { padding: .65rem .9rem .6rem; font-size: .96rem; }
  .tringle-vide-portes { gap: .6rem; }
  .tringle-vide .etiquette { --h: 2.5rem; font-size: .95rem; padding-right: .9em; }
  html.statique.page-cabine .page-scene { display: block; padding-top: calc(var(--entete) + 1rem); }
  html.statique.page-cabine .cabine { margin-top: 2rem; }
}
