/*=============================================
=            Blog Page Styles               =
=============================================*/

:root {
  --bg-debug: hsla(76, 100%, 47%, 0.1);
  --color-action: hsl(223, 100%, 40%);
  --color-action-hover: hsl(223, 100%, 28%);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/*----------  Outlined Buttons  ----------*/

.pill-outline {
  background: white;
  border-radius: 999px;
  border: 1px solid var(--color-action);
  color: var(--color-action);
  flex: 0 0 auto;
  font-size: 0.875rem;
  font-weight: 600;
  /* line-height: calc(1 / 14 * 16); */
  line-height: 1.1428571429;
  /* The Elza font in use has a base line-height issue */
  padding: 8px 16px 8px;
  text-transform: capitalize;
  white-space: nowrap;

  scroll-snap-align: center;
  scroll-margin-left: 1.5rem;

  &:first-child {
    margin-left: 16px;
  }
  &:last-child {
    margin-right: 16px;
  }

  &.is-active,
  &.is-active:hover {
    background: var(--color-action);
    color: white;
    cursor: default;
  }
}

.regular-view .pill-outline:hover {
  background: var(--color-action-hover);
  color: white;
}
/*----------  BLOG  ----------*/

.blog {
  overflow-x: hidden;
  .content-body & {
    padding-top: 4.5rem;
  }
  h1 {
    font-size: 1.5rem;
    @media (min-width: 1024px) {
      font-size: 3rem;
    }
  }
  > div {
    p {
      @media (min-width: 1024px) {
        width: 70%;
      }
    }
  }
}

.blog-utilities {
  display: flex;
  flex-direction: column;
  margin-top: 72px;
  gap: 16px;
  @media (min-width: 1024px) {
    align-items: center;
    flex-direction: row;
  }
}
.blog-search {
  position: relative;
  width: 100%;

  @media (min-width: 1024px) {
    max-width: 492px;
  }

  input {
    @media (min-width: 1024px) {
      max-width: 492px;
    }
  }
  a {
    align-items: center;
    display: flex;
    height: 99%;
    justify-content: center;
    position: absolute;
    right: 0;
    text-transform: capitalize;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
  }
}

.blog-categories {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  overflow-x: auto;
  padding-block: 16px;

  scroll-snap-type: x mandatory;
  scroll-padding-left: 1.5rem;
  -webkit-overflow-scrolling: touch;
  gap: 16px;
  &::-webkit-scrollbar {
    display: none;
  }

  @media (min-width: 768px) {
    margin-left: auto;
    width: auto;
    padding: 0;
  }

  .pill-outline {
    &:last-child {
      margin-right: 16px;
    }
  }
}

.blog-posts {
  display: grid;
  grid-gap: 16px;
  margin-top: 48px;

  @media (min-width: 768px) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  @media (min-width: 1024px) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content-body &:not(footer) {
    padding-block: 2.5rem;
  }
  div:has(> &) {
    @media (min-width: 768px) {
      margin-block-start: 48px; 
    }
  }
}

.blog-post {
  color: black;
  display: flex;
  flex-direction: column;
  img {
    background-color: white;
    border-radius: 16px;
    aspect-ratio: 4/3;
    object-fit: cover;
    width: 100%;
  }
  div {
    align-items: center;
    background: white;
    border-radius: 16px;
    display: flex;
    margin-top: -32px;
    margin-inline: auto;
    position: relative;
    text-align: center;
    width: calc(100% - 69px);
  }
  h3 {
    font-size: 1.25rem;
    line-height: 1.2;
    margin: 0;
    width: 100%;
  }
  .excerpt {
    font-size: 1rem; 
    line-height: 1.5; 
    border-radius: 0px;
    margin: 0; 
    text-align: center; 
    display: -webkit-box;             
    -webkit-box-orient: vertical;     
    overflow: hidden;                 
    text-overflow: ellipsis;          
    -webkit-line-clamp: 6;            
    line-clamp: 6;                   
    max-height: calc(1.5em * 6);      
  }
  .text-black {
    color: black;
  }
  .post-card .excerpt {
    margin: 0 auto;
  }

  .post-card {
    position: relative;
    height: 258px;
    display: flex;
    flex-direction: column;
  }
  
  .post-card h3 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    max-width: 85%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
  
  .post-card .excerpt {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    flex-grow: 1;
    width: 100%;
    text-align: center;
  }
  
  .post-card button {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 16px;
  }

  .post-card button, .hero-card-cta button {
    letter-spacing: 0.25px;
  }

  /*----------  First Post  ----------*/

  @media (min-width: 768px) {
    &:first-child.hero-post {
      grid-column: 1/3;
      h3 {
        font-size: 1.5rem;
      }
    }
  }
  @media (min-width: 1024px) {
    .hero-card{
      padding: 40px;
    }
    .hero-card h3{
      margin-bottom: 16px;
    }
    .hero-card-cta button {
      margin-top: 16px;
    }
  }
  @media (max-width: 1023px) {
    .hero-card {
      height: 258px;
      position: relative;
      padding: 16px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }
   
    .hero-card h3 {
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      max-width: 85%;
      margin-left: auto;
      margin-right: auto;
      text-align: center;
    }
   
    .hero-card .excerpt {
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 4;
      line-clamp: 4;
      flex-grow: 1;
      width: 90%;
      text-align: center;
      margin-bottom: 16px;
    }
   
    .hero-card .hero-card-cta {
      width: 100%;
      text-align: center;
      margin-top: auto; 
    }
   
    .hero-card .hero-card-cta button {
      margin: 0 auto;
    }
  }
  @media (min-width: 1024px) {
    &:first-child.hero-post {
      display: grid;
      grid-column: 1/4;
      grid-template-columns: repeat(6, minmax(0, 1fr));
      margin-bottom: 36px;

      img,
      div {
        grid-row: 1/2;
      }

      img {
        grid-column: 1/5;
        max-height: 480px;
      }
      div {
        align-self: center;
        grid-column: 4/-1;
        height: auto;
        margin: 0;
        min-height: 50%;
        width: auto;
        text-align: left;
      }
      h3 {
        font-size: 2rem;
      }
      h4 {
        font-size: 2rem;
      }
    }
  }
}

@media (min-width: 1024px) {
  .blog-post.hero-post.hero-post {
    position: relative;
    display: block;
    width: 100%;
    margin: 0 auto;
  }

  .blog-post.hero-post.hero-post img {
    width: auto;
    height: 520px;
    object-fit: cover;
    display: block;
  }

  .blog-post.hero-post .hero-card.hero-card {
    height: 100%;
    position: absolute;
    top: 50%;
    right: 46px;
    max-height: 350px;
    transform: translateY(-50%);
    background: white;
    padding: 32px 26px;
    width: 50%;
    z-index: 1;
    margin: auto 0;
  }

  .blog-post.hero-post .hero-card .excerpt.excerpt {
    width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: auto;
  }

  .blog-post.hero-post .hero-card-cta.hero-card-cta {
    width: 100%;
    min-height: 0;
  }

    .hero-card {
      margin: auto 0;
  }
}
  .blog-post .hero-card-content {
  display: flex;
  flex-direction: column;
  margin-top: 0;
}

.blog-post-no-hero {
  color: black;
  display: flex;
  flex-direction: column;
  img {
    background-color: white;
    border-radius: 16px;
    aspect-ratio: 4/3;
    object-fit: cover;
    width: 100%;
  }
  div {
    align-items: center;
    background: white;
    border-radius: 16px;
    display: flex;
    margin-top: -32px;
    margin-inline: auto;
    padding: 24px;
    position: relative;
    text-align: center;
    width: calc(100% - 48px);

  }
  h3 {
    font-size: 1.25rem;
    line-height: 1.2;
    margin: 0;
    width: 100%;
  }
}

.blog-post.hero-post {
  width: 100%;
  margin: 0 auto
}

.embla__buttons .btn__prev.blog-mobile.disabled, .embla__buttons .btn__next.blog-mobile.disabled {
  border-color:grey;
  color:grey;
  background-color: white !important
}

.embla__buttons .btn__prev.blog-mobile{ 
  left: 0 !important
}

.embla__buttons .btn__next.blog-mobile{ 
  right: 0 !important
}

@media (max-width: 1023px) {
  .embla__buttons .btn__prev.blog-mobile, .embla__buttons .btn__next.blog-mobile{
    display: none;
  }
}

/*----------  Single Blog Post  ----------*/

.blog-article {
  .content-body & {
    padding-top: 1rem;
  }
  h1 {
    font-size: 1.5rem;
    @media (min-width: 1024px) {
      font-size: 3rem;
    }
  }
  .article-category {
    opacity: 0.7;
  }
  .prose {
    padding-top: 1.5rem;
    word-wrap: break-word;

    img {
      margin-inline: auto;
    }
  }

  footer {
    /* margin-block-end: 3em; */
    div {
      flex-direction: column;
      /* align-items: flex-start; */
    }
  }
}

.blog-article-tags {
  gap: 0.5em;
  align-items: center;
  margin-block: 3em;
  h6 {
    margin: 0 1em 0 0;
  }
}

.article-date {
  display: flex;
  gap: 0.5em;
  align-items: center;
  margin-block: 3em;
  h6 {
    margin: 0 1em 0 0;
  }
}

.article-header-image img {
  width: 100%; /* Makes the image responsive */
  height: auto; /* Maintains the aspect ratio */
  display: block; /* Removes the bottom margin space */
  margin-bottom: 20px; /* Adds some space below the image */
}

@media (min-width: 768px) {
  .article-meta {
    display: flex;
    align-items: center;
  }
}

.blog-share {
  display: flex;
  gap: 4px;
  margin-block-start: 4px;

  @media (min-width: 768px) {
    margin-left: auto;
  }
  a {
    background: white;
    color: var(--color-action);
    border: 1px solid var(--color-action);
    border-radius: 4px;
    height: 32px;
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    &:hover {
      color: var(--color-action-hover);
    }
  }
}

.blog-posts .blog-post:not(:first-child) > div > h3 {
 padding: 8px;
}

.blog-posts .blog-post:not(:first-child) > .row > .excerpt {
  letter-spacing: 0.042px;
  width: 100%;
  padding: 4px 8px;
}

/*=====  End of Blog Page Styles     ======*/


.blog-utilities {
  display: flex;
  flex-wrap: wrap;
  overflow-wrap: break-word; 

}

.blog-search {
  flex: 1 1 100%;
}

.blog-categories {
  display: flex;
  flex-wrap: wrap;
}


.pill-outline:first-child {
  margin-left: 0; 
}

@media (max-width: 767px) {
  .blog-article article {
    text-align: center;
  }
  .blog-article ol,
  .blog-article ul {
    text-align: left; 
  }
}

@media (min-width: 768px) {
  .blog-share {
    justify-content: flex-end !important;
  }
}

.blog-article hr {
  border-top: 4px solid #dedede;
  margin: 16px 0;
}

@media (max-width: 1023px) {
  .blog-post {
    div {
      width: calc(100% - 42px);
    }

    .post-card {
      height: 242px;
    }

    .post-card h3 {
      max-width: 100%;
    }

    .hero-card .excerpt {
      width: 100%;
    }

    .post-card .excerpt {
      font-size: 14px;
    }
  }

  .blog-posts .blog-post:not(:first-child) > div > h3 {
    font-size: 16px;
    padding: 0;
  }
}

@media (max-width: 768px) {
  .hero-card .excerpt {
    font-size: 14px;
  }

  .blog-post  .hero-card-content {
    width: 100%;
    margin: 0;
  }

  .hero-card .hero-card-content h3 {
    max-width: 100%;
    font-size: 16px;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .post-card .excerpt {
      font-size: 16px;
    }
}

@media (min-width: 640px) and (max-width: 767px) {
  .hero-card .hero-card-content h3 {
      font-size: 20px;
  }

  .blog-posts .blog-post:not(:first-child) > div > h3 {
    font-size: 20px;
  }
}