/*
 * Event page: layout of image, facts box and content (phone: image, facts, content; desktop: content column 7/12, one empty column,
 * facts box 4/12 beside it), status notice, section headings, contributors, partners, links, press rows.
 */
@layer components {
  .event__notice {
    margin-block-end: var(--space-24);
  }

  .event__layout {
    display: grid;
    gap: var(--layout-stack-l);
    grid-template-columns: minmax(0, 1fr);
  }

  .event__media,
  .event__aside,
  .event__content {
    min-inline-size: 0;
  }

  .event__image {
    --image-ratio: 3 / 2;
    --bubble-radius: var(--component-bubble-radius-m);
    --bubble-opposite: var(--component-bubble-radius-opposite-m);
  }

  .event__content {
    display: flex;
    flex-direction: column;
    gap: var(--space-48); /* between content groups: larger than the stack tokens (stack/l is 32 on phones) */
  }

  .event__description {
    max-inline-size: var(--layout-container-text);
  }

  .event-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
  }

  .event-section__title {
    font-size: var(--type-heading-m-size);
    line-height: var(--type-heading-m-line-height);
  }

  .contributors {
    display: grid;
    gap: var(--space-12);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .contributors__item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-4) var(--space-12);
  }

  .contributors__name {
    font-weight: var(--font-weight-bold);
  }

  a.contributors__name {
    color: var(--color-text-link);
    text-underline-offset: 0.2em;
  }

  .contributors__role {
    color: var(--color-text-subtle);
  }

  .event-organizer {
    max-inline-size: var(--layout-container-text);
  }

  .event-partners {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-16);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .event-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-8);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  /* Press rows: source · date · type above the title, action on the right (below on the phone). */
  .press-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-block-start: var(--border-width-thin) solid var(--color-border-default);
  }

  .press-list__row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-12);
    padding-block: var(--space-16);
    border-block-end: var(--border-width-thin) solid var(--color-border-default);
  }

  .press-list__text {
    min-inline-size: 0;
  }

  .press-list__meta {
    color: var(--color-text-subtle);
    font-size: var(--type-label-s-size);
    line-height: var(--type-label-s-line-height);
  }

  .press-list__title {
    font-size: var(--type-heading-s-size);
    line-height: var(--type-heading-s-line-height);
    overflow-wrap: anywhere;
  }

  /* The registration form sits on its own subtle section. */
  .event-registration .registration-form {
    margin-inline: auto;
  }

  @media (min-width: 640px) {
    .event-partners {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (min-width: 1024px) {
    .event__layout {
      grid-template-columns: repeat(12, minmax(0, 1fr));
      column-gap: var(--layout-grid-gap);
      row-gap: var(--layout-stack-l);
      align-items: start;
    }

    .event__content {
      gap: var(--space-64);
    }

    /* Main column 7 of 12, column 8 stays empty, facts box 9 to 12. */
    .event__media {
      grid-column: 1 / span 7;
      grid-row: 1;
    }

    .event__content {
      grid-column: 1 / span 7;
      grid-row: 2;
    }

    .event__aside {
      grid-column: 9 / span 4;
      grid-row: 1 / span 2;
      align-self: stretch;
    }

    .event__layout--no-media .event__content {
      grid-row: 1;
    }

    .event__layout--no-media .event__aside {
      grid-row: 1;
    }

    /* Only the facts box: it moves to the left edge instead of leaving an empty column. */
    .event__layout--facts-only .event__aside {
      grid-column: 1 / span 4;
    }

    .event__image {
      --image-ratio: 4 / 3;
      --bubble-radius: var(--component-bubble-radius-l);
      --bubble-opposite: var(--component-bubble-radius-opposite-l);
    }

    .press-list__row {
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      gap: var(--space-24);
    }
  }

  /* Facts box stays in view while the main column scrolls; it stops where the two-column area ends.
     Only on desktop widths with enough height (at 200 % zoom the layout width drops below 1024 px). */
  @media (min-width: 1024px) and (min-height: 760px) {
    .event__aside .event-facts {
      position: sticky;
      top: var(--space-24);
    }
  }
}
