/* =========================================
   Archive
========================================= */

.posts-archive {
  padding: 80px 20px;
}

.posts-archive__container {
  width: min(1920px, 100%);
  margin: 0 auto;
}

/* =========================================
   Header
========================================= */

.posts-archive__header {
  margin-bottom: 48px;
}

.posts-archive__title {
  margin: 0;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.posts-archive__description {
  max-width: 700px;
  margin: 20px 0 0;
  font-size: 18px;
  line-height: 1.6;
}

/* =========================================
   Category filter
========================================= */

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 48px;
  padding-bottom: 20px;
  border-bottom: 1px solid #ddd;
}

.category-filter__button {
  appearance: none;
  border: 1px solid #ccc;
  background: transparent;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;

  font: inherit;
  font-size: 14px;

  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.category-filter__button:hover,
.category-filter__button:focus-visible {
  border-color: #111;
}

.category-filter__button.is-active {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* =========================================
   Grid
========================================= */

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 56px 28px;
}

/* =========================================
   Post card
========================================= */

.post-card {
  min-width: 0;
}

.post-card__image-link {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #eee;
}

.post-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  border-radius: var(--roundedEdge);
}

.post-card__image-link:hover .post-card__image {
}

.post-card__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;

  color: #777;
  font-size: 14px;
}

/* =========================================
   Content
========================================= */

.post-card {
  background: var(--white);
  border-radius: var(--cornerExcess);
  padding: 2rem;
}

.post-card__content {
  padding-top: 20px;
  .siiButton {
    span {
      background: var(--contactButton);
    }
  }
}

.post-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.4;
}

.post-card__date {
  color: #666;
}

.post-card__separator {
  color: #aaa;
}

.post-card__category {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  background: var(--accent);
  padding: 0.25rem 0.75rem;
  border-radius: var(--roundedEdge);
}

/* =========================================
   Title
========================================= */

.post-card__title {
  margin: 0 0 12px;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  word-wrap: anywhere;
}

.post-card__title a {
  color: inherit;
  text-decoration: none;
}

.post-card__title a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* =========================================
   Excerpt
========================================= */

.post-card__excerpt {
  margin-bottom: 18px;

  color: #555;
  font-size: 15px;
  line-height: 1.65;
}

.post-card__excerpt p {
  margin: 0;
}

/* =========================================
   Read more
========================================= */

.post-card__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  color: inherit;
  text-decoration: none;

  font-size: 14px;
  font-weight: 600;
}

.post-card__link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* =========================================
   Loading
========================================= */

.posts-loading {
  display: none;
  margin: 40px 0;
  text-align: center;

  font-size: 14px;
}

.posts-loading.is-visible {
  display: block;
}

/* =========================================
   Empty state
========================================= */

.posts-grid__empty {
  grid-column: 1 / -1;

  margin: 40px 0;
  text-align: center;

  color: #666;
}

/* =========================================
   Load more
========================================= */

.load-more {
  display: block;
  margin: 60px auto 0;

  padding: 13px 28px;

  border: 1px solid #111;
  border-radius: 999px;

  background: #111;
  color: #fff;

  cursor: pointer;

  font: inherit;
  font-size: 14px;
  font-weight: 600;

  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.load-more:hover {
  background: transparent;
  color: #111;
}

.load-more[hidden] {
  display: none;
}

/* =========================================
   Tablet
========================================= */

@media (max-width: 900px) {
  .posts-archive {
    padding: 60px 20px;
  }

  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 45px 24px;
  }
}

/* =========================================
   Mobile
========================================= */

@media (max-width: 600px) {
  .posts-archive {
    padding: 45px 16px;
  }

  .posts-archive__header {
    margin-bottom: 32px;
  }

  .category-filter {
    margin-bottom: 35px;

    flex-wrap: nowrap;
    overflow-x: auto;

    padding-bottom: 15px;

    scrollbar-width: none;
  }

  .category-filter::-webkit-scrollbar {
    display: none;
  }

  .category-filter__button {
    flex: 0 0 auto;
  }

  .posts-grid {
    grid-template-columns: 1fr;
    gap: 45px;
  }

  .post-card__image-link {
    aspect-ratio: 16 / 10;
  }
}

/* =========================================
   Featured post
========================================= */

.featured-post {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  margin-bottom: 70px;
  background: #fff;
  padding: 3rem;
  border-radius: 50px;
}

.featured-post__image-link {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.featured-post__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.featured-post__image-link:hover .featured-post__image {
}

.featured-post__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(30px, 5vw, 70px);
}

.featured-post__content {
  .siiButton {
    span {
      background: var(--contactButton);
    }
  }
}

.featured-post__meta {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  time {
    margin-top: 0.25rem;
  }
}

.category {
  background: #cbd975;
  border-radius: 100px;
  padding: 0.25rem 0.75rem;
}

.featured-post__title {
  margin: 0 0 20px;

  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.featured-post__title a {
  color: inherit;
  text-decoration: none;
}

.featured-post__excerpt {
  margin-bottom: 25px;

  color: #555;
  font-size: 16px;
  line-height: 1.7;
}

.featured-post__excerpt p {
  margin: 0;
}

.featured-post__link {
  align-self: flex-start;

  color: inherit;
  text-decoration: none;

  font-size: 14px;
  font-weight: 600;
}

.featured-post__link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 800px) {
  .featured-post {
    grid-template-columns: 1fr;
    margin-bottom: 50px;
  }

  .featured-post__image-link {
    aspect-ratio: 16 / 10;
  }

  .featured-post__content {
    padding: 30px 24px 35px;
  }
}
