:root {
  --show-grey: #eee;
  --top-text-shadow: 1px 1px var(--top-bg), -1px -1px var(--top-bg),
    2px 2px var(--top-bg), -2px -2px var(--top-bg);
}

.questions_show {
  padding: 2.5rem 1rem 0;
}

.top {
  width: 100vw;
  translate: -1rem;
  margin-bottom: 2rem;
  padding: 2rem 1rem;
  background: var(--show-grey);
  overflow: hidden;

  > p {
    font-size: 5rem;
    position: absolute;
    bottom: 0;
    right: 0;
    opacity: 0.2;
    z-index: -1;
    rotate: 15deg;
  }
}

.title {
  h1 {
    position: relative;
    z-index: 1;
    margin: 0;
    text-shadow: var(--top-text-shadow);
  }

  p {
    margin-top: 0.5rem;
    white-space: pre-line;
    text-shadow: var(--top-text-shadow);
  }
}

.info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;

  time {
    font-size: 0.875rem;
    opacity: 0.8;
  }
}

.form {
  position: relative;
  z-index: 1;
  &:has(.tori) {
    padding-bottom: 4rem;
  }

  h2 {
    margin-bottom: 1rem;
    padding: 0;
    color: inherit;
    background: transparent;
    filter: none;
    &:before,
    &:after {
      content: none;
    }
  }

  fieldset {
    &:not(:first-of-type) {
      margin-top: 2rem;
    }
    &:last-of-type {
      margin-top: 4rem;
    }
  }

  label {
    display: flex;
    align-items: end;
    margin-bottom: 0.25rem;

    span {
      margin-inline: auto 0.25rem;
    }
  }
}

.comment_body {
  > div {
    position: relative;
  }

  textArea {
    min-height: 12rem;
  }

  .tori {
    width: auto;
    position: absolute;
    top: 50%;
    right: 2rem;
    pointer-events: none;
    opacity: 0;
    translate: 25% -100%;
    transition:
      opacity 0.3s,
      translate 0.3s;

    &.stay {
      opacity: 1;
      translate: 0 -50%;
    }
  }
}

.questions_show .icon_button {
  position: relative;

  button {
    padding: 0.75rem 4.5rem 0.75rem 1rem;
    font-size: 1.5rem;
    line-height: 1;
  }

  span {
    bottom: initial;
    top: 50%;
    right: 1rem;
    translate: 0 -50%;
    line-height: 1;
  }
}

.comment_submit {
  p {
    display: table;
    margin: 0 auto 1rem;
    font-size: 0.875rem;
    color: var(--red);
  }
}

.comment {
  margin-top: 4rem;
}

.comments_search {
  margin-bottom: 2rem;

  form {
    position: relative;
    margin-bottom: 1rem;

    .input_text {
      border-radius: 50vh;
      padding: 0.75rem 3.5rem 0.75rem 1rem;
    }

    button {
      display: grid;
      place-content: center;
      background: conic-gradient(
        from -90deg at -5% center,
        #f9cc45,
        rgb(255, 132, 91),
        var(--red),
        #ff9054
      );
      color: var(--white);
      font-weight: bold;
      white-space: nowrap;
      border-radius: 50%;
      line-height: 1;
      width: 3rem;
      height: 3rem;
      outline: 1px solid var(--white);
      outline-offset: -3px;
      position: absolute;
      top: 50%;
      right: 0;
      translate: 0 -50%;
    }
  }

  .sort_select {
    position: relative;
    width: fit-content;
    width: -moz-fit-content;
    margin-left: auto;
    background: var(--white);
    border: 1px solid #999;
    border-radius: 50vh;
    &::after {
      content: "";
      width: 1rem;
      height: 1rem;
      background: url(/assets/icon/caret.svg) no-repeat center / contain;
      filter: invert(1);
      position: absolute;
      top: 50%;
      right: 0.5rem;
      translate: 0 -50%;
      pointer-events: none;
      rotate: 90deg;
    }

    select {
      padding: 0.5rem 2rem 0.5rem 1rem;
    }
  }
}

.scroll {
  position: fixed;
  bottom: 7rem;
  left: 0;
  z-index: 10;
  translate: -100%;
  background: rgb(255 255 255 / 0.85);
  writing-mode: vertical-rl;
  font-size: 0.875rem;
  font-weight: bold;
  padding: 0.5rem 0.5rem 1rem;
  border: 1px solid #ccc;
  border-radius: 0 1rem 1rem 0;
  transition: translate 0.3s;
  &.active {
    translate: 0;
  }

  img {
    filter: invert(1);
    rotate: 270deg;
    width: 1.5rem;
    height: 1.5rem;
  }
}

.dialog {
  padding: 0;

  > div {
    padding: 1rem;
  }
}

@media (min-width: 744px) {
  .questions_show {
    display: grid;
    grid-template-columns: 1fr 50%;
    align-items: start;
    gap: 2rem;
    padding: 5rem 2rem 0;
  }

  .left_wrapper {
    grid-column: 1;
    position: sticky;
    top: 2rem;
    padding-bottom: 2rem;
  }

  .top {
    position: relative;
    width: 100%;
    translate: none;
    border-radius: 0.25rem;
    padding: 1rem;

    > p {
      z-index: 1;
    }
  }

  .title {
    h1 {
      font-size: 1rem;
    }

    p {
      font-size: 0.875rem;
    }
  }

  .comment_body .tori {
    width: 16rem;
    position: fixed;
    top: 5rem;
    left: calc(50% + 4rem);
    right: initial;
    translate: none;
    opacity: 1;
    &.stay {
      translate: none;
    }
  }

  .comment {
    margin-top: 0;
    grid-column: 2;
  }

  .scroll {
    display: none;
  }
}

@media (min-width: 1024px) {
  .questions_show {
    grid-template-columns: 40% 1fr;
  }

  .left_wrapper {
    overflow-y: auto;
    max-height: 80vh;
    padding: 0 1rem 2rem 0;
  }

  .form {
    fieldset {
      &:not(:first-of-type) {
        margin-top: 1rem;
      }

      .comment_submit {
        margin-top: 2rem;
      }
    }
  }

  .comment_body .tori {
    width: 20rem;
    left: calc(50% + 2rem);
  }

  .comment {
    h2 {
      padding-left: 2.5rem;
      &::before {
        width: 97.5%;
      }
    }
  }
}

@media (min-width: 1280px) {
  .left_wrapper {
    max-height: 90vh;
  }
}
