/* Page détail d'un spot : style « fiche technique » (IBM Plex, noir et blanc, pente en couleur) */

.fiche {
  --encre: #111111;
  --gris: #4a4a4a;
  --filet: #d9d9d9;
  --fond-doux: #f4f4f4;
  --danger: #a3241c;
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 56px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  color: var(--encre);
  background: #ffffff;
}
.fiche a { color: var(--encre); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.fiche a:hover { color: #c2410c; }
.fiche-mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.fiche-petit { font-size: 12px; color: var(--gris); }
.fiche-gras { font-weight: 600; }
.fiche-droite { text-align: right; }

/* en-tête */
.fiche-entete {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px;
  border-bottom: 1px solid var(--encre); padding-bottom: 20px;
}
.fiche-surtitre { font-size: 13px; color: var(--gris); }
.fiche-surtitre a { color: var(--gris); }
.fiche-titre { margin: 8px 0 0; font-family: 'IBM Plex Sans', sans-serif; font-size: clamp(36px, 6vw, 64px); line-height: .95; font-weight: 700; letter-spacing: -1.5px; }
.fiche-difficulte { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.fiche-etiquette { font-size: 12px; color: var(--gris); }
.fiche-echelle { display: flex; gap: 4px; }
.fiche-echelle span { width: 30px; height: 30px; opacity: .25; }
.fiche-echelle span.actuelle { opacity: 1; outline: 3px solid var(--encre); outline-offset: 2px; }
.fiche-difficulte-nom { font-size: 14px; font-weight: 600; }

/* chiffres clés */
.fiche-stats { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-bottom: 1px solid var(--encre); }
.fiche-stats > div { padding: 14px 8px; border-right: 1px solid var(--filet); text-align: center; }
.fiche-stats dt { font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 400; color: var(--gris); }
.fiche-stats dd { margin: 2px 0 0; font-family: 'IBM Plex Mono', monospace; font-size: 28px; font-weight: 500; }

/* colonnes : textes à gauche, carte à droite ; sur écran étroit la carte passe au-dessus */
.fiche-colonnes { display: flex; flex-wrap: wrap; gap: 40px; margin-top: 32px; align-items: flex-start; }
.fiche-textes { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.fiche-carto { flex: 999 1 560px; min-width: 0; border: 1px solid var(--encre); position: sticky; top: calc(var(--nav-h, 61px) + 16px); /* sous la barre de navigation fixe */ }

.fiche-rubrique { margin: 0 0 8px; font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600; }
.fiche-texte { margin: 0; font-size: 17px; line-height: 1.55; overflow-wrap: anywhere; }
.fiche-manque { margin: 0; color: var(--gris); }

/* état / signalements */
.fiche-etat { border: 1px solid var(--encre); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.fiche-etat + .fiche-etat { margin-top: 8px; }
.fiche-etat p { margin: 0; }
.fiche-etat-vide { flex-direction: row; align-items: center; gap: 10px; }
.fiche-etat-vide span:nth-child(2) { flex: 1 1 auto; }
.fiche-point { width: 10px; height: 10px; border-radius: 50%; background: #9a9a9a; }
.fiche-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.fiche-badges span { font-size: 13px; font-weight: 600; padding: 3px 8px; border: 1px solid currentColor; }
.fiche-badges .ok { color: #166534; }
.fiche-badges .info { color: #1d4ed8; }
.fiche-badges .alerte { color: #9a3412; }
.fiche-badges .danger { color: #ffffff; background: var(--danger); border-color: var(--danger); }
.fiche .fiche-lien-fort { font-size: 13px; font-weight: 600; text-decoration: none; align-self: flex-start; }

/* photos */
.fiche-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fiche-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.fiche .fiche-photo-ajout {
  aspect-ratio: 1; border: 1px dashed #8a8a8a; display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 13px; padding: 8px; text-decoration: none;
}

/* widget Strava : largeur fixe (590 px), réduit à la largeur de la colonne par le script de la page */
.fiche-strava { overflow: hidden; height: 405px; }
.fiche-strava iframe { display: block; width: 590px; height: 405px; border: 0; transform-origin: 0 0; }
.fiche .fiche-strava-lien { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 600; text-decoration: none; }

/* historique */
.fiche-historique { width: 100%; border-collapse: collapse; font-size: 14px; }
.fiche-historique td { padding: 8px 8px 8px 0; border-top: 1px solid var(--filet); vertical-align: top; }
.fiche-historique tr:last-child td { border-bottom: 1px solid var(--filet); }

/* actions */
.fiche-actions { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; font-weight: 600; }
.fiche .fiche-actions a { min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; border: 1px solid var(--encre); text-decoration: none; }
.fiche .fiche-actions a.plein { background: var(--encre); color: #ffffff; }
.fiche .fiche-actions a.danger { border-color: transparent; color: var(--danger); }

/* carte */
#fiche-carte { height: 480px; }
.fiche-extremite { width: 20px; height: 20px; background-size: contain; background-repeat: no-repeat; }
.fiche-curseur-carte { width: 18px; height: 18px; border-radius: 50%; background: #ffffff; border: 4px solid var(--encre); box-shadow: 0 0 0 4px rgba(255,255,255,.7); }

/* profil */
.fiche-profil-bloc { border-top: 1px solid var(--encre); padding: 14px 16px 12px; }
.fiche-profil-tete { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; margin-bottom: 8px; }
#fiche-profil { position: relative; height: 180px; padding-left: 44px; }
#fiche-profil-graphe { position: relative; height: 100%; cursor: crosshair; touch-action: none; }
#fiche-profil-graphe svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.fiche-graduation { position: absolute; left: 44px; right: 0; border-top: 1px solid #ececec; pointer-events: none; }
.fiche-graduation span { position: absolute; left: -44px; transform: translateY(-50%); font-size: 11px; color: var(--gris); }
.fiche-curseur-ligne { display: none; position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--encre); pointer-events: none; }
.fiche-curseur-point { display: none; position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #ffffff; border: 3px solid var(--encre); pointer-events: none; }
#fiche-profil-distances { position: relative; height: 18px; margin-left: 44px; font-size: 11px; color: var(--gris); }
#fiche-profil-distances span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
#fiche-profil-distances span:first-child { transform: none; }
.fiche-legende { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12px; }
.fiche-legende span { display: inline-flex; align-items: center; gap: 6px; }
.fiche-legende i { width: 14px; height: 14px; display: inline-block; }

/* commentaires */
.fiche-commentaires { margin-top: 48px; border-top: 2px solid var(--encre); padding-top: 20px; }
.fiche-commentaire-form { margin-top: 16px; }

@media (max-width: 980px) {
  .fiche-carto { order: -1; position: static; }
}
@media (max-width: 700px) {
  .fiche { padding: 20px 16px 40px; }
  #fiche-carte { height: 340px; }
  .fiche-difficulte { align-items: flex-start; }
}
