/*-- -------------------------- -->
<---            Blog            -->
<--- -------------------------- -*/

/* Mobile - 360px */
@media only screen and (min-width: 0rem) {
  #blog_cards {
    background-color: #f7f7f7;
    padding: var(--sectionPadding);
    overflow: hidden;
  }
  #blog_cards .cs-container {
    width: 100%;
    /* changes to 1280px at desktop */
    max-width: 36.5rem;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* 48px - 64px */
    gap: clamp(3rem, 6vw, 4rem);
  }
  #blog_cards .cs-content {
    /* set text align to left if content needs to be left aligned */
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    /* centers content horizontally, set to flex-start to left align */
    align-items: center;
  }

  #blog_cards .cs-title {
    margin-bottom: 2rem;
    max-width: 20ch;
  }

  #blog_cards .cs-button-solid {
    /* prevents flexbox from squishing it */
    flex: none;
  }
  #blog_cards .cs-card-group {
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    /* 16px - 20px */
    gap: clamp(1rem, 2vw, 1.25rem);
    position: relative;
  }
  #blog_cards .cs-item {
    list-style: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    position: relative;
  }
  #blog_cards .cs-item:hover {
    cursor: pointer;
  }
  #blog_cards .cs-item:hover .cs-info:before {
    opacity: 1;
    background-color: var(--primary);
  }
  #blog_cards .cs-item:hover .cs-picture img {
    transform: scale(1.15);
  }
  #blog_cards .cs-item:hover .cs-date {
    color: #fff;
  }
  #blog_cards .cs-item:hover .cs-icon {
    filter: brightness(150%);
  }
  #blog_cards .cs-item:hover .cs-link {
    color: #fff;
  }
  #blog_cards .cs-picture {
    width: 100%;
    height: 30rem;
    /* removed at tablet */
    aspect-ratio: 0.68333333;
    /* clips img tag from overflowing it on hover */
    overflow: hidden;
    display: block;
    position: relative;
    z-index: 1;
  }
  #blog_cards .cs-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* makes sure the top of the image is at the top of the parent, heads won't get cut off this way */
    object-position: top;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    transition: transform 0.9s;
  }
  #blog_cards .cs-info {
    width: 83%;
    max-width: 26.25rem;
    /* 16px - 24px */
    padding: clamp(1rem, 2vw, 1.5rem);
    /* prevents padding from affecting the height and width */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 10;
  }
  #blog_cards .cs-info:before {
    /* background-color */
    content: "";
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    opacity: 0.8;
    position: absolute;
    display: block;
    top: 0;
    left: 0;
    z-index: -1;
    transition: background-color 0.3s, opacity 0.3s;
  }
  #blog_cards .cs-date {
    font-size: 1rem;
    line-height: 1.2em;
    font-weight: 700;
    margin: 0 0 1.25rem 0;
    color: #bababa;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s;
  }
  #blog_cards .cs-icon {
    width: 1.25rem;
    height: auto;
    transition: filter 0.3s;
  }
  #blog_cards .cs-h3 {
    font-size: 1.25rem;
    line-height: 1.2em;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    color: #fff;
    display: block;
  }
  #blog_cards .cs-desc {
    font-size: 1rem;
    line-height: 1.5em;
    margin: 0 0 1.25rem 0;
    color: #f7f7f7;
    display: block;
  }
  #blog_cards .cs-link {
    font-size: 1rem;
    line-height: 1.2em;
    font-weight: 700;
    text-decoration: none;
    width: auto;
    margin: 0;
    color: var(--primary);
    display: inline-block;
    position: relative;
    transition: color 0.3s;
  }
  #blog_cards .cs-link:hover {
    color: #fff;
  }
  #blog_cards .cs-link:before {
    /* underline */
    content: "";
    width: 100%;
    height: 1px;
    background: currentColor;
    opacity: 1;
    position: absolute;
    display: block;
    bottom: 0;
    left: 0;
    transition: background-color 0.3s;
  }
}
/* Tablet - 550px */
@media only screen and (min-width: 34.375rem) {
  #blog_cards .cs-content {
    text-align: left;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    gap: 3rem;
    overflow: hidden;
  }
  #blog_cards .cs-title {
    margin: 0;
  }
  #blog_cards .cs-picture {
    /* remove the aspect ratio so the height can be squished */
    aspect-ratio: initial;
  }
}
/* Small Desktop - 1024px */
@media only screen and (min-width: 64rem) {
  #blog_cards .cs-container {
    max-width: 80rem;
    overflow: hidden;
  }
  #blog_cards .cs-card-group {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  /* 3 cards per row */
  #blog_cards .cs-item {
    width: calc(80rem / 3 - 1rem);
    flex: 1 1 calc(32% - 16px); /* 33.333% for 3 items and 16px for gap */
    margin: 8px; /* half of 16px gap */
    box-sizing: border-box; /* include padding and border in the width */
  }
}
