/* ==========================================================================
   column-list.css — 칼럼 목록 페이지 (Track L · SPEC2 §2 차별화 리디자인)
   1차(Track A)는 언웹스 .blog-list 1:1 이식이었다. 이번 개편의 차별점 4가지:
     1) 사이드바 좌 220px → 우 260px (DOM: main 먼저, ≤1180 에선 order로 상단 복귀)
     2) 피처드 헤드라인 카드 .kdc-featured (언웹스에 없는 요소)
     3) 카드: 회색 배경 → 흰 배경 + 보더 + 이미지 좌상단 카테고리 뱃지
     4) 상단 타이틀 가운데 → 좌측 정렬 + primary 강조선
   전부 .kdc-scope 하위 스코프. 색 토큰은 column-base.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   2컬럼 레이아웃: 본문 + 우측 사이드바 260px (SPEC2 §2.1)
   그리드 트랙은 반드시 minmax(0, …) — min-width:auto blowout 방지(1차 때 실측 버그)
   -------------------------------------------------------------------------- */
.kdc-scope .kdc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 60px;
  margin-top: 48px;
}

/* ◆ 사이드바 — 우측 · 스티키 유지 */
.kdc-scope .kdc-sidebar {
  min-width: 0;
  position: sticky;
  top: calc(var(--kdc-header-h, 100px) + 32px);
  align-self: start;
}

/* 검색바 (pill 유지) */
.kdc-scope .kdc-search {
  position: relative;
  margin-bottom: 36px;
}

.kdc-scope .kdc-search-input {
  width: 100%;
  height: 46px;
  padding: 0 48px 0 18px;
  border: 1px solid var(--kdc-border);
  border-radius: 999px;
  background: var(--kdc-white);
  font-size: 14px;
  font-family: inherit;
  color: var(--kdc-text);
  letter-spacing: -0.01em;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.kdc-scope .kdc-search-input:focus {
  outline: none;
  border-color: var(--kdc-primary);
}

.kdc-scope .kdc-search-input::placeholder {
  color: #b5b9c1;
}

.kdc-scope .kdc-search-input::-webkit-search-decoration,
.kdc-scope .kdc-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.kdc-scope .kdc-search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--kdc-sub);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.kdc-scope .kdc-search-btn:hover {
  color: var(--kdc-primary);
  background: rgba(var(--kdc-primary-rgb), 0.08);
}

.kdc-scope .kdc-search-btn svg {
  width: 18px;
  height: 18px;
}

/* 사이드바 타이틀 */
.kdc-scope .kdc-sidebar-tit {
  font-size: 22px;
  font-weight: 800;
  color: var(--kdc-text);
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--kdc-border);
  letter-spacing: -0.02em;
}

/* 카테고리 리스트 (+글 수 +활성 인디케이터 유지) */
.kdc-scope .kdc-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 100%;
}

.kdc-scope .kdc-cat-item {
  margin: 0;
}

.kdc-scope .kdc-cat-item + .kdc-cat-item {
  border-top: 1px solid var(--kdc-border-soft);
}

.kdc-scope .kdc-cat-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 4px 14px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--kdc-sub);
  transition: color 0.2s ease;
  position: relative;
}

/* 활성 인디케이터 — 우측 사이드바에 맞춰 링크 안쪽 좌측에 점 */
.kdc-scope .kdc-cat-link::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--kdc-primary);
  transform: translateY(-50%) scale(0);
  transition: transform 0.2s ease;
}

.kdc-scope .kdc-cat-link:hover {
  color: var(--kdc-text);
}

.kdc-scope .kdc-cat-item.is-active .kdc-cat-link {
  color: var(--kdc-text);
  font-weight: 700;
}

.kdc-scope .kdc-cat-item.is-active .kdc-cat-link::before {
  transform: translateY(-50%) scale(1);
}

.kdc-scope .kdc-cat-name {
  flex: 1;
  letter-spacing: -0.01em;
}

.kdc-scope .kdc-cat-count {
  font-size: 13px;
  color: var(--kdc-sub);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   ◆ 상단 타이틀 — 좌측 정렬 + 강조선 (SPEC2 §2.4 · base.css 오버라이드)
   -------------------------------------------------------------------------- */
.kdc-list-con .kdc-tit-box {
  text-align: left;
}

.kdc-list-con .kdc-tit::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--kdc-primary);
  margin-top: 20px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   ◆ 피처드 헤드라인 카드 (SPEC2 §2.2 · 언웹스에 없는 요소)
   -------------------------------------------------------------------------- */
.kdc-scope .kdc-featured {
  min-width: 0;
  margin-bottom: 40px;
}

.kdc-scope .kdc-featured-link {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 0;
  background: #f7f8fa;
  border-radius: 20px;
  overflow: hidden;
  color: var(--kdc-text);
}

.kdc-scope .kdc-featured-img {
  min-width: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--kdc-bg);
  transform: translateZ(0);
  isolation: isolate;
}

.kdc-scope .kdc-featured-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.kdc-scope .kdc-featured-link:hover .kdc-featured-img img {
  transform: scale(1.04);
}

.kdc-scope .kdc-featured-body {
  min-width: 0;
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
}

.kdc-scope .kdc-featured-badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--kdc-white);
  border: 1px solid var(--kdc-border);
  font-size: 12px;
  font-weight: 700;
  color: var(--kdc-text);
}

.kdc-scope .kdc-featured-tit {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.025em;
  color: var(--kdc-text);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
  transition: color 0.2s ease;
}

.kdc-scope .kdc-featured-link:hover .kdc-featured-tit {
  color: var(--kdc-primary);
}

.kdc-scope .kdc-featured-desc {
  font-size: 16px;
  line-height: 1.7;
  color: var(--kdc-sub);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
}

.kdc-scope .kdc-featured-meta {
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   ◆ 본문 카드 그리드 (SPEC2 §2.3 — 흰 배경 + 보더, 언웹스 회색 카드와 차별)
   -------------------------------------------------------------------------- */
.kdc-scope .kdc-main {
  min-width: 0;
}

.kdc-scope .kdc-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 24px;
}

.kdc-scope .kdc-item {
  min-width: 0;
}

.kdc-scope .kdc-item-link {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--kdc-text);
  background: var(--kdc-white);
  border: 1px solid var(--kdc-border);
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.35s ease, border-color 0.25s ease, box-shadow 0.35s ease;
}

.kdc-scope .kdc-item-link:hover {
  transform: translateY(-3px);
  border-color: var(--kdc-primary);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.kdc-scope .kdc-item-link:hover .kdc-item-tit {
  color: var(--kdc-primary);
}

/* 카드 이미지 — 뱃지 기준점(position:relative) */
.kdc-scope .kdc-item-img {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--kdc-bg);
  transform: translateZ(0);
  isolation: isolate;
}

.kdc-scope .kdc-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.kdc-scope .kdc-item-link:hover .kdc-item-img img {
  transform: scale(1.05);
}

/* 카테고리 뱃지 — 이미지 좌상단 (SPEC2 §2.3 신설 · 언웹스에 없는 요소) */
.kdc-scope .kdc-item-badge {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 12px;
  font-weight: 700;
  color: var(--kdc-text);
  white-space: nowrap;
}

.kdc-scope .kdc-item-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #c8ccd2;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 22px;
}

/* 카드 정보 */
.kdc-scope .kdc-item-info {
  padding: 24px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kdc-scope .kdc-item-tit {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--kdc-text);
  margin: 0;
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
  transition: color 0.2s ease;
}

.kdc-scope .kdc-item-meta {
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--kdc-sub);
}

.kdc-scope .kdc-item-date {
  letter-spacing: 0;
}

.kdc-scope .kdc-item-readtime {
  position: relative;
  padding-left: 11px;
}

.kdc-scope .kdc-item-readtime::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 10px;
  background: currentColor;
  opacity: 0.35;
  transform: translateY(-50%);
}

/* 글 없음 */
.kdc-scope .kdc-empty {
  text-align: center;
  padding: 80px 0;
  color: var(--kdc-sub);
  margin: 0;
}

/* --------------------------------------------------------------------------
   ◆ 검색 결과 0건 (SPEC §4.6 유지)
   -------------------------------------------------------------------------- */
.kdc-scope .kdc-search-empty {
  margin-top: 0;
  padding: 72px 40px;
  text-align: center;
  background: var(--kdc-card);
  border-radius: 20px;
}

.kdc-scope .kdc-search-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--kdc-white);
  color: var(--kdc-sub);
  font-size: 32px;
  margin: 0 auto 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.kdc-scope .kdc-search-empty-icon svg {
  width: 32px;
  height: 32px;
}

.kdc-scope .kdc-search-empty-tit {
  font-size: 24px;
  font-weight: 800;
  color: var(--kdc-text);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.kdc-scope .kdc-search-empty-txt {
  font-size: 15px;
  line-height: 1.7;
  color: var(--kdc-sub);
  margin: 0 0 32px;
}

.kdc-scope .kdc-search-empty-txt strong {
  color: var(--kdc-text);
  font-weight: 700;
}

.kdc-scope .kdc-search-empty-form {
  max-width: 460px;
  margin: 0 auto 36px;
}

.kdc-scope .kdc-search-empty-cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
}

.kdc-scope .kdc-search-empty-cats-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--kdc-sub);
  letter-spacing: 0.02em;
  margin-right: 6px;
}

.kdc-scope .kdc-search-empty-cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 16px;
  background: var(--kdc-white);
  border: 1px solid var(--kdc-border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--kdc-text);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.kdc-scope .kdc-search-empty-cat span {
  color: var(--kdc-sub);
  font-weight: 500;
}

.kdc-scope .kdc-search-empty-cat:hover {
  background: var(--kdc-primary);
  color: var(--kdc-white);
  border-color: var(--kdc-primary);
}

.kdc-scope .kdc-search-empty-cat:hover span {
  color: var(--kdc-white);
  opacity: 0.8;
}

.kdc-scope .kdc-search-empty-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--kdc-primary);
  transition: gap 0.2s ease;
}

.kdc-scope .kdc-search-empty-back:hover {
  gap: 8px;
}

/* --------------------------------------------------------------------------
   반응형 (1180 / 768 / 480 유지 · SPEC2 §2.1 사이드바 order 조정)
   -------------------------------------------------------------------------- */

/* ≤1180px — 1컬럼 + 사이드바가 위로(검색·카테고리 우선) + 카테고리 칩 랩 */
@media (max-width: 1180px) {
  .kdc-scope .kdc-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    margin-top: 36px;
  }

  /* DOM은 main 먼저지만 모바일에선 사이드바를 위로 */
  .kdc-scope .kdc-sidebar {
    order: -1;
    position: static;
    top: auto;
  }

  .kdc-scope .kdc-search {
    margin-bottom: 28px;
  }

  .kdc-scope .kdc-sidebar-tit {
    font-size: 18px;
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  /* 카테고리 → 칩 (여러 줄 랩 — 언웹스 원문 동작) */
  .kdc-scope .kdc-cat-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    row-gap: 8px;
    padding-bottom: 4px;
  }

  .kdc-scope .kdc-cat-item {
    flex: 0 0 auto;
  }

  .kdc-scope .kdc-cat-item + .kdc-cat-item {
    border-top: 0;
  }

  .kdc-scope .kdc-cat-link {
    padding: 10px 16px;
    border: 1px solid var(--kdc-border);
    border-radius: 999px;
    background: var(--kdc-white);
    font-size: 13px;
    white-space: nowrap;
  }

  .kdc-scope .kdc-cat-link::before {
    display: none;
  }

  .kdc-scope .kdc-cat-item.is-active .kdc-cat-link {
    background: var(--kdc-primary);
    border-color: var(--kdc-primary);
    color: var(--kdc-white);
  }

  .kdc-scope .kdc-cat-item.is-active .kdc-cat-count {
    color: var(--kdc-white);
    opacity: 0.85;
  }

  /* 피처드 본문 패딩 축소 */
  .kdc-scope .kdc-featured-body {
    padding: 32px 32px;
  }

  .kdc-scope .kdc-featured-tit {
    font-size: 22px;
  }

  /* 카드 */
  .kdc-scope .kdc-list {
    gap: 28px 20px;
  }

  .kdc-scope .kdc-item-info {
    padding: 22px 22px 20px;
  }

  .kdc-scope .kdc-item-tit {
    font-size: 17px;
  }
}

/* ≤768px — 피처드 1컬럼 스택 + 카드 1컬럼 */
@media (max-width: 768px) {
  .kdc-scope .kdc-featured {
    margin-bottom: 32px;
  }

  .kdc-scope .kdc-featured-link {
    grid-template-columns: minmax(0, 1fr);
  }

  .kdc-scope .kdc-featured-img {
    aspect-ratio: 16 / 9;
  }

  .kdc-scope .kdc-featured-body {
    padding: 26px 24px 28px;
    gap: 12px;
  }

  .kdc-scope .kdc-featured-tit {
    font-size: 20px;
  }

  .kdc-scope .kdc-featured-desc {
    font-size: 15px;
  }

  .kdc-scope .kdc-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .kdc-scope .kdc-item-info {
    padding: 22px 22px 18px;
  }

  .kdc-scope .kdc-search-empty {
    padding: 56px 24px;
  }

  .kdc-scope .kdc-search-empty-tit {
    font-size: 20px;
  }
}

/* ≤480px — 카드 패딩 축소 */
@media (max-width: 480px) {
  .kdc-scope .kdc-featured-body {
    padding: 22px 20px 26px;
  }

  .kdc-scope .kdc-item-info {
    padding: 20px 20px 18px;
  }

  .kdc-scope .kdc-item-tit {
    font-size: 17px;
  }
}

/* --------------------------------------------------------------------------
   상단 오프셋 — 헤더가 fixed라 섹션 상단 패딩에 헤더 높이를 더해야
   "헤더 아래 여백"(약 114~120px)이 나온다.
   -------------------------------------------------------------------------- */
.kdc-list-con {
  padding-top: calc(var(--kdc-header-h, 100px) + var(--kdc-section-py));
}
