/* Thème luxe — cuir crocodile · ivoire · bleu nuit */
:root {
  --croco-dark: #1a120c;
  --croco: #2c1810;
  --croco-mid: #3d2817;
  --croco-light: #5c4033;
  --stitch: #b8956a;
  --stitch-soft: rgba(184, 149, 106, 0.35);
  --ivory: #f8f6f2;
  --cream: #efe9e0;
  --mist: rgba(248, 246, 242, 0.62);
  --navy: #1a2f4a;
  --navy-mid: #2c4a6e;
  --blue-accent: #4a6fa5;
  --line: rgba(184, 149, 106, 0.28);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-ui: "Outfit", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 24px 80px rgba(26, 18, 12, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 400;
  color: var(--ivory);
  background: var(--croco-dark);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Texture cuir */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background:
    radial-gradient(ellipse 100% 80% at 50% -20%, rgba(74, 111, 165, 0.12), transparent 50%),
    repeating-linear-gradient(
      125deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.03) 2px,
      rgba(0, 0, 0, 0.03) 4px
    ),
    linear-gradient(180deg, var(--croco) 0%, var(--croco-dark) 100%);
}

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }

.shell {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px 72px;
}

/* Nav */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ivory);
}

.brand span { color: var(--stitch); font-weight: 400; font-style: italic; }

.topnav-links {
  display: flex;
  gap: 24px;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mist);
}

.topnav-links a:hover { color: var(--ivory); }

/* Hero */
.hero {
  text-align: center;
  padding: 20px 0 48px;
}

.hero-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--stitch);
  margin-bottom: 16px;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 400;
  line-height: 1;
}

.hero-lead {
  max-width: 40ch;
  margin: 20px auto 0;
  color: var(--mist);
  font-weight: 300;
  font-size: 1rem;
}

/* Stats — luxe minimaliste épuré */
.ribbon {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 8px 0 56px;
  padding: 8px 0;
  background: transparent;
  border: none;
}

.ribbon-cell {
  position: relative;
  padding: 32px 20px;
  text-align: center;
  background: transparent;
  opacity: 0;
  transform: translateY(18px);
  animation: ribbonStagger 0.9s var(--ease) forwards;
}

.ribbon-cell:nth-child(1) { animation-delay: 0ms; }
.ribbon-cell:nth-child(2) { animation-delay: 100ms; }
.ribbon-cell:nth-child(3) { animation-delay: 200ms; }
.ribbon-cell:nth-child(4) { animation-delay: 300ms; }

.ribbon-cell:not(:first-child)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(248, 246, 242, 0.28) 20%,
    rgba(248, 246, 242, 0.28) 80%,
    transparent
  );
}

.ribbon-cell strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.65rem);
  font-weight: 600;
  line-height: 1;
  color: #ffffff;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 24px rgba(255, 255, 255, 0.08);
}

.ribbon-cell span {
  display: block;
  margin-top: 10px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-accent);
}

@keyframes ribbonStagger {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Map */
.chapter { margin-bottom: 64px; }

.chapter-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.chapter-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 400;
}

.chapter-head p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--mist);
  letter-spacing: 0.06em;
}

.map-frame {
  padding: 4px;
  background: linear-gradient(160deg, var(--stitch), var(--croco-mid) 40%, var(--navy-mid));
  box-shadow: var(--shadow);
}

.map-inner {
  position: relative;
  overflow: hidden;
  background: var(--ivory);
}

#map {
  height: min(68vh, 540px);
  width: 100%;
  min-height: 400px;
  z-index: 1;
}

.leaflet-container { font-family: var(--font-ui); background: #e8e4dc; }

.leaflet-control-zoom a {
  background: var(--croco) !important;
  color: var(--ivory) !important;
  border: 1px solid var(--line) !important;
}

.leaflet-control-attribution {
  background: rgba(26, 18, 12, 0.8) !important;
  color: var(--mist) !important;
  font-size: 9px !important;
}

.map-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 450;
  box-shadow: inset 0 0 80px rgba(26, 18, 12, 0.2);
}

.map-fallback {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: none;
  place-items: center;
  background: var(--cream);
  color: var(--croco);
  text-align: center;
  padding: 24px;
}

.map-fallback.show { display: grid; }

/* Pins — nom seulement */
.pin-wrap { background: none !important; border: none !important; }

.pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.25s var(--ease);
}

.pin:hover { transform: translateY(-3px); }

.pin-ring {
  position: relative;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--pin-color, var(--navy-mid));
  border: 2px solid var(--ivory);
  box-shadow:
    0 2px 10px rgba(26, 18, 12, 0.45),
    0 0 12px color-mix(in srgb, var(--pin-color, var(--navy-mid)) 45%, transparent);
}

.pin-ring::before,
.pin-ring::after {
  content: "";
  position: absolute;
  inset: 50%;
  width: 100%;
  height: 100%;
  margin: -50% 0 0 -50%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  opacity: 0;
  transform: scale(1);
  pointer-events: none;
}

.pin-ring::before {
  animation: radar 3s var(--ease) infinite;
}

.pin-ring::after {
  animation: radar 3s var(--ease) 1.1s infinite;
}

.pin:hover .pin-ring::before,
.pin.is-active .pin-ring::before {
  animation-duration: 2s;
  border-color: rgba(255, 255, 255, 0.75);
}

.pin:hover .pin-ring::after,
.pin.is-active .pin-ring::after {
  animation-duration: 2s;
  border-color: rgba(255, 255, 255, 0.65);
}

.pin.is-active .pin-ring {
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--pin-color) 35%, transparent),
    0 2px 14px rgba(26, 18, 12, 0.5);
  transform: scale(1.12);
}

@keyframes radar {
  0% { transform: scale(1); opacity: 0.45; }
  100% { transform: scale(3.4); opacity: 0; }
}

.pin.future .pin-ring {
  opacity: 0.75;
}

.pin-label {
  margin-top: 6px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--croco);
  color: var(--cream);
  border: 1px solid var(--stitch-soft);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}

/* Noms visibles au zoom ≥ 5, au survol ou ville sélectionnée */
.map-inner.map-labels-on .pin-label,
.pin:hover .pin-label,
.pin.is-active .pin-label {
  opacity: 1;
  transform: translateY(0);
}

/* Bouton flottant — ouvrir l'album après sélection dans la liste */
.map-go-cta {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 480;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s;
  pointer-events: none;
}

.map-go-cta.is-shown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.map-go-cta-btn {
  appearance: none;
  border: 1px solid var(--stitch);
  background: var(--croco);
  color: var(--ivory);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 20px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s, border-color 0.2s;
}

.map-go-cta-btn:hover {
  background: var(--croco-mid);
  border-color: var(--ivory);
}

.map-go-cta-dismiss {
  appearance: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: rgba(44, 24, 16, 0.9);
  color: var(--cream);
  cursor: pointer;
  font-size: 0.9rem;
}

/* Hover preview carte — position via JS (translate3d) */
.map-preview {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  width: 220px;
  will-change: transform, opacity;
  transition: opacity 0.28s var(--ease);
}

.map-preview.visible {
  opacity: 1;
}

@media (pointer: coarse) {
  #mapPreview { display: none !important; }
}

.map-preview-card {
  background: var(--croco);
  border: 1px solid var(--stitch);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.map-preview-title {
  padding: 10px 12px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ivory);
}

.map-preview-grid {
  display: block;
  background: var(--line);
  overflow: hidden;
}

.map-preview-grid video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center;
  transform: scale(var(--cover-scale, 1));
  transform-origin: center center;
}

.map-preview-cta {
  padding: 8px 12px;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: var(--stitch);
  background: rgba(0, 0, 0, 0.2);
}

/* Dest list */
.dest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.dest-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(44, 24, 16, 0.6);
  color: var(--cream);
  padding: 12px;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
}

.dest-btn.visible {
  transition:
    opacity 0.6s var(--ease),
    transform 0.6s var(--ease),
    border-color 0.2s,
    background 0.2s;
}

.dest-btn:hover {
  border-color: var(--stitch);
  background: rgba(184, 149, 106, 0.1);
}

.dest-btn.future.visible { opacity: 0.55; }

.dest-btn.is-active {
  border-color: var(--stitch);
  background: rgba(184, 149, 106, 0.18);
  box-shadow: 0 0 0 1px var(--stitch-soft);
}


/* Gallery */
.gallery-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  margin: 0 0 8px;
}

.gallery-sub { color: var(--mist); font-size: 0.88rem; margin: 0 0 24px; }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.card-trip {
  position: relative;
  display: block;
  aspect-ratio: 4/5;
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: pointer;
  background: var(--line);
}

.card-trip.visible:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card-trip-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.card-trip-media img,
.card-trip-media video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  object-position: center;
}


.card-trip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(26, 18, 12, 0.9), transparent 50%);
}

.card-trip figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 16px;
}

.card-trip strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  display: block;
}

.card-trip span {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stitch);
}

/* Scroll reveal — titres / sections */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.75s var(--ease),
    transform 0.75s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll cascade — albums, destinations, galerie ville */
.card-trip,
.dest-btn,
.ville-gallery .cell {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.card-trip.visible,
.dest-btn.visible,
.ville-gallery .cell.visible {
  opacity: 1;
  transform: translateY(0);
}

.card-trip.visible {
  transition:
    opacity 0.6s var(--ease),
    transform 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}

.ville-gallery .cell.visible.cell-clickable {
  transition:
    opacity 0.6s var(--ease),
    transform 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
}

.ville-gallery .cell.visible.cell-clickable:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow);
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .ribbon-cell,
  .card-trip,
  .dest-btn,
  .ville-gallery .cell {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }
  .card-trip.visible,
  .dest-btn.visible,
  .ville-gallery .cell.visible {
    opacity: 1;
    transform: none;
  }
  .dest-btn.future.visible { opacity: 0.55; }
  .pin-ring::before,
  .pin-ring::after { animation: none !important; }
}

.footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--mist);
}

/* —— Page ville —— */
.ville-hero {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stitch);
  margin-bottom: 24px;
}

.back-link:hover { color: var(--ivory); }

.ville-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 400;
}

.ville-meta {
  margin-top: 12px;
  color: var(--mist);
  font-size: 0.95rem;
}

.ville-badge {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 14px;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--stitch);
  color: var(--stitch);
}

.ville-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.ville-gallery .cell {
  border: 1px solid var(--line);
  overflow: hidden;
  aspect-ratio: 3/4;
  background: var(--croco-mid);
}

.ville-gallery .cell img,
.ville-gallery .cell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ville-gallery .cell.featured {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: auto;
  min-height: 320px;
}

.ville-gallery .cell-clickable {
  cursor: zoom-in;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 32px;
  background: rgba(10, 9, 8, 0.94);
  backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: calc(100vh - 120px);
}

.lightbox-stage img,
.lightbox-stage video {
  max-width: min(1100px, 96vw);
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.lightbox-caption {
  margin: 16px 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--mist);
  text-align: center;
  max-width: 50ch;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: rgba(44, 24, 16, 0.85);
  color: var(--ivory);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  transition: border-color 0.2s, background 0.2s;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  border-color: var(--stitch);
  background: var(--croco-mid);
}

.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }

@media (max-width: 800px) {
  .ribbon { grid-template-columns: repeat(2, 1fr); }
  .ribbon-cell:nth-child(3)::before { display: none; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .ville-gallery .cell.featured { grid-column: span 1; grid-row: span 1; min-height: 0; aspect-ratio: 3/4; }
}

@media (max-width: 500px) {
  .gallery { grid-template-columns: 1fr; }
  .dest-grid { grid-template-columns: repeat(2, 1fr); }
}
