.blog {
  margin-top: 4.5rem;
  animation: blog-in 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes blog-in {
  from {
    opacity: 0.5;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog {
    animation: none;
  }
}

.blog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.blog__title {
  font-size: 0.875rem;
  background-image: linear-gradient(-180deg, #7F45B3, #E62AA1);
  background-clip: text;
  color: transparent;
}

.blog__view-all {
  font-size: 0.625rem;
  color: hsl(268, 53%, 37%);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
}

@media (hover: hover) and (pointer: fine) {
  .blog__view-all {
    transition: color 200ms ease, text-decoration 200ms ease;
  }

  .blog__view-all:hover {
    text-decoration: underline;
    color: hsl(212, 70%, 30%);
  }
}

.blog__view-all:focus-visible {
  outline: 2px solid hsl(319, 80%, 35%);
  outline-offset: 2px;
}

.blog__empty {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  color: hsl(210, 2%, 59%);
}

.blog__list-wrapper {
  position: relative;
}

.blog__scroll-btn {
  display: none;
}

.blog__list {
  padding: 0.25rem;
  display: flex;
  gap: 0.625rem;
  overflow-x: auto;
  margin-top: 1.25rem;
  padding-block-end: 0.75rem;
}

.blog__card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 13rem;
  max-width: 15rem;
  background-color: hsl(0 0% 100%);
  border: 1px solid hsl(210, 4%, 89%);
  border-radius: 5px;
}

.blog__card:has(.blog__card-title a:focus-visible) {
  outline: 2px solid hsl(319, 80%, 35%);
  outline-offset: -2px;
}

.blog__card-img {
  width: 100%;
  height: 9.5rem;
  object-fit: cover;
}

.blog__card-body {
  padding: 0.625rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
  flex: 1;
}

.blog__card-header {
  min-height: 4.25rem;
}

.blog__card-title {
  font-size: 0.75rem;
  font-weight: 500;
}

.blog__card-title a {
  color: hsl(0 0% 0%);
  text-decoration: none;
}

.blog__card-title a:after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
  .blog__card-title a {
    transition: color 200ms ease;
  }

  .blog__card-title a:hover {
    color: hsl(268, 53%, 37%);
  }
}

.blog__card-title a:focus-visible {
  outline: none;
}

.blog__card-date {
  font-size: 0.625rem;
  color: hsl(210, 2%, 59%);
}

.blog__card-description {
  font-size: 0.75rem;
  color: hsl(228, 5%, 19%);
  line-height: 1.4;
}

.blog__card-description p {
  margin: 0;
}

@media (hover: hover) and (pointer: fine) {
  .blog .blog__card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .blog .blog__card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px hsl(210, 4%, 89%);
  }

  .blog .blog__card:active {
    transform: scale(0.97);
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog .blog__card:hover,
  .blog .blog__card:active {
    transform: none;
  }
}

.blog__card-link {
  display: none;
}

.blog__card--view-all {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
  padding: 1rem;
}

.blog__card-view-all-text,
.blog__card-link {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}

.blog__card-link {
  margin-top: auto;
}

.blog__card-view-all-text {
  color: hsl(268, 53%, 37%);
  font-size: 0.875rem;
  font-weight: 500;
}

.blog__card-link-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

@media (min-width: 75rem) {
  .blog__title {
    font-size: 1.5rem;
  }

  .blog__list-wrapper {
    display: block;
  }

  .blog__scroll-btn {
    display: none;
  }

  .blog__list {
    margin-inline: auto;
    padding-inline: 0;
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: repeat(4, auto);
    gap: 0.5rem;
    overflow: hidden;
  }

  .blog__card--featured .blog__card-picture {
    padding: 1rem;
  }

  .blog__card-description {
    font-size: 0.875rem;
  }

  .blog__card {
    max-width: unset;
  }

  .blog__card--featured {
    grid-column: 1;
    grid-row: 1 / span 4;
  }

  .blog__card--featured .blog__card-title {
    font-size: 1.25rem;
    line-height: 1.5;
  }

  .blog__card--featured .blog__card-date {
    font-size: 0.875rem;
  }

  .blog__card--featured .blog__card-description {
    font-size: 1rem;
    line-height: 1.8;
  }

  .blog__card--featured .blog__card-img {
    width: 100%;
    height: 22rem;
    object-fit: cover;
  }

  .blog__card-img {
    border-radius: 8px;
  }

  .blog__card--featured .blog__card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    border: 1px solid hsl(268, 53%, 37%);
    border-radius: 8px;
    background-color: hsl(0 0% 100%);
  }

  .blog__card--secondary {
    grid-column: 2;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
  }

  .blog__card--secondary:nth-of-type(2) {
    grid-row: 1;
  }

  .blog__card--secondary:nth-of-type(3) {
    grid-row: 2;
  }

  .blog__card--secondary:nth-of-type(4) {
    grid-row: 3;
  }

  .blog__card--secondary .blog__card-picture {
    order: 2;
    padding: 0.75rem;
  }

  .blog__card--secondary .blog__card-img {
    width: 10rem;
    height: 9rem;
    object-fit: cover;
  }

  .blog__card--secondary .blog__card-body {
    order: 1;
  }

  .blog__card--secondary .blog__card-description {
    display: none;
  }

  .blog__card--desktop-hidden {
    display: none;
  }

  .blog__card-link {
    display: inline-flex;
    color: hsl(268, 53%, 37%);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
  }

  .blog__card--view-all {
    grid-column: 2;
    grid-row: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
  }

}
