/*
 * Date row of a series: the date line is one link (arrow at the right end), the secondary s button "Anmelden" sits
 * between date and arrow as a separate link. Layout: link and button share one grid cell; the button floats above the
 * link's reserved space, so the row is never one big link.
 * Phone: the time is hidden unless the date deviates from the series.
 */
@layer components {
  .date-list {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .date-list > li {
    border-block-start: var(--border-width-thin) solid var(--color-border-default);
  }

  .date-list > li:last-child {
    border-block-end: var(--border-width-thin) solid var(--color-border-default);
  }

  .date-row {
    --date-row-arrow: 16px;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-block-size: 56px;
  }

  .date-row__heading {
    grid-area: 1 / 1 / 2 / 3;
    font-family: var(--font-family-base), system-ui, sans-serif;
    font-size: var(--type-label-m-size);
    line-height: var(--type-label-m-line-height);
  }

  .date-row__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-16);
    padding: var(--space-16) 0;
    color: var(--color-text-default);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
  }

  .date-row__link:focus-visible {
    outline: var(--border-width-focus) solid var(--color-focus);
    outline-offset: var(--space-4);
    border-radius: var(--radius-s);
  }

  .date-row__text {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-inline-size: 0;
  }

  .date-row__line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4) var(--space-8);
  }

  /* Day, separator and time are one run of text from 1024 px (like .event-row__dateline): "·" with one space on each side,
     the badge stays a flex item. Below 1024 px the children are flex items themselves (a deviating time takes its own line). */
  .date-row__dateline {
    display: contents;
  }

  .date-row__sep,
  .date-row__time {
    display: none;
  }

  /* Phone: a deviating time stands on its own line under the day. */
  .date-row--deviating .date-row__time {
    display: inline;
    flex-basis: 100%;
  }

  .date-row--deviating:not(.date-row--cancelled) .date-row__time {
    color: var(--color-text-default);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.2em;
  }

  /* Past date: what there is to see („11 Fotos · 1 Pressebericht“). */
  .date-row__extra {
    color: var(--color-text-subtle);
    font-weight: var(--font-weight-regular);
    font-size: var(--type-label-s-size);
    line-height: var(--type-label-s-line-height);
  }

  .date-row__note {
    padding: var(--space-4) var(--space-8);
    border: var(--border-width-thin) solid var(--color-border-strong);
    border-radius: var(--radius-xs);
    color: var(--color-text-default);
    font-size: var(--type-label-s-size);
    line-height: var(--type-label-s-line-height);
  }

  .date-row__name {
    color: var(--color-text-default);
    font-family: var(--font-family-heading), serif;
    font-size: var(--type-heading-s-size);
    line-height: var(--type-heading-s-line-height);
    overflow-wrap: anywhere;
  }

  .date-row--cancelled .date-row__day,
  .date-row--cancelled .date-row__time,
  .date-row--cancelled .date-row__name {
    color: var(--color-text-subtle);
  }

  .date-row__arrow {
    flex: none;
    color: var(--color-text-subtle);
    display: inline-flex;
    inline-size: var(--date-row-arrow);
  }

  @media (min-width: 1024px) {
    .date-row__dateline {
      display: block;
      min-inline-size: 0;
    }

    .date-row__sep,
    .date-row__time,
    .date-row--deviating .date-row__time {
      display: inline;
      flex-basis: auto;
    }
  }
}
