@import url(lower.css);

.archive {
  padding-block: max(8vw, 60px);
  width: min(100%, 1300px);
  margin-inline: auto;
}
.sticky-box {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 5vw;
}
.cat-list,
.side-bar {
  position: sticky;
  top: 180px;
  width: max(18%, 200px);
  display: flex;
  flex-direction: column;
  gap: 1em;
  .more {
    width: 100%;
    padding: 0.6em 0;
    justify-content: center;
    margin: 0;
    font-weight: 500;
    color: #666;
  }
}
.articles {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: max(5vw, 2em) max(3vw, 1em);
  article {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1em;
    transition: translate 0.5s;
    @media (any-hover: hover) {
      &:hover {
        translate: 0 -20px;
      }
    }
  }
}

/* ---------- pagination ---------- */

.pagination {
  padding-top: max(5vw, 50px);
  font-size: max(1.3vw, 1em);
  .inner {
    display: flex;
    justify-content: center;
    gap: 1.4em;
    font-weight: 300;
  }
}
.page-numbers {
  padding: 0.8em 0.3em;
  &.current {
    border-bottom: 1px solid;
  }
  &.next {
    letter-spacing: 0.1em;
  }
}
a.page-numbers {
  position: relative;
  transform-origin: right;
  transition: scale 0.4s;
  &::before {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 1px;
    background-color: #777;
    scale: 0 1;
    transform-origin: right;
    transition: scale 0.2s;
  }
  &:hover::before {
    transform-origin: left;
    scale: 1;
  }
}

/* ---------- category ---------- */

.side-bar {
  gap: 2em;
  hgroup {
    display: flex;
    align-items: center;
    gap: 0.6em;
    h2 {
      font-size: max(1.6vw, 1.3em);
      color: #666;
      font-weight: 500;
    }
    span {
      color: var(--secondary-c);
      font-size: max(2.4vw, 1.6em);
    }
  }
}

@media (width < 540px) {
  .sticky-box {
    flex-direction: column;
    gap: 50px;
  }
  .cat-list {
    flex-wrap: wrap;
    .more {
      width: auto;
      padding: 0.4em 0.6em;
      gap: 0.4em;
    }
  }

  .cat-list,
  .side-bar {
    width: 100%;
    position: relative;
    top: 0;
    flex-direction: row;
    gap: 1em;
  }
  .side-bar {
    hgroup h2 {
      font-size: 1.2em;
    }
    > * {
      flex: 1;
    }
  }
}
