/* Layout specific to this site. Colors, type and components come from the
   Sectional design system (dom500d/design-system), so add to it first if a
   style would be useful in another project. */

.section {
  padding-block: var(--ds-7);
  border-top: 1px solid var(--ds-line);
  scroll-margin-top: var(--ds-7);
}

.section--charted {
  position: relative;
  overflow: hidden;
}

/* The first section meets the header's own bottom line. */
main > .section:first-of-type {
  border-top: 0;
}

.section__chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The drawing scales with the screen, but its lines stay thin. */
.section__chart ellipse {
  vector-effect: non-scaling-stroke;
}

.section__content {
  position: relative;
}

.section__title {
  margin-bottom: var(--ds-5);
}

/* About */
.about {
  display: grid;
  gap: var(--ds-5);
  align-items: start;
}

@media (min-width: 48rem) {
  .about {
    grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
    gap: var(--ds-6);
  }
}

.about__image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 0; /* Crop from the bottom so the head stays in frame. */
  border-radius: var(--ds-radius-lg);
}

.about__card {
  gap: var(--ds-5);
  padding: var(--ds-5);
}

.about strong {
  font-weight: 600;
}

/* Cycling */
.cycling__image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: 50% 70%; /* Keeps the helmet and front wheel in frame. */
  border-radius: var(--ds-radius-lg);
}

@media (max-width: 40rem) {
  .cycling__image {
    aspect-ratio: 4 / 3;
  }
}

.ds-stat dd.ds-skeleton {
  width: 4rem;
  height: 1.15em;
}

.koms td:first-child {
  min-width: 13rem;
  white-space: normal;
}

/* Keeps time and power on screen at phone width. */
@media (max-width: 40rem) {
  .koms th:nth-child(3),
  .koms td:nth-child(3),
  .koms th:nth-child(4),
  .koms td:nth-child(4) {
    display: none;
  }

  .koms td:first-child {
    min-width: 0;
    white-space: normal;
  }
}

.koms .ds-skeleton {
  width: 100%;
  min-width: 3rem;
}

/* Projects */
.ds-card__media {
  height: auto;
}

.ds-card .ds-card__body {
  flex: 1;
  grid-template-rows: auto 1fr auto;
}

.ds-card:has(.project-more) .ds-card__body {
  grid-template-rows: auto 1fr auto auto;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-1);
}

.project-more {
  color: var(--ds-second);
  font-size: var(--ds-text-sm);
  font-weight: 600;
}

/* Project details */
.project-dialog {
  width: min(44rem, calc(100vw - 2rem));
}

.project-dialog h2 {
  font-size: var(--ds-text-xl);
}

.project-dialog h2:focus {
  outline: none;
}

#modalImage img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.project-dialog__text {
  display: grid;
  gap: var(--ds-3);
  color: var(--ds-fg2);
}

.project-dialog__text strong {
  color: var(--ds-fg);
  font-weight: 600;
}

.project-dialog__text ul {
  display: grid;
  gap: var(--ds-1);
  margin: 0;
  padding-left: var(--ds-5);
}
