 /* Make columns flex so their child cards can stretch to equal heights */
  .main-primary .row > [class*="col-"] {
    display: flex;
  }

  /* Ensure the anchor and article fill the column height */
  .main-primary .row > [class*="col-"] > a.no-icon {
    display: flex;
    width: 100%;
  }

  /* Card container: column flex to stack image + caption */
  .main-primary article {
    display: flex;
    flex-direction: column;
    width: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
  }

  /* Uniform image sizing */
  .main-primary article img {
    width: 100%;
    height: 240px; /* adjust if needed */
    object-fit: cover;
    display: block;
  }

  /* Fixed-height caption area */
  .main-primary article .p-a-sm {
    height: 120px;
    flex: 0 0 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  /* Caption text rules */
  .main-primary article .p-a-sm p {
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Hover polish */
  .main-primary article:hover {
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.08);
    transition: box-shadow 0.2s ease-in-out;
  }

  /* MOBILE SPACING: match Bootstrap gutter spacing */
  /* Tighten row spacing on mobile to match column spacing */
  @media (max-width: 767px) {
    .main-primary .row {
      margin-top: 0 !important;   /* remove the mt-4 1.5rem space */
      margin-bottom: 0 !important;
    }

    .main-primary .row > [class*="col-"] {
      padding-left: 0.75rem;
      padding-right: 0.75rem;
      margin-bottom: 1rem;       /* your desired mobile gap */
    }
  }

  }