.peterthon img {
  border-radius: var(--pico-border-radius);
}

.peterthon h2,
.peterthon h3 {
  margin-bottom: 0.25rem;
}

.peterthon.hero {
  max-width: 40rem;
  margin-inline: auto;
  text-align: center;
}

.peterthon.hero img {
  display: block;
  max-width: 16rem;
  margin: 0 auto var(--pico-spacing);
}

.cards {
  display: grid;
  gap: var(--pico-spacing);
}

.cards .peterthon {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: var(--pico-spacing);
  margin-bottom: 0;
}

.cards .peterthon img {
  align-self: start;
}

.cards .peterthon > div {
  display: flex;
  flex-direction: column;
}

.cards .peterthon p {
  margin-bottom: 0.5rem;
}

/* contain: size keeps the text from growing the card, so the poster sets its height. */
.cards .peterthon .description {
  flex: 1;
  contain: size;
  overflow: hidden;
  margin-bottom: 0;
  mask-image: linear-gradient(to bottom, black calc(100% - 1.5em), transparent);
  font-size: 0.875em;
  color: var(--pico-muted-color);
}

@media (min-width: 768px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1280px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 575px) {
  .cards .peterthon {
    grid-template-columns: 6rem 1fr;
  }
}

.peterthon.detail {
  display: flow-root;
}

.peterthon.detail img {
  float: left;
  width: 16rem;
  margin: 0 var(--pico-spacing) var(--pico-spacing) 0;
}

/* Without a block formatting context, list markers sit under the floated poster. */
.peterthon.detail :is(ul, ol) {
  display: flow-root;
}

.peterthon.detail h1 small {
  color: var(--pico-muted-color);
  white-space: nowrap;
}

.placeholder {
  display: grid;
  place-items: center;
  min-height: 16rem;
  border: 2px dashed var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  color: var(--pico-muted-color);
}

.route-map {
  height: 28rem;
  margin-bottom: var(--pico-spacing);
  border-radius: var(--pico-border-radius);
}

/* Leaflet's zoom links are role="button", which Pico styles as its own buttons.
   Leaflet's :first-child/:last-child rules tie on specificity and load later, so they keep their rounded ends. */
.route-map .leaflet-bar a {
  padding: 0;
  border: 0;
  border-bottom: 1px solid #ccc;
  border-radius: 0;
}

.route-readout {
  min-height: 1.5em;
  color: var(--pico-muted-color);
  font-variant-numeric: tabular-nums;
}

.route-charts {
  touch-action: pan-y;
}

.route-charts figure {
  margin-bottom: 0.5rem;
}

.route-charts figcaption {
  padding: 0;
  font-size: 0.875em;
  color: var(--pico-muted-color);
}

.route-charts svg {
  display: block;
  overflow: visible;
}

.route-charts .series {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.route-charts .grid {
  stroke: var(--pico-muted-border-color);
  stroke-width: 1;
}

.route-charts .tick {
  fill: var(--pico-muted-color);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.route-charts .crosshair {
  stroke: var(--pico-muted-color);
  stroke-width: 1;
}

.route-charts .dot {
  stroke-width: 2;
}

.route-splits,
.route-check-ins {
  font-variant-numeric: tabular-nums;
}

.route-check-in {
  display: grid;
  place-items: center;
  border: 2px solid var(--pico-background-color);
  border-radius: 50%;
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
  font-size: 0.75rem;
}

.route-check-ins i {
  color: var(--pico-primary);
}

@media (max-width: 575px) {
  .peterthon.detail img {
    float: none;
    display: block;
    margin-inline: auto;
  }
}

.personal-best {
  color: var(--pico-primary);
  white-space: nowrap;
}
