/* Glossaire data football — styles page (tokens --ef-* uniquement, zéro hex).
   Réutilise .about-card (shared-components.css, chargé globalement) pour les
   fiches. Les patterns .tl-filter (chips) et l'état vide sont réécrits ici en
   version tokenisée : match-detail.css n'est PAS chargé sur cette page.
   RTL arabe : propriétés logiques (inline-start/end), aucune direction en dur. */

.glo-page {
  max-width: 900px;
}

/* ─── En-tête ─── */
.glo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ef-space-4);
  flex-wrap: wrap;
  margin-bottom: var(--ef-space-5);
}
.glo-title {
  font-size: var(--ef-fs-h);
  font-weight: 700;
  color: var(--ef-text);
  margin: 0 0 var(--ef-space-2);
}
.glo-subtitle {
  font-size: var(--ef-fs-body);
  color: var(--ef-text-muted);
  margin: 0;
}
.glo-pdf-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Barre d'outils (recherche + chips), sticky sous la navbar ─── */
.glo-toolbar {
  position: sticky;
  top: var(--nav-height);
  z-index: 5;
  background: var(--ef-surface);
  padding: var(--ef-space-3) 0;
  margin-bottom: var(--ef-space-4);
  border-block-end: 1px solid var(--ef-border);
}

.glo-search {
  position: relative;
  margin-bottom: var(--ef-space-3);
}
.glo-search-icon {
  position: absolute;
  inset-inline-start: var(--ef-space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--ef-text-muted);
  pointer-events: none;
}
.glo-search-input {
  width: 100%;
  padding: var(--ef-space-3) var(--ef-space-6);
  padding-inline-start: calc(var(--ef-space-6) + var(--ef-space-2));
  border: 1px solid var(--ef-border-strong);
  border-radius: var(--ef-radius);
  font-family: var(--ef-font);
  font-size: var(--ef-fs-body);
  color: var(--ef-text);
  background: var(--ef-surface);
}
.glo-search-input:focus {
  outline: none;
  border-color: var(--ef-primary);
  box-shadow: var(--nav-focus-ring);
}
.glo-search-clear {
  position: absolute;
  inset-inline-end: var(--ef-space-3);
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--ef-text-muted);
  cursor: pointer;
  padding: var(--ef-space-1);
  line-height: 1;
}
.glo-search-clear:hover { color: var(--ef-text); }

/* ─── Chips catégories (pattern .tl-filter, version tokenisée) ─── */
.glo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ef-space-2);
}
.glo-chips .tl-filter,
.glo-empty .tl-filter {
  border: 1px solid var(--ef-border-strong);
  background: var(--ef-surface);
  padding: 5px 14px;
  border-radius: 20px;
  font-family: var(--ef-font);
  font-size: var(--ef-fs-meta);
  font-weight: 600;
  color: var(--ef-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}
.glo-chips .tl-filter:hover,
.glo-empty .tl-filter:hover {
  border-color: var(--ef-primary);
  color: var(--ef-primary);
}
.glo-chips .tl-filter.active {
  background: var(--ef-primary);
  color: var(--ef-surface);
  border-color: var(--ef-primary);
}
.tl-filter:focus-visible {
  outline: none;
  box-shadow: var(--nav-focus-ring);
}

.glo-count {
  margin: var(--ef-space-3) 0 0;
  font-size: var(--ef-fs-meta);
  color: var(--ef-text-muted);
}

/* ─── Sections ─── */
.glo-section {
  margin-bottom: var(--ef-space-6);
}
.glo-section-title {
  font-size: var(--ef-fs-title);
  font-weight: 700;
  color: var(--ef-text);
  margin: 0 0 var(--ef-space-4);
  scroll-margin-top: calc(var(--nav-height) + 120px);
}
.glo-section-count {
  font-weight: 400;
  color: var(--ef-text-muted);
  font-size: var(--ef-fs-body);
}

/* ─── Fiche terme (base .about-card) ─── */
.glo-term {
  margin-bottom: var(--ef-space-4);
  /* décalage d'ancre : la carte ciblée ne passe pas sous la navbar + toolbar */
  scroll-margin-top: calc(var(--nav-height) + 130px);
}
.glo-term-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--ef-space-3);
}
.glo-term-title {
  font-size: var(--ef-fs-title);
  font-weight: 600;
  color: var(--ef-text);
  margin: 0;
}
.glo-term-anchor {
  color: var(--ef-text-faint);
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
  text-decoration: none;
}
.glo-term:hover .glo-term-anchor,
.glo-term-anchor:focus-visible {
  opacity: 1;
  color: var(--ef-primary);
}
.glo-term-def {
  font-size: var(--ef-fs-body);
  color: var(--ef-text);
  margin: var(--ef-space-2) 0 0;
}
.glo-term-alias {
  font-size: var(--ef-fs-meta);
  color: var(--ef-text-muted);
  margin: var(--ef-space-3) 0 0;
}
.glo-term-alias-label {
  font-weight: 600;
}

/* ─── Bloc formule (distinct de la définition) ─── */
.glo-formula {
  margin-top: var(--ef-space-3);
  padding: var(--ef-space-3) var(--ef-space-4);
  background: var(--ef-surface-alt);
  border-inline-start: 3px solid var(--ef-primary);
  border-radius: var(--ef-radius-sm);
  font-size: var(--ef-fs-meta);
}
.glo-formula-label {
  font-weight: 700;
  color: var(--ef-text);
  margin-inline-end: var(--ef-space-2);
}
.glo-formula-expr {
  font-family: 'Ubuntu', var(--ef-font);
  color: var(--ef-text);
}

/* ─── Flash de surbrillance au deep-link #slug ─── */
.glo-term.glo-flash {
  animation: glo-flash 1.5s ease-out;
}
@keyframes glo-flash {
  0%   { background: var(--ef-primary-soft); }
  100% { background: var(--ef-surface); }
}

/* ─── État vide ─── */
.glo-empty {
  text-align: center;
  padding: var(--ef-space-7) var(--ef-space-4);
  color: var(--ef-text-faint);
}
.glo-empty > i {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--ef-space-2);
}
.glo-empty-title {
  margin: 0;
  font-size: var(--ef-fs-body);
  color: var(--ef-text-muted);
  font-weight: 600;
}
.glo-empty-hint {
  margin: var(--ef-space-1) 0 var(--ef-space-4);
  font-size: var(--ef-fs-meta);
}

/* ─── Responsive ─── */
@media (max-width: 575.98px) {
  .glo-header {
    flex-direction: column;
  }
  .glo-pdf-btn {
    width: 100%;
    justify-content: center;
  }
  /* Chips : rangée scrollable horizontalement, pas de retour à la ligne */
  .glo-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .glo-chips .tl-filter {
    white-space: nowrap;
    flex-shrink: 0;
  }
}
