/**
 * 프론트 페이지 스타일
 *
 * front-page.php의 모든 섹션 스타일링
 * - 히어로 섹션 (.main-part)
 * - 뉴스 컨테이너 (.news-container)
 * - 연구 분야 (.research-area)
 * - 논문 컨테이너 (.paper-container)
 * - 갤러리 (.gallery-container)
 */

/* ==================== 히어로 섹션 ==================== */
.main-part {
  width: var(--full-width);
  margin-top: 0;

  & .img-container {
    width: var(--full-width);
    height: 350px;
    position: relative;
    overflow: hidden;

    & img {
      width: var(--full-width);
      height: 100%;
      object-fit: cover;
    }

    /* 투명 오버레이 */
    &::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: var(--full-width);
      height: 100%;
      background: rgba(0, 0, 0, 0.3);
      pointer-events: none;
    }
  }

  & .text-box {
    position: absolute;
    width: var(--full-width);
    top: 80px;
    z-index: 1;
    animation: fadeIn 2s ease-in-out;

    & .text-overlay_1 {
      position: relative;
      width: var(--full-width);
      color: var(--color-white);
      font-size: 40px;
      text-align: center;
      animation: slideDown 1.2s ease-in-out;
      overflow: hidden;
    }

    & .text-overlay_2 {
      width: 80%;
      max-width: var(--content-max-width);
      margin: auto;
      color: var(--color-white);
      font-size: 14px;
      text-align: center;
      animation: slideUp 1.2s ease-in-out;
    }
  }
}

/* 애니메이션 정의 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==================== 공통 컨테이너 ==================== */
.front-container {
  margin-bottom: 30px;
}

/* ==================== 학생 모집 버튼 (사용 안 함) ==================== */
.find-student {
  position: sticky;
  top: 80px;
  width: var(--content-width);
  max-width: var(--content-max-width);
  height: 20px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: end;
  margin: auto;
  margin-top: 0px;
  z-index: 10;

  & .button {
    transition: all 0.2s;
    box-shadow: 0px 5px 0px 0px var(--shadow-button);
    padding: 10px;
    margin-top: 15px;
    margin-left: 16px;
    margin-right: 30px;
    border: none;
    background-color: var(--bg-button-primary);
    border-radius: var(--radius-large);
    z-index: 100;

    &:hover {
      margin-top: 15px;
      margin-bottom: 5px;
      box-shadow: 0px 0px 0px 0px var(--shadow-button);
    }

    & p {
      margin: 0;
      padding: 0;
      font-size: 14px;
      color: var(--color-white);
      font-weight: 600;
    }
  }
}

/* ==================== 연구 분야 섹션 ==================== */
.research-area {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  width: var(--content-width);
  max-width: var(--content-max-width);
  margin: auto;
  margin-top: 20px;
  gap: 30px;

  & .research-block {
    width: calc(50% - 15px);
    min-width: 300px;

    & .title {
      margin: 0;
      margin-bottom: 10px;
      color: var(--color-dark-blue);
      text-align: left;
      font-size: 22px;
      font-weight: 600;
    }

    & .block-img {
      width: 100%;
      height: 220px;
      border-radius: var(--radius-medium);
      object-fit: cover;
      transition: opacity 0.3s ease;

      &:hover {
        opacity: 0.9;
      }
    }

    & .description {
      margin: 0;
      margin-top: 10px;
      text-align: justify;
      font-size: 14px;
      line-height: 1.6;
      color: #666;
    }
  }
}

/* ==================== 뉴스 컨테이너 (Swiper) ==================== */
.news-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-content: center;
  width: var(--content-width);
  max-width: var(--content-max-width);
  margin: auto;
  margin-top: 40px;
  margin-bottom: 40px;
  animation: fadeIn 1s ease-in-out;

  & .news-swiper {
    width: var(--full-width);
    padding: 20px 10px 40px;

    & .swiper-slide {
      display: flex;
      justify-content: center;
      align-items: center;

      & .new-bb {
        width: var(--full-width);
        height: auto;
        padding: 0 60px;

        & a {
          display: block;

          & img {
            width: var(--full-width);
            height: auto;
            border-radius: var(--radius-large);
          }
        }
      }
    }

    & .swiper-button-next,
    & .swiper-button-prev {
      color: var(--bg-nav-primary);
      width: 40px;
      height: 40px;

      &::after {
        font-size: 18px;
        font-weight: bold;
      }
    }

    & .swiper-pagination {
      & .swiper-pagination-bullet {
        background: var(--bg-darkgray-02);
        opacity: 0.5;

        &.swiper-pagination-bullet-active {
          background: var(--bg-nav-primary);
          opacity: 1;
        }
      }
    }
  }
}

/* ==================== 갤러리 컨테이너 ==================== */
.gallery-container {
  display: flex;
  flex-direction: column;
  width: var(--content-width);
  max-width: var(--content-max-width);
  margin: auto;

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

  & .g_box {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: start;
    width: var(--full-width);

    & .instar-box {
      width: 310px;
      height: min-content;
      margin-bottom: 40px;
      margin-right: 20px;
      border: 1px solid #e0e0e0;
      border-radius: 8px;
      background-color: var(--bg-white);
      overflow: hidden;

      & .ins-top {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        width: 100%;
        padding: 12px 15px;

        & .text-top {
          & .where {
            margin: 0;
            font-size: 15px;
            font-weight: 600;
            color: #1A202C;
          }

          & .date {
            margin: 0;
            margin-top: 2px;
            font-size: 13px;
            font-weight: 400;
            color: #666;
          }
        }
      }

      & .ins-img {
        width: var(--full-width);
        height: auto;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        display: block;
      }

      & .ins-actions {
        padding: 8px 15px;
        border-bottom: 1px solid #f0f0f0;

        & .action-buttons {
          display: flex;
          gap: 16px;

          & .action-btn {
            background: none;
            border: none;
            padding: 0;
            cursor: pointer;
            display: flex;
            align-items: center;
            transition: opacity 0.2s;

            &:hover {
              opacity: 0.6;
            }

            & svg {
              display: block;
            }
          }
        }
      }

      & .ins-main {
        margin: 0;
        padding: 8px 15px 12px;

        & .text {
          margin: 0;
          font-size: 15px;
          font-weight: 400;
          line-height: 1.5;
          color: #1A202C;
        }

        & .tag {
          margin: 0;
          margin-top: 8px;
          font-size: 14px;
          font-weight: 400;
          color: #666;
          line-height: 1.4;

          & b {
            color: var(--color-accent-orange);
            font-weight: 400;
          }
        }
      }
    }
  }
}

/* ==================== 섹션 타이틀 ==================== */
.g_title {
  width: var(--content-width);
  max-width: var(--content-max-width);
  margin: 0 auto;
  margin-top: 50px;
  margin-bottom: 20px;

  & p {
    margin: 0;
    padding: 0;
    padding-bottom: 10px;
    text-align: left;
    font-size: 28px;
    font-weight: 600;
    color: var(--color-dark-blue);
    border-bottom: 1px solid #e0e0e0;
    width: var(--full-width);
  }
}


/* ==================== 반응형: 모바일 (768px 이하) ==================== */
@media screen and (max-width: 768px) {
  .main-part {
    & .text-box {
      position: absolute;
      width: var(--full-width);
      top: 55px;
      z-index: 1;
      animation: fadeIn 2s ease-in-out;

      & .text-overlay_1 {
        position: relative;
        width: var(--full-width);
        color: var(--color-white);
        font-size: 32px;
        text-align: center;
        animation: slideDown 1.2s ease-in-out;
        overflow: hidden;
        margin: 12px 0;
      }

      & .text-overlay_2 {
        width: 80%;
        max-width: var(--content-max-width);
        margin: auto;
        color: var(--color-white);
        font-size: 13px;
        text-align: center;
        animation: slideUp 1.2s ease-in-out;
      }
    }
  }

  .research-area {
    & .research-block {
      width: 100%;
      min-width: unset;
    }
  }

  .gallery-container {
    & .g_box {
      & .instar-box {
        width: 100%;
        height: min-content;
        margin-bottom: 40px;
        margin-right: 0;
        margin-left: 0;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        background-color: var(--bg-white);
        overflow: hidden;
      }
    }
  }

  .news-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-content: center;
    max-width: var(--content-max-width);
    margin: 0;
    margin-top: 40px;
    margin-bottom: 40px;
    width: 100%;

    & .news-swiper {
      width: var(--full-width);
      padding: 0;

      & .swiper-slide {
        & .new-bb {
          width: var(--full-width);
          height: auto;
          padding: 0 15px;
        }
      }
    }
  }
}

/* ==================== 반응형: 태블릿 (1100px 이하) ==================== */
@media screen and (max-width: 1100px) {
  .main-part {
    & .text-box {
      position: absolute;
      width: var(--full-width);
      top: 45px;
      z-index: 1;
      animation: fadeIn 2s ease-in-out;
      transition: top 0.3s ease-in-out;
    }
  }
}
