/**
 * @interface
 * var(--short-attachments-multiple: true) - arrange images in a grid
 * var(--short-attachments-featured: true) - feature the first image across two rows
 */

@layer components {
  @scope (blog-short-attachments) to ([data-component]) {
    :scope {
      display: block;
      min-width: 0;
      --content-image-layout: bounded;
    }

    .gallery {
      list-style: none;
      margin: 0;
      padding: 0;

      @container style(--short-attachments-multiple: true) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: clamp(7rem, 27vw, 15rem);
        gap: 0.25rem;
        --content-image-layout: fill;
      }
    }

    li {
      min-width: 0;
      min-height: 0;

      @container style(--short-attachments-featured: true) {
        &:first-child {
          grid-row: span 2;
        }
      }
    }
  }
}
