/* ============================================================
   새 메인 화면 추가 CSS
   기존 style.css 파일 맨 아래에 이 내용을 그대로 붙여넣으면 됩니다.
   (특정 셀렉터를 직접 수정해야 하는 부분은 없습니다)
   ============================================================ */

/* 기존 헤더(area_head, 80px 고정)가 사라지면서 생기는 상단 여백 제거 */
#dkContent.cont_skin {
  margin-top: 0;
}

/* ---------- 상단 고정 헤더 (검색 + 카테고리 + 아티스트 태그) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #eee;
}
.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 12px 8px;
}
.search-row .tf_search {
  width: 100%;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 15px;
  background: #fafafa;
  box-sizing: border-box;
}

.cat-row,
.tag-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-top: 8px;
  scrollbar-width: none;
}
.cat-row::-webkit-scrollbar,
.tag-row::-webkit-scrollbar {
  display: none;
}

/* [##_category_list_##] 가 출력하는 ul/li 구조를 가로 스크롤 pill로 표시 */
.cat-row ul {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.cat-row ul > li {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
/* '분류 전체보기' 안에 나머지 카테고리들이 중첩 ul/li로 들어있는 구조 → 평탄화해서 한 줄로 표시 */
.cat-row ul > li > ul,
.cat-row ul > li > ul > li {
  display: contents;
}
.cat-row a {
  display: inline-block;
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 13px;
  color: #444;
  white-space: nowrap;
  text-decoration: none;
}
.cat-row .selected > a,
.cat-row a:hover {
  background: #222;
  color: #fff;
  border-color: #222;
  text-decoration: none;
}
.cat-row .c_cnt,
.cat-row img {
  display: none;
}

/* 스크린리더용 건너뛰기 링크 - 화면에는 표시하지 않음 */
#dkIndex {
  display: none;
}

/* '분류 전체보기'는 카테고리 목록을 펼치기 위한 부모 링크일 뿐이라 숨김
   (.cat-row 바로 아래 ul의 첫 li만 대상으로 해야, 평탄화된 나머지 카테고리가 같이 숨겨지지 않음) */
.cat-row > ul > li > a:first-child {
  display: none;
}

/* 글 하단 '◯◯ 카테고리의 다른 글' 추천 테이블 숨김 */
.skin_view .another_category {
  display: none;
}

/* 본문 하단 공감/공유하기/게시글관리 버튼 숨김 */
.postbtn_like {
  display: none;
}

/* 아티스트 키워드 태그 (script.js가 채워줌) */
.tag-row .tag-pill {
  flex: 0 0 auto;
  font-size: 12px;
  color: #888;
  border: 1px solid #f0f0f0;
  background: #fafafa;
  border-radius: 16px;
  padding: 6px 14px;
  white-space: nowrap;
  text-decoration: none;
}
.tag-row .tag-pill:hover {
  background: #eee;
  text-decoration: none;
}

/* ---------- 글 상세보기 제목 영역 단순화 ---------- */
.skin_view .area_title {
  padding: 24px 0;
  margin-bottom: 12px;
  border-bottom: none;
  text-align: left;
}
.skin_view .tit_category {
  display: block;
  margin-bottom: 10px;
}
.skin_view .tit_category a {
  display: inline-block;
  background: #222;
  color: #fff;
  font-weight: normal;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 16px;
  text-decoration: none;
}
.skin_view .tit_post {
  margin-top: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}
.skin_view .tit_post a {
  color: #000 !important;
  text-decoration: none !important;
}

/* 좁은 화면에서는 카테고리/태그를 가로 스크롤 대신 줄바꿈으로 전부 노출 */
@media (max-width: 640px) {
  .cat-row,
  .tag-row {
    overflow-x: visible;
  }
  .cat-row ul > li,
  .tag-row {
    flex-wrap: wrap;
  }
  .cat-row ul > li {
    flex-basis: 100%;
  }
}

/* 현재 카테고리/검색 상태 안내 문구 */
.list-tit {
  max-width: 960px;
  margin: 12px auto 0;
  padding: 0 12px;
  font-size: 13px;
  color: #999;
}

/* ---------- 게시물 그리드 ---------- */
/* .card가 있을 때만 그리드 레이아웃 적용 → 글 상세 페이지(skin_view)에는 영향 없음 */
.grid:has(.card) {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 960px;
  margin: 0 auto;
  padding: 12px;
}
@media (min-width: 768px) {
  .grid:has(.card) {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  display: block;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: #222;
}
.card:hover {
  text-decoration: none;
}
.thumb {
  position: relative;
  aspect-ratio: 1;
  background: #f2f2f2;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  color: #222;
}
.card-badge:empty {
  display: none;
}
.card-body {
  padding: 8px 10px;
}
.card-title {
  font-size: 13px;
  line-height: 1.4;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #222;
}
.card-date {
  font-size: 11px;
  color: #999;
  margin: 0;
}

/* .grid가 그리드 모드(.card 존재)일 때, 글 상세보기는 그리드 칸에 끼이지 않고 전체 폭 사용 */
.grid:has(.card) .article_skin {
  grid-column: 1 / -1;
  width: 100%;
}

/* ---------- 우측 하단 고정 버튼 (트위터 / 오픈카톡) ---------- */
.fab-group {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 90;
}
.fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #222;
  text-decoration: none;
}

/* ---------- 무한스크롤 ---------- */
/* 기본 페이지네이션은 화면에서 숨기고, script.js가 다음 페이지 링크 정보만 읽어서 사용 */
.area_paging {
  display: none;
}
.grid-loading {
  text-align: center;
  font-size: 13px;
  color: #999;
  padding: 16px;
}