/* trails-detail.css — fiche parcours : en-tête + aperçu carte compact +
   tableau des étapes (le cœur de la page). Volontairement différent de
   l'explorer : ici on LIT et on PARTAGE un parcours ; l'explorer sert à
   le PARCOURIR. Style noir / blanc / cream beboun. */

body { background: #fff; }

.td-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

/* ── En-tête ──────────────────────────────────────────────────── */
.td-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 18px;
  border-bottom: 1px solid #EFEEEC;
}
.td-header-info { flex: 1; min-width: 0; }
.td-back-link {
  display: inline-block;
  font-size: 12px;
  color: #888;
  text-decoration: none;
  margin-bottom: 6px;
}
.td-back-link:hover { color: #111; }
.td-header-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  color: #111;
  margin: 0;
  line-height: 1.1;
  letter-spacing: -.015em;
}
.td-header-meta { font-size: 13px; color: #666; margin-top: 8px; }
.td-header-meta strong { color: #111; font-weight: 600; }

.td-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.td-cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}
.td-cta-btn:hover { background: #000; }

.td-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: #fff;
  color: #333;
  border: 1px solid #DDD;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.td-share-btn:hover { background: #F5F5F3; border-color: #999; }
.td-share-btn.copied { background: #16A34A; color: #fff; border-color: #16A34A; }

/* Toggle public/privé */
.visibility-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: #fff;
  border: 1px solid #DDD;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  transition: background .15s, color .15s, border-color .15s;
}
.visibility-toggle:hover { background: #F5F5F3; color: #111; border-color: #999; }
.visibility-toggle[data-public="1"] { background: #111; color: #fff; border-color: #111; }
.visibility-toggle[data-public="1"]:hover { background: #333; border-color: #333; }
.visibility-toggle--copied { background: #16A34A !important; border-color: #16A34A !important; color: #fff !important; }
.visibility-icon { flex-shrink: 0; }
.visibility-label { line-height: 1; }

/* Delete (owner) */
.td-owner-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #fff;
  border: 1px solid #DDD;
  border-radius: 999px;
  cursor: pointer;
  color: #999;
  transition: background .15s, color .15s, border-color .15s;
}
.td-owner-delete:hover { background: #FEF2F2; color: #DC2626; border-color: #FCA5A5; }

/* ── Corps ────────────────────────────────────────────────────── */
.td-main { padding-top: 24px; }
.td-block { margin-bottom: 28px; }
.td-section-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 10px;
}
.td-desc {
  font-size: 15px;
  color: #333;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0;
}

/* Aperçu carte compact (pas une carte plein écran : c'est une fiche) */
.td-preview { position: relative; margin-bottom: 28px; }
#td-map {
  width: 100%;
  height: 300px;
  border-radius: 16px;
  overflow: hidden;
  background: #F5F5F3;
  border: 1px solid #EFEEEC;
}

/* En-tête de la section étapes : label à gauche, total à droite */
.td-steps-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.td-steps-head .td-section-label { margin: 0; }
.td-steps-total { font-size: 13px; font-weight: 600; color: #111; flex-shrink: 0; }

/* Tableau des étapes : chaque étape = une carte ; entre deux, la marche */
.td-steps { list-style: none; margin: 0; padding: 0; }
.td-step { position: relative; }

.td-step-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border: 1px solid #EFEEEC;
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, background .15s;
}
.td-step-row:hover { border-color: #111; background: #FAFAF8; }
.td-step.is-active .td-step-row { border-color: #111; background: #FAFAF8; }

.td-step-pin { position: relative; width: 42px; height: 42px; flex-shrink: 0; }
.td-step-blob { width: 42px; height: 42px; display: block; }
.td-step-badge {
  position: absolute;
  right: -3px;
  bottom: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  border: 2px solid #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.td-step-text { flex: 1; min-width: 0; }
.td-step-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.td-step-cat { display: block; font-size: 12px; color: #777; margin-top: 1px; }

.td-step-chev { width: 18px; height: 18px; flex-shrink: 0; color: #CCC6BB; transition: color .15s; }
.td-step-row:hover .td-step-chev { color: #111; }

/* Connecteur "marche vers l'étape suivante" entre deux cartes */
.td-step-link {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: 35px;      /* aligné sous le centre de l'avatar (14 + 21) */
  padding: 8px 0;
  font-size: 12.5px;
  color: #999;
}
.td-step-link svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .65; }

/* ── Marqueur carte : pin goutte à yeux (comme l'explorer) ─────── */
.td-marker svg {
  display: block;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.28));
}

/* ── Pill flottante : nom du lieu actif sur la carte ──────────── */
.td-place-pill {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 8px 8px 8px 14px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.12);
  font-size: 14px;
  font-weight: 600;
  color: #111;
}
.td-place-pill[hidden] { display: none; }
.td-place-pill-dot {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #888;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0, 0, 0, .08);
}
.td-place-pill-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.td-place-pill-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: #F0EFEA;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  transition: background .15s, color .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.td-place-pill-close:hover { background: #E5E4DE; color: #111; }

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .td-page { padding: 0 14px 48px; }
  .td-header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 0 14px;
  }
  .td-header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .td-cta-btn { padding: 8px 14px; }
  #td-map { height: 240px; }
  .td-step-name { font-size: 14px; }
}
