/* Couleurs Vinci Immobilier : marine #1b2632, vert d'eau #55e1cb, pétrole #006573 */
:root {
  --navy: #1b2632;
  --navy-deep: #131c26;
  --navy-soft: #26333f;
  --mint: #55e1cb;
  --mint-dark: #2fc6ad;
  --teal: #006573;
  --text-soft: #a9b6c2;
  --white: #fff;
  --shadow: 0 18px 50px rgba(0, 0, 0, .4);
  --bar-h: 76px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Outfit", system-ui, sans-serif;
  color: var(--white);
  background: var(--navy);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Barre haute ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--bar-h); z-index: 20;
  display: flex; align-items: center; gap: 28px; padding: 0 32px;
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.logo { height: 38px; width: auto; display: block; }
.project {
  display: flex; flex-direction: column; line-height: 1.15;
  padding-left: 28px; border-left: 1px solid rgba(255,255,255,.18);
  font-weight: 600; font-size: 17px;
}
.project em { font-style: normal; font-weight: 300; font-size: 13px; color: var(--text-soft); }

.menu {
  margin: 0 auto; display: flex; gap: 4px; padding: 5px;
  border: 1px solid rgba(255,255,255,.25); border-radius: 999px;
}
.menu a {
  color: var(--white); text-decoration: none; font-weight: 500; font-size: 15px;
  padding: 10px 22px; border-radius: 999px; transition: background .2s, color .2s;
}
.menu a:hover { color: var(--mint); }
.menu a.active { background: var(--mint); color: var(--navy); }

.list-toggle {
  border: 1px solid rgba(255,255,255,.4); background: transparent; color: var(--white);
  padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
}
.list-toggle:hover, .list-toggle[aria-expanded="true"] { background: var(--white); color: var(--navy); }
body.on-galerie .list-toggle { visibility: hidden; }

/* ---------- Pages ---------- */
.view { position: fixed; inset: var(--bar-h) 0 0 0; }

/* Page 1 : l'image tient toujours entière dans l'écran */
.stage { display: grid; place-items: center; background: var(--navy-deep); }
.scene {
  position: relative;
  /* ratio de la perspective : 3000 x 2122 */
  width: min(100vw, calc((100vh - var(--bar-h)) * 3000 / 2122));
  aspect-ratio: 3000 / 2122;
}
.scene img { display: block; width: 100%; height: 100%; user-select: none; }
.hotspots { position: absolute; inset: 0; }
.hint {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); margin: 0;
  background: var(--navy); color: var(--white); padding: 10px 20px; border-radius: 999px;
  font-size: 15px; box-shadow: var(--shadow); pointer-events: none; white-space: nowrap;
}
.hint::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--mint); margin-right: 10px; vertical-align: middle;
}

/* ---------- Points cliquables ---------- */
.hotspot {
  position: absolute; transform: translate(-50%, -50%);
  width: 36px; height: 36px; border-radius: 50%; padding: 0;
  border: 3px solid var(--white); background: var(--mint);
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
  display: grid; place-items: center;
  transition: transform .2s ease, background .2s ease;
}
.hotspot::before {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid var(--mint); animation: pulse 2.4s ease-out infinite;
}
.hotspot svg { width: 16px; height: 16px; fill: var(--navy); }
.hotspot:hover, .hotspot:focus-visible, .hotspot.is-hl {
  transform: translate(-50%, -50%) scale(1.18); background: var(--navy); outline: none;
}
.hotspot:hover svg, .hotspot:focus-visible svg, .hotspot.is-hl svg { fill: var(--mint); }
.hotspot .tip {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; pointer-events: none;
  background: var(--navy); color: var(--white); font-size: 13px; padding: 6px 12px; border-radius: 999px;
  opacity: 0; transition: opacity .15s;
}
.hotspot:hover .tip, .hotspot:focus-visible .tip, .hotspot.is-hl .tip { opacity: 1; }
@keyframes pulse {
  0% { transform: scale(1); opacity: .9; }
  100% { transform: scale(2.1); opacity: 0; }
}

/* ---------- Liste latérale ---------- */
.sidebar {
  position: fixed; top: var(--bar-h); right: 0; bottom: 0; width: 310px; z-index: 15;
  background: var(--navy); padding: 24px; overflow-y: auto;
  transform: translateX(100%); transition: transform .3s ease;
  box-shadow: var(--shadow);
}
.sidebar.open { transform: none; }
.sidebar h3 {
  margin: 20px 0 10px; font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .12em; color: var(--mint);
}
.sidebar h3:first-child { margin-top: 0; }
.sidebar button {
  display: flex; justify-content: space-between; align-items: baseline; width: 100%; text-align: left;
  border: 0; background: var(--navy-soft); color: var(--white);
  padding: 12px 14px; margin-bottom: 6px; border-radius: 10px;
}
.sidebar button:hover { background: var(--mint); color: var(--navy); }
.sidebar button small { color: var(--text-soft); }
.sidebar button:hover small { color: var(--teal); }

/* ---------- Page 2 : galerie ---------- */
.gallery { overflow-y: auto; padding: 40px 32px 60px; }
.gallery-head { max-width: 1400px; margin: 0 auto 28px; }
.kicker { margin: 0; font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: var(--mint); }
.gallery-head h1 { margin: 4px 0 0; font-size: 40px; font-weight: 600; }
.grid {
  max-width: 1400px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 20px;
}
.card {
  position: relative; border: 0; padding: 0; border-radius: 0 0 0 0; overflow: hidden;
  background: var(--navy-soft); aspect-ratio: 4 / 3; text-align: left; color: var(--white);
}
/* coin arrondi façon Vinci (grand arrondi en haut à droite) */
.card { border-top-right-radius: 90px; }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.card:hover img { transform: scale(1.04); }
.card span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 20px 16px;
  background: linear-gradient(transparent, rgba(19,28,38,.85));
  font-size: 18px; font-weight: 500;
}

.lightbox {
  position: fixed; inset: 0; z-index: 60; background: rgba(13,19,26,.96);
  display: grid; place-items: center; animation: fade .25s;
}
.lightbox img { max-width: 94vw; max-height: 84vh; object-fit: contain; display: block; }
.lb-caption { position: absolute; left: 0; right: 0; bottom: 20px; margin: 0; text-align: center; font-size: 17px; }
.lightbox .close { position: absolute; top: 20px; right: 20px; }

/* ---------- Pop-up ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(13, 19, 26, .82); animation: fade .25s; }
.modal-panel {
  position: relative; width: min(1280px, 94vw); height: min(860px, 90vh);
  display: flex; flex-direction: column;
  background: var(--navy); color: var(--white); border-radius: 16px 60px 16px 16px; overflow: hidden;
  box-shadow: var(--shadow); animation: rise .3s ease;
}
.modal-head { display: flex; align-items: center; gap: 24px; padding: 18px 24px 16px 28px; }
.modal-head h2 { margin: 2px 0 0; font-size: 24px; font-weight: 600; }
.tabs { display: flex; gap: 4px; margin-left: auto; border: 1px solid rgba(255,255,255,.25); padding: 4px; border-radius: 999px; }
.tabs button {
  border: 0; background: transparent; color: var(--white); padding: 8px 20px; border-radius: 999px; font-size: 15px; font-weight: 500;
}
.tabs button:hover { color: var(--mint); }
.tabs button[aria-selected="true"] { background: var(--mint); color: var(--navy); }
.close {
  border: 0; background: rgba(255,255,255,.1); color: var(--white);
  width: 44px; height: 44px; border-radius: 50%; font-size: 28px; line-height: 1;
}
.close:hover { background: var(--mint); color: var(--navy); }
.modal-body { flex: 1; min-height: 0; position: relative; }
.pane { position: absolute; inset: 0; display: flex; flex-direction: column; }

.viewer { position: relative; flex: 1; min-height: 0; background: #000; }
.viewer img { width: 100%; height: 100%; object-fit: contain; display: block; }
.nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: var(--white); color: var(--navy); font-size: 32px; line-height: 1;
}
.nav:hover { background: var(--mint); }
.prev { left: 16px; } .next { right: 16px; }
.counter {
  position: absolute; right: 16px; bottom: 14px; font-size: 13px;
  background: rgba(0,0,0,.55); padding: 4px 10px; border-radius: 999px;
}
.thumbs { display: flex; gap: 8px; padding: 12px 24px; overflow-x: auto; background: var(--navy-deep); }
.thumbs button { border: 2px solid transparent; padding: 0; border-radius: 8px; overflow: hidden; flex: 0 0 auto; background: none; opacity: .6; }
.thumbs button.active { border-color: var(--mint); opacity: 1; }
.thumbs img { display: block; width: 120px; height: 68px; object-fit: cover; }

#videoEl { width: 100%; height: 100%; background: #000; }
#panoEl { flex: 1; }
.pano-hint {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); margin: 0;
  background: rgba(0,0,0,.55); padding: 6px 14px; border-radius: 999px; font-size: 13px; pointer-events: none;
}

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } }

/* ---------- Mode édition ---------- */
.editbar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 30;
  background: var(--white); color: var(--navy); padding: 10px 12px 10px 18px; border-radius: 999px;
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); font-size: 14px;
}
.editbar button { border: 0; background: var(--navy); color: var(--white); padding: 8px 14px; border-radius: 999px; }
body.editing .hint { display: none; }
body.editing .hotspot { cursor: move; }
body.editing .hotspot::before { animation: none; }
body.editing .hotspot .tip { opacity: 1; }

/* ---------- Tablette / mobile ---------- */
@media (max-width: 1100px) {
  .project { display: none; }
  .menu a { padding: 9px 16px; font-size: 14px; }
}
@media (max-width: 760px) {
  :root { --bar-h: 112px; }
  .topbar { flex-wrap: wrap; height: auto; min-height: var(--bar-h); padding: 12px 16px; gap: 10px 12px; align-content: center; }
  .logo { height: 30px; }
  .list-toggle { margin-left: auto; padding: 7px 12px; font-size: 13px; }
  .menu { order: 3; width: 100%; margin: 0; }
  .menu a { flex: 1; text-align: center; padding: 8px 6px; font-size: 13px; }
  .hint { font-size: 13px; bottom: 14px; }
  .hotspot { width: 26px; height: 26px; border-width: 2px; }
  .hotspot svg { width: 12px; height: 12px; }
  .gallery { padding: 24px 16px 40px; }
  .gallery-head h1 { font-size: 30px; }
  .card { border-top-right-radius: 50px; }
  .modal-panel { width: 100vw; height: 100dvh; border-radius: 0; }
  .modal-head { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .modal-head h2 { font-size: 19px; }
  .tabs { order: 3; width: 100%; margin: 0; }
  .tabs button { flex: 1; padding: 8px; }
  .close { margin-left: auto; }
  .nav { width: 40px; height: 40px; font-size: 24px; }
  .sidebar { width: 100%; }
}
