/* Card grid shared by /aircrafts and /basic. Nested under .cards so the global .card class does not
   leak into other pages that use their own .card (e.g. the LMS student home). */
@layer components {
  .cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;

    .card {
      background: #fff;
      border: 1px solid #ccc;
      border-radius: 8px;
      padding: 0;
      box-sizing: border-box;
      position: relative;
      cursor: pointer;
      inline-size: 500px;
      block-size: auto;
      font-size: 1.125rem;

      img {
        inline-size: 100%;
        block-size: 100%;
        object-fit: cover;
        border-radius: 4px;
        user-select: none;
        margin: 0;
        padding: 0;
      }

      .overlay {
        position: absolute;
        inset: 0;
        background: transparent;
        border-radius: 4px;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        padding: 0;
        box-sizing: border-box;
        transition: background 0.3s ease;
      }

      &:hover .overlay {
        background: rgb(0 0 0 / 0.3);
      }

      :is(h2, h3, h4, h5) {
        position: absolute;
        inset-inline-start: 20px;
        inset-block-end: 50px;
        font-size: 1.5em;
        color: #fff;
        margin: 0;
        padding: 0;
        font-style: italic;
      }

      p {
        position: absolute;
        inset-inline-start: 30px;
        inset-block-end: 25px;
        font-size: 1em;
        color: #fff;
        margin: 0;
        padding: 0;
      }
    }
  }
}
