/* ============================================================
   VARIABLES & RESET
   ============================================================ */
:root {
  --primary:        #37474F;
  --primary-light:  #78909C;
  --secondary:      #C6D431;
  --secondary-light:#F4F8D0;
  --white:          #ffffff;
  --shadow:         0 4px 24px rgba(0,0,0,.18);
  --radius:         12px;
  --radius-sm:      8px;
  --transition:     .25s ease;
  --header-h:       64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  background: #eceff1;
  color: var(--primary);
  overflow: hidden;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--primary);
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--white);
}

.header-title .fa-earth-europe {
  font-size: 2.4rem;
  color: var(--secondary);
  flex-shrink: 0;
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.header-line1 {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-line1 h1 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--white);
  line-height: 1;
}

/* Badge prénoms */
.header-badge {
  display: inline-flex;
  align-items: center;
  background: var(--secondary);
  color: var(--primary);
  font-size: .8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  line-height: 1;
  letter-spacing: .02em;
}

.header-dates {
  font-size: .8rem;
  font-weight: 400;
  color: #b0bec5;
  line-height: 1;
}

/* ============================================================
   MAP
   ============================================================ */
main {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
}

#map { width: 100%; height: 100%; }

/* ============================================================
   MARKERS
   ============================================================ */
.custom-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.35));
  transition: transform var(--transition);
}

.custom-marker:hover { transform: scale(1.12) translateY(-2px); }

.marker-pin {
  width: 36px; height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255,255,255,.8);
}

.marker-pin i {
  transform: rotate(45deg);
  font-size: .85rem;
  color: var(--primary);
}

.marker-tip {
  width: 3px; height: 8px;
  background: var(--secondary);
  margin-top: -1px;
}

.marker-label {
  background: var(--white);
  color: var(--primary);
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  margin-top: 3px;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   POPUP LEAFLET
   ============================================================ */
.leaflet-popup-content-wrapper {
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 0;
  border: none;
}

.leaflet-popup-content {
  margin: 0;
  padding: 10px 14px;
  font-size: .82rem;
  line-height: 1.4;
}

.leaflet-popup-tip { background: var(--primary); }

.leaflet-popup-close-button {
  color: #b0bec5 !important;
  font-size: 18px !important;
  top: 4px !important;
  right: 6px !important;
}

.popup-day {
  font-size: .7rem;
  color: var(--secondary);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.popup-name {
  font-size: .95rem;
  font-weight: 700;
  margin: 2px 0;
}

.popup-hint {
  font-size: .72rem;
  color: #b0bec5;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox.hidden { display: none; }

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 30, 36, .92);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.lightbox-container {
  position: relative;
  width: 100%;
  max-width: 860px;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  animation: lbIn .25s ease;
}

@keyframes lbIn {
  from { opacity: 0; transform: scale(.95) translateY(12px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

/* Header lightbox */
.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--primary);
  color: var(--white);
  flex-shrink: 0;
}

.lightbox-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

/* Ligne date · ville */
.lb-top-row {
  display: flex;
  align-items: center;
  gap: 10px;        /* espace entre badge date et ville */
  flex-wrap: wrap;
}

.lb-date {
  display: inline-flex;
  align-items: center;
  background: var(--secondary);
  color: var(--primary);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.lb-place {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-desc {
  font-size: .85rem;   /* était .78rem */
  color: #b0bec5;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lb-close {
  background: rgba(255,255,255,.12);
  border: none;
  color: var(--white);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 16px;
  align-self: flex-start;
  transition: background var(--transition);
}
.lb-close:hover { background: rgba(255,255,255,.25); }

/* Stage */
.lightbox-stage {
  position: relative;
  background: #1a2428;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 200px;
  overflow: hidden;
}

.lb-img-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lb-img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  display: block;
  transition: opacity .2s ease;
}

#lb-img.loading { opacity: 0; }

.lb-loader {
  position: absolute;
  color: var(--primary-light);
  font-size: 1.6rem;
  display: none;
}
.lb-loader.visible { display: block; }

/* Boutons nav */
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(69,90,100,.75);
  border: none;
  color: var(--white);
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background var(--transition), transform var(--transition);
  backdrop-filter: blur(4px);
}
.lb-nav:hover  { background: var(--primary); transform: translateY(-50%) scale(1.08); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-nav:disabled { opacity: .25; cursor: default; }

/* ============================================================
   LÉGENDE — overlay, dots ne la gênent plus
   ============================================================ */
.lb-caption {
  position: absolute;
  bottom: -1px;          /* ← déborde d'1px sous le stage pour couvrir le joint */
  left: 0; right: 0;
  background: linear-gradient(
    to top,
    rgba(20, 30, 36, .92) 0%,    /* légèrement plus opaque en bas */
    rgba(20, 30, 36, .5)  60%,
    transparent           100%
  );
  color: var(--white);
  font-size: .78rem;
  font-style: italic;
  line-height: 1.4;
  padding: 28px 56px 10px;
  text-align: center;
  z-index: 9;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--transition), transform var(--transition);
  pointer-events: none;
}

.lb-caption.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   FOOTER DOTS — même couleur que le header lightbox
   ============================================================ */
.lb-footer {
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  flex-shrink: 0;
  min-height: 36px;    /* hauteur fixe même sans dots */
}

.lb-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.lb-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  flex-shrink: 0;
}

.lb-dot.active {
  background: var(--secondary);
  transform: scale(1.3);
}

.lb-dot:hover:not(.active) {
  background: rgba(255,255,255,.55);
}


/* ============================================================
   RESPONSIVE MOBILE
   ============================================================ */
@media (max-width: 600px) {
  :root { --header-h: 60px; }

  .header-title .fa-earth-europe { font-size: 1.8rem; }
  .header-line1 h1  { font-size: 1.1rem; }
  .header-badge     { font-size: .75rem; }
  .header-dates     { font-size: .75rem; }

  .lightbox { padding: 0; }

  .lightbox-container {
    max-width: 100%;
    border-radius: 0;
    max-height: 100vh;
  }

  .lightbox-header  { padding: 10px 12px; }
  .lb-place         { font-size: .9rem; }
  .lb-desc          { -webkit-line-clamp: 1; }

  #lb-img { max-height: calc(100vh - 140px); }

  .lb-nav  { width: 36px; height: 36px; font-size: .85rem; }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }

  .marker-label { display: none; }

  .lb-caption {
    font-size: .72rem;
    padding: 24px 48px 8px;
  }

  .lb-dots {
    bottom: 38px;
  }

  .lb-footer {
    padding: 8px 16px;
    min-height: 32px;
  }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }