/**
 * Training times and trainer team
 * One of the stylesheets of the website, loaded in a fixed order by php/include/header.php
 * (list and order: AGENTS.md, "Stylesheets").
 */

/**
 * @section Training
 * Cards of the training groups (list.Training.php on the page of php/include/php/zeiten.php):
 * frame and shadow of .card (achievements.css), yellow head like the achievement cards, lines
 * with a thin icon (Lucide, stroke-width 1.25 as in achievements.css), times as tiles
 */
/* masonry: columns of at least 20rem, each card in the column that ends highest, so no gaps stay
   below shorter cards. Natively with grid-lanes; other browsers: js/lanes.js places the cards in a
   grid of 1px rows (.lanes); without JavaScript the cards run top to bottom through CSS columns.
   (main.page ul of layout.css indents lists: not these) */
main.page ul.training {
  columns: 20rem;
  column-gap: 0.75rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}
.training.card {
  break-inside: avoid;
  margin: 0 0 0.75rem;
  list-style: none;
}
@supports (display: grid-lanes) {
  main.page ul.training {
    display: grid-lanes;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
    gap: 0.75rem;
  }
  .training.card {
    margin-bottom: 0;
  }
}
main.page ul.training.lanes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  grid-auto-rows: 1px;
  align-items: start;
  column-gap: 0.75rem;
  row-gap: 0;
}
.lanes > .training.card {
  margin-bottom: 0;
}
/* the same values as the achievement cards (.card, .achievement.card .athlete, .card > div in
   achievements.css; narrow screens: 1em instead of 2em at the sides, below) */
.training.card > .training-head {
  margin: -0.5em -2em 1em;
  padding: 0.6em 1em;
  background-color: var(--color-yellow);
}
.training-head .title {
  margin: 0 0 -0.2em;
  font-size: 1.25em;
  line-height: inherit;
}
.training-head .target {
  display: block;
  font-size: 0.9em;
}
/* picture of the group (TrainingIcon): a white circle on the left like the portrait of the
   athletes (achievements.css), centred on the icons of the lines below; the text starts where
   theirs does (--card-side: the side padding of the card) */
.training.card {
  --card-side: 2em;
}
/* at least as high as the circle with the usual padding above and below it, also with the title
   alone (no target group); the text then stands in the middle */
.training.card > .training-head.has-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 42px;
  padding-left: calc(var(--card-side) + 44px);
  position: relative;
}
.training-head.has-icon .title:last-child {
  margin-bottom: 0;
}
.training-icon {
  align-items: center;
  background-color: var(--color-white);
  border-radius: 50%;
  box-shadow: var(--shadow-inset-light);
  box-sizing: border-box;
  display: flex;
  height: 42px;
  justify-content: center;
  left: calc(var(--card-side) - 6px);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
}
.training-icon img {
  height: 26px;
  width: 26px;
}
.training.card > .training-line {
  position: relative;
  margin: 0 0 0.5em;
  padding-top: 4px;
  padding-left: 44px;
}
/* faces as high as the icon: from its top, not 4px below like text */
.training.card > .training-people {
  padding-top: 0;
}
.training.card > .training-line:last-child {
  margin-bottom: 1em;
}
.training-line:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  background: no-repeat center / contain;
}
.training-people:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
}
.training-text:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round' %3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
}
.training-times:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round' %3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
}
.training-text > :first-child {
  margin-top: 0;
}
.training-text > :last-child {
  margin-bottom: 0;
}
/* trainers: faces overlapping, the names next to them */
.training-people {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.training-people .name {
  white-space: nowrap;
}
.training-faces {
  display: flex;
  flex: none;
  isolation: isolate;
}
.training-faces > * {
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  margin-left: -9px;
  border: 2px solid var(--color-white);
  border-radius: 50%;
  object-fit: cover;
}
.training-faces > :first-child {
  margin-left: 0;
}
/* the faces overlap with the first one on top (--stack, list.Training.php); the face of a trainer
   grows and comes to the front while the pointer is on it or on the name (.active, js/training.js) */
.training-faces > * {
  position: relative;
  z-index: var(--stack, auto);
  transition: transform 0.15s ease-out;
}
.training-faces > :hover,
.training-faces > .active {
  transform: scale(1.3);
  z-index: 100;
}
@media (prefers-reduced-motion: reduce) {
  .training-faces > * {
    transition: none;
  }
}
.training-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-darkblue);
  color: var(--color-white);
  font-size: 0.7rem;
  font-weight: bold;
}
/* times: one tile each, weekday in the dark blue head */
main.page .training-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* (main.page li of base.css adds a bottom margin: not to the tiles) */
main.page .training-tile {
  display: flex;
  flex-direction: column;
  width: 7.2rem;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--color-lightgray);
  border-radius: var(--border-radius);
  text-align: center;
}
.training-tile .day {
  padding: 0.15em 0;
  background-color: var(--color-darkblue);
  color: var(--color-white);
  font-size: 0.8rem;
  font-weight: bold;
}
.training-tile .time {
  padding: 0.25em 0.3em 0;
  font-size: 1.05rem;
  font-weight: bold;
}
.training-tile .time small {
  display: block;
  color: var(--color-gray-text);
  font-size: 0.72rem;
  font-weight: normal;
}
.training-tile .place,
.training-tile .comment {
  padding: 0 0.3em;
  color: var(--color-gray-text);
  font-size: 0.72rem;
}
.training-tile .comment {
  color: inherit;
  font-style: italic;
}
.training-tile > :last-child {
  padding-bottom: 0.35em;
}
/* filter bar of the page (js/training.js): number of hits or "Keine Gruppe passt …" */
.training-filter {
  margin-bottom: 0.5rem;
}
.training-result {
  color: var(--color-gray-text);
  font-size: 0.9em;
}

/**
 * @section Trainerteam
 */
ul#trainerteam {
  list-style: none;
  margin-bottom: 0.5em;
  margin-left: 0;
}
ul#trainerteam li {
  background-size: 80%;
  background-position: center;
  background-repeat: no-repeat;
  border: solid 2px transparent;
  display: inline-block;
  height: 176px;
  margin-bottom: -0.3em;
  position: relative;
  width: 126px;
  transition: all 0.666s 0.25s;
}
ul#trainerteam li:hover,
ul#trainerteam li:active {
  background-size: 100%;
  transition-delay: 0s;
}
ul#trainerteam li span {
  background-color: var(--color-lightgray-transparent-barely);
  border-radius: 5px;
  box-shadow: 0px 0px 5px var(--color-shadow);
  color: var(--color-darkblue);
  font-size: 0.9em;
  line-height: 1;
  opacity: 0;
  padding: 0.6em 0.8em 0.8em 0.8em;
  position: absolute;
  top: 85%;
  left: 50%;
  text-align: center;
  transform: translate(-50%, 0);
  transition: opacity 0.2s 0.1s;
  width: 90px;
  z-index: 100;
}
ul#trainerteam li:hover span,
ul#trainerteam li:active span {
  opacity: 1;
  transition: opacity 0.3s;
}

@media (max-width: 990px) {
  .training.card {
    --card-side: 1em;
  }
  .training.card > .training-head {
    margin-left: -1em;
    margin-right: -1em;
  }
}
/* phones: category and search on lines of their own, both fields start at the same place */
@media (max-width: 640px) {
  .training-filter .filter-bar-group {
    flex: 1 1 100%;
  }
  .training-filter .filter-bar-label {
    flex: 0 0 4.8rem;
  }
  .training-filter #trainingCategory,
  .training-filter .filter-multiselect {
    flex: 1 1 auto;
  }
}

/* phones and narrow windows (the sidebar moves below the content) */
@media (max-width: 990px) {
  ul#trainerteam li {
    height: 140px;
    width: 100px;
  }
}
