/* Bourse interne du club
   Couleurs tirées du balisage des pistes et des dossards de course. */
:root {
  --neige: #f2f5f8;
  --blanc: #ffffff;
  --encre: #14263a;
  --gris: #5a6878;
  --ligne: #d5dde6;
  --bleu: #1c5bae;
  --bleu-fonce: #154787;
  --rouge: #c62128;
  --vert: #1e7a46;
  --ambre: #9a5b00;
  --titres: "Bahnschrift", "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --texte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--neige);
  color: var(--encre);
  font: 1rem/1.55 var(--texte);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--bleu); text-underline-offset: .15em; }
a:hover { color: var(--bleu-fonce); }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }
img { max-width: 100%; display: block; }

h1, h2 { font-family: var(--titres); font-stretch: condensed; line-height: 1.15; letter-spacing: -.005em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 700; margin: 0 0 .5rem; }
h2 { font-size: 1.3rem; font-weight: 600; margin: 0 0 .75rem; }

/* ---------- Barre du haut ---------- */
.barre { background: var(--encre); color: #fff; border-bottom: 4px solid var(--rouge); }
.barre-int {
  max-width: 1180px; margin: 0 auto; padding: .7rem 1.25rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem;
}
.marque {
  color: #fff; text-decoration: none; font-family: var(--titres); font-stretch: condensed;
  font-weight: 700; font-size: 1.35rem; margin-right: auto;
}
.marque:hover { color: #fff; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.1rem; }
.nav a, .nav-bouton {
  color: #d9e3ee; text-decoration: none; font-size: .95rem;
  background: none; border: 0; padding: .25rem 0; font-family: inherit; cursor: pointer;
}
.nav a:hover, .nav-bouton:hover { color: #fff; text-decoration: underline; }
.nav form { margin: 0; }
.pastille {
  display: inline-block; min-width: 1.35em; padding: 0 .35em; border-radius: 1em;
  background: var(--rouge); color: #fff; font-size: .8rem; font-weight: 700; text-align: center;
}

/* ---------- Mise en page ---------- */
.page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 2rem 1.25rem 3rem; flex: 1; }
.etroit { max-width: 34rem; margin: 0 auto; }
.moyen { max-width: 46rem; margin: 0 auto; }
.intro { color: var(--gris); margin: 0 0 1.5rem; max-width: 60ch; }
.apres { margin-top: 1.5rem; color: var(--gris); }
.discret { color: var(--gris); font-size: .9rem; }
.facultatif { color: var(--gris); font-weight: 400; font-size: .85rem; }
.retour { margin: 0 0 1rem; }
.retour a::before { content: "‹ "; }
.sous-titre { margin-top: 2.5rem; }
.pied { text-align: center; color: var(--gris); font-size: .85rem; padding: 1.5rem 1rem 2rem; border-top: 1px solid var(--ligne); }
.pied p { margin: 0; }

/* ---------- Messages ---------- */
.flash { padding: .75rem 1rem; border-radius: 6px; margin: 0 0 1.25rem; border-left: 4px solid var(--vert); background: #e7f3ec; }
.flash-erreur { border-color: var(--rouge); background: #fbeaea; }
.flash-info { border-color: var(--bleu); background: #e8eff9; }
.erreurs { border-left: 4px solid var(--rouge); background: #fbeaea; padding: .5rem 1rem; border-radius: 6px; margin-bottom: 1.25rem; }
.erreurs p { margin: .35rem 0; }

/* ---------- Formulaires ---------- */
.formulaire { display: grid; gap: 1rem; }
.formulaire label { display: block; font-weight: 600; font-size: .95rem; }
.formulaire label > input:not([type=checkbox]), .formulaire label > select, .formulaire label > textarea { display: block; margin-top: .3rem; }
.formulaire label > .facultatif, .formulaire label > .aide { margin-left: .35rem; }
.formulaire label.case { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.case input { margin-top: .3rem; flex: none; width: 1.1rem; height: 1.1rem; }
.deux { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.trois { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
input:not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%; font: inherit; font-weight: 400; color: var(--encre);
  padding: .6rem .7rem; border: 1px solid #b9c5d2; border-radius: 6px; background: var(--blanc);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--bleu); outline: 2px solid rgba(28, 91, 174, .25); }
fieldset { border: 1px dashed #b9c5d2; border-radius: 6px; padding: 1rem; margin: 0; }
legend { font-weight: 600; padding: 0 .3rem; }

.bouton {
  display: inline-block; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  background: var(--bleu); color: #fff; border: 2px solid var(--bleu); border-radius: 6px;
  padding: .55rem 1.1rem; justify-self: start;
}
.bouton:hover { background: var(--bleu-fonce); border-color: var(--bleu-fonce); color: #fff; }
.bouton-second { background: var(--blanc); color: var(--bleu); }
.bouton-second:hover { background: #e8eff9; color: var(--bleu-fonce); }
.lien-danger { background: none; border: 0; padding: 0; color: var(--rouge); font: inherit; text-decoration: underline; cursor: pointer; }
.ligne-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: 0; }
.ligne-actions label { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.ligne-actions select { width: auto; }

/* ---------- Liste des annonces ---------- */
.entete-liste { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; }
.accueil { margin: .25rem 0 0; max-width: 65ch; }
.filtres {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem;
  padding: 1rem; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 8px; margin-bottom: 1.75rem;
}
.filtres label { display: block; font-size: .85rem; font-weight: 600; color: var(--gris); }
.filtres label > select, .filtres label > input { display: block; margin-top: .25rem; }
.filtres label.large { flex: 1 1 16rem; }
.filtres select { min-width: 12rem; }
.filtres input[name=prix_max] { width: 7rem; }
.effacer { align-self: center; font-size: .9rem; }

.grille { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.carte a { display: block; color: inherit; text-decoration: none; }
.carte-photo {
  position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden;
  background: #e3e9ef; border: 1px solid var(--ligne);
}
.carte-photo img { width: 100%; height: 100%; object-fit: cover; }
.carte a:hover .carte-photo { border-color: var(--bleu); }
.carte a:hover h2 { color: var(--bleu); text-decoration: underline; }
.carte-reservee .carte-photo img { filter: grayscale(.6); opacity: .8; }
.sans-photo { display: grid; place-items: center; width: 100%; height: 100%; color: var(--gris); font-size: .9rem; }
.carte-texte { padding: .65rem .1rem 0; }
.carte h2 { font-family: var(--texte); font-stretch: normal; font-size: 1rem; font-weight: 600; margin: 0 0 .2rem; line-height: 1.35; }
.details { margin: 0; color: var(--gris); font-size: .88rem; display: flex; flex-wrap: wrap; gap: .1rem .75rem; }
.details .taille { color: var(--encre); font-weight: 600; }
.la-mienne { margin: .3rem 0 0; font-size: .8rem; color: var(--vert); font-weight: 600; }
.etiquette-reserve {
  position: absolute; top: .6rem; right: .6rem; background: var(--encre); color: #fff;
  font-size: .8rem; font-weight: 600; padding: .15rem .55rem; border-radius: 4px;
}

/* Le dossard : l'élément signature, un dossard de course épinglé sur la photo */
.dossard {
  position: absolute; left: .7rem; bottom: .7rem;
  display: inline-block; min-width: 4.6rem; text-align: center;
  background: var(--blanc); color: var(--encre);
  border-top: 9px solid var(--rouge); border-radius: 2px 2px 9px 9px;
  padding: .2rem .7rem .3rem;
  box-shadow: 0 2px 0 rgba(20, 38, 58, .18);
  transform: rotate(-2.5deg);
}
.dossard::before, .dossard::after {
  content: ""; position: absolute; top: 3px; width: 5px; height: 5px; border-radius: 50%;
  background: #aab6c3; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .35);
}
.dossard::before { left: 5px; }
.dossard::after { right: 5px; }
.dossard-prix { font-family: var(--titres); font-stretch: condensed; font-weight: 700; font-size: 1.4rem; line-height: 1.1; white-space: nowrap; }
.dossard-grand { position: relative; left: auto; bottom: auto; border: 1px solid var(--ligne); border-top: 12px solid var(--rouge); padding: .3rem 1.1rem .45rem; }
.dossard-grand .dossard-prix { font-size: 2.1rem; }
.dossard-grand::before, .dossard-grand::after { top: 4px; width: 6px; height: 6px; }

.vide { text-align: center; padding: 3rem 1rem; background: var(--blanc); border: 1px dashed #b9c5d2; border-radius: 8px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 1.5rem; margin-top: 2rem; }

/* ---------- Détail d'une annonce ---------- */
.annonce { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.photo-principale { width: 100%; max-height: 38rem; object-fit: contain; background: #e3e9ef; border-radius: 8px; border: 1px solid var(--ligne); }
div.photo-principale { aspect-ratio: 4 / 3; }
.vignettes { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.vignettes a { width: 5.5rem; aspect-ratio: 1; border: 2px solid transparent; border-radius: 6px; overflow: hidden; }
.vignettes a.actif { border-color: var(--bleu); }
.vignettes img { width: 100%; height: 100%; object-fit: cover; }
.fiche-cat { margin: 0 0 .25rem; color: var(--gris); font-size: .95rem; }
.fiche-prix { display: flex; align-items: center; gap: 1rem; margin: 1rem 0 1.25rem; }
.statut { font-weight: 700; padding: .2rem .6rem; border-radius: 4px; }
.statut-reserve { background: #fdf1dd; color: var(--ambre); }
.statut-vendu { background: var(--encre); color: #fff; }
.caracteristiques { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; margin: 0 0 1.25rem; }
.caracteristiques dt { color: var(--gris); }
.caracteristiques dd { margin: 0; font-weight: 600; }
.description { max-width: 65ch; margin-bottom: 1.5rem; }
.bloc { background: var(--blanc); border: 1px solid var(--ligne); border-radius: 8px; padding: 1.25rem; margin-bottom: 1.25rem; }
.bloc-contact { border: 2px solid var(--bleu); }
.bloc-admin { border-style: dashed; }
.bloc-danger { border-color: #e8b9bb; }
.bloc > form + form { margin-top: .75rem; }
.bloc .ligne-actions + .ligne-actions { margin-top: .75rem; }
.interets { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.interets li { padding-bottom: 1rem; border-bottom: 1px solid var(--ligne); }
.interets li:last-child { border-bottom: 0; padding-bottom: 0; }
.interets a { margin-right: .75rem; }
blockquote { margin: .5rem 0 0; padding: .4rem .8rem; border-left: 3px solid var(--ligne); color: var(--encre); background: var(--neige); border-radius: 0 6px 6px 0; }

/* ---------- Photos dans le formulaire ---------- */
.photos-actuelles { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.formulaire label.photo-existante { display: grid; gap: .3rem; width: 7rem; font-weight: 400; font-size: .85rem; }
.photo-existante img { width: 7rem; height: 7rem; object-fit: cover; border-radius: 6px; border: 1px solid var(--ligne); }
.photo-existante:has(input:checked) img { opacity: .35; }

/* ---------- Listes en rangées ---------- */
.tableau { list-style: none; margin: 0 0 1rem; padding: 0; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 8px; }
.rang { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding: .85rem 1rem; border-bottom: 1px solid var(--ligne); }
.rang:last-child { border-bottom: 0; }
.rang-vendu { background: #f7f9fb; }
.rang-vendu .rang-texte strong { color: var(--gris); }
.rang-photo { width: 4.5rem; height: 3.4rem; flex: none; border-radius: 6px; overflow: hidden; background: #e3e9ef; }
.rang-photo img { width: 100%; height: 100%; object-fit: cover; }
.rang-texte { display: grid; gap: .1rem; flex: 1 1 14rem; min-width: 0; }
.rang-statut { margin: 0; }
.rang-statut select { width: auto; }
.badge { font-size: .75rem; font-weight: 600; background: #e8eff9; color: var(--bleu-fonce); padding: .1rem .45rem; border-radius: 4px; vertical-align: middle; }
.badge-gris { background: #e6eaee; color: var(--gris); }
.chiffres { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: 0 0 1.5rem; color: var(--gris); }
.chiffres strong { font-family: var(--titres); font-stretch: condensed; font-size: 1.6rem; color: var(--encre); margin-right: .2rem; }
.liste-simple { margin: 0; padding-left: 1.1rem; }

/* ---------- Petits écrans ---------- */
@media (max-width: 760px) {
  .annonce { grid-template-columns: 1fr; }
  .page { padding-top: 1.25rem; }
  .barre-int { padding: .6rem 1rem; }
  .marque { width: 100%; }
  .filtres select, .filtres input[name=prix_max] { min-width: 0; width: 100%; }
  .filtres label { flex: 1 1 45%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Pointures ---------- */
[hidden] { display: none !important; }
.aide { font-weight: 400; font-size: .85rem; margin-left: .35rem; }
.equivalences { color: var(--gris); font-weight: 400; }
.defile { overflow-x: auto; }
.table-pointures { width: 100%; border-collapse: collapse; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 8px; font-variant-numeric: tabular-nums; }
.table-pointures th, .table-pointures td { padding: .45rem .9rem; text-align: left; border-bottom: 1px solid var(--ligne); }
.table-pointures thead th { font-size: .9rem; color: var(--gris); background: var(--neige); }
.table-pointures tbody th { font-family: var(--titres); font-stretch: condensed; font-size: 1.1rem; }
.table-pointures tbody tr:hover { background: #e8eff9; }
.table-pointures tr.debut-adulte > * { border-top: 2px solid var(--encre); }
.large-page { max-width: 72rem; margin: 0 auto; }
.table-pointures thead th.groupe { text-align: center; border-bottom: 1px solid var(--ligne); }
.table-pointures td.generale { background: var(--neige); }
.table-pointures td.ecart { font-weight: 700; }
.table-pointures .absent { color: #aab6c3; }
.table-pointures th, .table-pointures td { white-space: nowrap; }

.date-annonce { margin: .25rem 0 0; font-size: .8rem; color: var(--gris); }
