/**
 * 광고포털 허브(IDX) — 유형별 표시 전용 스타일
 *
 * · 모바일 우선. 데스크톱은 min-width 로 얹는다.
 * · 아이콘 없음(텍스트 라벨) · 폰트는 9단계 토큰(--fs-*)만 사용.
 * · 본문 폭은 셸(pub-content-wrap--full)에 위임 — 여기서 max-width 를 걸지 않는다.
 */

.ads-hub {
  --ads-line: #e2e8f0;
  --ads-sub: #64748b;
  --ads-ink: #1e293b;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 4px 0 32px;
  color: var(--ads-ink);
}

.ads-hub-sec {
  border: 1px solid var(--ads-line);
  border-radius: 12px;
  background: #fff;
  padding: 16px 14px;
}

.ads-sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.ads-sec-head h2 {
  margin: 0;
  font-size: var(--fs-lg, 18px);
  font-weight: 700;
  letter-spacing: -0.3px;
}

.ads-sec-head .ads-sec-desc {
  margin: 0;
  font-size: var(--fs-sm, 15px);
  color: var(--ads-sub);
}

.ads-sec-head .ads-result-count {
  margin-left: auto;
  font-size: var(--fs-sm, 15px);
  color: var(--ads-sub);
}

/* ── 유형별 표시 탭 ───────────────────────────── */
.ads-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ads-type-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--ads-line);
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: var(--fs-base, 16px);
  text-decoration: none;
}

.ads-type-tab__count {
  font-size: var(--fs-sm, 15px);
  color: var(--ads-sub);
}

.ads-type-tab.is-active {
  border-color: var(--pub-accent, #dc2626);
  background: var(--pub-accent, #dc2626);
  color: #fff;
}

.ads-type-tab.is-active .ads-type-tab__count {
  color: rgba(255, 255, 255, 0.85);
}

/* ── 선택 유형 요약 ───────────────────────────── */
.ads-type-summary {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ads-line);
}

.ads-type-summary p {
  margin: 0 0 8px;
  font-size: var(--fs-base, 16px);
  color: #334155;
}

.ads-place-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ads-place-chips a {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--ads-line);
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: var(--fs-sm, 15px);
  text-decoration: none;
}

.ads-place-chips a.is-active {
  border-color: var(--pub-accent, #dc2626);
  color: var(--pub-accent, #dc2626);
  font-weight: 600;
}

/* ── 활성 필터 요약 ───────────────────────────── */
.ads-filter-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: var(--fs-sm, 15px);
  color: var(--ads-sub);
}

.ads-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--ads-line);
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  text-decoration: none;
}

.ads-filter-reset {
  color: var(--pub-accent, #dc2626);
  text-decoration: none;
  font-weight: 600;
}

/* ── 정렬 ─────────────────────────────────────── */
.ads-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ads-sort a {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ads-sub);
  font-size: var(--fs-sm, 15px);
  text-decoration: none;
}

.ads-sort a.is-active {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 600;
}

/* ── 카드 그리드 ──────────────────────────────── */
.ads-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ads-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 12px;
  border: 1px solid var(--ads-line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.ads-card__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 6;
  border-radius: 8px;
  background: #f1f5f9;
  overflow: hidden;
}

.ads-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ads-card__thumb span {
  font-size: var(--fs-sm, 15px);
  color: #94a3b8;
}

.ads-card__title {
  font-size: var(--fs-md, 17px);
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.ads-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: var(--fs-sm, 15px);
  color: var(--ads-sub);
}

.ads-card__place {
  align-self: flex-start;
  padding: 4px 8px;
  border: 1px solid var(--ads-line);
  border-radius: 6px;
  font-size: var(--fs-sm, 15px);
  color: #475569;
}

/* ── 빈 상태 ──────────────────────────────────── */
.ads-empty {
  padding: 24px 16px;
  border: 1px dashed var(--ads-line);
  border-radius: 12px;
  background: #f8fafc;
  text-align: center;
}

.ads-empty p {
  margin: 0 0 12px;
  font-size: var(--fs-base, 16px);
  color: var(--ads-sub);
}

/* ── CTA ──────────────────────────────────────── */
.ads-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ads-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--pub-accent, #dc2626);
  border-radius: 8px;
  background: #fff;
  color: var(--pub-accent, #dc2626);
  font-size: var(--fs-md, 17px);
  font-weight: 600;
  text-decoration: none;
}

.ads-btn--primary {
  background: var(--pub-accent, #dc2626);
  color: #fff;
}

.ads-btn--quiet {
  border-color: var(--ads-line);
  color: #334155;
}

/* ── 페이지네이션 ─────────────────────────────── */
.ads-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}

.ads-pager a {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--ads-line);
  border-radius: 8px;
  color: #334155;
  font-size: var(--fs-sm, 15px);
  text-decoration: none;
}

.ads-pager a.is-active {
  border-color: var(--pub-accent, #dc2626);
  background: var(--pub-accent, #dc2626);
  color: #fff;
  font-weight: 600;
}

@media (min-width: 640px) {
  .ads-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .ads-hub-sec {
    padding: 20px 18px;
  }

  .ads-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .ads-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

html[data-theme="dark"] .ads-hub {
  --ads-line: #334155;
  --ads-sub: #94a3b8;
  --ads-ink: #f1f5f9;
}

html[data-theme="dark"] .ads-hub-sec,
html[data-theme="dark"] .ads-card,
html[data-theme="dark"] .ads-place-chips a,
html[data-theme="dark"] .ads-btn {
  background: #1e293b;
  color: #e2e8f0;
}

html[data-theme="dark"] .ads-type-tab,
html[data-theme="dark"] .ads-empty,
html[data-theme="dark"] .ads-filter-chip {
  background: #0f172a;
  color: #e2e8f0;
}
