/* /trainers/: the third mode «Карточки» (card sets from the library) and a three-way switch that fits 320 px (round 2 D7). */

#trainersRoot .trainer-cards-toolbar {
  flex-wrap: wrap;
  min-height: 44px;
}

#trainersRoot .trainer-cards-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#trainersRoot .trainer-cards-links .ghost-button {
  min-height: 40px;
  text-decoration: none;
}

#trainersRoot .trainer-cards-skeleton-line {
  width: 180px;
}

#trainersRoot .trainer-card--skeleton .trainer-card-body {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 220px;
}

#trainersRoot .trainer-card--skeleton .learnio-trainers-skeleton-line:nth-child(1) { width: 40%; }
#trainersRoot .trainer-card--skeleton .learnio-trainers-skeleton-line:nth-child(2) { width: 86%; height: 20px; }
#trainersRoot .trainer-card--skeleton .learnio-trainers-skeleton-line:nth-child(3) { width: 64%; }

#trainersRoot .trainer-card--cards .trainer-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#trainersRoot .trainer-card--cards .trainer-card-actions .primary-button {
  text-decoration: none;
}

#trainersRoot .trainer-cards-state .primary-button {
  margin-top: 14px;
}

/* Short tab label for phones; the full one stays for screen readers (aria-label). */
#trainersRoot .mode-label-short {
  display: none;
}

@media (max-width: 767.98px) {
  /* Three modes on one line, never wrapped: short label, and if a very narrow
     screen still cannot fit them the strip scrolls sideways without a scrollbar. */
  body #trainersRoot .learnio-mode-switch {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }

  body #trainersRoot .learnio-mode-switch::-webkit-scrollbar {
    display: none;
  }

  body #trainersRoot .learnio-mode-switch-button {
    flex: 1 0 auto;
    min-width: 0;
    min-height: 44px;
    padding: 0 14px;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
  }

  body #trainersRoot .mode-label-full {
    display: none;
  }

  body #trainersRoot .mode-label-short {
    display: inline;
  }

  /* Tabs → toolbar 24 (the shell gap alone), toolbar → cards 16. */
  body #trainersRoot .trainers-shell > .trainers-header {
    margin-bottom: 0;
  }

  /* Toolbar: the filter button keeps one line, the summary goes below it. */
  body #trainersRoot .trainer-catalog-toolbar {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px 12px;
  }

  body #trainersRoot .trainer-filters-toggle {
    flex: none;
    white-space: nowrap;
  }

  body #trainersRoot .trainer-catalog-summary {
    flex: 1 0 100%;
  }

  body #trainersRoot .trainer-cards-links {
    width: 100%;
  }

  body #trainersRoot .trainer-cards-links .ghost-button {
    flex: 1 1 0;
  }
}

@media (max-width: 479.98px) {
  body #trainersRoot .learnio-mode-switch-button {
    padding: 0 7px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #trainersRoot .trainer-card--skeleton .learnio-trainers-skeleton-line {
    animation: none;
  }
}
