/* etalons2027.com — pages étalon et haras du Guide des étalons (piste « Clair », bordeaux de la liseuse, GG 02/12/2026).
   Mise en page seulement : les couleurs et la police des titres viennent de jetons.css (tools/marque/), chargé avant cette
   feuille ; aucune couleur en dur ici (hors blanc et noir translucides des dégradés et ombres).
   Mobile d'abord ; à partir de 1000 px, deux colonnes. Texte courant en police du système, aucune ressource extérieure. */

:root {
  --rayon: 6px;
  --barre: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--encre);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px; line-height: 1.45;
  padding-bottom: calc(var(--barre) + env(safe-area-inset-bottom));
}
body.page-accueil, body.page-404 { padding-bottom: 0; }
a { color: var(--rouge); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.15; margin: 0; font-family: var(--police-titre); font-weight: 700; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.evitement { position: absolute; left: -9999px; top: 0; background: var(--rouge); color: var(--fond); padding: 10px 14px; z-index: 30; }
.evitement:focus { left: 8px; top: 8px; }
.ic { flex: none; }

/* En-tête et pied */
.tete {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1180px; margin: 0 auto; padding: 10px 16px 9px; border-bottom: 1px solid var(--trait);
}
.marque { display: block; white-space: nowrap; color: var(--encre); text-decoration: none; line-height: 1.15; }
.m-haut { display: block; color: var(--gris); font-size: .72rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.m-bas { display: block; text-transform: uppercase; letter-spacing: .16em; font-size: .86rem; font-weight: 600; }
.m-bas b { color: var(--rouge); font-weight: 800; }
.tete-guide { display: inline-flex; align-items: center; gap: 6px; color: var(--encre); text-decoration: none; font-size: .86rem; }
.tete-guide .ic { color: var(--rouge); }
.tete-guide:hover span { text-decoration: underline; }
@media (max-width: 479px) { .tete-guide .long { display: none; } .m-bas { letter-spacing: .12em; } }
.pied { max-width: 1180px; margin: 32px auto 0; padding: 18px 16px 22px; border-top: 1px solid var(--trait); text-align: center; color: var(--gris); font-size: .9rem; }
.pied p { margin: 4px 0; }
.pied a { color: var(--gris); }


/* Fiche : un seul fil sur téléphone */
.fiche { max-width: 1180px; margin: 0 auto; }
.fiche > div, .fiche > nav, .fiche > section { padding-left: 16px; padding-right: 16px; }
.fiche > .f-photo { padding: 0; }
.f-photo figure { margin: 0; }
.f-photo img { width: 100%; aspect-ratio: auto; background: var(--fond-doux); }
figure { margin: 0; }
figcaption { font-size: .78rem; color: var(--gris); padding: 4px 16px 0; text-align: right; }
.vignette figcaption, .haras-photo figcaption { padding: 4px 0 0; }
figcaption .legende { color: var(--encre); float: left; text-align: left; }
.zoom { display: block; }

.f-tete { padding-top: 16px; }
h1 { font-size: clamp(2.3rem, 9vw, 3.1rem); letter-spacing: .005em; }
.f-du-haras { margin: 0; font-size: 1.2rem; font-style: italic; }
.f-du-haras a { color: var(--rouge); text-decoration-color: var(--trait); text-underline-offset: 3px; }
.f-lieu { margin: 6px 0 0; display: flex; align-items: center; gap: 4px; color: var(--gris); }
.f-lieu .ic { color: var(--rouge); }

/* Tête « vitrine » des pages étalon et haras : photo bord à bord, nom en blanc sur un dégradé sombre, crédit en haut à droite.
   Le texte passe au-dessus du lien de zoom mais le laisse cliquable (pointer-events) ; le h1 reste dans le flux. */
.vitrine { position: relative; color: #fff; }
.vitrine figure { position: relative; }
/* Sous 1000 px la tête suit le format réel de la photo (les dimensions de l'<img> donnent le rapport) : le cheval reste entier ;
   le plafond de hauteur ne rogne qu'une photo très haute. Dès 1000 px, bandeau 16:7 (voir plus bas). */
.vitrine .zoom img { width: 100%; aspect-ratio: auto; max-height: 80vh; max-height: 80svh; object-fit: cover; object-position: 50% 40%; }
.vitrine figcaption {
  position: absolute; top: 8px; right: 8px; z-index: 2; max-width: calc(100% - 16px); padding: 2px 8px; border-radius: 10px;
  background: rgba(20, 12, 12, .5); color: #fff; font-size: .72rem; line-height: 1.4; text-align: right; pointer-events: none;
}
.vitrine figcaption .legende { float: none; color: #fff; }
.v-titre {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; min-height: 55%; padding: 56px 16px 16px;
  display: flex; flex-direction: column; justify-content: flex-end; pointer-events: none;
  background: linear-gradient(to top, rgba(20, 12, 12, .85), rgba(20, 12, 12, 0));
}
.vitrine h1 {
  font-size: clamp(2.6rem, 5vw + 1.2rem, 4.4rem); line-height: 1; text-transform: uppercase; letter-spacing: .01em;
  text-wrap: balance; text-shadow: 0 2px 8px rgba(0, 0, 0, .45);
}
.v-par { margin: 6px 0 0; font-size: 1.05rem; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
/* Sans photo : même bloc de titre, blanc sur le rouge foncé, sans dégradé */
.fiche > .vitrine.sans-image { padding: 40px 16px 22px; background: var(--rouge-fonce); }
.sans-image .v-titre { position: static; min-height: 0; padding: 0; background: none; pointer-events: auto; }

/* Boutons */
.f-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.f-actions:empty { display: none; }
.f-actions .btn:only-child { grid-column: 1 / -1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 10px 14px;
  border: 2px solid var(--rouge); border-radius: var(--rayon); background: var(--fond); color: var(--encre);
  font: inherit; font-weight: 650; font-size: 1.05rem; text-decoration: none; cursor: pointer;
}
.btn .ic { color: var(--rouge); }
.btn:hover { background: var(--rouge-doux); }
.btn.plein { background: var(--rouge); color: var(--fond); }
.btn.plein .ic { color: var(--fond); }
.btn.plein:hover { background: var(--rouge-fonce); border-color: var(--rouge-fonce); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Page étalon pas encore enrichie (GG, 04/12/2026) : mention discrète sous les boutons, puis l'appel aux étalonniers en bouton
   secondaire. Habillage minimal, à reprendre par la discussion DESIGN. */
.f-enrichir { margin-top: 16px; }
.f-enrichir .aide { margin: 0 0 10px; font-size: .95rem; font-style: italic; }
.f-enrichir .btn { width: 100%; min-height: 46px; font-size: .98rem; text-align: center; }

/* Liens en cartes, style Province Courses */
.cartes { display: grid; gap: 10px; margin-top: 16px; }
.carte {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 62px; padding: 10px 14px 10px 24px; border: 1px solid var(--trait); border-radius: var(--rayon);
  background: var(--fond); color: var(--encre); text-decoration: none;
}
.carte::before { content: ""; position: absolute; left: 10px; top: 10px; bottom: 10px; width: 4px; border-radius: 2px; background: var(--rouge); }
.carte:hover { border-color: var(--rouge); background: var(--fond-doux); }
.carte .ic { color: var(--encre); }
.c-texte { display: flex; flex-direction: column; min-width: 0; }
.c-titre { font-weight: 750; font-size: 1.12rem; overflow-wrap: anywhere; }
.c-sous { font-style: italic; color: var(--gris); font-size: .95rem; overflow-wrap: anywhere; }
.carte.principal { background: var(--rouge-doux); border-color: var(--rouge); min-height: 70px; }
.carte.principal:hover { background: var(--rouge-doux); border-color: var(--rouge-fonce); }
.carte.principal .c-titre { font-size: 1.25rem; }

/* Liens de la page étalon en tuiles : Province Courses en grande tuile rouge, puis une grille de 2 colonnes (4 colonnes de
   base, chaque tuile en occupe 2). Une tuile jamais seule dans sa rangée : si le nombre est impair, la dernière prend tout. */
.f-principal { margin-top: 18px; }
.tuile {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 78px; padding: 12px 12px 12px 14px;
  border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--fond); color: var(--encre); text-decoration: none;
}
.tuile:hover { border-color: var(--rouge); background: var(--fond-doux); }
.t-texte { display: flex; flex-direction: column; min-width: 0; }
.t-titre { font-weight: 750; font-size: 1.05rem; line-height: 1.25; overflow-wrap: anywhere; }
.t-sous { color: var(--gris); font-size: .88rem; line-height: 1.3; overflow-wrap: anywhere; }
.tuile .ic { color: var(--rouge); margin-top: 2px; }
.tuile.principal { align-items: center; min-height: 82px; padding: 14px 16px; background: var(--rouge); border-color: var(--rouge); color: var(--fond); }
.tuile.principal .t-titre { font-size: 1.3rem; }
.tuile.principal .t-sous { color: rgba(255, 255, 255, .88); font-size: .95rem; }
.tuile.principal .ic { color: var(--fond); margin-top: 0; }
.tuile.principal:hover { background: var(--rouge-fonce); border-color: var(--rouge-fonce); }
.tuiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.tuiles .tuile { grid-column: span var(--s, 2); }
.tuiles .tuile:last-child:nth-child(odd) { --s: 4; }

/* Page haras : sans tête ni tuile principale, les tuiles suivent directement les actions */
.page-haras .f-tuiles { margin-top: 14px; }

/* Sections */
section { margin-top: 30px; }
h2 { font-size: 1.7rem; text-transform: uppercase; letter-spacing: .01em; padding-left: 10px; border-left: 4px solid var(--rouge); margin-bottom: 14px; }
/* Pages étalon et haras : le titre de section porte un filet qui court à droite */
.page-etalon h2, .page-haras h2 { display: flex; align-items: center; gap: 14px; padding-left: 0; border-left: 0; }
.page-etalon h2::after, .page-haras h2::after { content: ""; flex: 1; height: 1px; background: var(--trait); }

/* Vidéos et photos */
.video { position: relative; display: block; margin-bottom: 12px; border-radius: var(--rayon); overflow: hidden; color: #fff; text-decoration: none; background: var(--encre); }
.video img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.video .v-sans { display: block; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--rouge), var(--encre)); }
.v-voile { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: rgba(0, 0, 0, .28); }
.v-voile .ic { stroke-width: 1.4; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .5)); }
.v-texte { display: flex; flex-direction: column; align-items: center; font-weight: 700; font-size: 1.15rem; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.v-sous { font-weight: 400; font-size: .85rem; }
.video:hover .v-voile { background: rgba(0, 0, 0, .4); }
.galerie { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.galerie img { border-radius: var(--rayon); aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }

/* Étalons d'un haras : vignettes « vitrine » (photo qui remplit la case, nom en blanc sur un dégradé en bas, ou rouge foncé
   sans photo). Le format de la case suit celui des photos (3:2, la hauteur découle de la largeur : le cheval reste entier).
   Une colonne sur téléphone, 3 dès 640 px, 4 dès 1180 px ; la dernière rangée se répartit entière, jamais une vignette seule
   à côté d'un trou (même règle que les tuiles), et ses cartes élargies gardent le 3:2 ; jamais de carte seule sur toute la largeur
   dès 640 px (voir les blocs de grille plus bas). */
.etalons { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 12px; }
.etalons li { min-width: 0; grid-column: span 1; }
.etalons li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.e-vignette {
  position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--rayon);
  background: var(--rouge-fonce); color: #fff; text-decoration: none;
}
.e-vignette img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.e-sans { position: absolute; inset: 0; background: var(--rouge-fonce); }
.e-texte {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; padding: 40px 12px 12px;
  background: linear-gradient(to top, rgba(20, 12, 12, .85), rgba(20, 12, 12, 0));
}
.sans-image .e-texte { background: none; }
.e-nom {
  font-family: var(--police-titre); font-weight: 700; text-transform: uppercase; font-size: 1.4rem; line-height: 1; letter-spacing: .01em;
  text-wrap: balance; overflow-wrap: anywhere; text-shadow: 0 2px 8px rgba(0, 0, 0, .45);
}
.e-pere { margin-top: 4px; font-size: .88rem; line-height: 1.25; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); overflow-wrap: anywhere; }
.e-vignette:hover .e-nom { text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) {
  .e-vignette img { transition: transform .35s ease; }
  .e-vignette:hover img { transform: scale(1.04); }
}

/* Le haras, coordonnées */
.haras-photo { margin-bottom: 12px; }
.haras-photo img { border-radius: var(--rayon); width: 100%; aspect-ratio: 5 / 2; object-fit: cover; }
.coord { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.coord dt { color: var(--gris); }
.coord dd { margin: 0; overflow-wrap: anywhere; }
.coord a { font-weight: 600; }
.itineraire { margin-top: 16px; }
.it-titre { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-weight: 650; }
.it-titre .ic { color: var(--rouge); }
.it-choix { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.it-choix .btn { font-size: 1rem; min-height: 46px; }

/* Nous écrire */
.fiche > .f-ecrire { padding: 0 16px; }
.aide { color: var(--gris); margin: 0 0 12px; }
.formulaire { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--fond-doux); }
.champ label { display: block; font-weight: 600; margin-bottom: 4px; }
.requis { color: var(--rouge); }
.facultatif { color: var(--gris); font-weight: 400; }
.champ input, .champ textarea {
  width: 100%; font: inherit; font-size: 17px; padding: 10px 12px; border: 1px solid var(--gris); border-radius: var(--rayon); background: var(--fond); color: var(--encre);
}
.champ textarea { resize: vertical; min-height: 140px; }
.champ [aria-invalid="true"] { border-color: var(--rouge); }
.champ-err, .envoi-err { color: var(--rouge); margin: 4px 0 0; font-size: .92rem; }
.piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.mention { margin: 0; font-size: .85rem; color: var(--gris); }
.merci { padding: 16px; border-radius: var(--rayon); background: var(--rouge-doux); font-weight: 600; }
.merci p { margin: 0; }

/* Panneau « Nous écrire » (<dialog> modal, comme celui de la liseuse) : feuille qui monte du bas sur téléphone, panneau
   qui glisse par la droite (420 à 480 px) dès 720 px. Fond grisé derrière (::backdrop), page figée (html.bloque). */
html.bloque { overflow: hidden; }
.panneau-ecrire {
  color-scheme: light only; color: var(--encre); background: var(--fond);
  position: fixed; inset: auto 0 0 0; margin: 0; padding: 0; border: 0; outline: none;
  width: 100%; max-width: none; height: auto; max-height: 92vh; max-height: 92dvh;
  border-radius: 16px 16px 0 0; box-shadow: 0 -10px 32px rgba(20, 12, 12, .22);
}
.panneau-ecrire[open] { display: flex; flex-direction: column; animation: pe-monte .28s cubic-bezier(.25, .8, .3, 1); }
.panneau-ecrire[open]::backdrop { background: rgba(20, 12, 12, .4); animation: pe-fond .25s ease; }
.panneau-ecrire.ferme { animation: pe-descend .22s ease forwards; }
.panneau-ecrire.ferme::backdrop { animation: pe-fond-sort .22s ease forwards; }
.pe-tete {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 12px 14px 20px; background: var(--fond-doux); border-bottom: 1px solid var(--trait);
}
.panneau-ecrire .pe-tete h2 { display: block; margin: 0; padding: 0; border: 0; font-size: 1.9rem; }
.panneau-ecrire .pe-tete h2::after { content: none; }
.pe-fermer {
  flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; background: none; color: var(--rouge); cursor: pointer;
}
.pe-fermer:hover { background: var(--rouge-doux); }
.pe-defile { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.pe-defile .aide { margin: 0; padding: 16px 20px 0; }
.panneau-ecrire .formulaire { border: 0; border-radius: 0; background: none; padding: 16px 20px calc(24px + env(safe-area-inset-bottom)); }
.panneau-ecrire .merci { margin: 20px 20px calc(24px + env(safe-area-inset-bottom)); }
@keyframes pe-monte { from { transform: translateY(100%); } to { transform: none; } }
@keyframes pe-descend { from { transform: none; } to { transform: translateY(100%); } }
@keyframes pe-glisse { from { transform: translateX(100%); } to { transform: none; } }
@keyframes pe-recule { from { transform: none; } to { transform: translateX(100%); } }
@keyframes pe-fond { from { opacity: 0; } to { opacity: 1; } }
@keyframes pe-fond-sort { from { opacity: 1; } to { opacity: 0; } }
@media (min-width: 720px) {
  .panneau-ecrire {
    inset: 0 0 0 auto; width: clamp(420px, 34vw, 480px); height: 100%; max-height: 100%;
    border-radius: 0; border-left: 1px solid var(--trait); box-shadow: -10px 0 32px rgba(20, 12, 12, .2);
  }
  .panneau-ecrire[open] { animation-name: pe-glisse; }
  .panneau-ecrire.ferme { animation-name: pe-recule; }
}
@media (prefers-reduced-motion: reduce) {
  .panneau-ecrire[open], .panneau-ecrire.ferme, .panneau-ecrire[open]::backdrop, .panneau-ecrire.ferme::backdrop { animation: none; }
}

/* Barre d'actions collée en bas (téléphone) */
.barre {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  background: var(--fond); border-top: 1px solid var(--trait); box-shadow: 0 -2px 10px rgba(0, 0, 0, .06);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.fiche > .barre { padding-left: 4px; padding-right: 4px; }
.barre a {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px;
  color: var(--encre); text-decoration: none; font-size: .74rem; line-height: 1.15; text-align: center;
}
.barre a + a { border-left: 1px solid var(--filet); }
.barre a:hover { color: var(--rouge); }
.barre .ic { width: 24px; height: 24px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--barre) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 25;
  background: var(--encre); color: var(--fond); padding: 10px 16px; border-radius: 20px; font-size: .95rem;
}

/* Accueil */
.accueil { max-width: 860px; margin: 0 auto; padding: 22px 16px 0; }
.accueil h1 { font-size: clamp(2.1rem, 8vw, 2.9rem); margin-top: 10px; }
.intro { color: var(--gris); }
/* Index de l'accueil : onglets Étalons et Haras, barre de lettres sur deux rangées, liste par lettre. Rendu repris de l'index de la
   liseuse du Guide en ligne (tools/guide-en-ligne/site/liseuse.css), recopié ici : les deux sites ne dépendent pas l'un de l'autre.
   Onglets et barre de lettres collent en haut de l'écran au défilement ; leurs hauteurs sont fixes (variables) pour que le saut à
   une lettre (scroll-margin-top) et l'en-tête de lettre collant se calent dessous. Sans JavaScript : pas d'onglets, deux listes. */
.index-guide { max-width: 720px; padding-left: 0; padding-right: 0; --h-onglets: 44px; --h-ligne: 28px; --h-lettres: 75px; --h-collant: calc(var(--h-onglets) + var(--h-lettres)); }
.index-guide .onglet { margin-top: 0; }
/* Le haut de page (titre, intro, carte du Guide) garde les marges de l'ancien accueil ; le reste de l'index va bord à bord. */
.index-guide > h1, .index-guide > .intro, .index-guide > .cartes { margin-left: 16px; margin-right: 16px; }
.index-guide > .cartes { margin-bottom: 14px; }
.recherche { padding: 4px 16px 12px; }
.recherche input {
  display: block; width: 100%; height: 38px; padding: 0 12px; margin: 0;
  border: 1.5px solid var(--trait); border-radius: 8px; background: var(--fond-doux); color: var(--encre);
  font: inherit; font-size: 15px; -webkit-appearance: none; appearance: none;
}
.recherche input:focus { border-color: var(--rouge); background: var(--fond); outline: none; box-shadow: 0 0 0 3px rgba(164, 38, 44, .15); }
.recherche input::placeholder { color: var(--gris); }
/* Écran tactile : 44 px pour le doigt, jamais sous 16 px (iOS zoomerait sur le champ). */
@media (pointer: coarse) { .recherche input { height: 44px; font-size: 16px; } }
.q-bilan { min-height: 1.2em; margin: 4px 0 0; font-size: .8rem; color: var(--gris); }

.onglets {
  position: sticky; top: 0; z-index: 6; display: flex; gap: 2px; height: var(--h-onglets); padding: 0 16px;
  background: var(--fond); border-bottom: 1px solid var(--trait);
}
.onglets [role="tab"] {
  flex: 1 1 0; padding: 0 4px; border: 0; border-bottom: 3px solid transparent; background: none; cursor: pointer;
  font: inherit; font-size: 1rem; font-weight: 600; color: var(--gris); white-space: nowrap;
}
.onglets [role="tab"][aria-selected="true"] { color: var(--rouge); border-bottom-color: var(--rouge); }
.compte { font-weight: 400; font-size: .8em; color: var(--gris); }
.titre-liste { display: none; }

/* --colonnes de la liseuse : la classe c<N> (la moitié des lettres de la barre, posée par le générateur). */
.lettres {
  position: sticky; top: var(--h-onglets); z-index: 5; display: grid; grid-template-columns: repeat(11, 1fr); grid-auto-rows: var(--h-ligne);
  gap: 2px; height: var(--h-lettres); padding: 8px 12px; background: var(--fond); border-bottom: 1px solid var(--trait);
}
.lettres.c11 { grid-template-columns: repeat(11, 1fr); }
.lettres.c12 { grid-template-columns: repeat(12, 1fr); }
.lettres.c13 { grid-template-columns: repeat(13, 1fr); }
.lettres a, .lettres span {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 4px;
  font-size: .85rem; font-weight: 700; text-decoration: none;
}
.lettres a { color: var(--rouge); }
.lettres a:hover { background: var(--fond-doux); }
.lettres span, .lettres a.eteinte { color: #c9c2ba; pointer-events: none; }

.liste { position: relative; margin: 0; padding: 0 0 24px; list-style: none; }
.liste .lettre {
  position: sticky; top: var(--h-collant); z-index: 4; scroll-margin-top: var(--h-collant);
  padding: 4px 16px; background: var(--fond-doux); color: var(--rouge); font-weight: 800; font-size: .9rem;
}
.liste .entree > a { display: block; padding: 8px 16px; text-decoration: none; color: var(--encre); }
.liste .entree > a:hover { background: var(--fond-doux); }
.liste .nom { font-weight: 650; font-size: .95rem; }
.liste .par { color: var(--gris); font-size: .85rem; }
.liste .det { display: block; color: var(--gris); font-size: .85rem; }
/* Forme longue du nom de haras, « (Haras de l') » : masquée comme dans la liseuse ; pour la remettre, retirer display: none. */
.liste .art { display: none; font-style: italic; font-weight: 400; color: var(--gris); }
.vide { padding: 16px; color: var(--gris); }

/* Sans JavaScript : pas d'onglets, les deux listes l'une sous l'autre, un titre devant chacune ; la barre de lettres seule colle. */
@media (scripting: none) {
  .index-guide { --h-onglets: 0px; }
  .index-guide .recherche, .index-guide .onglets { display: none; }
  .index-guide .onglet[hidden] { display: block !important; }
  .titre-liste { display: block; margin-top: 18px; font-size: 1.6rem; }
}
/* Téléphone : barres compactes. */
@media (max-width: 479px) {
  .index-guide { --h-onglets: 40px; --h-ligne: 26px; --h-lettres: 63px; }
  .lettres { padding: 4px 8px; }
  .lettres a, .lettres span { font-size: .8rem; }
}

@media (min-width: 640px) {
  .galerie { grid-template-columns: repeat(3, 1fr); }
  .etalons { grid-template-columns: repeat(6, 1fr); }
  .etalons li, .etalons li:last-child:nth-child(odd) { grid-column: span 2; }
}
/* Grille de 3 (640 à 1179 px), jamais de carte seule sur toute la largeur : un seul étalon = demi-largeur à gauche ; 3n+2 = deux
   demi-largeurs ; 3n+1 (n ≥ 1) = les quatre dernières en 2 + 2. */
@media (min-width: 640px) and (max-width: 1179px) {
  .etalons li:last-child:nth-child(3n+2), .etalons li:nth-last-child(2):nth-child(3n+1),
  .etalons li:last-child:nth-child(3n+1), .etalons li:nth-last-child(2):nth-child(3n),
  .etalons li:nth-last-child(3):nth-child(3n+2), .etalons li:nth-last-child(4):nth-child(3n+1) { grid-column: span 3; }
  .etalons li:last-child:only-child { grid-column: span 3; }
}

/* Grand écran */
@media (min-width: 1000px) {
  body { padding-bottom: 0; }
  .m-haut { font-size: .82rem; }
  .tete, .pied { padding-left: 24px; padding-right: 24px; }
  .fiche { display: grid; grid-template-columns: minmax(0, 1fr) 400px; column-gap: 44px; padding: 24px 24px 0; align-items: start; }
  .fiche > div, .fiche > nav, .fiche > section { padding-left: 0; padding-right: 0; }
  .f-photo { grid-area: photo; }
  .f-photo img { border-radius: var(--rayon); }
  .f-photo figcaption { padding-right: 0; }
  .f-tete { grid-area: tete; padding-top: 0; }
  .f-actions { grid-area: actions; }
  .f-plus { grid-area: plus; }
  .f-etalons { grid-area: etalons; }
  .f-haras { grid-area: haras; }
  .f-ecrire { grid-area: ecrire; }
  .fiche > .f-ecrire { padding: 0; }
  .barre {
    grid-area: barre; position: static; margin-top: 16px; border: 1px solid var(--trait); border-radius: var(--rayon); padding: 6px 4px; background: var(--fond);
  }
  .toast { bottom: 24px; }
  .galerie { grid-template-columns: repeat(2, 1fr); }

  /* Page haras : vitrine pleine largeur, puis actions et barre, les tuiles et les étalons sur toute la largeur, enfin le fil
     (à voir en plus, formulaire) à gauche et « Coordonnées » à droite. Dernière rangée élastique, comme la page étalon. */
  .page-haras .fiche {
    grid-template-areas: "photo photo" "actions barre" "tuiles tuiles" "etalons etalons" "plus haras" "ecrire haras";
    grid-template-rows: auto auto auto auto auto 1fr;
  }
  .page-haras .f-actions, .page-haras .barre { margin-top: 22px; }
  /* Sans « À voir en plus » : « Coordonnées » sur toute la largeur, en deux colonnes (téléphones, e-mail, adresse à gauche ;
     itinéraire et fiche contact à droite). */
  .page-haras .fiche.sans-plus { grid-template-areas: "photo photo" "actions barre" "tuiles tuiles" "etalons etalons" "haras haras" "ecrire ecrire"; }
  .page-haras .sans-plus .f-haras {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 44px; align-content: start;
    grid-template-areas: "titre titre" "coord it" "coord cartes"; grid-template-rows: auto auto 1fr;
  }
  .page-haras .sans-plus .f-haras h2 { grid-area: titre; }
  .page-haras .sans-plus .f-haras .coord { grid-area: coord; align-self: start; }
  .page-haras .sans-plus .f-haras .itineraire { grid-area: it; margin-top: 0; }
  .page-haras .sans-plus .f-haras .cartes { grid-area: cartes; }
  .page-haras .sans-plus .f-haras .coord ~ .cartes:nth-child(3) { margin-top: 0; }
  .page-haras .f-tuiles { margin-top: 16px; }

  /* Page étalon (la vitrine, ci-dessus, sert aussi à la page haras) : pleine largeur (16/7, sans trou sous la photo), puis le fil à gauche et « Le haras » à droite.
     La dernière rangée est élastique : l'excédent de « Le haras » s'y range, pas entre les blocs de gauche. */
  .page-etalon .fiche {
    grid-template-areas: "photo photo" "tete barre" "actions haras" "enrichir haras" "principal haras" "tuiles haras" "plus haras" "ecrire haras";
    grid-template-rows: auto auto auto auto auto auto auto 1fr;
  }
  .vitrine, .vitrine .zoom img { border-radius: var(--rayon); }
  .vitrine .zoom img { aspect-ratio: 16 / 7; }
  .vitrine figcaption { top: 12px; right: 12px; }
  .v-titre { padding: 72px 32px 28px; }
  .fiche > .vitrine.sans-image { padding: 56px 32px 30px; }
  .page-etalon .f-tete { padding-top: 22px; }
  .page-etalon .barre { margin-top: 22px; }
  .f-principal { grid-area: principal; }
  .f-enrichir { grid-area: enrichir; }
  .f-tuiles { grid-area: tuiles; }
}

/* Tuiles sur grand écran : 3 par rangée de 1000 à 1179 px (6 colonnes de base, chacune en occupe 2), 4 par rangée au-delà
   (12 colonnes de base, chacune en occupe 3). La dernière rangée se répartit entière, sans tuile seule : reste 1 sur 3 ->
   les 4 dernières en 2 + 2 ; reste 2 sur 3 -> 2 tuiles de 3/6 ; reste 1 sur 4 -> les 5 dernières en 3 + 2 ; reste 2 -> 6 + 6 ;
   reste 3 -> 3 de 4/12. */
@media (min-width: 1000px) and (max-width: 1179px) {
  .tuiles { grid-template-columns: repeat(6, 1fr); }
  .tuiles .tuile, .tuiles .tuile:last-child:nth-child(odd) { --s: 2; }
  .tuiles .tuile:only-child { --s: 6; }
  .tuiles .tuile:last-child:nth-child(3n+2), .tuiles .tuile:nth-last-child(2):nth-child(3n+1) { --s: 3; }
  .tuiles .tuile:last-child:nth-child(3n+4), .tuiles .tuile:nth-last-child(2):nth-child(3n+3),
  .tuiles .tuile:nth-last-child(3):nth-child(3n+2), .tuiles .tuile:nth-last-child(4):nth-child(3n+1) { --s: 3; }
  .page-haras .tuiles .tuile:only-child { --s: 3; }
}
@media (min-width: 1180px) {
  .etalons { grid-template-columns: repeat(12, 1fr); }
  .etalons li, .etalons li:last-child:nth-child(odd) { grid-column: span 3; }
  /* Jamais de carte seule sur toute la largeur : un seul étalon = demi-largeur à gauche ; 4n+2 = deux moitiés ; 4n+3 = trois tiers ;
     4n+1 (n ≥ 1) = les cinq dernières en 3 + 2 (trois tiers puis deux moitiés). */
  .etalons li:last-child:nth-child(4n+2), .etalons li:nth-last-child(2):nth-child(4n+1),
  .etalons li:last-child:nth-child(4n+1), .etalons li:nth-last-child(2):nth-child(4n) { grid-column: span 6; }
  .etalons li:last-child:nth-child(4n+3), .etalons li:nth-last-child(2):nth-child(4n+2), .etalons li:nth-last-child(3):nth-child(4n+1),
  .etalons li:nth-last-child(3):nth-child(4n+3), .etalons li:nth-last-child(4):nth-child(4n+2), .etalons li:nth-last-child(5):nth-child(4n+1) { grid-column: span 4; }
  .etalons li:last-child:only-child { grid-column: span 6; }
  .tuiles { grid-template-columns: repeat(12, 1fr); }
  .tuiles .tuile, .tuiles .tuile:last-child:nth-child(odd) { --s: 3; }
  .tuiles .tuile:only-child { --s: 12; }
  .tuiles .tuile:last-child:nth-child(4n+2), .tuiles .tuile:nth-last-child(2):nth-child(4n+1) { --s: 6; }
  .tuiles .tuile:last-child:nth-child(4n+3), .tuiles .tuile:nth-last-child(2):nth-child(4n+2), .tuiles .tuile:nth-last-child(3):nth-child(4n+1) { --s: 4; }
  .tuiles .tuile:last-child:nth-child(4n+5), .tuiles .tuile:nth-last-child(2):nth-child(4n+4) { --s: 6; }
  .tuiles .tuile:nth-last-child(3):nth-child(4n+3), .tuiles .tuile:nth-last-child(4):nth-child(4n+2), .tuiles .tuile:nth-last-child(5):nth-child(4n+1) { --s: 4; }
  /* Page haras : une tuile seule ne prend pas toute la largeur */
  .page-haras .tuiles .tuile:only-child { --s: 4; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
