@import url(common.css);

footer {
  background-color: var(--bg-c);
}

.main {
  padding-top: calc(var(--header-h) + max(5vw, 30px));
  padding-inline: 0;
  width: min(90%, 1000px);
  margin-inline: auto;
}
article {
  background-color: var(--bg-c);
  padding: max(5vw, 50px) 5vw;
  border-radius: 2em;
  time {
    color: var(--primary-c);
  }
  h1 {
    font-size: clamp(18px, 2vw, 34px);
    font-weight: 500;
    margin-bottom: 2rem;
  }
  > img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 1em;
  }
  .body {
    line-height: 1.8;
    margin-top: 2em;
    display: flex;
    flex-direction: column;
    gap: 2em;
    a {
      color: var(--link-c2);
      border-bottom: 1px solid;
      transition: opacity .3s;
      &:hover {
        opacity: .6;
      }
    }
  }
}

.buttons {
  margin-top: max(5vw, 50px);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.back {
  display: flex;
  align-items: center;
  gap: 1em;
  border-radius: 4px;
  &:hover span {
    background-color: var(--primary-c);
    color: #fff;
  }
  span {
    color: var(--primary-c);
    display: grid;
    font-size: 22px;
    width: 2rem;
    border: 1px solid;
    border-radius: 4px;
    aspect-ratio: 1;
    place-items: center;
    transition-property: color, background-color;
    transition-duration: 0.4s;
  }
}
.pager {
  display: flex;
  gap: 2em;
  a {
    display: flex;
    align-items: center;
    gap: 1em;
    span {
      display: grid;
      font-size: 22px;
      width: 2rem;
      border-radius: 4px;
      aspect-ratio: 1;
      place-items: center;
      border: 1px solid;
      @media (any-hover: hover) {
        border-color: transparent;
        background-color: transparent;
        transition-property: color background-color;
        transition-duration: 0.4s;
      }
    }
    @media (any-hover: hover) {
      &:hover span {
        background-color: var(--primary-c);
        color: #fff;
      }
    }
  }
}

@media (width < 768px) {
  main {
    background-color: var(--bg-c);
  }
  article {
    width: 100vw;
    margin-left: -5vw;
    padding-block: 0;
    border-radius: 0;
  }
  footer {
    background-color: #fff;
    p {
      margin-left: auto;
    }
  }
}

@media (width < 440px) {
  .buttons {
    width: 260px;
    margin-inline: auto;
    flex-direction: column;
    gap: 2em;
    align-items: stretch;
  }
  .back {
    order: 1;
    align-self: start;
  }
  .pager {
    justify-content: space-between;
    &:not(:has([rel='next'])) {
      justify-content: start;
    }
    &:not(:has([rel='prev'])) {
      justify-content: end;
    }
  }
}