/* ── Sticky 2-Row Tab Bar ───────────────────────── */
.story-tabs{
  position:sticky;
  top:64px;
  z-index:100;
  background:var(--c-gray-100);
  width: 100%;
}
.story-main-tabs{
  height: 52px;
}
.story-main-tabs,
.story-sub-tabs{
  display:flex;
  max-width: 1280px;
  margin: auto;
  gap:.25rem;
  /* padding:0 1rem; */
}
.story-sub-tab-set{
  display:flex;
  flex-direction: column;
  justify-content: center;
}

/* 메인탭 ============================== */
.story-main-tab{
  display: flex;
  align-items: center;
  padding: 10px 20px;
  font-size: 16px;
  font-weight:600;
  color:var(--c-gray-800);
  background:none;
  cursor:pointer;
  border: none;
  transition:color .2s ease;
}
.story-main-tab.is-active{
  color:var(--c-pink);
  font-weight:800;
}

/* 서브탭 ============================== */
.story-sub-tabs{
  height: 48px;
}
.story-sub-tab-set{ 
  display:none; 
  height: 100%;
}
.story-sub-tab-set.is-active{ 
  display:flex; 
  flex-wrap:wrap; 
}
.story-sub-tab{
  padding: 10px 20px;
  font-size:16px;
  color:var(--c-gray-500);
  font-weight: 600;
  background:none;
  border:0;
  cursor:pointer;
  transition:color .2s ease;
}
.story-sub-tab.is-active{
  color:var(--c-white);
  background: var(--c-pink);
  font-weight:800;
  border-radius: 4px;
}

/* ── 콘텐츠 영역 ─────────────────────── */
.story-contents{
  margin-top: -80px; /* 헤더 높이 보정 */
  padding-top: 50px;
  min-height: calc(100vh - 436px); /* 빈 콘텐츠 대비 최소값 */
}
.story-section{ 
  display:none; 
}
.story-section.is-active{ 
  display:block; 
}
.story-sub-section{ 
  display:none; 
}
.story-sub-section.is-active{ 
  display:block; 
}
/* 1) 섹션을 멀티컬럼 레이아웃으로 전환 */
.story-sub-section{
  column-count: 2;            /* 데스크톱 기본 2열 */
  column-gap: 100px;           /* 열 사이 간격 */
}

/* 2) 카드 자체는 column-break 방지 + 가로 flex */
.book-card{
  break-inside: avoid;        /* 열 분리 방지 */
  display: flex;
  gap: 24px;
  width:100%;        /* 트랙 너비에 강제 맞춤 */
  margin-bottom: 48px;        /* 카드 간 세로 간격 */
  font-size: 15px;
  color: var(--c-gray-800);
}

/* 3) 썸네일 (좌측) */
.book-thumb{
  flex: 0 0 200px;            /* 고정 폭 */
  aspect-ratio: 2/2.95; /* 2:2.95 비율 */
  border-radius: 4px;
  border: 1px solid var(--c-gray-300);
  background-color: var(--c-gray-300);
  overflow: hidden;
}
.book-thumb img{
  display: block;
  object-fit: cover;
  object-position:center;
  width: 100%; 
  height: auto;
}

/* 4) 텍스트 정보 (우측) */
.book-info{
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center; /* 세로 중앙 정렬 */
}
.book-title{
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 4px;
}
.book-author{
  color: var(--c-gray-600);
  margin: 0 0 20px;
  font-size: 16px;
}
.book-desc{
  color: var(--c-gray-600);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.7;
  margin-bottom: 20px;
  /* 2줄 이후 말줄임 – 필요 시 삭제 */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: justify;     /* 양쪽 끝 맞춤 */
  text-align-last: left;   /* 마지막 줄은 왼쪽 정렬(옵션) */
}
.book-tags{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.book-tag{
  font-size: 14px;
  font-weight: 400;
  color: var(--c-gray-800);
  background: var(--c-gray-200);
  padding: 2px 6px;
  border-radius: 2px;
}

/* 5) 반응형 – 태블릿 이하 한 열 */
@media (max-width: 768px){
  .story-contents{
    padding-top: 30px;
  }
  .story-sub-tabs{
    margin: 0 10px;
    overflow-x: auto;          /* 가로 스크롤 활성화 */
    scroll-snap-type: x proximity;   /* 가로로 근접 스냅 */
    /* -webkit-overflow-scrolling: touch;  */
  }
  .story-sub-section{ 
    column-count: 1;
  }
  .story-sub-tab {
    scroll-snap-align: start;  /* 왼쪽 맞춤으로 스냅 */
  }
  .book-card{ 
    gap: 16px; 
    margin-bottom: 32px; 
  }
  .book-thumb{
    flex: 0 0 160px;            /* 고정 폭 */
    height: auto;
    border-radius: 4px;
  }
  .book-title{
    /* 2줄 이후 말줄임 – 필요 시 삭제 */
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .book-author{
    margin: 0 0 12px;
    font-size: 16px;
    /* 2줄 이후 말줄임 – 필요 시 삭제 */
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .book-desc{
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 12px;
    /* 2줄 이후 말줄임 – 필요 시 삭제 */
    -webkit-line-clamp:2;

  }
}

