/**
 * Unsere Erfolge: athletes, achievements, tags
 * One of the stylesheets of the website, loaded in a fixed order by php/include/header.php
 * (list and order: AGENTS.md, "Stylesheets").
 */

/**
 * @section Unsere Erfolge
 */
main.athlete #achievement-search {
  position: relative;
}
main.athlete #achievement-search * {
  box-sizing: border-box;
}
main.athlete #achievement-search input[type="search"] {
  background-color: var(--color-lightgray-transparent);
  border-radius: 20px;
  border: none;
  box-shadow: var(--color-shadow) 2px 2px 6px;
  font-size: 1.2em;
  outline: none;
  padding: 0.2em 0.25em;
  position: absolute;
  top: 150px;
  left: 50%;
  text-align: center;
  transform: translate(-50%, 0);
  transition: all 0.25s linear;
  min-width: 200px;
  max-width: 95%;
  width: 45%;
}
main.athlete #achievement-search:hover input[type="search"],
main.athlete #achievement-search:focus input[type="search"],
main.athlete #achievement-search input[type="search"]:hover,
main.athlete #achievement-search input[type="search"]:focus {
  background-color: var(--color-white);
  box-shadow: var(--color-shadow) 2px 2px 6px;
}
main.athlete #achievement-search #autoComplete_list {
  position: static;
  margin: 0;
  width: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
}
main.athlete #achievement-search .autoComplete_result {
  border-radius: 0 !important;
  border: none;
  clear: none;
  color: inherit;
  cursor: pointer;
  font-size: 1em;
  margin: 0 0.25em 0.25em 0;
  padding: 2px 5px;
  max-width: none;
  width: 49%;
}
main.athlete #achievement-search .autoComplete_result:hover,
main.athlete #achievement-search .autoComplete_result:focus,
main.athlete #achievement-search .autoComplete_result:focus-within {
  background-color: var(--color-yellow);
}
main.athlete #achievement-search .autoComplete_result.no_result {
  width: auto;
}
main.athlete #achievement-search .autoComplete_highlighted {
  color: inherit;
  font-weight: bold;
}

section.athlete > .athlete {
  box-sizing: border-box;
  margin-top: 2em;
  padding: 1em 1em;
  padding-left: 125px;
  position: relative;
  min-height: 120px;
}
section.athlete > .athlete h2 {
  margin-top: 0.25em;
}
section.athlete > .athlete .image {
  background-color: var(--color-lightgray);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: 45px;
  box-shadow: var(--shadow-inset-light);
  height: 130px;
  position: absolute;
  left: 15px;
  top: 15px;
  width: 90px;
}
section.athlete > .athlete > span {
  display: block;
}
section.athlete > .athlete .image:after {
  content: "";
  display: block;
  padding-right: 100%;
}
section.athlete > .athlete .home:before {
  content: "Wohnort: ";
}
section.athlete > .athlete .ageClass:before {
  content: "Altersklasse: ";
}
section.athlete > .athlete .year:before {
  content: "Jahrgang: ";
}
section.event > span {
  display: block;
}
section.event > .date {
  float: none;
}
section.event > .date:before {
  content: "Datum: ";
}
section.event > .place:before {
  content: "Ort: ";
  font-variant: normal;
}

.achievements {
  display: flex;
  flex-wrap: wrap;
}
.events > .event,
.achievements > .achievement {
  display: inline-block;
  margin: 0;
  margin-bottom: 0.5em;
  margin-right: 1%;
  width: 49%;
}
main.page > .events > .event {
  width: 99%;
}
.achievements > .event {
  margin-bottom: 0;
  width: 100%;
}
.achievements > .event h3 {
  margin-bottom: 0;
}
.achievements > .event div {
  margin-bottom: 1em;
  position: relative;
  padding-left: 1em;
}
.card .date {
  float: none;
}
.achievements > .event .date {
  float: none;
}
.achievements > .event .date:before {
  content: "am ";
  font-variant: normal;
}
.achievements > .event .place:before {
  content: "in ";
  font-variant: normal;
}
.card {
  background-color: var(--color-white);
  border-radius: 2px;
  box-sizing: border-box;
  padding: 0.5em 2em;
  position: relative;
  box-shadow: 1px 1px 4px var(--color-shadow),
    0 0 15px rgba(0, 0, 0, 0.025) inset;
}
.event.card .event,
.achievement.card .athlete {
  box-sizing: border-box;
  background-color: var(--color-yellow);
  margin: -0.5em -2em 1em -2em;
  padding: 0.6em 1em;
  padding-left: 75px;
  position: relative;
}
.event.card .event:only-child,
.achievement.card .athlete:only-child {
  margin-bottom: -0.5em;
}
section.athlete .achievement.card .athlete {
  padding-top: 0;
  padding-bottom: 0;
  height: 5px;
}
section.athlete .achievement.card .athlete > * {
  display: none;
}
.event.card .event a,
.achievement.card .athlete a {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
.event.card .event .title,
.achievement.card .athlete .name {
  display: block;
  font-weight: bold;
  font-size: 1.25em;
  margin-bottom: -0.2em;
}
.event.card .event .image,
.achievement.card .athlete .image {
  background-color: var(--color-darkblue);
  background-position: center 15%;
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: 50%;
  box-shadow: var(--shadow-inset-light);
  height: 42px;
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translate(0, -50%);
  width: 42px;
}
.event.card .event .image:after,
.achievement.card .athlete .image:after {
  content: "";
  display: block;
  padding-right: 100%;
}
.achievement.card .athlete .home:after {
  content: ",";
}
.achievement.card .athlete .ageClass:before {
  content: "Altersklasse ";
}
.achievement.card .athlete .year:before {
  content: " (";
}
.achievement.card .athlete .year:after {
  content: ")";
}
.event.card .event .date,
.achievement.card .athlete .image,
.achievement.card .athlete .home,
.achievement.card .athlete .year,
.achievement.card .athlete .ageClass {
  cursor: default;
  font-size: 0.9em;
  user-select: none;
}
.card > div {
  margin: 0;
  margin-bottom: 0.5em;
}
.card > div:last-child {
  margin-bottom: 1em;
}
.event.card > .achievement,
.achievement.card > .achievement,
.achievement.card > .event {
  padding-left: 44px;
  padding-top: 4px;
  position: relative;
}
/* (not in the achievement card: flex would drop the spaces between the parts) */
.event.card > .achievement {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
}
.event.card > .achievement:before,
.achievement.card > .achievement:before,
.achievement.card > .event:before {
  content: "";
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  height: 30px;
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
}

/* Card icons: Lucide (ISC, see img/icons/LICENSE) clipboard-list, map-pin and below timer,
   trophy, podium – embedded with stroke-width 1.25 instead of 2, as thin as the former icons */
.event.card > .achievement:before,
.achievement.card > .achievement: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%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Cpath d='M12 11h4'/%3E%3Cpath d='M12 16h4'/%3E%3Cpath d='M8 11h.01'/%3E%3Cpath d='M8 16h.01'/%3E%3C/svg%3E");
}

.achievement.card > .event: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='M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}
.achievement.card > .event > .title a {
  color: inherit;
}
.achievement.card > .event > .title {
  display: block;
}
.achievement.card > .event > .date {
  float: none;
}

.event.card > .event > .place:before {
  content: " / ";
  font-variant: normal;
}
.event.card > .event > .title {
  overflow-x: hidden;
  text-overflow: ellipsis;
}

/* Tags: always visible, shaped like the category tags of the news (slanted segments that
   join, rounded ends, see ul.categories), in the colours of this card: light blue with dark
   blue icon and text */
:is(.achievement.card, .achievement-report) .tags {
  display: flex;
  flex-wrap: wrap;
  row-gap: 0.3em;
  /* aligned with the text of the lines above (they leave 44px for their icon) */
  margin: 0.8em 0 0.5em 44px;
  padding: 0;
}
:is(.achievement.card, .achievement-report) .tags li {
  --slant: 10px;
  --border-radius: 6px;
  --padding: 6px;
  --spacing: -3px;
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  float: none;
  position: relative;
  margin: 0 var(--spacing);
  padding: 0.25em calc(var(--slant) + var(--padding) / 2);
  background-color: var(--color-darkblue-transparent-light);
  box-shadow: var(--shadow-inset-light);
  color: var(--color-darkblue);
  font-size: 0.8em;
  list-style: none;
  white-space: nowrap;
  clip-path: polygon(var(--slant) 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%);
}
:is(.achievement.card, .achievement-report) .tags li:first-child {
  margin-left: 0;
  padding-left: var(--padding);
  border-top-left-radius: var(--border-radius);
  border-bottom-left-radius: var(--border-radius);
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%);
}
:is(.achievement.card, .achievement-report) .tags li:last-child {
  padding-right: var(--padding);
  border-top-right-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
  clip-path: polygon(var(--slant) 0, 100% 0, 100% 100%, 0 100%);
}
:is(.achievement.card, .achievement-report) .tags li:first-child:last-child {
  clip-path: none;
  border-radius: var(--border-radius);
}
:is(.achievement.card, .achievement-report) .tags li span {
  display: inline;
}
:is(.achievement.card, .achievement-report) .tags li .icon {
  /* Lucide icons, see the mask images below */
  flex: none;
  width: 1.25em;
  height: 1.25em;
  background-color: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}
:is(.achievement.card, .achievement-report) .tags li.personalbest .icon {
  mask-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%3Cline x1='10' x2='14' y1='2' y2='2'/%3E%3Cline x1='12' x2='15' y1='14' y2='11'/%3E%3Ccircle cx='12' cy='14' r='8'/%3E%3C/svg%3E");
}
:is(.achievement.card, .achievement-report) .tags li.champion .icon {
  mask-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='M10 14.66V17a1 1 0 0 1-1 1 2 2 0 0 0-2 2v2'/%3E%3Cpath d='M14 14.66V17a1 1 0 0 0 1 1 2 2 0 0 1 2 2v2'/%3E%3Cpath d='M17.916 10H19.5A2.5 2.5 0 0 0 22 7.5V5a1 1 0 0 0-1-1h-3'/%3E%3Cpath d='M4 22h16'/%3E%3Cpath d='M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z'/%3E%3Cpath d='M6.084 10H4.5A2.5 2.5 0 0 1 2 7.5V5a1 1 0 0 1 1-1h3'/%3E%3C/svg%3E");
}
:is(.achievement.card, .achievement-report) .tags li.first .icon {
  mask-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='M12 6V2h-1'/%3E%3Cpath d='M9 15a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1'/%3E%3Cpath d='M9 21V11a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v10'/%3E%3C/svg%3E");
}
/* "Besondere Leistung": only in the admin and the annual report */
:is(.achievement.card, .achievement-report) .tags li.special .icon {
  mask-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='M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z'/%3E%3C/svg%3E");
}
:is(.achievement.card, .achievement-report) .tags li .title {
  display: none;
}

/**
 * Discipline Icons
 * @see https://thenounproject.com/prosymbols/collection/olympic-glyph-icons/
 */

/* phones and narrow windows (the sidebar moves below the content) */
@media (max-width: 990px) {
  .events > .event,
  .achievements > .achievement {
    margin-right: 0;
    width: 100%;
  }
  .card {
    padding-left: 1em;
    padding-right: 1em;
  }
  .achievement.card .athlete {
    margin-left: -1em;
    margin-right: -1em;
  }
  .achievement.card .athlete .ageClass:before {
    content: "";
  }
  main.athlete #achievement-search input[type="search"] {
    background-color: var(--color-white);
    box-shadow: var(--color-shadow) 2px 2px 6px;
    margin: -0.5em 10% 1em;
    position: static;
    transform: none;
    width: 80%;
  }
  main.athlete #achievement-search .autoComplete_result {
    float: none;
    width: 100%;
  }
}
