/* Annuaire /races/ (category-races.php). Chargé seulement sur is_category('races'), après search.css
   (en-tête .search-hero, champ .hero-search, tuiles .sr-guides / .sr-row). */

/* ── En-tête ── */
.rh-intro { max-width: 620px; margin: -6px 0 16px; }
.rh-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.rh-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
  border: 1.5px solid var(--green); border-radius: var(--radius-sm); background: var(--white);
  font-size: 0.9rem; font-weight: 600; color: var(--green); text-decoration: none; white-space: nowrap;
}
.rh-btn:hover { background: var(--green-light); color: var(--green); text-decoration: none; }
.rh-btn-main { background: var(--green); color: var(--white); }
.rh-btn-main:hover { background: var(--green-mid); border-color: var(--green-mid); color: var(--white); }

/* ── Sections ── */
.rh-sec { padding: 28px 0 0; }
.rh-sec-first { padding-top: 28px; }
.rh-sec-last { padding-bottom: 56px; }
.rh-sec .sr-heading { margin-top: 0; }
/* Tuiles blanches sur le fond beige de la page (sinon invisibles) */
.rh .sr-row { background: var(--white); border: 1px solid var(--border); }
.rh .sr-row:hover { background: var(--green-light); }
.rh-tiles .gr-title { font-size: 0.875rem; font-weight: 600; }

/* ── Filtres et tri : boutons à bordure (pas des capsules vertes, réservées aux étiquettes) ── */
/* Sans JS, les contrôles sont masqués : la liste complète reste lisible */
.rh-tools { display: none; }
.rh-js .rh-tools { display: grid; gap: 10px; margin-bottom: 16px; }
.rh-group { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; align-items: start; }
.rh-group-l { padding-top: 11px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.rh-size { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; max-width: 520px; }
.rh-prof { display: flex; flex-wrap: wrap; gap: 6px; }
.rh-f {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 40px; padding: 0 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--white); font-family: 'Inter', sans-serif; font-size: 0.8125rem; font-weight: 600;
  color: var(--text); cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s;
}
.rh-f:hover { border-color: var(--green); color: var(--green); }
.rh-f:focus-visible { outline: 2px solid var(--green-mid); outline-offset: 2px; }
.rh-f-n { font-weight: 400; color: var(--muted); }
.rh-f[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--white); }
.rh-f[aria-pressed="true"] .rh-f-n { color: rgba(255, 255, 255, .8); }
.rh-f[aria-pressed="true"]::before { content: '✓'; font-weight: 700; }

.rh-bar { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding-top: 4px; }
.rh-count { margin: 0; font-size: 0.9rem; color: var(--muted); }
.rh-count strong { color: var(--text); }
.rh-reset, .rh-reset-inline {
  min-height: 40px; padding: 0 4px; border: 0; background: none; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 0.875rem; font-weight: 600; color: var(--green); text-decoration: underline;
}
.rh-reset[hidden], .rh-empty[hidden] { display: none; }
.rh-sort { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.rh-sort select {
  min-height: 40px; max-width: 100%; padding: 0 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--white); font-family: 'Inter', sans-serif; font-size: 0.875rem; color: var(--text); cursor: pointer;
}
.rh-sort select:focus-visible { outline: 2px solid var(--green-mid); outline-offset: 2px; }

/* ── Cartes ── */
.rh-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.rh-item[hidden] { display: none; }
.rh-card {
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); text-decoration: none; transition: box-shadow .2s, border-color .2s;
}
.rh-card:hover { border-color: var(--green-mid); box-shadow: 0 6px 20px rgba(30, 92, 58, .1); color: var(--text); text-decoration: none; }
.rh-card-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--green-light); }
.rh-card-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rh-card-ph { display: flex; height: 100%; align-items: center; justify-content: center; font-size: 2.2rem; }
.rh-card-body { display: flex; flex-direction: column; gap: 2px; flex: 1; padding: 12px 14px 14px; }
.rh-card-name { font-family: var(--font-display); font-size: 1rem; font-weight: 700; line-height: 1.25; margin-bottom: 2px; overflow-wrap: break-word; }
.rh-card:hover .rh-card-name { color: var(--green); }
.rh-card-meta { font-size: 0.8125rem; color: var(--muted); line-height: 1.4; font-variant-numeric: tabular-nums; }
.rh-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 8px; }
.rh-chips .breed-chip { font-size: 0.75rem; white-space: nowrap; }

.rh-empty { margin: 8px 0 0; padding: 24px 16px; text-align: center; font-size: 0.95rem; color: var(--muted); background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); }
.rh-note { margin: 14px 0 0; max-width: 880px; font-size: 0.8125rem; line-height: 1.55; color: var(--muted); }
.rh-nw { white-space: nowrap; }
.rh-note a { color: var(--green); font-weight: 600; display: inline-block; padding: 10px 0; margin: -10px 0; } /* cible tactile ~40px sans changer l'interligne */

/* ── FAQ ── */
.rh-faq { max-width: 880px; }
.rh-faq .sante-faq-a p { margin: 0; font-size: 0.875rem; }

/* ── Grand écran : tuiles sur 3 colonnes ── */
@media (min-width: 768px) {
  .rh .rh-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
}

@media (max-width: 1024px) {
  .rh-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}

/* ── Mobile : compact, 2 colonnes, une seule étiquette non tronquée ── */
@media (max-width: 600px) {
  .rh-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .rh-btn { padding: 0 10px; font-size: 0.875rem; }
  .rh-sec, .rh-sec-first { padding-top: 22px; }
  .rh-sec-last { padding-bottom: 40px; }
  .rh-tiles .gr-title { font-size: 0.8125rem; }

  .rh-group { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .rh-group-l { padding-top: 0; }
  .rh-size { max-width: none; }
  .rh-f { padding: 0 10px; }
  .rh-bar { flex-wrap: nowrap; gap: 8px; }
  .rh-count, .rh-reset { white-space: nowrap; }
  .rh-sort { min-width: 0; }
  .rh-sort span { display: none; } /* le select garde son aria-label */
  .rh-sort select { width: 156px; }

  .rh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rh-card-body { padding: 10px 10px 12px; }
  .rh-card-name { font-size: 0.9rem; }
  .rh-chips .breed-chip:nth-child(n+2) { display: none; }
}
