@import url("../../css/epic/theme_tokens.css");
@import url("../Common/Common.css");

body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: #1e2224;
  font-family: "Pretendard", sans-serif;
}

/* 본문 컨테이너 */
.research-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

@media (min-width: 1300px) {
  .desktop-fixed {
    width: 1216px;
    max-width: 1216px;
    margin: 0 auto;
  }
}

/* 히어로 */
.research-hero {
  width: 100%;
  background: #0b2d1f;
  background-image: url("../../assets/images/Common/background.svg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.research-hero-inner {
  width: 100%;
  max-width: 1216px;
  margin: 0 auto;
  padding: 159px 0px 72px; /* top includes header overlap space */
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

.research-hero-title {
  font-family: "SUITE", sans-serif;
  font-size: 40px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
}

.research-hero-subtitle {
  margin: 0;
  color: var(---, #fff);
  font-family: var(---, Pretendard);
  font-size: 15px;
  font-style: normal;
  font-weight: 400;
  line-height: var(---, 20px);
  max-width: 840px;
}

.research-hero-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.research-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  margin-top: -36px;
}

.breadcrumb-icon-home {
  color: var(--Gray-400, #afb6bb);
  font-size: 16px;
}

.breadcrumb-separator-icon {
  color: var(--Gray-400, #afb6bb);
  font-size: 13px;
}

.breadcrumb-home {
  color: var(--Gray-400, #afb6bb);
  font-family: var(---, Pretendard);
  font-size: var(---, 14px);
  font-style: normal;
  font-weight: 600;
  line-height: var(---, 14px);
}

.breadcrumb-current {
  color: var(--Indigo-200, #bebdef);
  font-family: var(---, Pretendard);
  font-size: var(---, 14px);
  font-style: normal;
  font-weight: 600;
  line-height: var(---, 14px);
}
/* 본문 컨테이너 */
.research-content {
  width: 100%;
  padding: 56px 0 120px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* 탭 */
.research-tab-wrapper {
  border-radius: 0;
  padding: 0;
  display: flex;
  border-bottom: 1px solid var(---, #c2c8cc);
}

.research-tab-list {
  display: flex;
  gap: 4px;
  padding: 0;
  margin: 0;
  list-style: none;
  align-items: flex-end;
}

.research-tab-item button {
  border-radius: 8px 8px 0 0;
  border: 1px solid var(---, #c2c8cc);
  border-bottom-color: transparent;
  background: var(---, rgba(155, 164, 171, 0.1));
  display: flex;
  width: 129px;
  padding-top: 11px;
  padding-bottom: 11px;
  justify-content: center;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-family: var(---, Pretendard);
  font-size: var(---, 16px);
  font-style: normal;
  font-weight: 600;
  line-height: var(---, 16px);
  color: var(---, #6c7680);
  cursor: pointer;
}

.research-tab-item.is-active button {
  background: var(---BG, #fff);
  color: #5856d6; /* indigo */
  border: 1px solid var(---, #c2c8cc);
  border-bottom: 1px solid var(---, #c2c8cc);
  position: relative;
}

.research-tab-item.is-active button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1.5px; /* 1px 내려서 표시 */
  border-bottom: 2px solid var(---, #5856d6);
}

/* 검색/카운트 */
.research-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px;
  border-radius: var(---, 8px);
  background: var(---, rgba(155, 164, 171, 0.1));
  align-self: stretch;
}

.research-count {
  font-size: 15px;
  font-weight: 500;
  color: #3c4044;
  display: flex;
  gap: 4px;
  align-items: center;
}

/* count label (총 / 건의 연구성과...) */
.count-label {
  transform: translateY(1.5px);
  color: var(---, #0e0f11);
  font-family: var(---, Pretendard);
  font-size: var(---, 16px);
  font-style: normal;
  font-weight: 400;
  line-height: var(---, 16px);
}

/* count number (숫자) */
.count-number {
  color: var(---, #5856d6);
  font-family: var(---, Montserrat);
  font-size: var(---5-5, 20px);
  font-style: normal;
  font-weight: 600;
  line-height: var(---5-5, 20px);
}

.research-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.research-search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 0 0;
}

.research-search input {
  border-radius: var(---M-M, 8px);
  border: 1px solid var(---, #9ba4ab);
  background: var(---, #fff);
  display: flex;
  height: var(---M-M, 32px);
  padding: 8px var(---M-M, 36px) 8px var(---M-M, 14px);
  justify-content: space-between;
  align-items: center;
  flex: 1;
  color: #0e0f11;
  font-family: var(---, Pretendard);
  font-size: var(---M-M, 13px);
  font-style: normal;
  font-weight: 300;
  line-height: var(---M-M, 13px);
  box-sizing: border-box;
}

.research-search input {
  width: 269px;
  flex: 0 0 269px;
}

.research-search input::placeholder {
  color: #6c7680;
}

.research-search input:focus {
  border-radius: var(--button-input-s-button-s, 6px);
  border: 1.4px solid var(---, #5856d6);
  box-shadow: 0 2px 2px 0 var(---LV-1, rgba(14, 15, 17, 0.03)),
    0 4px 6px 0 var(---LV-2, rgba(14, 15, 17, 0.05));
  backdrop-filter: blur(50px);
  outline: none;
}

.research-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(---, #c2c8cc);
}

.research-search-clear.is-active {
  color: #5856d6;
}

.research-search-button {
  height: 40px;
  display: flex;
  height: var(---M-M, 32px);
  padding: 0 var(---M-M, 14px);
  gap: var(--button-input-mm-button-m, 6px);
  justify-content: center;
  align-items: center;
  border: none;
  border-radius: 8px;
  background: #0e0f11;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  height: var(---M-M, 32px);
}

.research-search-button:hover {
  background: #586269;
  color: #ffffff · 80%;
}

/* 리스트 */
.research-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.research-item {
  padding: 0 0 24px 0;
  border-bottom: 1px solid #e1e5e9;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.research-item:last-child {
  border-bottom: 1px solid var(---, #586269);
}

.research-item-header {
  display: flex;
  align-items: center;
}

.research-badge {
  border-radius: var(--button-input-s-button-s, 6px);
  border: 1px solid var(---, #5856d6);
  background: var(---, rgba(88, 86, 214, 0.1));
  display: flex;
  height: var(---S-S, 24px);
  padding: 0px var(--button-input-s-button-s, 12px);
  justify-content: center;
  align-items: center;
  gap: var(--button-input-s-button-s, 4px);

  color: var(---, #282691);
  font-family: var(---, Pretendard);
  font-size: var(---S-S, 12px);
  font-style: normal;
  font-weight: 700;
  line-height: var(---S-S, 12px);
}

.research-title {
  color: var(---, #0e0f11);
  font-family: var(---, Pretendard);
  font-size: var(---6-6, 18px);
  font-style: normal;
  font-weight: 400;
  line-height: var(---6-6, 26px);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.research-item .research-title {
  margin-bottom: 8px;
}

.research-title:hover {
  color: var(---, #5856d6);
  font-family: var(---, Pretendard);
  font-size: var(---6-6, 18px);
  font-style: normal;
  font-weight: 400;
  line-height: var(---6-6, 26px);
  text-decoration: none;
}

.research-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.research-meta i {
  font-size: 14px;
  color: var(---, #586269);
}

.research-meta-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.research-meta .meta-label {
  color: var(---, #586269);
  font-family: var(---, Pretendard);
  font-size: var(---, 14px);
  font-style: normal;
  font-weight: 600;
  line-height: var(---, 14px);
}

.research-meta .meta-value {
  color: var(---, #586269);
  font-family: var(---, Pretendard);
  font-size: var(---, 14px);
  font-style: normal;
  font-weight: 300;
  line-height: var(---, 14px);
}

.research-meta .meta-value.meta-count {
  color: var(---, #5856d6);
  font-weight: 600;
}

/* 페이지네이션 */
.research-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
}

.page-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(---, #0e0f11);
  text-align: center;
  font-family: var(---, Pretendard);
  font-size: var(---, 16px);
  font-style: normal;
  font-weight: 400;
  line-height: var(---, 16px);
  cursor: pointer;
}

.page-btn.nav-btn {
  border-radius: var(---999, 999px);
  background: var(---, rgba(0, 0, 0, 0.1));
  color: var(---, #0e0f11);
}

.page-prev {
  margin-right: 8px;
}

.page-next {
  margin-left: 8px;
}

.page-btn.nav-btn .icon {
  font-size: 14px;
  color: var(---, #0e0f11);
}

.page-btn:hover {
  color: var(---, #5856d6);
  font-family: var(---, Pretendard);
  font-size: var(---, 16px);
  font-style: normal;
  font-weight: 600;
  line-height: var(---, 16px);
}

.page-btn.is-active {
  border-radius: var(---999, 999px);
  background: var(---, #5856d6);
  display: flex;
  width: var(---, 24px);
  height: var(---, 24px);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(---, #fff);
  text-align: center;
  font-family: var(---, Pretendard);
  font-size: var(---, 16px);
  font-style: normal;
  font-weight: 600;
  line-height: var(---, 16px);
}

/* ==========================
   Modal
   ========================== */
.research-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(---, rgba(14, 15, 17, 0.5));
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 24px;
  box-sizing: border-box;
}

.research-modal-overlay.is-open {
  display: flex;
}

.research-modal {
  position: relative;
  border-radius: var(---, 16px);
  background: var(--white-90, rgba(255, 255, 255, 0.9));
  box-shadow: 0 0 24px 0 var(---LV-3, rgba(14, 15, 17, 0.07)),
    0 0 56px 0 var(---LV-3, rgba(14, 15, 17, 0.07)),
    0 0 72px 0 var(---LV-3, rgba(14, 15, 17, 0.07));
  backdrop-filter: blur(50px);
  width: min(800px, 90vw);
  padding: 16px;
  max-height: min(800px, calc(100vh - 48px));
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateY(var(--modal-translate-y, 0px));
  transition: transform 0.25s ease;
}

.modal-close {
  position: absolute;
  top: 32px;
  right: 32px;
  border: none;
  background: var(---, rgba(108, 114, 117, 0.15));
  padding: 0;
  border-radius: var(---999, 999px);
  display: flex;
  width: 32px;
  height: 32px;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #1e2224;
  font-size: 18px;
}

.modal-title {
  color: var(---, #0e0f11);
  font-family: var(---, SUITE);
  font-size: var(---4-4, 24px);
  font-style: normal;
  font-weight: 700;
  line-height: var(---4-4, 32px);
  padding-right: 64px;
}

.modal-drag-zone {
  display: none;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  margin-bottom: 8px;
}

.modal-drag-handle {
  width: 100px;
  height: 5px;
  border-radius: 100px;
  background: var(---, rgba(155, 164, 171, 0.3));
  touch-action: none;
}

.modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 16px 0;
  margin-bottom: 16px;
  box-sizing: border-box;
  min-height: 0;
}

.modal-meta {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(---, #586269);
  border-bottom: 1px solid var(---, #586269);
}

.modal-meta .meta-block {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(---, #1e2224);
  min-width: 0;
}

.modal-meta .value {
  color: var(---, #1e2224);
  font-family: var(---, Pretendard);
  font-size: 13px;
  font-style: normal;
  font-weight: 300;
  line-height: 13px;
}

.modal-meta .value.modal-views {
  color: var(---, #5856d6);
  font-family: var(---, Pretendard);
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
  line-height: 13px;
}

.modal-meta .label {
  color: var(---, #1e2224);
  font-family: var(---, Pretendard);
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
  line-height: 13px;
}

.modal-meta .meta-block .icon {
  font-size: 16px;
  color: var(---, #1e2224);
}

.modal-detail {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 736px; /* base 736px, allow grow/shrink within wrapper */
  width: 736px;
  max-width: 100%;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  padding-right: 8px;
  box-sizing: border-box; /* keep total width 736 while giving 8px right padding (content ~728px) */
  scrollbar-width: none; /* hide native scrollbar - custom track is used */
}

.modal-detail::-webkit-scrollbar {
  display: none;
}

.modal-detail-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
  flex: 1;
  height: 100%;
  overflow: hidden; /* contain the scroll area and track */
  min-height: 0;
  margin-right: -16px; /* extend past modal body padding */
  padding-right: 16px; /* reclaim spacing for content + shifted scrollbar */
}

.modal-scrollbar {
  display: none;
  position: absolute;
  top: 0;
  right: 0; /* keep fully visible inside wrapper */
  bottom: 0;
  width: 6px;
  background: transparent;
  border-radius: 999px;
  overflow: hidden;
  z-index: 2;
}

.modal-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: var(---, #9ba4ab);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(88, 86, 214, 0.25);
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  opacity: 0.9;
}

.modal-scrollbar-thumb.is-dragging,
.modal-scrollbar:hover .modal-scrollbar-thumb {
  background: var(---, #9ba4ab);
  opacity: 1;
}

.research-modal.is-dragging {
  transition: none;
}

.detail-row {
  border-bottom: 1px solid var(---, #6c7680);
  padding-bottom: 12px;
}

.detail-row-horizontal {
  display: flex;
  gap: 40px;
  border-bottom: none;
  padding-bottom: 0;
}

.detail-col {
  flex: 1;
  border-bottom: 1px solid var(---, #6c7680);
  padding-bottom: 12px;
}

.detail-label {
  color: var(---, #0e0f11);
  font-family: var(---, Pretendard);
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  line-height: 20px;
  margin-bottom: 8px;
}

.detail-label-ack {
  color: var(---, #586269);
}

.detail-value {
  color: var(---, #0e0f11);
  font-family: var(---, Pretendard);
  font-size: 15px;
  font-style: normal;
  font-weight: 200;
  line-height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.detail-journal-link {
  text-decoration: none;
  color: inherit;
}

.detail-value .icon {
  color: var(---, #5856d6);
  font-size: 16px;
}

.page-prev,
.page-next {
  color: #8b9096;
}

.page-prev:hover,
.page-next:hover {
  color: #5856d6;
}

body.modal-open {
  overflow-y: hidden;
}

/* 푸터 포함 오브젝트 */
/* 반응형 */
@media (max-width: 1299px) {
  .research-hero {
    height: 298px;
  }

  .research-hero-inner {
    padding: 144px 16px 72px;
    text-align: center;
    align-items: center;
    gap: 8px;
  }

  .research-hero-title {
    color: var(---, #fff);
    font-family: var(---, SUITE);
    font-size: var(---1-1, 32px);
    font-style: normal;
    font-weight: 800;
    line-height: var(---1-1, 32px);
  }

  .research-hero-meta-row {
    width: 100%;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 0;
  }

  .research-hero-subtitle {
    display: none;
  }

  .research-breadcrumb {
    margin-top: 0;
    font-size: 12px;
    display: inline-flex;
    justify-content: center;
    gap: 4px;
  }

  .breadcrumb-separator-icon {
    margin-left: -2px;
    margin-right: -2px;
  }

  .breadcrumb-home,
  .breadcrumb-current {
    font-size: 12px;
    line-height: 12px;
  }

  .research-content {
    padding: 32px 24px 80px;
  }

  .research-toolbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .research-search {
    width: 100%;
    margin-left: 0;
  }

  .research-search input {
    flex: 1;
    width: 100%;
    height: 42px;
    font-family: var(---, Pretendard);
    font-size: var(---M-M, 15px);
    font-style: normal;
    font-weight: 300;
    line-height: var(---M-M, 15px);
  }

  .research-search input::placeholder {
    color: var(---, #6c7680);
    font-family: var(---, Pretendard);
    font-size: var(---M-M, 15px);
    font-style: normal;
    font-weight: 300;
    line-height: var(---M-M, 15px);
  }

  .research-count,
  .count-label {
    color: var(---, #0e0f11);
    font-family: var(---, Pretendard);
    font-size: var(---, 15px);
    font-style: normal;
    font-weight: 300;
    line-height: var(---, 15px);
  }

  .count-number {
    color: var(---, #5856d6);
    font-family: var(---, Montserrat);
    font-size: var(---5-5, 20px);
    font-style: normal;
    font-weight: 600;
    line-height: var(---5-5, 20px);
  }

  .research-tab-wrapper {
    width: 100%;
    overflow-y: hidden;
  }

  .research-tab-list {
    width: 100%;
    justify-content: center;
    overflow-y: hidden;
  }

  .research-tab-item {
    flex: 1 1 0;
  }

  .research-tab-item button {
    width: 100%;
    font-family: var(---, Pretendard);
    font-size: var(---, 15px);
    font-style: normal;
    font-weight: 600;
    line-height: var(---, 15px);
  }

  .research-search-button {
    height: 42px;
    font-family: var(---, Pretendard);
    font-size: var(---M-M, 16px);
    font-style: normal;
    font-weight: 700;
    line-height: var(---M-M, 16px);
    color: var(---, #fff);
  }

  .research-badge {
    color: var(---, #282691);
    font-family: var(---, Pretendard);
    font-size: var(---XS-XS, 10px);
    font-style: normal;
    font-weight: 600;
    line-height: var(--button-input-XS-button-XS, 11px);
    padding: 0px 8px;
    height: 20px;
  }

  .research-title {
    color: var(---, #0e0f11);
    font-family: var(---, Pretendard);
    font-size: var(---, 15px);
    font-style: normal;
    font-weight: 400;
    line-height: var(---, 21px);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
  }

  .research-meta .meta-label,
  .research-meta .meta-value {
    font-size: 13px;
    line-height: 13px;
  }

  .research-title:hover {
    font-size: var(---, 15px);
    line-height: var(---, 21px);
    font-weight: 500;
  }

  .research-item {
    padding: 0 0 24px 0;
  }

  .research-pagination {
    margin-top: 0px;
  }

  .page-btn {
    font-size: 15px;
    line-height: 15px;
  }

  .page-btn:hover {
    font-size: 15px;
    line-height: 15px;
  }

  .page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    color: var(---, #0e0f11);
    font-family: var(---, Pretendard);
    font-size: 15px;
    font-weight: 400;
    line-height: 15px;
    position: relative;
    top: -4px;
  }
}

@media (max-width: 1299px) {
  .research-content {
    padding: 40px 24px 80px;
  }

  .research-tab-list {
    overflow-x: auto;
    white-space: nowrap;
  }

  .research-tab-item button {
    padding: 10px 16px;
  }

  .research-item {
    padding: 0 0 24px 0;
  }
}

@media (max-width: 924px) {
  .modal-meta {
    justify-content: space-between;
    gap: 0;
  }

  .research-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .research-modal {
    padding: 0px;
    width: 100%;
    margin-bottom: -16px;
    max-width: none;
    border-radius: 20px 20px 0 0;
    max-height: calc(100vh - 32px);
  }

  .modal-drag-zone {
    display: flex;
    margin-top: 0;
  }

  .modal-close {
    display: none;
  }

  .modal-title {
    font-size: 18px;
    line-height: 26px;
    padding-right: 0;
  }

  /* 모바일: 블록 하단 간격 제거 */
  .detail-row,
  .detail-row-horizontal,
  .detail-col {
    margin-bottom: 0;
  }

  /* 모바일: 좌우 패딩 16px 유지 */
  .modal-detail-wrapper {
    margin-right: 0;
    padding-right: 16px;
  }

  /* 모바일: 스크롤바 위치/크기 조정 */
  .modal-scrollbar {
    width: 4px;
    right: 0px;
  }

  .modal-scrollbar-thumb {
    width: 4px;
  }
}
