/**
 * Patrimoine de Libramont-Chevigny — plateforme collaborative du patrimoine
 * Fichier : css/style.css
 *
 * Copyright (c) 2026 Adam Ulrik. Tous droits réservés.
 *
 * Ce fichier est protégé par le droit d'auteur. Sa reproduction, sa
 * diffusion et sa réutilisation, totales ou partielles, sont interdites
 * sans autorisation écrite de l'auteur.
 */
/* ============================================================
   Carte de Libramont — design premium
   Palette tirée du logo : charbon + vert nature / jaune / bleu
   ============================================================ */
:root {
  --ink: #211d18;
  --ink-soft: #6a6157;
  --bg: #f3efe6;
  --panel: #fffdf9;
  --line: #e7e0d3;
  --line-soft: #f0ebe0;

  --green: #6d9a3c;
  --green-deep: #4f7a2c;
  --yellow: #f0be2a;
  --blue: #38a7cf;

  --shadow-sm: 0 2px 8px rgba(40, 32, 22, 0.08);
  --shadow-md: 0 10px 30px rgba(40, 32, 22, 0.13);
  --shadow-lg: 0 22px 60px rgba(30, 24, 16, 0.22);

  --sidebar-w: 384px;
  --r: 14px;

  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--green);
  color: #fff;
}

#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---------------- Barre latérale ---------------- */
#sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 600;
  box-shadow: var(--shadow-md);
}
/* liseré vert (nature) en bordure droite */
#sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(var(--green), var(--blue));
}

#side-header {
  /* En-tête COMPACT sur une ligne : emblème + nom + bouton « Accueil ».
     L'ancien grand logo prenait ~390 px de haut et la liste n'avait plus de
     place ; le logo complet reste sur la page d'accueil. */
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 13px 16px;
  background: radial-gradient(
      120% 120% at 0% 0%,
      rgba(109, 154, 60, 0.08),
      transparent 60%
    ),
    var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: var(--ink);
  border-radius: 10px;
}
.brand:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
.brand-mark {
  width: 46px;
  height: auto;
  flex: none;
}
.brand-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.brand-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.15;
  white-space: nowrap;
}
.home-link {
  margin-left: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  transition: border-color 0.15s, color 0.15s;
}
.home-link:hover,
.home-link:focus-visible {
  border-color: var(--green);
  color: var(--green-deep);
}
#side-header .subtitle {
  margin: 3px 0 0;
  color: var(--green-deep);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

#browse {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

#side-footer {
  flex: 0 0 auto;
  padding: 11px 24px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: #a89f92;
  text-align: center;
}
#side-footer::before {
  content: "✦ ";
  color: var(--green);
}

/* ---------------- Recherche ---------------- */
#search {
  margin: 14px 18px 8px;
  padding: 12px 16px 12px 42px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-family: var(--sans);
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236a6157' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M16 16l-3.5-3.5'/%3E%3C/svg%3E")
    14px center no-repeat;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#search::placeholder {
  color: #a89f92;
}
#search:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(109, 154, 60, 0.14);
}

/* ---------------- Filtres (chips à cocher) ---------------- */
#chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 14px 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: 12px;
  white-space: nowrap;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.chip .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent);
}
.chip:hover {
  border-color: var(--c);
  color: var(--ink);
  transform: translateY(-1px);
}
.chip.on {
  color: #fff;
  border-color: var(--c);
  background: var(--c);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--c) 40%, transparent);
}
.chip.on .dot {
  background: #fff;
  box-shadow: none;
}
.chip.tout {
  font-weight: 700;
}
.chip.tout.on {
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 4px 12px rgba(33, 29, 24, 0.35);
}

#count {
  padding: 6px 24px 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a89f92;
}

/* ---------------- Liste ---------------- */
#list {
  list-style: none;
  margin: 0;
  padding: 2px 12px 20px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #d9d2c5 transparent;
}
.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.13s, transform 0.13s;
}
.item:hover {
  background: var(--line-soft);
  transform: translateX(3px);
}
.item .ic {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c) 12%, #fff);
  border: 1.5px solid color-mix(in srgb, var(--c) 45%, #fff);
  font-size: 16px;
}
.item .txt {
  min-width: 0;
}
.item .name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item .type {
  font-size: 12px;
  color: var(--ink-soft);
}

/* ---------------- Fiche détail ---------------- */
#detail {
  overflow-y: auto;
  flex: 1;
  animation: slideIn 0.25s ease;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
#detail .back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 16px 20px 0;
  padding: 8px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--sans);
  transition: all 0.15s;
}
#detail .back:hover {
  border-color: var(--green);
  color: var(--green-deep);
}
#detail .photo {
  width: calc(100% - 40px);
  height: 210px;
  object-fit: cover;
  margin: 16px 20px 0;
  border-radius: var(--r);
  background: var(--line-soft);
  display: block;
  box-shadow: var(--shadow-sm);
}
#detail .body {
  padding: 18px 24px 32px;
}
#detail .badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--c, var(--green));
}
#detail h2 {
  font-family: var(--display);
  font-optical-sizing: auto;
  margin: 12px 0 8px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
}
#detail .desc {
  color: #3d372f;
  line-height: 1.65;
  font-size: 15px;
  white-space: pre-line; /* garde les paragraphes des textes de l'Office du tourisme */
}

/* --- Galerie (photo principale + crédit + vignettes) --- */
#detail .gal {
  margin: 0;
}
#detail .gal .credit {
  margin: 6px 20px 0;
  font-size: 11.5px;
  color: var(--ink-soft);
}
#detail .gal-thumbs {
  display: flex;
  gap: 6px;
  margin: 8px 20px 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
#detail .gal-t {
  flex: none;
  width: 58px;
  height: 44px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: center / cover var(--line-soft);
  cursor: pointer;
}
#detail .gal-t.on {
  border-color: var(--c, var(--green));
}

/* --- Texte officiel de l'Office du tourisme (dépliable) --- */
#detail .officiel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
#detail .officiel summary {
  cursor: pointer;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
}
#detail .officiel p {
  margin: 0;
  padding: 0 12px 12px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-line;
  color: #3d372f;
}

/* --- Fiche d'une balade --- */
#detail .b-loading {
  padding: 20px;
  color: var(--ink-soft);
}
#detail .b-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 14px;
}
#detail .b-facts span {
  font-size: 12.5px;
  font-weight: 600;
  background: #f4efe6;
  border-radius: 999px;
  padding: 5px 10px;
}
#detail .b-info {
  margin-top: 12px;
  padding: 9px 11px;
  font-size: 13.5px;
  line-height: 1.5;
  background: #fff7e6;
  border: 1px solid #f0dcae;
  border-radius: 10px;
}
#detail .b-h3 {
  font-family: var(--display);
  font-size: 17px;
  margin: 20px 0 8px;
}
#detail .b-etapes {
  margin: 0;
  padding-left: 22px;
}
#detail .b-etapes li {
  margin: 0 0 9px;
  font-size: 14px;
  cursor: pointer;
}
#detail .b-etapes li:hover strong {
  color: var(--c);
}
#detail .b-etapes li span {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--ink-soft);
  white-space: pre-line;
}
#detail .source {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
}
/* Marqueurs de départ et d'étapes sur la carte */
.b-start {
  font-size: 22px;
  line-height: 1;
}
.b-step span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--c);
  color: #fff;
  font: 700 11px/1 var(--sans);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
#detail .desc.empty {
  color: var(--ink-soft);
  font-style: italic;
}
#detail .links {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#detail .links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 4px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-top: 1px solid var(--line-soft);
  transition: color 0.13s, padding-left 0.13s;
}
#detail .links a:hover {
  color: var(--green-deep);
  padding-left: 10px;
}

/* Photos anciennes rattachées à un lieu (dans la fiche détail) */
#detail .linked-photos {
  margin-top: 22px;
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
}
#detail .linked-photos h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 10px;
}
#detail .lp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
#detail .lp-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  border: 1px solid var(--line);
  background-size: cover;
  background-position: center;
  background-color: #eee;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  transition: transform 0.13s, box-shadow 0.13s;
}
#detail .lp-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(40, 32, 22, 0.18);
}
#detail .lp-thumb span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 5px;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  text-align: left;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hidden {
  display: none !important;
}

/* ---------------- Carte ---------------- */
#map {
  flex: 1;
  height: 100%;
  background: #e9e4d8;
}
.leaflet-container {
  font-family: var(--sans);
}

/* Marqueurs — goutte façon carte */
.poi-marker .pin {
  width: 32px;
  height: 32px;
  background: var(--c);
  border: 2.5px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 5px 12px rgba(20, 14, 8, 0.4);
  display: grid;
  place-items: center;
  transition: transform 0.16s ease;
}
.poi-marker .glyph {
  transform: rotate(45deg);
  width: 21px;
  height: 21px;
  background: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
}
.poi-marker:hover {
  z-index: 1000 !important;
}
.poi-marker:hover .pin {
  transform: rotate(-45deg) scale(1.22);
  box-shadow: 0 10px 20px rgba(20, 14, 8, 0.45);
}

/* ---------------- Info-bulle enrichie (survol) ---------------- */
.leaflet-tooltip.poi-tooltip {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  white-space: normal;
}
.leaflet-tooltip.poi-tooltip::before {
  display: none;
}
.tip {
  width: 234px;
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  animation: tipIn 0.14s ease;
}
@keyframes tipIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.tip-photo {
  height: 118px;
  background: var(--line-soft);
}
.tip-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tip-body {
  padding: 11px 14px 14px;
  border-top: 3px solid var(--c);
}
.tip-type {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--c);
}
.tip-title {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin: 3px 0 0;
  line-height: 1.18;
}
.tip-text {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 6px;
  line-height: 1.45;
}

/* Boutons de zoom Leaflet — plus doux */
.leaflet-bar a {
  border-radius: 0 !important;
  color: var(--ink);
}
.leaflet-bar {
  border: none !important;
  box-shadow: var(--shadow-sm) !important;
  border-radius: 12px !important;
  overflow: hidden;
}

/* ---------------- Mobile & tablette (feuille coulissante) ---------------- */
.sheet-handle {
  display: none;
}

@media (max-width: 860px) {
  #app {
    display: block;
    height: 100vh;
    height: 100dvh;
  }

  /* La carte occupe tout l'écran, en fond */
  #map {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
  }

  /* La barre latérale devient une feuille qui coulisse depuis le bas */
  #sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    flex: none;
    height: 86vh;
    height: 86dvh;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 36px rgba(30, 24, 16, 0.3);
    transform: translateY(calc(86dvh - 218px)); /* replié : on voit ~218px */
    transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 1000;
  }
  #sidebar.open {
    transform: translateY(0);
  }
  #sidebar::after {
    display: none;
  }

  /* Poignée de préhension */
  .sheet-handle {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    padding: 11px 0 5px;
    cursor: pointer;
  }
  .sheet-handle::before {
    content: "";
    display: block;
    width: 46px;
    height: 5px;
    margin: 0 auto;
    border-radius: 3px;
    background: #d8d1c4;
  }

  #side-header {
    padding: 0 16px 6px;
    border-bottom: none;
    background: none;
  }
  .brand-mark {
    width: 36px;
  }
  .brand-name {
    font-size: 16px;
  }
  .home-link {
    font-size: 12.5px;
    padding: 5px 11px;
  }
  #side-header .subtitle {
    display: none;
  }

  #search {
    margin: 4px 16px 8px;
  }
  /* Filtres sur UNE seule ligne qui défile au doigt (la place est comptée
     dans la feuille repliée). Le fondu à droite signale qu'il y en a d'autres. */
  #chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2px 16px 8px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent);
  }
  #chips::-webkit-scrollbar {
    display: none;
  }
  .chip {
    flex: none;
  }
  #count {
    padding: 2px 20px 4px;
    text-align: center;
  }
  #side-footer {
    display: none;
  }

  #detail {
    animation: none;
  }
  #detail .photo {
    height: 190px;
  }

  /* Contrôles Leaflet un peu remontés pour ne pas passer sous la feuille */
  .leaflet-bottom {
    bottom: 224px;
  }
}

/* Très petits écrans : feuille un peu plus haute repliée */
@media (max-width: 400px) {
  .brand-name {
    font-size: 15px;
  }
  #chips {
    gap: 5px;
  }
  .chip {
    font-size: 12px;
    padding: 5px 9px;
  }
}

/* ---------------- Voyage dans le temps ---------------- */
.time-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border: none;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}
.time-toggle:hover {
  background: #000;
}
.time-toggle .tt-ico {
  display: inline-block;
  font-size: 16px;
  transform-origin: 50% 20%;
}

/* Invitation visuelle : entrée en douceur, halo doré qui pulse et horloge qui
   « sonne », par cycles. Retirée (classe .attract) dès que le visiteur a
   essayé le bouton — mémorisé dans son navigateur. */
.time-toggle.attract {
  animation: tt-in 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.time-toggle.attract::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  animation: tt-halo 7s ease-out 1s 6;
}
.time-toggle.attract .tt-ico {
  animation: tt-ring 7s ease-in-out 1s 6;
}
@keyframes tt-in {
  from { opacity: 0; transform: translateY(-14px) scale(0.92); }
  to { opacity: 1; transform: none; }
}
@keyframes tt-halo {
  0% { box-shadow: 0 0 0 0 rgba(240, 190, 42, 0.8); }
  12% { box-shadow: 0 0 0 16px rgba(240, 190, 42, 0); }
  13% { box-shadow: 0 0 0 0 rgba(240, 190, 42, 0.6); }
  26% { box-shadow: 0 0 0 16px rgba(240, 190, 42, 0); }
  100% { box-shadow: 0 0 0 0 rgba(240, 190, 42, 0); }
}
@keyframes tt-ring {
  0%, 20%, 100% { transform: rotate(0); }
  3% { transform: rotate(-18deg) scale(1.18); }
  6% { transform: rotate(15deg) scale(1.18); }
  9% { transform: rotate(-11deg) scale(1.12); }
  12% { transform: rotate(7deg) scale(1.06); }
  15% { transform: rotate(-3deg); }
}
/* Au survol : l'horloge sonne une fois */
.time-toggle:hover .tt-ico {
  animation: tt-ring-once 0.9s ease-in-out;
}
@keyframes tt-ring-once {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(-18deg) scale(1.18); }
  35% { transform: rotate(15deg) scale(1.18); }
  55% { transform: rotate(-9deg) scale(1.1); }
  75% { transform: rotate(5deg); }
}
/* Bulle d'explication (3 premières visites) */
.tt-hint {
  position: absolute;
  top: calc(100% + 12px);
  right: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.35s, transform 0.35s;
  pointer-events: none;
}
.tt-hint::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 24px;
  width: 10px;
  height: 10px;
  background: #fffdf9;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: rotate(45deg);
}
.time-toggle.hint-on .tt-hint {
  opacity: 1;
  transform: none;
}
/* Animations coupées si le visiteur l'a demandé dans ses réglages : on garde
   juste un liseré doré fixe. */
@media (prefers-reduced-motion: reduce) {
  .time-toggle.attract,
  .time-toggle.attract::before,
  .time-toggle.attract .tt-ico,
  .time-toggle:hover .tt-ico {
    animation: none;
  }
  .time-toggle.attract::before {
    box-shadow: 0 0 0 3px rgba(240, 190, 42, 0.85);
  }
  .tt-hint {
    transition: none;
  }
}

#timebar {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 901;
  width: 300px;
  max-width: calc(100vw - 28px);
  background: rgba(20, 16, 12, 0.93);
  color: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
}
#timebar .tb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#timebar .tb-year {
  font-size: 14px;
}
#timebar .tb-year b {
  font-family: var(--display);
  font-size: 22px;
  color: var(--yellow);
}
#timebar .tb-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.7;
}
#tbSlider {
  width: 100%;
  margin: 12px 0 8px;
  accent-color: var(--yellow);
  cursor: pointer;
}
#timebar .tb-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: #d8d1c4;
}
#tbUndated {
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #fff;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  cursor: pointer;
}

/* Cases à cocher du voyage dans le temps */
#timebar .tb-opts {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
#timebar .tb-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: #efe9dd;
  cursor: pointer;
  user-select: none;
}
#timebar .tb-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--yellow);
  cursor: pointer;
  flex: none;
}
#timebar .tb-check small {
  color: #b3aa9a;
  font-size: 11.5px;
}
/* Quand « toutes les photos » est coché, le curseur d'année est désactivé */
#timebar.all-on #tbSlider {
  opacity: 0.35;
  pointer-events: none;
}
#timebar.all-on .tb-year b {
  font-size: 15px;
}

.photo-marker .pm {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
  background-size: cover;
  background-position: center;
  background-color: #ccc;
  cursor: pointer;
  transition: transform 0.15s;
}
.photo-marker:hover .pm {
  transform: scale(1.16);
}

/* Plusieurs photos au même endroit : effet de pile + badge du nombre */
.photo-marker.multi .pm {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.55), 4px -4px 0 -1px #fff,
    5px -5px 0 0 rgba(0, 0, 0, 0.28);
}
.photo-marker .pm-count {
  position: absolute;
  right: -6px;
  bottom: -4px;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--yellow);
  color: #2b2205;
  border: 2px solid #fff;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 12, 8, 0.93);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 24px 40px;
  overflow-y: auto; /* le panneau sous la photo doit rester atteignable */
  overscroll-behavior: contain;
}
#lightbox figure {
  margin: auto;
  max-width: 92vw;
  text-align: center;
}
#lightbox img {
  max-width: 92vw;
  max-height: 62vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
#lightbox figcaption {
  color: #f3efe6;
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.5;
  max-width: 640px;
}
#lightbox .lb-year {
  font-family: var(--display);
  font-size: 20px;
  color: var(--yellow);
  display: block;
  margin-bottom: 4px;
}
#lightbox .lb-credit {
  font-size: 12.5px;
  color: #b7b0a4;
  margin-top: 6px;
}

#lbClose {
  position: fixed;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
}

/* ============================================================
   Compléments responsive — confort mobile (ajoutés en fin de
   fichier, ne modifient pas le rendu desktop).
   Cible : recherche, filtres, « voyage dans le temps » et
   lightbox parfaitement lisibles et sans débordement à 375px.
   ============================================================ */
@media (max-width: 760px) {
  /* Recherche : police >= 16px pour éviter le zoom auto iOS */
  #search {
    font-size: 16px;
  }

  /* Filtres à cocher : espacements resserrés, boutons compacts */
  #chips {
    gap: 6px;
  }
  .chip {
    padding: 6px 11px;
    font-size: 12.5px;
  }

  /* Voyage dans le temps : paddings resserrés, cases lisibles */
  #timebar {
    padding: 13px 14px;
  }
  #timebar .tb-check {
    align-items: flex-start; /* propre si le libellé passe sur 2 lignes */
  }

  /* Lightbox : aucune photo ne dépasse de l'écran */
  #lightbox {
    padding: 52px 12px 34px;
  }
  #lightbox figure {
    max-width: calc(100vw - 24px);
  }
  #lightbox img {
    max-width: calc(100vw - 24px);
    max-height: 58vh;
  }
  #lightbox figcaption {
    font-size: 14px;
  }
  #lightbox .lb-year {
    font-size: 18px;
  }
}

@media (max-width: 460px) {
  /* Voyage dans le temps : pleine largeur avec petites marges */
  #timebar {
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
  }
  #timebar .tb-year {
    font-size: 13px;
  }
  #timebar .tb-year b {
    font-size: 19px;
  }
  #timebar .tb-check {
    font-size: 13px;
  }

  /* Filtres encore plus compacts sur très petits écrans */
  #chips {
    gap: 5px;
  }
  .chip {
    padding: 5px 9px;
    font-size: 12px;
  }

  /* Lightbox : hauteur d'image ajustée, fermeture bien visible */
  #lightbox {
    padding: 48px 10px 30px;
  }
  #lightbox img {
    max-width: calc(100vw - 20px);
    max-height: 54vh;
  }
  #lbClose {
    top: 10px;
    right: 12px;
    font-size: 28px;
  }
}

