/* ===========================
   insights.css — homepagerenewal/insight.html 시안을 블로그 목록(/blog/)에 이식
   마크업/치수는 시안의 `.in-*` 규칙을 그대로 따르되, 데이터는 실제 Post/Category다.

   시안 style.css는 전역 :root 변수(--navy/--orange/--max/--ink)와 .wrap에 의존하는데
   이 프로젝트의 design-tokens.css / renewal.css에는 둘 다 없다.
   전역을 오염시키지 않기 위해 .insights 스코프 안에서 자체 정의한다.
   =========================== */

.insights {
  --in-white: #fafafa;
  --in-navy: #0d1b3e;
  --in-orange: #ff7900;
  --in-ink: #1b1b1b;
  --in-border: #c7cbce;
  --in-max: 1200px;
}

/* 시안의 .wrap 대체. 전역 .wrap이 없으므로 인사이트 전용 컨테이너를 둔다. */
.insights .in-wrap {
  width: 100%;
  max-width: var(--in-max);
  margin: 0 auto;
  padding: 0 40px;
}

/* ── Hero ── */
.insights .in-hero {
  background: var(--in-navy);
  overflow: hidden;
}

.insights .in-hero-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 40px;
  min-height: 480px;
}

.insights .in-hero-txt {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 21px;
  padding: 70px 0;
}

.insights .in-hero-txt h1 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(40px, 5vw, 64px);
  letter-spacing: -1.28px;
  line-height: 1.3;
  color: #fff;
}

.insights .in-hero-txt p {
  margin: 0;
  font-weight: 500;
  font-size: clamp(17px, 2vw, 24px);
  letter-spacing: -0.24px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

.insights .in-hero-art {
  flex: 0 0 auto;
  align-self: stretch;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  overflow: hidden;
}

.insights .in-hero-art img {
  height: 94%;
  width: auto;
  max-width: none;
  display: block;
}

/* ── 카테고리 탭 ── */
.insights .in-tabs {
  background: var(--in-ink);
}

.insights .in-tabs-inner {
  max-width: var(--in-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 94px;
}

.insights .in-tab {
  display: flex;
  align-items: center;
  padding: 8px 40px;
  font-weight: 500;
  font-size: clamp(16px, 1.6vw, 24px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  transition: color 0.2s;
}

.insights .in-tab:last-child {
  border-right: none;
}

.insights .in-tab.active,
.insights .in-tab:hover {
  color: #fff;
  font-weight: 700;
}

/* ── 카드 리스트 ── */
.insights .in-list {
  background: var(--in-white);
  padding: 100px 0 120px;
}

.insights .in-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto 44px;
  background: #fff;
  border: 1px solid var(--in-border);
  border-radius: 999px;
  padding: 12px 12px 12px 22px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.insights .in-search:focus-within {
  border-color: var(--in-orange);
  box-shadow: 0 0 0 3px rgba(255, 121, 0, 0.15);
}

.insights .in-search .ic {
  flex: 0 0 auto;
  color: #8a8f98;
}

.insights .in-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-weight: 500;
  font-size: 16px;
  color: var(--in-ink);
}

.insights .in-search input::placeholder {
  color: #9aa0a8;
}

.insights .in-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.insights .in-search button {
  flex: 0 0 auto;
  border: none;
  cursor: pointer;
  background: var(--in-navy);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.15px;
  padding: 10px 22px;
  border-radius: 999px;
  transition: background 0.2s;
}

.insights .in-search button:hover {
  background: var(--in-orange);
}

/* 검색 로딩 인디케이터 — 검색 버튼 왼쪽에 겹쳐 표시 */
.insights .in-search__loading {
  position: absolute;
  right: 96px;
  top: 50%;
  transform: translateY(-50%);
  color: #8a8f98;
  pointer-events: none;
}

.insights .in-search__loading svg {
  animation: in-spin 0.9s linear infinite;
}

@keyframes in-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── 검색 자동완성 패널 ── */
.insights .in-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  z-index: 30;
  background: #fff;
  border: 1px solid var(--in-border);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(13, 27, 62, 0.14);
  overflow: hidden;
  max-height: 380px;
  overflow-y: auto;
}

.insights .in-suggest-item {
  display: block;
  padding: 14px 20px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #eef0f2;
  transition: background 0.15s;
}

.insights .in-suggest-item:last-child {
  border-bottom: none;
}

.insights .in-suggest-item:hover {
  background: #f6f7f8;
}

.insights .in-suggest-item__title {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.45;
  color: var(--in-ink);
}

.insights .in-suggest-item__snippet {
  margin-top: 4px;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(42, 42, 42, 0.72);
}

.insights .in-suggest-item__meta {
  margin-top: 6px;
  font-size: 13px;
  color: #8a8f98;
}

.insights .in-suggest-empty,
.insights .in-suggest-error {
  padding: 18px 20px;
  font-weight: 500;
  font-size: 15px;
  color: #8a8f98;
  text-align: center;
}

/* ── 카드 그리드 ── */
.insights .in-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.insights .in-card {
  background: #fff;
  border: 0.88px solid var(--in-border);
  border-radius: 16px;
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.insights .in-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(13, 27, 62, 0.12);
}

.insights .in-card a {
  text-decoration: none;
  color: inherit;
}

.insights .in-card .thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 9px;
  overflow: hidden;
  background: #b7b7b7;
}

.insights .in-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 커버 없는 글 — 회색 판 위 플레이스홀더 아이콘 */
.insights .in-card .thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.75);
}

.insights .in-card .body {
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex: 1 1 auto;
}

/* 시안은 카테고리 1개지만 Post는 M2M이라 복수 가능 — 가로 배치로 감싼다 */
.insights .in-card .cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.insights .in-card .cat {
  align-self: flex-start;
  background: var(--in-orange);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.15px;
  line-height: 1.42;
  padding: 5px 18px;
  border-radius: 22px;
}

.insights .in-card h3 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(1.5rem, 2.2vw, 1.75rem);
  letter-spacing: -0.56px;
  line-height: 1.5;
  color: #111;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.insights .in-card:hover h3 {
  color: var(--in-orange);
}

.insights .in-card .ex {
  margin: 0;
  font-weight: 500;
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.55;
  color: rgba(42, 42, 42, 0.72);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.insights .in-card .date {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.6;
  color: #2a2a2a;
  margin-top: auto;
  padding-top: 6px;
}

.insights .in-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-weight: 500;
  font-size: 18px;
  color: #8a8f98;
  padding: 60px 0;
}

/* ── 페이지네이션 ── */
.insights .in-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-top: 50px;
}

.insights .in-pager:empty {
  margin-top: 0;
}

.insights .in-pager .pg-num,
.insights .in-pager .pg-arrow {
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 24px;
  text-decoration: none;
  line-height: 1;
}

.insights .in-pager .pg-num {
  border: 1px solid var(--in-border);
  color: var(--in-ink);
}

.insights .in-pager .pg-num.active {
  border-color: var(--in-orange);
  color: var(--in-orange);
}

.insights .in-pager .pg-arrow {
  color: var(--in-ink);
  margin: 0 4px;
  font-size: 28px;
}

.insights .in-pager .pg-arrow:hover,
.insights .in-pager .pg-num:hover {
  color: var(--in-orange);
}

/* ── 반응형 (시안 브레이크포인트 그대로) ── */
@media (max-width: 1000px) {
  .insights .in-hero-inner {
    flex-direction: column;
    text-align: center;
    padding: 60px 0 0;
    min-height: 0;
  }
  .insights .in-hero-txt {
    align-items: center;
    padding: 0 0 30px;
  }
  .insights .in-hero-art {
    align-self: center;
  }
  .insights .in-hero-art img {
    height: auto;
    width: 100%;
    /* 시안 420px에서 20% 확대 */
    max-width: 504px;
  }
  .insights .in-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .insights .in-tab {
    padding: 8px 22px;
  }
  .insights .in-list {
    padding: 70px 0 80px;
  }
}

@media (max-width: 640px) {
  .insights .in-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Insight mobile (≤560px) — insight_standalone.html 시안 이식 =====
   기존 640px 블록에 넣어뒀던 hero 문단 nowrap 해제는 시안이 560px에서 처리하므로 이쪽으로 옮겼다. */
@media (max-width: 560px) {
  /* 시안 공용 .wrap{padding:0 20px} 대응 — 이 프로젝트는 페이지별 .in-wrap을 쓴다 */
  .insights .in-wrap {
    padding: 0 20px;
  }

  /* Hero */
  .insights .in-hero-inner {
    padding: 48px 0 0;
  }
  .insights .in-hero-txt {
    gap: 14px;
  }
  .insights .in-hero-txt h1 {
    font-size: clamp(32px, 9vw, 44px);
  }
  .insights .in-hero-txt p {
    font-size: 15px;
    white-space: normal;
  }
  .insights .in-hero-art img {
    /* 시안 300px에서 20% 확대 */
    max-width: 360px;
  }

  /* filter tabs */
  .insights .in-tabs-inner {
    min-height: 0;
    padding: 12px 4px;
  }
  .insights .in-tab {
    padding: 8px 14px;
    font-size: 15px;
  }

  /* card list */
  .insights .in-list {
    padding: 48px 0 64px;
  }
  .insights .in-search {
    margin-bottom: 32px;
    padding: 10px 10px 10px 18px;
  }
  .insights .in-search input {
    font-size: 15px;
  }
  .insights .in-card {
    padding: 24px 20px;
    gap: 16px;
  }
  .insights .in-card h3 {
    font-size: 1.375rem;
  }
  .insights .in-card .ex {
    font-size: 15px;
  }
  .insights .in-card .date {
    font-size: 14px;
  }
  .insights .in-pager {
    margin-top: 36px;
  }

  /* 시안에 없는 요소 — 검색 로딩 스피너는 프로젝트 전용이다.
     좁은 폭에서 검색 버튼과 겹치므로 숨긴다. */
  .insights .in-search__loading {
    display: none;
  }
}
