/* The two application screens. One treatment for both, applied
   everywhere an application screen appears on this site: the same
   radius, the same hairline, the same single shadow recipe. A mixture
   would read as a mood board.

   Above 62rem the order list is absolutely placed over the bottom
   left corner of the dashboard and hangs out of its column. Below
   that both screens stack at full width and nothing overlaps. */

@layer components {
  .product__grid {
    display: grid;
    gap: var(--space-l);
  }

  .product__title {
    max-inline-size: 18ch;
    margin-block-start: var(--space-xs);
    font-size: var(--step-3);
    font-weight: 700;
  }

  .product__lead p {
    margin-block-start: var(--space-m);
    color: var(--color-muted);
  }

  .product__points {
    display: grid;
    gap: var(--space-2xs);
    margin: 0;
    margin-block-start: var(--space-m);
    padding: 0;
    list-style: none;
    font-size: var(--step--1);
    color: var(--color-muted);
  }

  /* A coral tick, drawn from two rules rather than shipped as an icon,
     because it repeats nine times and an SVG would not earn it. */
  .product__points li {
    position: relative;
    padding-inline-start: var(--space-m);
  }

  .product__points li::before {
    content: '';
    position: absolute;
    inset-block-start: 0.45em;
    inset-inline-start: 0;
    inline-size: 0.45rem;
    block-size: 0.8rem;
    border-inline-end: 2px solid var(--color-accent);
    border-block-end: 2px solid var(--color-accent);
    rotate: 45deg;
  }

  .product__shot {
    position: relative;
    display: grid;
    gap: var(--space-m);
    margin: 0;
  }

  .product__screen {
    inline-size: 100%;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    background: var(--color-bg);
  }

  .product__screen--main {
    box-shadow: var(--shadow);
  }

  .product__caption {
    font-size: var(--step--1);
    color: var(--color-muted);
  }

  @media (min-width: 62rem) {
    /* Twelve columns, twelve-column gutter. See hero.css: a section
       sized gap here leaves the columns with almost nothing. */
    .product__grid {
      grid-template-columns: repeat(12, minmax(0, 1fr));
      column-gap: var(--space-m);
      row-gap: var(--space-l);
      align-items: center;
    }

    .product__lead {
      grid-column: 1 / 6;
    }

    .product__shot {
      grid-column: 6 / 13;
      /* Room underneath for the order list to hang into. */
      padding-block-end: 6rem;
    }

    /* Hangs exactly one column gap to the left, so it always stops
       short of the text column instead of landing on the last bullet
       at narrower desktop widths. */
    .product__screen--inset {
      position: absolute;
      inset-block-end: 2.5rem;
      inset-inline-start: calc(var(--space-m) * -1);
      inline-size: 50%;
      box-shadow: var(--shadow);
    }

    .product__caption {
      position: absolute;
      inset-block-end: 0;
      inset-inline-end: 0;
      max-inline-size: 34ch;
      text-align: end;
    }
  }
}
