/*
 * Layout corrections for PI funding periods and News presentations.
 * Load after style.css/sp.css and utility.sc.css.
 * Scoped to affected sections so other site pages remain unchanged.
 */

/* PI: never split a funding period across two lines. */
.pi .grant-block .grant-period {
  white-space: nowrap;
}

@media screen and (min-width: 770px) {
  /* The original date column is 120px; allow longer dates to fit. */
  .pi .grant-block .grant-period {
    flex: 0 0 170px;
  }

  /* Keep the description and amounts aligned with the funding title. */
  .pi .grant-block .grant-detail,
  .pi .grant-block .grant-amount {
    padding-left: 170px;
  }

  .pi .grant-block .grant-title {
    min-width: 0;
  }

  /* Presentations: use one date column, independently of date length. */
  #presentations-content .list_bdr_dot > li {
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr);
    align-items: start;
  }

  #presentations-content .list_bdr_dot > li > .date-text {
    grid-column: 1;
    grid-row: 1 / span 2;
    white-space: nowrap;
  }

  #presentations-content .list_bdr_dot > li > .content-text {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
    padding-left: 0;
  }

  #presentations-content .list_bdr_dot > li > .news_info {
    grid-column: 2;
    grid-row: 2;
    padding-left: 0;
  }
}

@media screen and (max-width: 769px) {
  /* Narrow screens: put the date on its own line and align both text rows. */
  #presentations-content .list_bdr_dot > li > .date-text {
    display: block;
    white-space: nowrap;
  }

  #presentations-content .list_bdr_dot > li > .content-text {
    display: block;
    margin-left: 1rem;
    padding-left: 0;
  }

  #presentations-content .list_bdr_dot > li > .news_info {
    margin-left: 1rem;
    padding-left: 0;
  }
}
