/**
 * 논문 컨테이너 스타일
 *
 * 학회 논문, 저널 논문, 책, 뉴스 등 다양한 페이지에서 공통으로 사용
 * - .paper-container: 논문 목록 컨테이너
 * - .paper-box: 개별 논문 박스
 * - .mini-cat: 카테고리 배지
 */

/* ==================== 논문 컨테이너 (Paper) ==================== */
.paper-container {
  display: flex;
  flex-direction: column;
  width: var(--content-width);
  max-width: var(--content-max-width);
  margin: auto;

  /* Personal 페이지에서는 full width 사용 */
  &.at_personal {
    width: var(--full-width);
  }

  & .g_title {
    width: var(--full-width);
    max-width: none;
    margin: 0;
    margin-top: 50px;
    margin-bottom: 20px;
  }

  & .year {
    margin: 0;
    padding: 0;
    margin-top: 45px;
    margin-bottom: 10px;
    border-bottom: 3px solid black;

    & p {
      margin: 0;
      padding: 0;
      text-align: start;
      font-size: 40px;
      color: black;
    }
  }

  & .paper-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: var(--full-width);
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;

    &:last-child {
      border-bottom: none;
    }

    & .paper-meta-wrapper {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 0;
    }

    & .index {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 60px;

      & .index-text {
        font-size: 20px;
        color: var(--color-dark-blue);
      }
    }

    & .where {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      width: 200px;

      & .where-tier {
        margin: 0;
        font-size: 15px;
        color: var(--color-accent-orange);
      }

      & .where-text {
        margin: 0;
        font-size: 22px;
        text-align: center;
        color: #023047;
      }
    }

    & .award-img {
      & img {
        width: 320px;
        min-width: 200px;
        border-radius: var(--radius-medium);
        padding: 0 40px;
      }
    }

    & .text {
      display: flex;
      flex-direction: column;
      justify-content: center;
      width: var(--full-width);

      & .link-box {
        display: flex;
        flex-direction: row;
        align-items: center;

        & .link-img {
          display: inline;
          vertical-align: middle;
          width: 18px;
          height: 18px;
        }
      }

      & .category {
        display: flex;
        flex-direction: row;
        width: var(--full-width);

        & .mini-cat {
          margin-left: 10px;
          margin-top: 10px;
          border-radius: var(--radius-small);

          & .cat {
            margin: 0;
            padding: 1px 6px;
            font-size: 13px;
            font-weight: bold;
            color: #37352F;
            border: 1px solid #37352F;
            border-radius: var(--radius-small);
            display: inline-block;
          }
        }
      }

      & .text-text {
        margin: 0;
        padding: 10px;
        padding-top: 3px;
        padding-bottom: 0;
        font-size: 17px;
        color: black;
        display: inline;

        & strong {
          color: var(--color-accent-orange);
        }

        & a {
          padding: 0;
          color: inherit;
          text-decoration: none;

          &::after {
            content: ' 🔗';
            font-size: 14px;
            opacity: 0.6;
          }

          &:hover {
            color: inherit;
          }
        }
      }

      & .text-where_full {
        margin: 0;
        padding: 10px;
        padding-top: 0;
        padding-bottom: 0;
        color: #8b8c89;
        font-weight: 500;
        font-size: 14px;
      }

      & .text-who {
        margin: 0;
        padding: 10px;
        padding-top: 0;
        color: #354f52;
        font-weight: 400;
        font-size: 14px;
      }

      & .text-aut-box {
        display: flex;
        align-items: center;
        justify-content: start;
        margin: 0;
        padding: 10px;
        padding-top: 0;

        & .each-img {
          width: 32px;
          height: 32px;
          margin-right: 3px;
          object-fit: cover;
          border-radius: 50%;
        }
      }
    }

    & .preview-picture {
      position: absolute;
      top: 50%;
      right: -315px;
      transform: translateY(-50%) scale(0.9);
      width: 300px;
      height: auto;
      opacity: 0;
      visibility: hidden;
      border-radius: var(--radius-medium);
      transition: opacity 0.2s ease-in-out;
    }

    &:hover {
      & .preview-picture {
        visibility: visible;
        opacity: 1;
        transform: translateY(-50%) scale(1);
      }
    }

    &.hidden {
      opacity: 0;
      transform: scaleY(0);
      visibility: hidden;
      height: 0;
      margin: 0;
      padding: 0;
    }
  }
}

/* ==================== Books & News 페이지 스타일 ==================== */
.books,
.news {
  padding-top: 40px;

  & .paper-box {
    margin-bottom: 30px;

    & .where {
      width: 80px;
    }
  }
}

/* ==================== 반응형: 모바일 (768px 이하) ==================== */
@media screen and (max-width: 768px) {
  .paper-container {
    & .paper-box {
      flex-direction: column;
      align-items: flex-start;

      & .paper-meta-wrapper {
        display: none;
      }

      & .index {
        display: none;
      }

      & .where {
        width: auto;
        align-items: flex-start;

        & .where-text {
          text-align: left;
        }
      }

      & .where {
        display: inline-flex;
      }

      & .text {
        width: 100%;
        margin-top: 10px;
      }
    }

    & .year {
      margin: 0;
      padding: 0;
      margin-top: 25px;
      margin-bottom: 10px;
      border-bottom: 3px solid black;

      & p {
        margin: 0;
        padding: 0;
        text-align: start;
        font-size: 30px;
        color: black;
      }
    }
  }

  .preview-picture {
    display: none !important;
  }

  /* Conference, Journal 페이지에서만 index 보이기 */
  .page-conference_papers,
  .page-journal_papers {
    & .paper-container {
      & .paper-box {
        & .index {
          display: inline-flex !important;
          width: auto;
          margin-right: 20px;
        }

        & .where {
          margin-left: 0;
        }
      }
    }
  }

  .paper-container {
    & .paper-box {
      /* Awards 페이지 이미지 가운데 정렬 */
      & .award-img {
        width: 100% !important;
        display: flex;
        justify-content: center;

        & img {
          width: 100%;
          max-width: 320px;
        }
      }
    }
  }
}
