/* ==========================================================
   layout.css — 페이지 골격 / 그리드 (T-001)
   ========================================================== */

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  word-break: keep-all;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--header-h);
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.header__search {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

/* ---------- 카테고리 칩 바 ---------- */
.chipbar {
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.chipbar__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--chipbar-h);
}

.chipbar__scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: 4px;
}

.chipbar__scroll::-webkit-scrollbar {
  display: none;
}

/* ---------- 섹션 ---------- */
.section {
  margin-top: 40px;
}

.section--hero {
  margin-top: 24px;
}

.section__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.section__title {
  font-size: var(--fs-section);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section__tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.section__more {
  margin-left: auto;
}

/* ---------- 그리드 ---------- */
.grid {
  display: grid;
  gap: var(--gap);
}

.grid--shorts {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.grid--products {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.grid--creators {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

/* ---------- 히어로 캐러셀 ---------- */
.carousel {
  position: relative;
}

.carousel__track {
  display: flex;
  /* stretch(기본값)면 쇼츠 카드가 가장 큰 아이템 높이까지 늘어나 9:16 이 깨진다.
     행 높이는 쇼츠 카드의 aspect-ratio 가 결정하도록 한다. (T-005) */
  align-items: flex-start;
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.carousel__track::-webkit-scrollbar {
  display: none;
}

.carousel__track > * {
  scroll-snap-align: start;
}

.carousel__next {
  position: absolute;
  top: 50%;
  right: -18px;
  transform: translateY(-50%);
  z-index: 3;
}

/* ---------- 하단 배너 영역 ---------- */
.bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 48px;
}

/* ---------- 푸터 ---------- */
.site-footer {
  margin-top: 56px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px 32px;
  padding-block: 36px 28px;
  align-items: start;
}

.footer__bottom {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

main {
  padding-bottom: 8px;
}
