/* ============================================================
   Resources Page — 자료실
   news.css 레이아웃 기반 + 카테고리 탭
   ============================================================ */

/* ── Toolbar (탭 + 검색) ── */
.wd-res__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* ── Search (news와 동일) ── */
.wd-res__search {
  width: 440px;
}

.wd-res__search-inner {
  display: flex;
  align-items: center;
  max-width: 440px;
  height: 44px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background-color: var(--wd-surface-white);
  border-radius: 50px;
  box-sizing: border-box;
  overflow: hidden;
}

.wd-res__search-select {
  display: block;
  width: 110px;
  height: 100%;
  padding-left: 1.2rem;
  border: 0;
  background-color: transparent;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--wd-font-primary);
  color: var(--wd-text-primary);
  letter-spacing: -0.05em;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23333' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
}

.wd-res__search-select:focus { outline: none; }

.wd-res__search-input {
  flex: 1;
  height: 100%;
  border: 0;
  background-color: transparent;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--wd-font-primary);
  color: var(--wd-text-primary);
  letter-spacing: -0.05em;
  text-indent: 0.8rem;
  -webkit-appearance: none;
}

.wd-res__search-input::placeholder { color: rgba(114, 114, 114, 0.6); }
.wd-res__search-input:focus { outline: none; }
.wd-res__search-input::-webkit-search-cancel-button { display: none; }

.wd-res__search-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin: 0 5px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--wd-primary);
  color: #fff;
  cursor: pointer;
  transition: opacity var(--wd-duration-default);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.wd-res__search-btn svg {
  display: block;
  width: 14px;
  height: 14px;
}

.wd-res__search-btn:hover { opacity: 0.85; }

/* ── Category Tabs (총n건 위치) ── */
.wd-res__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wd-res__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 22px;
  border: 0;
  border-radius: 28px;
  background-color: var(--wd-surface-subtle);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--wd-font-primary);
  color: var(--wd-text-primary);
  letter-spacing: -0.03em;
  cursor: pointer;
  transition: all var(--wd-duration-default);
  white-space: nowrap;
}

.wd-res__tab:hover {
  background-color: var(--wd-border-default);
}

.wd-res__tab.is-active {
  background-color: var(--wd-secondary, #0165a0);
  color: #fff;
}

/* ── File List (news 리스트 스타일 기반) ── */
.wd-res__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid #000;
}

.wd-res__item-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 7rem;
  box-sizing: border-box;
  border-bottom: 1px solid var(--wd-border-light);
  background-color: var(--wd-surface-white);
  text-decoration: none;
  transition: all var(--wd-duration-default);
}

.wd-res__item-inner:hover { background-color: var(--wd-surface-light); }
.wd-res__item-inner:hover .wd-res__item-title { color: var(--wd-primary); }
.wd-res__item-inner:hover .wd-res__item-btn { color: var(--wd-primary); }

/* Info (카테고리 + 제목) */
.wd-res__item-info {
  display: flex;
  align-items: center;
  width: 80%;
}

.wd-res__item-cate {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--wd-primary);
  letter-spacing: -0.03em;
  margin-right: 2rem;
  min-width: 6rem;
}

.wd-res__item-title {
  display: inline-block;
  overflow: hidden;
  width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.6rem;
  font-weight: 700;
  color: #333;
  letter-spacing: -0.25px;
  transition: color var(--wd-duration-default);
}

/* Meta (날짜 + 다운로드) */
.wd-res__item-meta {
  display: flex;
  align-items: center;
  text-align: right;
}

.wd-res__item-date {
  font-family: var(--wd-font-secondary);
  font-size: 1.4rem;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.25);
  letter-spacing: -0.02em;
  margin-right: 1.6rem;
  white-space: nowrap;
}

.wd-res__item-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.15);
  transition: color var(--wd-duration-default);
}

.wd-res__item-btn svg {
  display: block;
}

/* ── Paging (news와 동일) ── */
.wd-res__paging {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.5rem;
}

.wd-res__paging-nav {
  display: flex;
  align-items: center;
  gap: 3px;
}

.wd-res__paging-num,
.wd-res__paging-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #f5f5f5;
  border-radius: 4px;
  background-color: #f3f3f3;
  font-size: 13px;
  font-weight: 500;
  color: rgba(4, 4, 4, 0.5);
  letter-spacing: -0.065em;
  text-decoration: none;
  transition: all var(--wd-duration-fast);
}

.wd-res__paging-num.is-active {
  border-color: #040404;
  background-color: var(--wd-surface-white);
  font-weight: 600;
  color: #040404;
}

.wd-res__paging-arrow {
  background: transparent;
  border: none;
}

.wd-res__paging-arrow i {
  font-size: 16px;
  margin: 0 -6px;
}

.wd-res__paging-input {
  display: flex;
  align-items: center;
}

.wd-res__paging-cur input {
  display: block;
  width: 34px;
  height: 34px;
  line-height: 34px;
  border: 1px solid #040404;
  border-radius: 4px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--wd-font-secondary);
  color: #040404;
  letter-spacing: -0.065em;
  background-color: var(--wd-surface-white);
}

.wd-res__paging-slash {
  font-size: 16px;
  color: #000;
  margin: 0 8px;
}

.wd-res__paging-total {
  font-size: 13px;
  color: #000;
  font-weight: 600;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 800px) {
  .wd-res__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .wd-res__search { width: 100%; }

  .wd-res__search-inner {
    max-width: none;
    height: 40px;
  }

  .wd-res__search-select { width: 90px; font-size: 13px; }
  .wd-res__search-input { font-size: 13px; }

  .wd-res__search-btn {
    width: 30px;
    height: 30px;
  }

  .wd-res__tabs {
    gap: 6px;
  }

  .wd-res__tab {
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
  }

  .wd-res__item-inner {
    height: auto;
    min-height: 50px;
    padding: 12px 5px 12px 12px;
  }

  .wd-res__item-info { width: 70%; }
  .wd-res__item-title { font-size: 14px; }
  .wd-res__item-cate { font-size: 12px; min-width: 5rem; margin-right: 1rem; }
  .wd-res__item-date { font-size: 1.2rem; margin-right: 10px; }

  .wd-res__paging-num,
  .wd-res__paging-arrow {
    width: 28px;
    height: 28px;
  }

  .wd-res__paging-cur input {
    width: 28px;
    height: 28px;
    line-height: 28px;
  }

  .wd-res__paging-slash { font-size: 14px; }
}

@media (max-width: 480px) {
  .wd-res__item-info {
    width: 80%;
    margin-right: 10px;
  }

  .wd-res__item-date { display: none; }

  .wd-res__paging {
    flex-direction: column;
  }

  .wd-res__paging-nav { margin-bottom: 16px; }
}
