/* Content typed into the grid. Cells have no fill of their own, so text sits on the
   gridlines; they still stop 1px short on the right and bottom so filled cells
   (headers, buttons, tags) leave the gridlines showing. Modifiers are the reusable styles. */
@layer sheet {
  .cell {
    min-inline-size: 0;
    display: flex;
    align-items: center;
    margin: 0 1px 1px 0;
    padding-inline: 6px;
    overflow: hidden;
    font-size: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: cell;

    &:is(a, button) {
      cursor: pointer;
    }
  }

  /* Text */

  .cell--title {
    font-size: 60px;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -1.5px;
    white-space: normal;
    text-wrap: balance;
  }

  .cell--heading {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
  }

  .cell--subtitle {
    font-size: 20px;
  }

  .cell--kicker {
    font-size: 13px;
    color: var(--text-kicker);
  }

  .cell--label {
    font-weight: 700;
  }

  .cell--wrap {
    white-space: normal;
    line-height: 1.3;
  }

  .cell--body {
    white-space: normal;
    line-height: 1.35;
    font-size: 13.5px;
  }

  .cell--table-header {
    background: var(--green-header);
    font-size: 13px;
    font-weight: 700;
  }

  /* Values */

  .cell--number {
    justify-content: flex-end;
    font: 15px var(--font-mono);
  }

  .cell--formula {
    font: 12.5px var(--font-mono);
    color: var(--text-formula);
  }

  .cell--link {
    color: var(--green);
    text-decoration: underline;

    &:hover {
      color: var(--red);
    }
  }

  /* Calls to action */

  .cell--cta {
    z-index: 2;
    justify-content: center;
    border-radius: 6px;
    background: var(--green);
    box-shadow: 0 3px 0 var(--green-dark);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;

    &,
    &:hover {
      color: var(--white);
    }
  }

  /* Images */

  /* An <img> cell. Replaced elements only stretch to their grid area when asked to. */
  .cell--photo {
    align-self: stretch;
    justify-self: stretch;
    min-block-size: 0;
    padding: 0;
    object-fit: contain;
  }
}

/* Phones: smaller headings and table labels to suit 84px columns. */
@layer sheet {
  @media (width <= 600px) {
    .cell--heading {
      font-size: 26px;
    }

    .cell--table-header {
      font-size: 12px;
    }

    .cell--body {
      font-size: 13.5px;
    }

  }
}
