/**
 * 블로그차트 트렌드 아티클 매거진 전용 스타일시트 (article_magazine.css)
 * 공식 라이트 테마 (#f8fafc), 화이트 카드 (#ffffff), 시그니처 레드 (#f05050) 포인트
 */

/* ==============================================================================
   1. 레이아웃 컨테이너 & 상단 탭 네비게이션
   ============================================================================== */
.bc-mag-wrapper {
  background-color: #f8fafc;
  min-height: calc(100vh - 200px);
  padding-bottom: 3.5rem;
}

.bc-mag-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 2rem;
  align-items: start;
}

.bc-mag-main,
.bc-mag-sidebar {
  min-width: 0;
  width: 100%;
}

.bc-bigkeyword-banner img {
  max-width: 100%;
  height: auto;
}


.bc-mag-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.8rem 1.5rem 0.5rem 1.5rem;
}

.bc-mag-title-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.bc-mag-main-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bc-mag-main-title i {
  color: #f05050;
}

.bc-mag-main-sub {
  font-size: 0.92rem;
  color: #64748b;
  margin-top: 4px;
}

/* 상단 탭 (실시간 아티클 vs 카테고리별 트렌드) */
.bc-mag-nav-tabs {
  display: inline-flex;
  background: #e2e8f0;
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.bc-mag-tab-btn {
  padding: 7px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #475569;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bc-mag-tab-btn:hover {
  color: #0f172a;
}

.bc-mag-tab-btn.active {
  background: #ffffff;
  color: #f05050 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ==============================================================================
   2. 아티클 카드 컴포넌트
   ============================================================================== */
.bc-card-feed {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.bc-article-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.bc-article-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

/* 뱃지 태그 */
.bc-card-badge-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.75rem;
}

.bc-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
  letter-spacing: -0.2px;
}

.bc-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  display: inline-block;
  animation: bcPulse 1.8s infinite ease-in-out;
}

@keyframes bcPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.bc-badge-category {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 4px;
}

/* 아티클 제목 */
.bc-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.45;
  margin-bottom: 0.75rem;
  letter-spacing: -0.3px;
  transition: color 0.2s ease;
  word-break: keep-all;
}

.bc-article-card:hover .bc-card-title {
  color: #f05050;
}

/* 3줄 요약문 말줄임표 */
.bc-card-excerpt {
  font-size: 0.93rem;
  color: #475569;
  line-height: 1.65;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* 메타 정보 행 */
.bc-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: #64748b;
  padding-top: 0.85rem;
  border-top: 1px solid #f1f5f9;
}

.bc-card-meta-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.bc-card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.bc-card-meta-item i {
  color: #94a3b8;
  font-size: 0.82rem;
}

.bc-card-meta-right {
  color: #f05050;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s ease;
}

.bc-article-card:hover .bc-card-meta-right {
  gap: 7px;
}

/* ==============================================================================
   3. 인피드 및 직사각형 광고 배너 카드 (Ad Slots)
   ============================================================================== */
.bc-feed-ad-card {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.01);
}

.bc-rect-ad-wrap {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  text-align: center;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  box-sizing: border-box;
}

.bc-rect-ad-wrap .adsbygoogle,
.bc-feed-ad-card .adsbygoogle {
  width: 100%;
  display: block;
}

.bc-ad-badge {
  font-size: 0.68rem;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  font-weight: 600;
}

/* 광고 미송출(unfilled) 시 빈 카드 자동 숨김 */
.bc-rect-ad-wrap:has(ins[data-ad-status="unfilled"]),
.bc-feed-ad-card:has(ins[data-ad-status="unfilled"]) {
  display: none !important;
}

/* ==============================================================================
   4. 우측 사이드바 위젯
   ============================================================================== */
.bc-mag-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.bc-mag-widget {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.bc-widget-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #f1f5f9;
  letter-spacing: -0.3px;
}

.bc-widget-title i {
  color: #f05050;
  margin-right: 6px;
}

/* 31개 테마 바로가기 그리드 */
.bc-theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.bc-theme-link {
  display: block;
  padding: 6px 3px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bc-theme-link:hover {
  background: #f05050;
  color: #ffffff !important;
  border-color: #f05050;
  transform: translateY(-1px);
}

/* 사이드바 광고 배너 영역 */
.bc-sidebar-banner-widget {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.bc-bigkeyword-banner {
  display: block;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(49, 16, 104, 0.16);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #311068;
}

.bc-bigkeyword-banner:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(49, 16, 104, 0.3);
}

.bc-bigkeyword-banner img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 13px;
}

.bc-sidebar-ad-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 1rem;
  text-align: center;
}

/* 카테고리 내비게이션 리스트 */
.bc-cat-nav-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bc-cat-nav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  transition: all 0.2s ease;
  background: #f8fafc;
  border: 1px solid transparent;
}

.bc-cat-nav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.bc-cat-nav-item.active {
  background: #eff6ff;
  color: #2563eb !important;
  border-color: #bfdbfe;
}

.bc-cat-count {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 600;
}

.bc-cat-nav-item.active .bc-cat-count {
  color: #2563eb;
}

/* 실시간 급상승 키워드 목록 */
.bc-trend-rank-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bc-trend-rank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #334155;
  text-decoration: none;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.bc-trend-rank-item:hover {
  background: #fee2e2;
  color: #dc2626;
}

.bc-trend-rank-num {
  font-weight: 800;
  color: #0ca678;
  width: 20px;
  font-size: 0.8rem;
}

.bc-trend-kw-bullet {
  width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
}

.bc-trend-rank-kw {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==============================================================================
   5. 카테고리 매거진 뷰 전용 스타일
   ============================================================================== */
.bc-category-section {
  margin-bottom: 2.25rem;
}

.bc-category-section:last-child {
  margin-bottom: 0;
}

.bc-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.bc-section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.3px;
}

.bc-section-more {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f05050;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s ease;
}

.bc-section-more:hover {
  gap: 7px;
}

/* ==============================================================================
   6. 무한 스크롤 로더 및 종료 문구
   ============================================================================== */
.bc-infinite-loading {
  text-align: center;
  padding: 2rem 0;
  font-size: 0.95rem;
  color: #64748b;
  display: none;
}

.bc-infinite-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #e2e8f0;
  border-top-color: #f05050;
  border-radius: 50%;
  animation: bcSpin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes bcSpin {
  to { transform: rotate(360deg); }
}

.bc-infinite-end {
  text-align: center;
  padding: 2.5rem 0 1rem 0;
  font-size: 0.88rem;
  color: #94a3b8;
  border-top: 1px solid #e2e8f0;
  margin-top: 1.5rem;
  display: none;
}

/* ==============================================================================
   6. 번호형 페이징 컴포넌트 (.bc-pagination-wrap)
   ============================================================================== */
.bc-pagination-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2.5rem 0 1rem 0;
}

.bc-pagination-list {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.bc-page-item {
  display: inline-block;
}

.bc-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.bc-page-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.bc-page-btn.active {
  background: #f05050 !important;
  border-color: #f05050 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(240, 80, 80, 0.35);
  cursor: default;
}

.bc-page-btn.bc-page-prev,
.bc-page-btn.bc-page-next {
  gap: 5px;
  padding: 0 14px;
  font-size: 0.84rem;
  background: #ffffff;
  color: #475569;
}

.bc-page-btn.bc-page-prev:hover,
.bc-page-btn.bc-page-next:hover {
  background: #f8fafc;
  color: #f05050;
  border-color: #f05050;
}

/* ==============================================================================
   7. 반응형 미디어 쿼리
   ============================================================================== */
@media (max-width: 992px) {
  .bc-mag-container {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.25rem 1.25rem 0 1.25rem;
  }
  .bc-mag-header {
    padding: 1.5rem 1.25rem 0.5rem 1.25rem;
  }
  .bc-mag-sidebar {
    order: 2;
  }
  .bc-theme-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 640px) {
  .bc-mag-container {
    padding: 1rem 1rem 0 1rem;
    gap: 1.25rem;
  }
  .bc-mag-header {
    padding: 1.25rem 1rem 0.5rem 1rem;
  }
  .bc-mag-main-title {
    font-size: 1.35rem;
  }
  .bc-card-title {
    font-size: 1.08rem;
  }
  .bc-article-card {
    padding: 1.15rem;
  }
  .bc-theme-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .bc-card-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .bc-card-meta-right {
    align-self: flex-end;
  }
  /* 모바일 번호 페이징 최적화 */
  .bc-pagination-list {
    gap: 4px;
  }
  .bc-page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 0.8rem;
  }
  .bc-page-btn.bc-page-prev,
  .bc-page-btn.bc-page-next {
    padding: 0 10px;
    font-size: 0.78rem;
  }
}
