/* ═══════════════════════════════════════════
   동네보험 — columns.css v9
   보험 칼럼 게시판 (목록 + 상세)
   시안 B: 2컬럼 사이드바 레이아웃
   v6: 모바일 개선 — 가로 스크롤 탭 + row 카드 유지 + 사이드바 숨김
   v7: 꾸준한 칼럼니스트 왕관 + 칼럼 상세 면책 문구
   v8: sticky footer 수정 (상세 페이지 푸터 공중 뜸 해결)
   v9: 모바일 사이드바 표시 (인기 칼럼 TOP5 + 꾸준한 칼럼니스트)
   ═══════════════════════════════════════════ */

/* ── Sticky footer: body를 flex 컬럼으로 만들어 푸터를 항상 하단에 고정 ── */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.header { flex-shrink: 0; }
.col-intro { flex-shrink: 0; }
.col-wrap,
.col-detail-wrap { flex: 1; }
.footer { flex-shrink: 0; }

/* ── 색상 변수 (global.css 없이도 동작) ── */
:root {
  --cobalt: #3272c7;
  --cobalt-bg: #EEF4FC;
  --cobalt-50: #f0f6ff;
  --amber: #c9892a;
  --amber-bg: #FEF3E2;
  --mint: #2e9e6e;
  --mint-bg: #E8F7F1;
  --purple-bg: #F3F0FA;
  --purple-text: #7C3AED;
  --coral-bg: #FFF0EE;
  --coral-text: #C45333;
}

/* ──────────────────────────────────────────
   INTRO 밴드
   ────────────────────────────────────────── */
.col-intro {
  background: var(--cobalt-50);
  border-bottom: 1px solid #D6E6F9;
}
.col-intro__inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
.col-intro__left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.col-intro__icon {
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(50, 114, 199, 0.15);
  flex-shrink: 0;
}
.col-intro__title {
  font-size: 18px;
  font-weight: 700;
}
.col-intro__sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.col-intro__back {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--cobalt);
  font-weight: 500;
  padding: 6px 12px;
  border: 1px solid #D6E6F9;
  border-radius: 20px;
  background: #fff;
  transition: background 0.2s;
}
.col-intro__back:hover {
  background: var(--cobalt-bg);
}

/* ──────────────────────────────────────────
   CATEGORY GRID (list view, in-list area)
   ────────────────────────────────────────── */
.col-cats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  margin-bottom: 14px;
}

/* ──────────────────────────────────────────
   2-COLUMN LAYOUT
   ────────────────────────────────────────── */
.col-wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: start;
  min-height: calc(100vh - var(--header-height) - 80px);
}

/* ── Left: List area ── */
.col-list-area {
  min-width: 0;
}

/* Controls row */
.list-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}
.list-search {
  flex: 1;
  min-width: 0;
  position: relative;
}
.list-search input {
  width: 100%;
  padding: 9px 36px 9px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}
.list-search input:focus {
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgba(50, 114, 199, 0.1);
}
.list-search__btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  padding: 0;
}
.list-search__btn:hover {
  color: var(--cobalt);
  background: var(--cobalt-bg);
}
.sort-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.sort-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  color: var(--text-secondary);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}
.sort-btn.active {
  border-color: var(--cobalt);
  color: var(--cobalt);
  background: var(--cobalt-bg);
}

/* Count */
.list-count {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}
.list-count strong { color: var(--text-primary); }

/* Column list */
.col-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
}
.col-list-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
  gap: 10px;
  color: var(--text-tertiary);
  font-size: 13px;
}
.col-empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-tertiary);
}
.col-empty svg { margin: 0 auto 10px; opacity: 0.4; display: block; }
.col-empty p { font-size: 13px; }

/* Column item card */
.col-item {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
}
.col-item:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}
.col-item__avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: #D6E6F9;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.col-item__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.col-item__avatar-initials {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.col-item__body {
  flex: 1;
  min-width: 0;
}
.col-item__top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.col-item__new {
  font-size: 10px;
  color: var(--cobalt);
  font-weight: 500;
}
.col-item__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  margin-bottom: 4px;
}
.col-item__preview {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-bottom: 8px;
}
.col-item__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}
.col-item__author {
  font-weight: 500;
  color: var(--text-secondary);
}
.col-item__dot { color: var(--text-tertiary); }

/* Category badge */
.cat-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  line-height: 1.6;
}
.cat-badge--blue   { background: var(--cobalt-bg); color: var(--cobalt); }
.cat-badge--green  { background: var(--mint-bg); color: var(--mint); }
.cat-badge--amber  { background: var(--amber-bg); color: var(--amber); }
.cat-badge--purple { background: var(--purple-bg); color: var(--purple-text); }
.cat-badge--coral  { background: var(--coral-bg); color: var(--coral-text); }

/* Pagination */
.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: 20px 0 0;
}
.pg-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pg-btn.active {
  background: var(--cobalt);
  color: #fff;
  border-color: var(--cobalt);
}
.pg-btn:hover:not(.active):not(:disabled) { background: #f8fafc; }
.pg-btn:disabled { opacity: 0.4; cursor: default; }

/* ── Right: Sidebar ── */
.col-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: calc(52px + 16px); /* header + gap */
}

.sidebar-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.sidebar-card__title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
}
.sidebar-card__title svg { color: var(--cobalt); flex-shrink: 0; }

/* Popular list */
.sidebar-pop {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-pop-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
}
.sidebar-pop-item:hover .sidebar-pop-title { color: var(--cobalt); }
.sidebar-rank {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cobalt-bg);
  color: var(--cobalt);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.sidebar-rank.top { background: var(--cobalt); color: #fff; }
.sidebar-pop-title {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  transition: color 0.15s;
}
.sidebar-pop-meta {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Active planners */
.sidebar-planners {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-planner-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: none;
  color: inherit;
}
.sidebar-planner-item:hover .sidebar-planner-name { color: var(--cobalt); }
.sidebar-planner-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #D6E6F9;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-planner-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-planner-avatar-initials {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-planner-name {
  font-size: 12px;
  font-weight: 600;
  transition: color 0.15s;
}
.sidebar-planner-meta { font-size: 10px; color: var(--text-tertiary); margin-top: 1px; }
.sidebar-planner-cnt {
  margin-left: auto;
  font-size: 10px;
  color: var(--cobalt);
  font-weight: 600;
  background: var(--cobalt-bg);
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Sidebar categories */
.sidebar-cats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}
.sidebar-cat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  background: #fff;
}
.sidebar-cat-item:hover,
.sidebar-cat-item.active {
  border-color: var(--cobalt);
  background: var(--cobalt-50);
  color: var(--cobalt);
}
.sidebar-cat-item svg { flex-shrink: 0; }

/* Sidebar loading */
.sidebar-loading {
  display: flex;
  justify-content: center;
  padding: 12px 0;
}

/* ──────────────────────────────────────────
   DETAIL VIEW
   ────────────────────────────────────────── */
.col-detail-wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

/* Article wrap */
.detail-article-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding-top: 32px;
}

/* Planner footer card (하단 설계사 카드) */
.detail-planner-footer {
  margin-top: 36px;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}
.detail-footer__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.detail-footer__card {
  display: flex;
  gap: 18px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  align-items: flex-start;
  box-shadow: 0 2px 10px rgba(50, 114, 199, 0.06);
}
.detail-footer__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-footer__avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.detail-footer-initials {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  align-items: center;
  justify-content: center;
}
.detail-footer__info { flex: 1; min-width: 0; }
.detail-footer__name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.detail-footer__name { font-size: 16px; font-weight: 700; }
.planner-type-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}
.planner-type-badge--compare   { background: var(--cobalt-bg); color: var(--cobalt); }
.planner-type-badge--exclusive { background: #FFFBEB; color: #92400E; }
.detail-footer__greeting {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 8px;
  font-style: italic;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.detail-footer__location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}
.detail-footer__location svg { flex-shrink: 0; }
.detail-footer__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  background: var(--cobalt);
  color: #fff;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  transition: opacity 0.15s;
  text-decoration: none;
}
.detail-footer__link:hover { opacity: 0.88; }
.detail-article {}
.detail-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 0;
  gap: 10px;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* Article header */
.detail-article__head {
  margin-bottom: 24px;
}
.detail-article__cats {
  display: flex;
  gap: 7px;
  margin-bottom: 12px;
  align-items: center;
}
.detail-article__title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 12px;
  word-break: keep-all;
}
.detail-article__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}
.detail-article__meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.detail-article__meta-item svg { flex-shrink: 0; }

/* Article content (Quill HTML) */
.detail-article__content {
  font-size: 15px;
  line-height: 1.9;
  color: #1e293b;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.detail-article__content h1,
.detail-article__content h2,
.detail-article__content h3 {
  font-weight: 700;
  margin: 24px 0 10px;
  line-height: 1.4;
}
.detail-article__content h1 { font-size: 22px; }
.detail-article__content h2 { font-size: 19px; }
.detail-article__content h3 { font-size: 16px; }
.detail-article__content p  { margin-bottom: 14px; }
.detail-article__content ul,
.detail-article__content ol {
  margin: 12px 0 12px 20px;
}
.detail-article__content li { margin-bottom: 6px; }
.detail-article__content ul { list-style: disc; }
.detail-article__content ol { list-style: decimal; }
.detail-article__content strong { font-weight: 700; }
.detail-article__content em    { font-style: italic; }
.detail-article__content a     { color: var(--cobalt); text-decoration: underline; }
.detail-article__content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
  display: block;
}
.detail-article__content blockquote {
  border-left: 3px solid var(--cobalt);
  padding: 12px 16px;
  background: var(--cobalt-50);
  border-radius: 0 8px 8px 0;
  margin: 16px 0;
  font-style: italic;
  color: var(--text-secondary);
}

/* More columns (bottom) */
.detail-more {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}
.detail-more__title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}
.detail-more__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.detail-more-item {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
  text-decoration: none;
  color: inherit;
}
.detail-more-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  transform: translateY(-1px);
}
.detail-more-item__title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}
.detail-more-item__date {
  font-size: 11px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.detail-more__all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--cobalt);
  font-weight: 600;
  text-decoration: none;
}
.detail-more__all:hover { text-decoration: underline; }

/* ──────────────────────────────────────────
   SPINNER (재정의 — global.css에도 있으나 일관성)
   ────────────────────────────────────────── */
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--cobalt);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner--sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ──────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .col-wrap { grid-template-columns: 1fr 260px; gap: 24px; }
}

@media (max-width: 768px) {
  .col-wrap {
    grid-template-columns: 1fr;
    padding: 16px 16px 40px;
    gap: 20px;
  }

  /* 모바일에서 사이드바: 단일 컬럼 레이아웃 아래 표시 (sticky 해제) */
  .col-sidebar { position: static; }

  /* 카테고리: 3×2 그리드 → 가로 스크롤 탭 (시안 A) */
  .col-cats-grid {
    display: flex;
    grid-template-columns: unset;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    margin-bottom: 14px;
  }
  .col-cats-grid::-webkit-scrollbar { display: none; }
  .col-cats-grid .sidebar-cat-item {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 13px;
    white-space: nowrap;
    border-radius: 8px;
  }

  /* 검색+정렬: 한 줄 유지 */
  .list-controls { flex-wrap: nowrap; }
  .sort-btns { width: auto; flex-wrap: nowrap; }
  .sort-btn { padding: 8px 12px; }

  .col-intro__inner { padding: 14px 16px; }
  .col-intro__icon { display: none; }

  .detail-footer__card { flex-direction: column; align-items: center; text-align: center; }
  .detail-footer__name-row { justify-content: center; }
  .detail-footer__location { justify-content: center; }
  .detail-footer__link { align-self: center; }
  .detail-article__title { font-size: 20px; }
  .detail-article-wrap { padding: 20px 0 0; }
  .col-detail-wrap { padding: 0 16px 40px; }
}

@media (max-width: 480px) {
  /* 카드: 480px 이하에서도 row 유지 — 아바타가 있어야 설계사 신뢰감 유지 */
  .col-item { flex-direction: row; gap: 12px; padding: 13px; }
  .col-item__avatar { width: 52px; height: 52px; font-size: 18px; }
  .col-item__title { font-size: 13.5px; -webkit-line-clamp: 2; }
  .col-item__preview { -webkit-line-clamp: 2; }

  /* 검색+정렬 한 줄 유지 */
  .list-controls { flex-wrap: nowrap; }
  .list-search { min-width: 0; }
  .sort-btns { width: auto; flex-shrink: 0; }
  .sort-btn { flex: unset; padding: 8px 10px; }
}

/* ──────────────────────────────────────────
   v7: 꾸준한 칼럼니스트 왕관 뱃지
   ────────────────────────────────────────── */
.sidebar-planner-crown {
  display: inline-flex;
  align-items: center;
  color: var(--amber);
  margin-left: 3px;
  vertical-align: middle;
  opacity: 0.9;
}

/* ──────────────────────────────────────────
   v7: 칼럼 상세 면책 문구
   ────────────────────────────────────────── */
.detail-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 28px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.65;
}
.detail-disclaimer svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: #94a3b8;
}
.detail-disclaimer p { margin: 0; }
