.profiles__container {
  align-items: center;
  column-gap: 1.27em; /* Fallback, do not remove -SM */
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: row;
  grid-row-gap: 2.94em;
  grid-column-gap: 1.27em;  /* Due to the profile card photos overflowing from the top of the card (by design) */
  grid-template-columns: repeat(3, 345px); /* Percentages unfortunately don't work when there are only two providers in a row. -SM 11.28.2023 */
  justify-content: center;
  margin: 5% auto;
  max-width:1080px;
  /* For demo purposes */
  row-gap: 2.94em; /* Fallback, do not remove -SM */
  width: 100%;
}

/* Slightly different name because this holds a single profile card instead of 3 */
.profile__container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 5% auto;
  width: auto;
}

/* For profile cards with locations only */
.profile__container .card--profile__img {
  margin-top: unset;
  top: 1em;
}

/* Holds a single card, helps with row spacing */
.card--profile__container {
  width: 100%;
}

.card--profile {
  background-color: var(--primary-neutral-light);
  border: 1px solid var(--secondary-neutral-light-gray);
  border-radius: 0;
  box-shadow: 0px 15px 60px rgba(31, 127, 155, 0.05);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 1.66em 0;
  min-height: 610px;
  overflow: inherit;
  position: relative; /* The only way the bottom portion of the card will stay in place, DO NOT REMOVE */
  color: var(--primary-dark);
}

/* Div holding profile image */
.card--profile__img {
  align-items: center;
  align-self: center;
  display: flex;
  flex-direction: column;
  margin-top: -3em;
  position: absolute;
  z-index: 2;
}


/* The class for the actual image */
.card--profile .profile__img {
  border-radius: 0;
  box-shadow: 0px 15px 60px rgba(31, 127, 155, 0.05);
  height: auto;
  max-height: 150px;
}

.card--profile__inner {
  align-items: center;
  display: flex;
  flex-direction: column;
  margin: 2.61em 1.66em 1.66em 1.66em;
  /* Margin-top different from style guide due to positioning */
  position: relative;
  z-index: 1;
}

.card--profile__header {
  height: clamp(125px, 125px, 0);
  margin: 60px 0 0;
  width: 100%;
}

.card--profile__header h2 {
  font-size: 1em;
  margin-bottom: 30px;
}

.card--profile__header a {
  color: var(--primary-color);
}

.card--profile__header a:focus,
.card--profile__header a:hover {
  text-decoration: underline;
}

.card--profile__header--locations {
  height: auto;
  margin: 2.75em 0 0 0;
  width: 100%;
}

.card--profile__inner .p--body {
  color: var(--primary-dark);
  margin: 0;
}

.card--profile__contact,
.card--profile__specialties,
.card--profile__locations {
  width: 100%;
}

.card--profile__contact,
.card--profile__locations,
.card--profile__specialties {
  margin-bottom: 15px;
}

.card--profile .profile__specLoc__headings {
  align-items: center;
  column-count: 2;
  column-gap: 10px;
  display: inline-flex;
  flex-direction: row;
  margin: 0;
  padding: 0;
}

.card--profile .profile__subheader {
  font-display: auto;
  font-family: var(--primary-font-family);
  font-stretch: normal;
  font-style: normal;
  font-size: var(--med-font-size);
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0;
  padding: 0;
}

.card--profile__bottom {
  bottom: 0;
  height: clamp(100px, 120px, 135px); /* DO NOT REMOVE */
  margin: 0 auto 25px;
  position: absolute;
  width: 100%;
  z-index: 3;
}

.card--profile__link,
.card--profile__btn {
  text-align: center;
}

.card--profile__link .allCaps {
  font-size: var(--sm-font-size);
  letter-spacing: 1px;
  margin: 0 auto;
}

.card--profile hr {
  color: var(--secondary-neutral-light-gray);
  margin: 20px auto;
  max-width: 285px; /* Formerly width, changed because width of profile cards on individual provider pages was lessened, 11.30.2023 */
}

.card--profile__btn {
  margin-top: 1.27em;
  width: 100%;
}

.modal__trigger:not(:focus-visible) {
  outline: 0;
  text-decoration: none;
}


/* For locations cards */
.card--profile .card--profile__locations--full {
  display: flex;
  flex-direction: column;
  height: auto;
  width: 100%;
}

.card--profile .profile__location {
  align-items: first baseline;
  align-self: first baseline;
  column-count: 2;
  column-gap: 10px;
  display: flex;
  flex-direction: row;
}

.card--profile .profile__location__icon {
  order: 1;
}

.card--profile .profile__location__contact {
  order: 2;
  width: 100%;
}

.profile__location__icon svg {
  height: auto;
  margin-bottom: -3px; /* To bring the icon and address text more in line with each other */
  width: auto;
}

.profile__location__contact address {
  font-display: auto;
  font-family: var(--primary-font-family);
  font-stretch: normal;
  font-style: normal;
  font-weight: 400;
  font-size: var(--med-font-size); 

}

.card--profile .profile__location__contact a {
  font-display: auto;
  font-family: var(--primary-font-family);
  font-stretch: normal;
  font-style: normal;
  font-weight: 400;
  color: var(--primary-color);
  font-size: var(--med-font-size);
}

.card--profile .profile__location__contact a:focus,
.card--profile .profile__location__contact a:hover {
  text-decoration: underline;
}






/***** MEDIA QUERIES *****/

@media only screen and (max-width: 1024px) {
  .profiles__container {
    grid-template-columns: auto;
    display: flex;
    flex-direction: column;
  }
  
  .card--profile__container {
    width: 50%;
   }
}


@media only screen and (max-width: 580px) {
  
  .card--profile__img {
      height: 250px;
    	width:250px;
  }
  
  .card--profile__container {
    width: 80%;
   }
  
  .card--profile .profile__img {
      height: auto;
  }
  
  	.card--profile__inner {
      margin: 2.61em 1.66em 1.66em 1.66em;
  }
  
    .card--profile {
        margin-top: 100px;
        height: 680px;
        margin-bottom: 100px;
    }
  
}


@media only screen and (max-width: 480px) {
  
    .card--profile {
        height: auto;
    }
  
}


@media only screen and (max-width: 420px) {
  
    .card--profile__img {
      height: 150px;
    	width:150px;
  }
  
  .card--profile__container {
    width: 100%;
   }
  

}



@media screen and (min-width: 375px) and (max-width: 767px) {
  .profiles__container {
    grid-template-columns: none;
    margin: 15% auto; /* Prevents the cards from bumping up against the pagination and filters too much */
  }
}


@media screen and (min-width: 375px) and (max-width: 1024px) {
  .card--profile__container {
    margin: 0 auto;
    width: 90%;
  }
}

@media screen and (min-width: 1280px) {
 /* Added 11.28.2023 because on larger screens, the profile card borders get cut off in the first and third columns on larger screens */
 /* Percentages unfortunately don't work because it messes up cards with specialties where there are only 2 providers instead of 3 in a single row */
  .profiles__container {
    grid-template-columns: repeat(3, 344px);
  }
}





